X-Original-To: pgsql-odbc-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by postgresql.org (Postfix) with ESMTP id 95A9C9DC826 for ; Sat, 24 Dec 2005 05:54:05 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 48067-01 for ; Sat, 24 Dec 2005 05:54:06 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey- Received: from smtp.pzkagis.cz (gis6.netbox.cz [83.240.30.214]) by postgresql.org (Postfix) with ESMTP id 54C479DC80F for ; Sat, 24 Dec 2005 05:54:01 -0400 (AST) Received: (from luf@localhost) by smtp.pzkagis.cz (8.11.6/8.11.6) id jBO9s4314286 for pgsql-odbc@postgresql.org; Sat, 24 Dec 2005 10:54:04 +0100 Date: Sat, 24 Dec 2005 10:54:04 +0100 From: Ludek Finstrle To: pgsql-odbc@postgresql.org Subject: Re: patch for [ psqlodbc-Bugs-1000498 ] rollback to savepoint in case of error Message-ID: <20051224095404.GA14270@soptik.pzkagis.cz> References: <20051223093549.C2A7F112506C@pgfoundry.org> <20051224093543.GA14222@soptik.pzkagis.cz> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="2fHTh5uZTiUOsy+g" Content-Disposition: inline In-Reply-To: <20051224093543.GA14222@soptik.pzkagis.cz> User-Agent: Mutt/1.4i X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0.05 required=5 tests=[AWL=0.050] X-Spam-Score: 0.05 X-Spam-Level: X-Archive-Number: 200512/314 X-Sequence-Number: 6793 --2fHTh5uZTiUOsy+g Content-Type: text/plain; charset=us-ascii Content-Disposition: inline > > Bugs item #1000498, was opened at 2005-12-21 15:19 > > > > Why does an error breaks the savepoint environment ? > > I fix this problem this way: > abort after query failed is examined only if there is autocommit on and > not running manual transaction. > > Patch is attached. It could be applied only after psqlodbc-sqlstate.diff. > > Please review and comment > > Luf I make previous patch againist older source :-( I attach new one (it differ only in layout). Regards, Luf --2fHTh5uZTiUOsy+g Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="psqlodbc-transact_abort.diff" diff -c psqlodbc.orig\connection.c psqlodbc\connection.c *** psqlodbc.orig\connection.c Sat Dec 24 11:44:33 2005 --- psqlodbc\connection.c Sat Dec 24 11:53:18 2005 *************** *** 1506,1521 **** { if ((res->status == PGRES_EMPTY_QUERY) || (res->status == PGRES_BAD_RESPONSE)) { ! 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); goto cleanup; } if (create_keyset) --- 1506,1527 ---- { if ((res->status == PGRES_EMPTY_QUERY) || (res->status == PGRES_BAD_RESPONSE)) { ! 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) { ! 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) --2fHTh5uZTiUOsy+g--