Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit38d9919

Browse files
committed
Now that fastpath protocol allows null arguments to be passed,
fastpath.c had better check for strict functions.
1 parent0ac6298 commit38d9919

File tree

1 file changed

+30
-3
lines changed

1 file changed

+30
-3
lines changed

‎src/backend/tcop/fastpath.c

Lines changed: 30 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $Header: /cvsroot/pgsql/src/backend/tcop/fastpath.c,v 1.63 2003/05/09 18:08:48 tgl Exp $
11+
* $Header: /cvsroot/pgsql/src/backend/tcop/fastpath.c,v 1.64 2003/05/09 18:18:54 tgl Exp $
1212
*
1313
* NOTES
1414
* This cruft is the server side of PQfn.
@@ -273,6 +273,7 @@ HandleFunctionRequest(StringInfo msgBuf)
273273
Datumretval;
274274
structfp_infomy_fp;
275275
structfp_info*fip;
276+
boolcallit;
276277

277278
/*
278279
* Read message contents if not already done.
@@ -341,8 +342,34 @@ HandleFunctionRequest(StringInfo msgBuf)
341342
/* Verify we reached the end of the message where expected. */
342343
pq_getmsgend(msgBuf);
343344

344-
/* Okay, do it ... */
345-
retval=FunctionCallInvoke(&fcinfo);
345+
/*
346+
* If func is strict, must not call it for null args.
347+
*/
348+
callit= true;
349+
if (fip->flinfo.fn_strict)
350+
{
351+
inti;
352+
353+
for (i=0;i<fcinfo.nargs;i++)
354+
{
355+
if (fcinfo.argnull[i])
356+
{
357+
callit= false;
358+
break;
359+
}
360+
}
361+
}
362+
363+
if (callit)
364+
{
365+
/* Okay, do it ... */
366+
retval=FunctionCallInvoke(&fcinfo);
367+
}
368+
else
369+
{
370+
fcinfo.isnull= true;
371+
retval= (Datum)0;
372+
}
346373

347374
SendFunctionResult(retval,fcinfo.isnull,fip->rettype,rformat);
348375

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp