fix problem with SQLState returning in failed stmt
authorLudek Finstrle <luf@pzkagis.cz>
Sun, 25 Dec 2005 07:26:43 +0000 (07:26 +0000)
committerLudek Finstrle <luf@pzkagis.cz>
Sun, 25 Dec 2005 07:26:43 +0000 (07:26 +0000)
connection.c

index f4d1b31533c9bca5e8fd133a794969423df81c83..178e47ca09774374ca90d0e13490a315add9fb85 100644 (file)
@@ -1504,13 +1504,18 @@ CC_send_query(ConnectionClass *self, char *query, QueryInfo *qi, UDWORD flag)
            used_passed_result_object = TRUE;
        if (!used_passed_result_object)
        {
-           if ((res->status == PGRES_EMPTY_QUERY) || (res->status == PGRES_FATAL_ERROR) ||
-               (res->status == PGRES_BAD_RESPONSE))
+           if ((res->status == PGRES_EMPTY_QUERY) || (res->status == PGRES_BAD_RESPONSE))
            {
-               mylog("send_query: sended query failed -> abort\n");
+               mylog("send_query: sending query failed -> abort\n");
                QR_set_aborted(res, TRUE);
                QR_Destructor(res);
-               res = NULL;
+               res = NULL;
+               goto cleanup;
+           }
+           else if (res->status == PGRES_FATAL_ERROR)
+           {
+               mylog("send_query: sended query failed -> abort\n");
+               QR_set_aborted(res, TRUE);
                goto cleanup;
            }
            if (create_keyset)