Fix coredump problem in plpgsql's RETURN NEXT. When a SELECT INTO

Tom Lane <tgl@sss.pgh.pa.us>

Commit: a4482f4c4c4e052f954f4f333ae8f5ce999613ab
Author: Tom Lane <tgl@sss.pgh.pa.us>
Date: 2003-01-21T22:06:12Z
Releases: 7.4.1
Fix coredump problem in plpgsql's RETURN NEXT.  When a SELECT INTO
that's selecting into a RECORD variable returns zero rows, make it
assign an all-nulls row to the RECORD; this is consistent with what
happens when the SELECT INTO target is not a RECORD.  In support of
this, tweak the SPI code so that a valid tuple descriptor is returned
even when a SPI select returns no rows.

Files

PathChange+/−
doc/src/sgml/spi.sgml modified +3 −3
src/backend/executor/spi.c modified +57 −43
src/backend/tcop/dest.c modified +2 −2
src/include/access/printtup.h modified +4 −2
src/pl/plpgsql/src/pl_exec.c modified +39 −13