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

Commit1819a37

Browse files
committed
Fix inline_set_returning_function() to allow multiple OUT parameters.
inline_set_returning_function failed to distinguish functions returninggeneric RECORD (which require a column list in the RTE, as well as run-timetype checking) from those with multiple OUT parameters (which do not).This prevented inlining from happening. Per complaint from Jay Levitt.Back-patch to 8.4 where this capability was introduced.
1 parente4e60e7 commit1819a37

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

‎src/backend/optimizer/util/clauses.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
#include"catalog/pg_type.h"
2727
#include"executor/executor.h"
2828
#include"executor/functions.h"
29+
#include"funcapi.h"
2930
#include"miscadmin.h"
3031
#include"nodes/makefuncs.h"
3132
#include"nodes/nodeFuncs.h"
@@ -4476,9 +4477,12 @@ inline_set_returning_function(PlannerInfo *root, RangeTblEntry *rte)
44764477
* If it returns RECORD, we have to check against the column type list
44774478
* provided in the RTE; check_sql_fn_retval can't do that. (If no match,
44784479
* we just fail to inline, rather than complaining; see notes for
4479-
* tlist_matches_coltypelist.)
4480+
* tlist_matches_coltypelist.) We don't have to do this for functions
4481+
* with declared OUT parameters, even though their funcresulttype is
4482+
* RECORDOID, so check get_func_result_type too.
44804483
*/
44814484
if (fexpr->funcresulttype==RECORDOID&&
4485+
get_func_result_type(func_oid,NULL,NULL)==TYPEFUNC_RECORD&&
44824486
!tlist_matches_coltypelist(querytree->targetList,rte->funccoltypes))
44834487
gotofail;
44844488

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp