Re: [HACKERS] PERFORM effects FOUND patch (Was: I must be

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Nigel J(dot) Andrews" <nandrews(at)investsystems(dot)co(dot)uk>
Cc: pgsql-general(at)postgresql(dot)org, pgsql-hackers(at)postgresql(dot)org
Subject: Re: [HACKERS] PERFORM effects FOUND patch (Was: I must be
Date: 2002-06-24 23:14:25
Message-ID: 2000.1024960465@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-hackers

> Jan Wieck <JanWieck(at)Yahoo(dot)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);
}

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Neil Conway 2002-06-24 23:44:11 Re: Astonishing explain...!
Previous Message s 2002-06-24 23:03:58 Re: calling a plpgsql procedure

Browse pgsql-hackers by date

  From Date Subject
Next Message Hiroshi Inoue 2002-06-24 23:51:41 Re: [HACKERS] ODBC Driver 7.02.0001 (Win32) (Unicode mode): CRLF->LF
Previous Message Tom Lane 2002-06-24 22:40:37 Re: Request for builtin function: Double_quote