|
8 | 8 | *
|
9 | 9 | *
|
10 | 10 | * IDENTIFICATION
|
11 |
| - * $Header: /cvsroot/pgsql/src/backend/executor/spi.c,v 1.85 2003/01/29 15:24:46 tgl Exp $ |
| 11 | + * $Header: /cvsroot/pgsql/src/backend/executor/spi.c,v 1.86 2003/02/14 21:12:45 tgl Exp $ |
12 | 12 | *
|
13 | 13 | *-------------------------------------------------------------------------
|
14 | 14 | */
|
@@ -1088,6 +1088,15 @@ _SPI_execute(const char *src, int tcount, _SPI_plan *plan)
|
1088 | 1088 | else
|
1089 | 1089 | canSetResult= false;
|
1090 | 1090 |
|
| 1091 | +/* Reset state if can set result */ |
| 1092 | +if (canSetResult) |
| 1093 | +{ |
| 1094 | +SPI_processed=0; |
| 1095 | +SPI_lastoid=InvalidOid; |
| 1096 | +SPI_tuptable=NULL; |
| 1097 | +_SPI_current->tuptable=NULL; |
| 1098 | +} |
| 1099 | + |
1091 | 1100 | if (queryTree->commandType==CMD_UTILITY)
|
1092 | 1101 | {
|
1093 | 1102 | if (IsA(queryTree->utilityStmt,CopyStmt))
|
@@ -1199,6 +1208,15 @@ _SPI_execute_plan(_SPI_plan *plan, Datum *Values, const char *Nulls,
|
1199 | 1208 | else
|
1200 | 1209 | canSetResult= false;
|
1201 | 1210 |
|
| 1211 | +/* Reset state if can set result */ |
| 1212 | +if (canSetResult) |
| 1213 | +{ |
| 1214 | +SPI_processed=0; |
| 1215 | +SPI_lastoid=InvalidOid; |
| 1216 | +SPI_tuptable=NULL; |
| 1217 | +_SPI_current->tuptable=NULL; |
| 1218 | +} |
| 1219 | + |
1202 | 1220 | if (queryTree->commandType==CMD_UTILITY)
|
1203 | 1221 | {
|
1204 | 1222 | res=SPI_OK_UTILITY;
|
|