Fix for error in autocommit off
Tom pointed out a problem with our current error handling with
autocommit off:
SET autocommit TO off;
lkjasdfasdf;
SELECT 1;
COMMIT;
In our current code, SELECT is considred to be in a new transaction.
This patch fixes that by making the SELECT be part of the aborted
transaction. Basically we didn't have proper autocommit handling in the
abort function.
--
Bruce Momjian | http://candle.pha.pa.us
pgman@candle.pha.pa.us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073
Attachments:
/pgpatches/errortext/plainDownload+5-5
Bruce Momjian <pgman@candle.pha.pa.us> writes:
*/
case TBLOCK_DEFAULT:
AbortTransaction();
! if (autocommit)
! CleanupTransaction();
! else
! s->blockState = TBLOCK_ABORT;
break;
You forgot suppressChain...
regards, tom lane
I wasn't sure how to handle it. Is the attached patch correct?
---------------------------------------------------------------------------
Tom Lane wrote:
Bruce Momjian <pgman@candle.pha.pa.us> writes:
*/
case TBLOCK_DEFAULT:
AbortTransaction();
! if (autocommit)
! CleanupTransaction();
! else
! s->blockState = TBLOCK_ABORT;
break;You forgot suppressChain...
regards, tom lane
---------------------------(end of broadcast)---------------------------
TIP 6: Have you searched our list archives?
--
Bruce Momjian | http://candle.pha.pa.us
pgman@candle.pha.pa.us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073
Attachments:
/bjm/difftext/plainDownload+516-338
Bruce Momjian <pgman@candle.pha.pa.us> writes:
I wasn't sure how to handle it. Is the attached patch correct?
Do I have to wade through a thousand lines of Windows hacks to find out?
suppressChain should force autocommit-on behavior, it's not hard...
regards, tom lane
I have suppressChain behaving just like it does in
CommitTransactionCommand(). That should do it.
---------------------------------------------------------------------------
Tom Lane wrote:
Bruce Momjian <pgman@candle.pha.pa.us> writes:
I wasn't sure how to handle it. Is the attached patch correct?
Do I have to wade through a thousand lines of Windows hacks to find out?
suppressChain should force autocommit-on behavior, it's not hard...regards, tom lane
--
Bruce Momjian | http://candle.pha.pa.us
pgman@candle.pha.pa.us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073