Re: improves ExecMakeFunctionResultNoSets - Mailing list pgsql-patches

From Tom Lane
Subject Re: improves ExecMakeFunctionResultNoSets
Date
Msg-id 13327.1111522702@sss.pgh.pa.us
Whole thread Raw
In response to improves ExecMakeFunctionResultNoSets  (a_ogawa <a_ogawa@hi-ho.ne.jp>)
List pgsql-patches
a_ogawa <a_ogawa@hi-ho.ne.jp> writes:
> This patch uses InitFunctionCallInfoData macro instead of MemSet to
> initialize FunctionCallInfoData.
> An idea of this patch discussed in the "FunctionCallN improvement" thread.
> (http://archives.postgresql.org/pgsql-hackers/2005-01/msg01054.php)

Looks good --- applied with minor changes.  I figured that if we were
going to make InitFunctionCallInfoData generally available, we had
better fix it to cover initializing the context and resultinfo fields
per caller option.  Also cleaned up a couple of other places that
already had hand-optimized calling sequences, and can now be written
more cleanly using the macro.  Also, I removed this code you added in
a couple places:

+         /*
+          * argnull is initialized here for safety. Because it might not be
+          * set by ExecEvalExpr.
+          */
+         fcinfo->argnull[i] = false;

If ExecEvalExpr fails to set its isNull argument we will have breakage
all over; there is no need for speed-critical code to assume it has
to do this.

            regards, tom lane

pgsql-patches by date:

Previous
From: a_ogawa
Date:
Subject: improves ExecMakeFunctionResultNoSets
Next
From: Mark Wong
Date:
Subject: Re: [HACKERS] WAL: O_DIRECT and multipage-writer