*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/tcop/fastpath.c,v 1.63 2003/05/09 18:08:48 tgl Exp $
+ * $Header: /cvsroot/pgsql/src/backend/tcop/fastpath.c,v 1.64 2003/05/09 18:18:54 tgl Exp $
*
* NOTES
* This cruft is the server side of PQfn.
Datum retval;
struct fp_info my_fp;
struct fp_info *fip;
+ bool callit;
/*
* Read message contents if not already done.
/* Verify we reached the end of the message where expected. */
pq_getmsgend(msgBuf);
- /* Okay, do it ... */
- retval = FunctionCallInvoke(&fcinfo);
+ /*
+ * If func is strict, must not call it for null args.
+ */
+ callit = true;
+ if (fip->flinfo.fn_strict)
+ {
+ int i;
+
+ for (i = 0; i < fcinfo.nargs; i++)
+ {
+ if (fcinfo.argnull[i])
+ {
+ callit = false;
+ break;
+ }
+ }
+ }
+
+ if (callit)
+ {
+ /* Okay, do it ... */
+ retval = FunctionCallInvoke(&fcinfo);
+ }
+ else
+ {
+ fcinfo.isnull = true;
+ retval = (Datum) 0;
+ }
SendFunctionResult(retval, fcinfo.isnull, fip->rettype, rformat);