> Jan Wieck <JanWieck@Yahoo.com> writes:
>> Perform has nothing to do with ORACLE. It was added because people tried
>> to call other "procedures" and didn't want any result back.
> Well, in that case we can do what we want with it.
> Does anyone object to making it set FOUND?
Given the lack of objection, I have committed the attached patch for 7.3,
along with a suitable documentation update.
regards, tom lane
*** src/pl/plpgsql/src/pl_exec.c.orig Mon Mar 25 02:41:10 2002
--- src/pl/plpgsql/src/pl_exec.c Mon Jun 24 18:23:11 2002
***************
*** 969,977 ****
else
{
/*
! * PERFORM: evaluate query and discard result. This cannot share
! * code with the assignment case since we do not wish to
! * constraint the discarded result to be only one row/column.
*/
int rc;
--- 969,979 ----
else
{
/*
! * PERFORM: evaluate query and discard result (but set FOUND
! * depending on whether at least one row was returned).
! *
! * This cannot share code with the assignment case since we do not
! * wish to constrain the discarded result to be only one row/column.
*/
int rc;
***************
*** 984,989 ****
--- 986,993 ----
rc = exec_run_select(estate, expr, 0, NULL);
if (rc != SPI_OK_SELECT)
elog(ERROR, "query \"%s\" didn't return data", expr->query);
+
+ exec_set_found(estate, (estate->eval_processed != 0));
exec_eval_cleanup(estate);
}