call RALLBACK with bad stmt only when autocommit is on
authorLudek Finstrle <luf@pzkagis.cz>
Sun, 8 Jan 2006 10:07:03 +0000 (10:07 +0000)
committerLudek Finstrle <luf@pzkagis.cz>
Sun, 8 Jan 2006 10:07:03 +0000 (10:07 +0000)
connection.c

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