mirror of
https://github.com/postgres/postgres.git
synced 2025-09-02 04:21:28 +03:00
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.
This commit is contained in:
@@ -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.
|
||||
*
|
||||
@@ -1844,11 +1844,6 @@ exec_stmt_execsql(PLpgSQL_execstate * estate,
|
||||
PLpgSQL_expr *expr = stmt->sqlstmt;
|
||||
bool isnull;
|
||||
|
||||
/*
|
||||
* Set magic FOUND variable to false
|
||||
*/
|
||||
exec_set_found(estate, false);
|
||||
|
||||
/*
|
||||
* On the first call for this expression generate the plan
|
||||
*/
|
||||
@@ -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:
|
||||
|
Reference in New Issue
Block a user