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

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

Commit: 1f74045675156f9e1dea4f66932ddf0a58180936
Author: Tom Lane <tgl@sss.pgh.pa.us>
Date: 2003-01-21T22:06:36Z
Releases: 7.3.2
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