[BUGS] Two phase commit in ECPG - Mailing list pgsql-bugs

From Masahiko Sawada
Subject [BUGS] Two phase commit in ECPG
Date
Msg-id CAD21AoDZTi+C06oF3-i15r-ZMx+cCx7PjK_m859YKA-08CbyHw@mail.gmail.com
Whole thread Raw
Responses Re: [BUGS] [HACKERS] Two phase commit in ECPG  (Michael Meskes <meskes@postgresql.org>)
List pgsql-bugs
Hi all,

I found that ecpg has not been supporting COMMIT PREPARED and ROLLBACK
PREPARED since version 9.0.2.
For example, if the test code does,
  EXEC SQL BEGIN;
  EXEC SQL INSERT INTO t1 VALUES(1);
  EXEC SQL PREPARE TRANSACTION 'gxid';
  EXEC SQL COMMIT PREPARED 'gxid';
I got error "COMMIT PREPARED cannot run inside a transaction block".

This cause is that the "begin transaction" is issued automatically
before executing COMMIT PREPARED if we're not in auto commit. The
Commit 816b008eaf1a1ff1069f3bafff363a9a8bf04a21 fixed bug of incorrect
status calculation but at the same time it became the cause of this
behavior.
Is this a bug?

Attached 001 patch fixes this issue and add regression test for two
phase commit in ecpg.

Also, in spite of ecpg identifies these two commands as transaction
command similar to other transaction commands like commit and rollback
the documentation doesn't mentioned about these at all. Attached 002
patch add description about these to documentation.

Regards,

--
Masahiko Sawada
NIPPON TELEGRAPH AND TELEPHONE CORPORATION
NTT Open Source Software Center

-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs

Attachment

pgsql-bugs by date:

Previous
From: Tom Lane
Date:
Subject: Re: [BUGS] Error with Softlinks after using pg_upgrade
Next
From: Tom Lane
Date:
Subject: Re: [BUGS] BUG #14573: lateral joins, ambuiguity