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

Commit175b0c8

Browse files
committed
pathman: check that variable is the partitioning key (bugfix)
1 parent7345c79 commit175b0c8

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

‎contrib/pg_pathman/pg_pathman.c

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1340,11 +1340,9 @@ handle_arrexpr(const ScalarArrayOpExpr *expr, const PartRelationInfo *prel)
13401340
result->orig= (constNode*)expr;
13411341
result->args=NIL;
13421342

1343-
if (varnode==NULL|| !IsA(varnode,Var))
1344-
{
1345-
result->rangeset=list_make1_irange(make_irange(0,prel->children_count-1, true));
1346-
returnresult;
1347-
}
1343+
/* If variable is not the partition key then skip it */
1344+
if (!varnode|| !IsA(varnode,Var)|| ((Var*)varnode)->varattno!=prel->attnum)
1345+
gotohandle_arrexpr_return;
13481346

13491347
if (arraynode&&IsA(arraynode,Const)&&
13501348
!((Const*)arraynode)->constisnull)
@@ -1384,6 +1382,7 @@ handle_arrexpr(const ScalarArrayOpExpr *expr, const PartRelationInfo *prel)
13841382
returnresult;
13851383
}
13861384

1385+
handle_arrexpr_return:
13871386
result->rangeset=list_make1_irange(make_irange(0,prel->children_count-1, true));
13881387
returnresult;
13891388
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp