diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2005-05-09 14:28:39 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2005-05-09 14:28:39 +0000 |
commit | 1198d6339781e656e0f4f53959b119d5fe0eb898 (patch) | |
tree | ae44f668f1123befac080c7b83274768c4f5fb12 /src | |
parent | 4744c1a0a16d4fdad4196c9874e050936e1133ed (diff) | |
download | postgresql-1198d6339781e656e0f4f53959b119d5fe0eb898.tar.gz postgresql-1198d6339781e656e0f4f53959b119d5fe0eb898.zip |
Add some defenses against functions declared to return set that don't
actually follow the protocol; per example from Kris Jurka.
Diffstat (limited to 'src')
-rw-r--r-- | src/backend/executor/execQual.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/backend/executor/execQual.c b/src/backend/executor/execQual.c index 43e0c19d545..1375db2e0a4 100644 --- a/src/backend/executor/execQual.c +++ b/src/backend/executor/execQual.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/executor/execQual.c,v 1.177 2005/05/06 17:24:53 tgl Exp $ + * $PostgreSQL: pgsql/src/backend/executor/execQual.c,v 1.178 2005/05/09 14:28:39 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -948,7 +948,7 @@ ExecMakeFunctionResult(FuncExprState *fcache, * returns set, save the current argument values to re-use * on the next call. */ - if (fcache->func.fn_retset) + if (fcache->func.fn_retset && *isDone == ExprMultipleResult) { memcpy(&fcache->setArgs, &fcinfo, sizeof(fcinfo)); fcache->setHasSetArg = hasSetArg; @@ -967,7 +967,8 @@ ExecMakeFunctionResult(FuncExprState *fcache, * Make sure we say we are returning a set, even if the * function itself doesn't return sets. */ - *isDone = ExprMultipleResult; + if (hasSetArg) + *isDone = ExprMultipleResult; break; } |