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

Commitcbc5f4f

Browse files
committed
checkretval() failed to cope with an empty SQL function body.
1 parent821f467 commitcbc5f4f

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

‎src/backend/catalog/pg_proc.c

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $Header: /cvsroot/pgsql/src/backend/catalog/pg_proc.c,v 1.51 2000/11/20 20:36:47 tgl Exp $
11+
* $Header: /cvsroot/pgsql/src/backend/catalog/pg_proc.c,v 1.52 2000/12/07 19:40:56 tgl Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -339,6 +339,15 @@ checkretval(Oid rettype, List *queryTreeList)
339339
intrelnatts;
340340
inti;
341341

342+
/* guard against empty function body; OK only if no return type */
343+
if (queryTreeList==NIL)
344+
{
345+
if (rettype!=InvalidOid)
346+
elog(ERROR,"function declared to return %s, but no SELECT provided",
347+
typeidTypeName(rettype));
348+
return;
349+
}
350+
342351
/* find the final query */
343352
parse= (Query*)nth(length(queryTreeList)-1,queryTreeList);
344353

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp