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

Commit42af56e

Browse files
committed
Revise implementation of SubLinks so that there is a consistent,
documented intepretation of the lefthand and oper fields. Fix a number ofobscure problems while at it --- for example, the old code failed if the parserdecided to insert a type-coercion function just below the operator of aSubLink.CAUTION: this will break stored rules that contain subplans. You mayneed to initdb.
1 parentedda70c commit42af56e

File tree

8 files changed

+325
-321
lines changed

8 files changed

+325
-321
lines changed

‎src/backend/executor/nodeSubplan.c

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,8 +94,25 @@ ExecSubPlan(SubPlan *node, List *pvar, ExprContext *econtext)
9494
Const*con=lsecond(expr->args);
9595
boolisnull;
9696

97+
/*
98+
* The righthand side of the expression should be either a Const
99+
* or a function call taking a Const as arg (the function would
100+
* be a run-time type coercion inserted by the parser to get to
101+
* the input type needed by the operator). Find the Const node
102+
* and insert the actual righthand side value into it.
103+
*/
104+
if (!IsA(con,Const))
105+
{
106+
Assert(IsA(con,Expr));
107+
con=lfirst(((Expr*)con)->args);
108+
Assert(IsA(con,Const));
109+
}
97110
con->constvalue=heap_getattr(tup,i,tdesc,&(con->constisnull));
98-
result=ExecEvalExpr((Node*)expr,econtext,&isnull, (bool*)NULL);
111+
/*
112+
* Now we can eval the expression.
113+
*/
114+
result=ExecEvalExpr((Node*)expr,econtext,&isnull,
115+
(bool*)NULL);
99116
if (isnull)
100117
{
101118
if (subLinkType==EXPR_SUBLINK)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp