File tree Expand file tree Collapse file tree 1 file changed +4
-5
lines changed
Expand file tree Collapse file tree 1 file changed +4
-5
lines changed Original file line number Diff line number Diff line change @@ -1447,11 +1447,9 @@ handle_arrexpr(const ScalarArrayOpExpr *expr, WalkerContext *context)
14471447 result -> orig = (const Node * )expr ;
14481448 result -> args = NIL ;
14491449
1450- if (varnode == NULL || !IsA (varnode , Var ))
1451- {
1452- result -> rangeset = list_make1_irange (make_irange (0 , prel -> children_count - 1 , true));
1453- return result ;
1454- }
1450+ /* If variable is not the partition key then skip it */
1451+ if (!varnode || !IsA (varnode , Var ) || ((Var * ) varnode )-> varattno != prel -> attnum )
1452+ goto handle_arrexpr_return ;
14551453
14561454 if (arraynode && IsA (arraynode , Const ) &&
14571455 !((Const * ) arraynode )-> constisnull )
@@ -1491,6 +1489,7 @@ handle_arrexpr(const ScalarArrayOpExpr *expr, WalkerContext *context)
14911489 return result ;
14921490 }
14931491
1492+ handle_arrexpr_return :
14941493 result -> rangeset = list_make1_irange (make_irange (0 , prel -> children_count - 1 , true));
14951494 return result ;
14961495}
You can’t perform that action at this time.
0 commit comments