88 *
99 *
1010 * 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 $
1212 *
1313 *-------------------------------------------------------------------------
1414 */
@@ -948,7 +948,7 @@ ExecMakeFunctionResult(FuncExprState *fcache,
948948 * returns set, save the current argument values to re-use
949949 * on the next call.
950950 */
951- if (fcache -> func .fn_retset )
951+ if (fcache -> func .fn_retset && * isDone == ExprMultipleResult )
952952{
953953memcpy (& fcache -> setArgs ,& fcinfo ,sizeof (fcinfo ));
954954fcache -> setHasSetArg = hasSetArg ;
@@ -967,7 +967,8 @@ ExecMakeFunctionResult(FuncExprState *fcache,
967967 * Make sure we say we are returning a set, even if the
968968 * function itself doesn't return sets.
969969 */
970- * isDone = ExprMultipleResult ;
970+ if (hasSetArg )
971+ * isDone = ExprMultipleResult ;
971972break ;
972973}
973974