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

Commitdadb14f

Browse files
committed
Hack parse_coerce so it won't try to constant-fold the dummy Const
nodes introduced by make_subplan(). It'd be better if we used adifferent node type for subplan result placeholders, but for now...
1 parent9da6d2c commitdadb14f

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

‎src/backend/parser/parse_coerce.c

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $Header: /cvsroot/pgsql/src/backend/parser/parse_coerce.c,v 2.39 2000/03/20 15:42:45 momjian Exp $
11+
* $Header: /cvsroot/pgsql/src/backend/parser/parse_coerce.c,v 2.40 2000/03/23 07:36:03 tgl Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -38,8 +38,9 @@ coerce_type(ParseState *pstate, Node *node, Oid inputTypeId,
3838
{
3939
Node*result;
4040

41-
if (targetTypeId==InvalidOid||
42-
targetTypeId==inputTypeId)
41+
if (targetTypeId==inputTypeId||
42+
targetTypeId==InvalidOid||
43+
node==NULL)
4344
{
4445
/* no conversion needed */
4546
result=node;
@@ -141,8 +142,13 @@ coerce_type(ParseState *pstate, Node *node, Oid inputTypeId,
141142
*
142143
* Note that no folding will occur if the conversion function is
143144
* not marked 'iscachable'.
145+
*
146+
* HACK: if constant is NULL, don't fold it here. This is needed
147+
* by make_subplan(), which calls this routine on placeholder Const
148+
* nodes that mustn't be collapsed. (It'd be a lot cleaner to make
149+
* a separate node type for that purpose...)
144150
*/
145-
if (IsA(node,Const))
151+
if (IsA(node,Const)&& ! ((Const*)node)->constisnull)
146152
result=eval_const_expressions(result);
147153
}
148154

@@ -614,7 +620,6 @@ PromoteLesserType(Oid inType1, Oid inType2, Oid *newType1, Oid *newType2)
614620
{
615621
case (BPCHAROID):
616622
case (VARCHAROID):
617-
case (BYTEA):
618623
case (TEXTOID):
619624

620625
case (INT2OID):

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp