1
0
mirror of https://github.com/postgres/postgres.git synced 2025-09-02 04:21:28 +03:00

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.
This commit is contained in:
Tom Lane
2003-01-21 22:06:12 +00:00
parent f8d8266ac5
commit a4482f4c4c
5 changed files with 106 additions and 64 deletions

View File

@@ -7,7 +7,7 @@
* Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* $Id: printtup.h,v 1.22 2002/09/04 20:31:37 momjian Exp $
* $Id: printtup.h,v 1.23 2003/01/21 22:06:12 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -23,7 +23,9 @@ extern void debugSetup(DestReceiver *self, int operation,
extern void debugtup(HeapTuple tuple, TupleDesc typeinfo,
DestReceiver *self);
/* XXX this one is really in executor/spi.c */
/* XXX these are really in executor/spi.c */
extern void spi_dest_setup(DestReceiver *self, int operation,
const char *portalName, TupleDesc typeinfo);
extern void spi_printtup(HeapTuple tuple, TupleDesc tupdesc,
DestReceiver *self);