summaryrefslogtreecommitdiff
path: root/src/backend/executor/spi.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2004-07-27 05:11:48 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2004-07-27 05:11:48 +0000
commitcc813fc2b8d9293bbd4d0e0d6a6f3b9cf02fe32f (patch)
tree9f7e6635c94bb61cb9d6340c3647c429dca9504b /src/backend/executor/spi.c
parentb1ee93884d528672fbce446a38659954a86219e1 (diff)
downloadpostgresql-cc813fc2b8d9293bbd4d0e0d6a6f3b9cf02fe32f.tar.gz
Replace nested-BEGIN syntax for subtransactions with spec-compliant
SAVEPOINT/RELEASE/ROLLBACK-TO syntax. (Alvaro) Cause COMMIT of a failed transaction to report ROLLBACK instead of COMMIT in its command tag. (Tom) Fix a few loose ends in the nested-transactions stuff.
Diffstat (limited to 'src/backend/executor/spi.c')
-rw-r--r--src/backend/executor/spi.c25
1 files changed, 8 insertions, 17 deletions
diff --git a/src/backend/executor/spi.c b/src/backend/executor/spi.c
index 19dbfc13d0..f2fa0a4316 100644
--- a/src/backend/executor/spi.c
+++ b/src/backend/executor/spi.c
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/executor/spi.c,v 1.120 2004/07/01 21:17:13 tgl Exp $
+ * $PostgreSQL: pgsql/src/backend/executor/spi.c,v 1.121 2004/07/27 05:10:51 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -1181,18 +1181,16 @@ _SPI_execute(const char *src, int tcount, _SPI_plan *plan)
res = SPI_ERROR_CURSOR;
goto fail;
}
+ else if (IsA(queryTree->utilityStmt, TransactionStmt))
+ {
+ res = SPI_ERROR_TRANSACTION;
+ goto fail;
+ }
res = SPI_OK_UTILITY;
if (plan == NULL)
{
ProcessUtility(queryTree->utilityStmt, dest, NULL);
-
- if (IsA(queryTree->utilityStmt, TransactionStmt))
- {
- CommitTransactionCommand();
- StartTransactionCommand();
- }
- else
- CommandCounterIncrement();
+ CommandCounterIncrement();
}
}
else if (plan == NULL)
@@ -1308,14 +1306,7 @@ _SPI_execute_plan(_SPI_plan *plan, Datum *Values, const char *Nulls,
{
ProcessUtility(queryTree->utilityStmt, dest, NULL);
res = SPI_OK_UTILITY;
-
- if (IsA(queryTree->utilityStmt, TransactionStmt))
- {
- CommitTransactionCommand();
- StartTransactionCommand();
- }
- else
- CommandCounterIncrement();
+ CommandCounterIncrement();
}
else
{