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

Commit4405b3e

Browse files
committed
simplify_function() mustn't try to evaluate functions that return
composite types, because TupleTableSlots aren't Datums and can't bestored in Const nodes. We can remove this restriction if we everadopt a cleaner runtime representation for whole-tuple results, butat the moment it's broken. Per example from Thomas Hallgren.
1 parent45842e6 commit4405b3e

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

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

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $PostgreSQL: pgsql/src/backend/optimizer/util/clauses.c,v 1.162 2004/01/12 20:48:15 tgl Exp $
11+
* $PostgreSQL: pgsql/src/backend/optimizer/util/clauses.c,v 1.163 2004/01/28 00:05:04 tgl Exp $
1212
*
1313
* HISTORY
1414
* AUTHORDATEMAJOR EVENT
@@ -1711,6 +1711,7 @@ evaluate_function(Oid funcid, Oid result_type, List *args,
17111711
boolhas_null_input= false;
17121712
List*arg;
17131713
FuncExpr*newexpr;
1714+
charresult_typtype;
17141715

17151716
/*
17161717
* Can't simplify if it returns a set.
@@ -1747,6 +1748,15 @@ evaluate_function(Oid funcid, Oid result_type, List *args,
17471748
has_nonconst_input)
17481749
returnNULL;
17491750

1751+
/*
1752+
* Can't simplify functions returning composite types (mainly because
1753+
* datumCopy() doesn't cope; FIXME someday when we have a saner
1754+
* representation for whole-tuple results).
1755+
*/
1756+
result_typtype=get_typtype(funcform->prorettype);
1757+
if (result_typtype=='c')
1758+
returnNULL;
1759+
17501760
/*
17511761
* OK, looks like we can simplify this operator/function.
17521762
*

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp