]> granicus.if.org Git - postgresql/commitdiff
Change COMMIT back to the old behavior of emitting command tag COMMIT,
authorTom Lane <tgl@sss.pgh.pa.us>
Sat, 30 Oct 2004 20:44:43 +0000 (20:44 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Sat, 30 Oct 2004 20:44:43 +0000 (20:44 +0000)
not ROLLBACK, for the case of COMMIT outside a transaction block.
Alvaro Herrera

src/backend/access/transam/xact.c

index 583fb36a6f6d353965005c2a7c6ec21348b4ba2a..40f26822e6c502a789f64ed5faf0437b820d207f 100644 (file)
@@ -10,7 +10,7 @@
  *
  *
  * 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)
                        break;
 
                        /*
-                        * here, the user issued COMMIT when not inside a transaction.
-                        * Issue a WARNING and go to abort state.  The upcoming call
-                        * to CommitTransactionCommand() will then put us back into
-                        * the default state.
+                        * The user issued COMMIT when not inside a transaction.  Issue a
+                        * WARNING, staying in TBLOCK_STARTED state.  The upcoming call to
+                        * CommitTransactionCommand() will then close the transaction and
+                        * put us back into the default state.
                         */
                case TBLOCK_STARTED:
                        ereport(WARNING,
                                        (errcode(ERRCODE_NO_ACTIVE_SQL_TRANSACTION),
                                         errmsg("there is no transaction in progress")));
-                       s->blockState = TBLOCK_ABORT_PENDING;
+                       result = true;
                        break;
 
                        /* These cases are invalid. */