Fix a bug of CC_send_query_append() when the ignore_roundtrip_time flag is on.
authorHiroshi Inoue <h-inoue@dream.email.ne.jp>
Thu, 8 Apr 2021 09:55:36 +0000 (18:55 +0900)
committerHiroshi Inoue <h-inoue@dream.email.ne.jp>
Thu, 8 Apr 2021 10:04:41 +0000 (19:04 +0900)
connection.c
statement.c

index 02794ff2c845ce9fb141850fa95d476b08e51f6a..3e6d246ac854a9887877ad295b30f11c47cf0438 100644 (file)
@@ -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))
index 24dee4c97f3d9bd3c5aa06c32b3cd737a2a2144f..eea2c869b2aace7c8227b38e1f2bcb80ffe0abed 100644 (file)
@@ -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;