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

Commit9da6d2c

Browse files
committed
ExecSubPlan needs to be able to cope with RelabelType nodes atop the
Const placeholder nodes for subplan result values.
1 parentb212e7a commit9da6d2c

File tree

1 file changed

+20
-8
lines changed

1 file changed

+20
-8
lines changed

‎src/backend/executor/nodeSubplan.c

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* Portions Copyright (c) 1994, Regents of the University of California
88
*
99
* IDENTIFICATION
10-
* $Header: /cvsroot/pgsql/src/backend/executor/nodeSubplan.c,v 1.23 2000/03/21 04:20:45 tgl Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/executor/nodeSubplan.c,v 1.24 2000/03/23 07:32:58 tgl Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -141,16 +141,28 @@ ExecSubPlan(SubPlan *node, List *pvar, ExprContext *econtext, bool *isNull)
141141

142142
/*
143143
* The righthand side of the expression should be either a Const
144-
* or a function call taking a Const as arg (the function would
145-
* be a run-time type coercion inserted by the parser to get to
146-
* the input type needed by the operator). Find the Const node
147-
* and insert the actual righthand side value into it.
144+
* or a function call or RelabelType node taking a Const as arg
145+
* (these nodes represent run-time type coercions inserted by
146+
* the parser to get to the input type needed by the operator).
147+
* Find the Const node and insert the actual righthand-side value
148+
* into it.
148149
*/
149150
if (!IsA(con,Const))
150151
{
151-
Assert(IsA(con,Expr));
152-
con=lfirst(((Expr*)con)->args);
153-
Assert(IsA(con,Const));
152+
switch (con->type)
153+
{
154+
caseT_Expr:
155+
con=lfirst(((Expr*)con)->args);
156+
break;
157+
caseT_RelabelType:
158+
con= (Const*) (((RelabelType*)con)->arg);
159+
break;
160+
default:
161+
/* will fail below */
162+
break;
163+
}
164+
if (!IsA(con,Const))
165+
elog(ERROR,"ExecSubPlan: failed to find placeholder for subplan result");
154166
}
155167
con->constvalue=heap_getattr(tup,col,tdesc,
156168
&(con->constisnull));

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp