Re: BUG #15977: Inconsistent behavior in chained transactions

From: fn ln <emuser20140816(at)gmail(dot)com>
To: Fabien COELHO <coelho(at)cri(dot)ensmp(dot)fr>
Cc: PostgreSQL Bugs <pgsql-bugs(at)lists(dot)postgresql(dot)org>, PostgreSQL Developers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: BUG #15977: Inconsistent behavior in chained transactions
Date: 2019-08-29 11:39:39
Message-ID: CA+99BHrULLrx-g+Ga68F7bzNa9mQR9ezBzHsDihsQ+0=Q0LiCA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs pgsql-hackers

Added two kinds of test for the implicit transaction: in single query and
in implicit block.
The patch file is now created with Unix-style line ending (LF).

2019年8月29日(木) 15:30 Fabien COELHO <coelho(at)cri(dot)ensmp(dot)fr>:

>
> 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.
>

Attachment Content-Type Size
implicit_xact_chain_test.patch application/octet-stream 1.8 KB

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Fabien COELHO 2019-08-29 12:10:06 Re: BUG #15977: Inconsistent behavior in chained transactions
Previous Message Fabien COELHO 2019-08-29 07:24:11 Re: BUG #15977: Inconsistent behavior in chained transactions

Browse pgsql-hackers by date

  From Date Subject
Next Message Ahsan Hadi 2019-08-29 11:47:31 Re: Email to hackers for test coverage
Previous Message Ashutosh Sharma 2019-08-29 11:30:45 Re: Zedstore - compressed in-core columnar storage