File tree 1 file changed +10
-1
lines changed
1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change 8
8
*
9
9
*
10
10
* 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 $
12
12
*
13
13
*-------------------------------------------------------------------------
14
14
*/
@@ -339,6 +339,15 @@ checkretval(Oid rettype, List *queryTreeList)
339
339
int relnatts ;
340
340
int i ;
341
341
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
+
342
351
/* find the final query */
343
352
parse = (Query * ) nth (length (queryTreeList ) - 1 , queryTreeList );
344
353
You can’t perform that action at this time.
0 commit comments