Re: BUG #15977: Inconsistent behavior in chained transactions - Mailing list pgsql-bugs

From Fabien COELHO
Subject Re: BUG #15977: Inconsistent behavior in chained transactions
Date
Msg-id alpine.DEB.2.21.1908290815110.28828@lancre
Whole thread Raw
In response to Re: BUG #15977: Inconsistent behavior in chained transactions  (fn ln <emuser20140816@gmail.com>)
Responses Re: BUG #15977: Inconsistent behavior in chained transactions  (fn ln <emuser20140816@gmail.com>)
Re: BUG #15977: Inconsistent behavior in chained transactions  (fn ln <emuser20140816@gmail.com>)
List pgsql-bugs
Hello,

> COMMIT AND CHAIN in implicit block leaves blockState as TBLOCK_STARTED, 
> which doesn't trigger the chaining. but ROLLBACK AND CHAIN sets the 
> blockState into TBLOCK_ABORT_PENDING, so the chaining is triggered.
>
> I think disabling s->chain beforehand should do the desired behavior.

Patch applies with "patch", although "git apply" complained because of 
CRLF line terminations forced by the octet-stream mime type.

Patch compiles cleanly. Make check ok.

Patch works for me, and solution seems appropriate. It should be committed 
for pg 12.0.

There could be a test added in "regress/sql/transactions.sql", I'd suggest 
something like:

-- implicit transaction and not chained.
COMMIT AND CHAIN;
COMMIT;
ROLLBACK AND CHAIN;
ROLLBACK;

which should show the appropriate "no transaction in progress" warnings.

Doc could be made a little clearer about what to expect when there is no 
explicit transaction in progress.

-- 
Fabien.



pgsql-bugs by date:

Previous
From: Michael Paquier
Date:
Subject: Re: BUG #15964: vacuumdb.c:187:10: error: use of undeclaredidentifier 'FD_SETSIZE'
Next
From: Mikael Kjellström
Date:
Subject: Re: BUG #15964: vacuumdb.c:187:10: error: use of undeclaredidentifier 'FD_SETSIZE'