Commit 88868d4f authored by Tom Lane's avatar Tom Lane

Change COMMIT back to the old behavior of emitting command tag COMMIT,

not ROLLBACK, for the case of COMMIT outside a transaction block.
Alvaro Herrera
parent e5ac8db0
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/access/transam/xact.c,v 1.193 2004/10/29 22:19:53 tgl Exp $ * $PostgreSQL: pgsql/src/backend/access/transam/xact.c,v 1.194 2004/10/30 20:44:43 tgl Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -2538,16 +2538,16 @@ EndTransactionBlock(void) ...@@ -2538,16 +2538,16 @@ EndTransactionBlock(void)
break; break;
/* /*
* here, the user issued COMMIT when not inside a transaction. * The user issued COMMIT when not inside a transaction. Issue a
* Issue a WARNING and go to abort state. The upcoming call * WARNING, staying in TBLOCK_STARTED state. The upcoming call to
* to CommitTransactionCommand() will then put us back into * CommitTransactionCommand() will then close the transaction and
* the default state. * put us back into the default state.
*/ */
case TBLOCK_STARTED: case TBLOCK_STARTED:
ereport(WARNING, ereport(WARNING,
(errcode(ERRCODE_NO_ACTIVE_SQL_TRANSACTION), (errcode(ERRCODE_NO_ACTIVE_SQL_TRANSACTION),
errmsg("there is no transaction in progress"))); errmsg("there is no transaction in progress")));
s->blockState = TBLOCK_ABORT_PENDING; result = true;
break; break;
/* These cases are invalid. */ /* These cases are invalid. */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment