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

Commitc713fb8

Browse files
committed
change Param-related macros used in expr. walker
1 parent6760448 commitc713fb8

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

‎pg_pathman.c

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -122,8 +122,12 @@ static Path *get_cheapest_parameterized_child_path(PlannerInfo *root, RelOptInfo
122122
#definecheck_gt(flinfo,arg1,arg2) \
123123
((int) FunctionCall2(cmp_func, arg1, arg2) > 0)
124124

125-
#defineIsConstValue(node) \
126-
( IsA((node), Const) || IsA((node), Param) )
125+
#defineWcxtHasExprContext(wcxt) ( (wcxt) && (wcxt)->econtext )
126+
127+
/* We can transform Param into Const provided that 'econtext' is available */
128+
#defineIsConstValue(wcxt,node) \
129+
( IsA((node), Const) || (WcxtHasExprContext(wcxt) ? IsA((node), Param) : false) )
130+
127131
#defineExtractConst(wcxt,node) \
128132
( IsA((node), Param) ? extract_const((wcxt), (Param *) (node)) : ((Const *) (node)) )
129133

@@ -1276,13 +1280,13 @@ handle_opexpr(WalkerContext *wcxt, const OpExpr *expr, const PartRelationInfo *p
12761280
firstarg= (Node*)linitial(expr->args);
12771281
secondarg= (Node*)lsecond(expr->args);
12781282

1279-
if (IsA(firstarg,Var)&&IsConstValue(secondarg)&&
1283+
if (IsA(firstarg,Var)&&IsConstValue(wcxt,secondarg)&&
12801284
((Var*)firstarg)->varattno==prel->attnum)
12811285
{
12821286
handle_binary_opexpr(prel,result, (Var*)firstarg,ExtractConst(wcxt,secondarg));
12831287
returnresult;
12841288
}
1285-
elseif (IsA(secondarg,Var)&&IsConstValue(firstarg)&&
1289+
elseif (IsA(secondarg,Var)&&IsConstValue(wcxt,firstarg)&&
12861290
((Var*)secondarg)->varattno==prel->attnum)
12871291
{
12881292
handle_binary_opexpr(prel,result, (Var*)secondarg,ExtractConst(wcxt,firstarg));

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp