Index: execQual.c =================================================================== RCS file: /projects/cvsroot/pgsql-server/src/backend/executor/execQual.c,v retrieving revision 1.159 diff -u -r1.159 execQual.c --- execQual.c 10 May 2004 22:44:43 -0000 1.159 +++ execQual.c 20 May 2004 11:28:20 -0000 @@ -894,21 +894,20 @@ } /* - * If function returns set, prepare a resultinfo node for - * communication + * Prepare a resultinfo node for communication. We always do this + * even if not expecting a set result, so that we can pass + * expectedDesc. In the generic-expression case, the expression + * doesn't actually get to see the resultinfo, but set it up anyway + * because we use some of the fields as our own state variables. */ - if (fcache->func.fn_retset) - { - fcinfo.resultinfo = (Node *) &rsinfo; - rsinfo.type = T_ReturnSetInfo; - rsinfo.econtext = econtext; - rsinfo.expectedDesc = NULL; - rsinfo.allowedModes = (int) SFRM_ValuePerCall; - rsinfo.returnMode = SFRM_ValuePerCall; - /* isDone is filled below */ - rsinfo.setResult = NULL; - rsinfo.setDesc = NULL; - } + fcinfo.resultinfo = (Node *) &rsinfo; + rsinfo.type = T_ReturnSetInfo; + rsinfo.econtext = econtext; + rsinfo.allowedModes = (int) (SFRM_ValuePerCall | SFRM_Materialize); + rsinfo.returnMode = SFRM_ValuePerCall; + /* isDone is filled below */ + rsinfo.setResult = NULL; + rsinfo.setDesc = NULL; /* * now return the value gotten by calling the function manager,