From: Hiroshi Inoue Date: Thu, 8 Apr 2021 09:55:36 +0000 (+0900) Subject: Fix a bug of CC_send_query_append() when the ignore_roundtrip_time flag is on. X-Git-Tag: REL-13_01_0000~8 X-Git-Url: http://git.postgresql.org/gitweb/?a=commitdiff_plain;h=1bdea3dec9c22b783ce09d893c5fc0d8301d90e8;p=psqlodbc.git Fix a bug of CC_send_query_append() when the ignore_roundtrip_time flag is on. --- 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;