Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 772a074

Browse files
committed
Somebody seems to have thought they could get away without checking for
rsinfo->expectedDesc == NULL in deflist_to_tuplestore(), but that doesn't look very safe to me. Noted in passing while studying problem report from Greg Davidson.
1 parent d747140 commit 772a074

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/backend/foreign/foreign.c

+3-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
* Portions Copyright (c) 1996-2009, PostgreSQL Global Development Group
77
*
88
* IDENTIFICATION
9-
* $PostgreSQL: pgsql/src/backend/foreign/foreign.c,v 1.4 2009/06/11 14:48:57 momjian Exp $
9+
* $PostgreSQL: pgsql/src/backend/foreign/foreign.c,v 1.5 2009/06/11 16:14:18 tgl Exp $
1010
*
1111
*-------------------------------------------------------------------------
1212
*/
@@ -279,7 +279,8 @@ deflist_to_tuplestore(ReturnSetInfo *rsinfo, List *options)
279279
ereport(ERROR,
280280
(errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
281281
errmsg("set-valued function called in context that cannot accept a set")));
282-
if (!(rsinfo->allowedModes & SFRM_Materialize))
282+
if (!(rsinfo->allowedModes & SFRM_Materialize) ||
283+
rsinfo->expectedDesc == NULL)
283284
ereport(ERROR,
284285
(errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
285286
errmsg("materialize mode required, but it is not allowed in this context")));

0 commit comments

Comments
 (0)