From 1bdea3dec9c22b783ce09d893c5fc0d8301d90e8 Mon Sep 17 00:00:00 2001 From: Hiroshi Inoue Date: Thu, 8 Apr 2021 18:55:36 +0900 Subject: [PATCH] Fix a bug of CC_send_query_append() when the ignore_roundtrip_time flag is on. --- connection.c | 2 +- statement.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/connection.c b/connection.c index 02794ff..3e6d246 100644 --- a/connection.c +++ b/connection.c @@ -1837,7 +1837,7 @@ CC_send_query_append(ConnectionClass *self, const char *query, QueryInfo *qi, UD QResultHold rholda; rhold = CC_send_query_append(self, query, qi, flag, stmt, NULL); - if (QR_command_maybe_successful(res)) + if (QR_command_maybe_successful(rhold.first)) { rholda = CC_send_query_append(self, appendq, qi, flag & (~(GO_INTO_TRANSACTION)), stmt, NULL); if (QR_command_maybe_successful(rholda.first)) diff --git a/statement.c b/statement.c index 24dee4c..eea2c86 100644 --- a/statement.c +++ b/statement.c @@ -2083,7 +2083,7 @@ SC_execute(StatementClass *self) * If we received fewer rows than requested, there are no * more rows to fetch. */ - if (qres->num_cached_rows < qi.row_size) + if (qres && qres->num_cached_rows < qi.row_size) /* check qres != NULL for safety */ QR_set_reached_eof(qres); } first = qres; -- 2.39.5