From b8b6411574f20537ccda1751e082ac55825086d1 Mon Sep 17 00:00:00 2001 From: Ludek Finstrle Date: Sun, 8 Jan 2006 10:07:03 +0000 Subject: [PATCH] call RALLBACK with bad stmt only when autocommit is on --- connection.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/connection.c b/connection.c index 178e47c..6d285c6 100644 --- a/connection.c +++ b/connection.c @@ -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) -- 2.39.5