Skip to content

Commit 88868d4

Browse files
committed
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
1 parent e5ac8db commit 88868d4

File tree

1 file changed

+6
-6
lines changed
  • src/backend/access/transam

1 file changed

+6
-6
lines changed

src/backend/access/transam/xact.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
*
1111
*
1212
* IDENTIFICATION
13-
* $PostgreSQL: pgsql/src/backend/access/transam/xact.c,v 1.193 2004/10/29 22:19:53 tgl Exp $
13+
* $PostgreSQL: pgsql/src/backend/access/transam/xact.c,v 1.194 2004/10/30 20:44:43 tgl Exp $
1414
*
1515
*-------------------------------------------------------------------------
1616
*/
@@ -2538,16 +2538,16 @@ EndTransactionBlock(void)
25382538
break;
25392539

25402540
/*
2541-
* here, the user issued COMMIT when not inside a transaction.
2542-
* Issue a WARNING and go to abort state. The upcoming call
2543-
* to CommitTransactionCommand() will then put us back into
2544-
* the default state.
2541+
* The user issued COMMIT when not inside a transaction. Issue a
2542+
* WARNING, staying in TBLOCK_STARTED state. The upcoming call to
2543+
* CommitTransactionCommand() will then close the transaction and
2544+
* put us back into the default state.
25452545
*/
25462546
case TBLOCK_STARTED:
25472547
ereport(WARNING,
25482548
(errcode(ERRCODE_NO_ACTIVE_SQL_TRANSACTION),
25492549
errmsg("there is no transaction in progress")));
2550-
s->blockState = TBLOCK_ABORT_PENDING;
2550+
result = true;
25512551
break;
25522552

25532553
/* These cases are invalid. */

0 commit comments

Comments
 (0)