aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2002-08-29 04:12:03 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2002-08-29 04:12:03 +0000
commit99fd5cbd410c29381d2ffdfd98705c68fe99fbe3 (patch)
treeee7cb47fb333ab4967739c5787d2a926b8ec13a2 /src
parent5241a6259ff0a4a12d7659b25310f0987b51f211 (diff)
downloadpostgresql-99fd5cbd410c29381d2ffdfd98705c68fe99fbe3.tar.gz
postgresql-99fd5cbd410c29381d2ffdfd98705c68fe99fbe3.zip
FOUND patch was a bit over-enthusiastic: SQL commands that are not
INSERT, UPDATE, or DELETE shouldn't change FOUND. IMHO anyway. Also, try to make documentation a little clearer.
Diffstat (limited to 'src')
-rw-r--r--src/pl/plpgsql/src/pl_exec.c16
1 files changed, 5 insertions, 11 deletions
diff --git a/src/pl/plpgsql/src/pl_exec.c b/src/pl/plpgsql/src/pl_exec.c
index c6522c35b9c..363a04839a4 100644
--- a/src/pl/plpgsql/src/pl_exec.c
+++ b/src/pl/plpgsql/src/pl_exec.c
@@ -3,7 +3,7 @@
* procedural language
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/pl/plpgsql/src/pl_exec.c,v 1.58 2002/08/24 15:00:47 tgl Exp $
+ * $Header: /cvsroot/pgsql/src/pl/plpgsql/src/pl_exec.c,v 1.59 2002/08/29 04:12:03 tgl Exp $
*
* This software is copyrighted by Jan Wieck - Hamburg.
*
@@ -1845,11 +1845,6 @@ exec_stmt_execsql(PLpgSQL_execstate * estate,
bool isnull;
/*
- * Set magic FOUND variable to false
- */
- exec_set_found(estate, false);
-
- /*
* On the first call for this expression generate the plan
*/
if (expr->plan == NULL)
@@ -1927,16 +1922,15 @@ exec_stmt_execsql(PLpgSQL_execstate * estate,
case SPI_OK_SELINTO:
break;
+ case SPI_OK_INSERT:
+ case SPI_OK_DELETE:
+ case SPI_OK_UPDATE:
/*
* If the INSERT, DELETE, or UPDATE query affected at least
* one tuple, set the magic 'FOUND' variable to true. This
* conforms with the behavior of PL/SQL.
*/
- case SPI_OK_INSERT:
- case SPI_OK_DELETE:
- case SPI_OK_UPDATE:
- if (SPI_processed > 0)
- exec_set_found(estate, true);
+ exec_set_found(estate, (SPI_processed != 0));
break;
case SPI_OK_SELECT: