diff options
author | Tom Lane | 2009-06-11 16:14:18 +0000 |
---|---|---|
committer | Tom Lane | 2009-06-11 16:14:18 +0000 |
commit | 8ac1e84376e5f56be480e49f1b0a6bf47fedf08c (patch) | |
tree | 13a3d4338d282954b60a971d59b324135b9a7cdd | |
parent | e5f41a6bca5489f22dd7a0232314c790a5fc7323 (diff) |
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.
-rw-r--r-- | src/backend/foreign/foreign.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/backend/foreign/foreign.c b/src/backend/foreign/foreign.c index 981cd10b1c..13174a5959 100644 --- a/src/backend/foreign/foreign.c +++ b/src/backend/foreign/foreign.c @@ -279,7 +279,8 @@ deflist_to_tuplestore(ReturnSetInfo *rsinfo, List *options) ereport(ERROR, (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), errmsg("set-valued function called in context that cannot accept a set"))); - if (!(rsinfo->allowedModes & SFRM_Materialize)) + if (!(rsinfo->allowedModes & SFRM_Materialize) || + rsinfo->expectedDesc == NULL) ereport(ERROR, (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), errmsg("materialize mode required, but it is not allowed in this context"))); |