Skip to content

Commit 1f9d176

Browse files
committed
use var->varoattno instead of varattno
1 parent 8d0f62b commit 1f9d176

File tree

2 files changed

+10
-7
lines changed

2 files changed

+10
-7
lines changed

src/nodes_common.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ append_part_attr_to_tlist(List *tlist, Index relno, PartRelationInfo *prel)
149149
TargetEntry *te = (TargetEntry *) lfirst(lc);
150150
Var *var = (Var *) te->expr;
151151

152-
if (IsA(var, Var) && var->varattno == prel->attnum)
152+
if (IsA(var, Var) && var->varoattno == prel->attnum)
153153
part_attr_found = true;
154154
}
155155

src/pg_pathman.c

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1117,12 +1117,15 @@ handle_opexpr(const OpExpr *expr, WalkerContext *context)
11171117
/*
11181118
* Checks if expression is a KEY OP PARAM or PARAM OP KEY,
11191119
* where KEY is partition key (it could be Var or RelableType) and PARAM is
1120-
* whatever. Function returns variable (or RelableType) and param via var_ptr
1120+
* whatever. Function returns variable (or RelableType) and param via var_ptr
11211121
* and param_ptr pointers. If partition key isn't in expression then function
11221122
* returns false.
11231123
*/
11241124
static bool
1125-
pull_var_param(const WalkerContext *ctx, const OpExpr *expr, Node **var_ptr, Node **param_ptr)
1125+
pull_var_param(const WalkerContext *ctx,
1126+
const OpExpr *expr,
1127+
Node **var_ptr,
1128+
Node **param_ptr)
11261129
{
11271130
Node *left = linitial(expr->args),
11281131
*right = lsecond(expr->args);
@@ -1135,22 +1138,22 @@ pull_var_param(const WalkerContext *ctx, const OpExpr *expr, Node **var_ptr, Nod
11351138
(Var *) left :
11361139
(Var *) ((RelabelType *) left)->arg;
11371140

1138-
if (v->varattno == ctx->prel->attnum)
1141+
if (v->varoattno == ctx->prel->attnum)
11391142
{
11401143
*var_ptr = left;
11411144
*param_ptr = right;
11421145
return true;
11431146
}
11441147
}
1145-
1148+
11461149
/* ... variable is on the right side */
11471150
if (IsA(right, Var) || IsA(right, RelabelType))
11481151
{
11491152
v = !IsA(right, RelabelType) ?
11501153
(Var *) right :
11511154
(Var *) ((RelabelType *) right)->arg;
11521155

1153-
if (v->varattno == ctx->prel->attnum)
1156+
if (v->varoattno == ctx->prel->attnum)
11541157
{
11551158
*var_ptr = right;
11561159
*param_ptr = left;
@@ -1245,7 +1248,7 @@ handle_arrexpr(const ScalarArrayOpExpr *expr, WalkerContext *context)
12451248
var = !IsA(varnode, RelabelType) ?
12461249
(Var *) varnode :
12471250
(Var *) ((RelabelType *) varnode)->arg;
1248-
if (var->varattno != prel->attnum)
1251+
if (var->varoattno != prel->attnum)
12491252
goto handle_arrexpr_return;
12501253
}
12511254
else

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy