8
8
*
9
9
*
10
10
* IDENTIFICATION
11
- * $PostgreSQL: pgsql/src/backend/executor/execQual.c,v 1.177 2005/05/06 17:24:53 tgl Exp $
11
+ * $PostgreSQL: pgsql/src/backend/executor/execQual.c,v 1.178 2005/05/09 14:28:39 tgl Exp $
12
12
*
13
13
*-------------------------------------------------------------------------
14
14
*/
@@ -948,7 +948,7 @@ ExecMakeFunctionResult(FuncExprState *fcache,
948
948
* returns set, save the current argument values to re-use
949
949
* on the next call.
950
950
*/
951
- if (fcache -> func .fn_retset )
951
+ if (fcache -> func .fn_retset && * isDone == ExprMultipleResult )
952
952
{
953
953
memcpy (& fcache -> setArgs ,& fcinfo ,sizeof (fcinfo ));
954
954
fcache -> setHasSetArg = hasSetArg ;
@@ -967,7 +967,8 @@ ExecMakeFunctionResult(FuncExprState *fcache,
967
967
* Make sure we say we are returning a set, even if the
968
968
* function itself doesn't return sets.
969
969
*/
970
- * isDone = ExprMultipleResult ;
970
+ if (hasSetArg )
971
+ * isDone = ExprMultipleResult ;
971
972
break ;
972
973
}
973
974