mirror of https://github.com/citusdata/citus.git
Pass NULL for plannerInfo as we don't generate PlaceHolderVars
parent
86d9260781
commit
b01e7e884c
|
@ -688,6 +688,8 @@ ShardsMatchingDeleteCriteria(Oid relationId, List *shardIntervalList,
|
||||||
Assert(deleteCriteria != NULL);
|
Assert(deleteCriteria != NULL);
|
||||||
List *deleteCriteriaList = list_make1(deleteCriteria);
|
List *deleteCriteriaList = list_make1(deleteCriteria);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/* walk over shard list and check if shards can be dropped */
|
/* walk over shard list and check if shards can be dropped */
|
||||||
ShardInterval *shardInterval = NULL;
|
ShardInterval *shardInterval = NULL;
|
||||||
foreach_ptr(shardInterval, shardIntervalList)
|
foreach_ptr(shardInterval, shardIntervalList)
|
||||||
|
@ -703,8 +705,16 @@ ShardsMatchingDeleteCriteria(Oid relationId, List *shardIntervalList,
|
||||||
Expr *lessThanExpr = (Expr *) linitial(andExpr->args);
|
Expr *lessThanExpr = (Expr *) linitial(andExpr->args);
|
||||||
Expr *greaterThanExpr = (Expr *) lsecond(andExpr->args);
|
Expr *greaterThanExpr = (Expr *) lsecond(andExpr->args);
|
||||||
|
|
||||||
RestrictInfo *lessThanRestrictInfo = make_simple_restrictinfo(lessThanExpr);
|
/*
|
||||||
RestrictInfo *greaterThanRestrictInfo = make_simple_restrictinfo(
|
* passing NULL for plannerInfo will be problematic if we have placeholder
|
||||||
|
* vars. However, it won't be the case here because we are building
|
||||||
|
* the expression from shard intervals which don't have placeholder vars.
|
||||||
|
* Note that this is only the case with PG14 as the parameter doesn't exist
|
||||||
|
* prior to that.
|
||||||
|
*/
|
||||||
|
RestrictInfo *lessThanRestrictInfo = make_simple_restrictinfo_compat(NULL,
|
||||||
|
lessThanExpr);
|
||||||
|
RestrictInfo *greaterThanRestrictInfo = make_simple_restrictinfo_compat(NULL,
|
||||||
greaterThanExpr);
|
greaterThanExpr);
|
||||||
|
|
||||||
restrictInfoList = lappend(restrictInfoList, lessThanRestrictInfo);
|
restrictInfoList = lappend(restrictInfoList, lessThanRestrictInfo);
|
||||||
|
|
|
@ -747,7 +747,16 @@ RouterModifyTaskForShardInterval(Query *originalQuery,
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
shardRestrictionList = make_simple_restrictinfo((Expr *) shardOpExpressions);
|
|
||||||
|
/*
|
||||||
|
* passing NULL for plannerInfo will be problematic if we have placeholder
|
||||||
|
* vars. However, it won't be the case here because we are building
|
||||||
|
* the expression from shard intervals which don't have placeholder vars.
|
||||||
|
* Note that this is only the case with PG14 as the parameter doesn't exist
|
||||||
|
* prior to that.
|
||||||
|
*/
|
||||||
|
shardRestrictionList = make_simple_restrictinfo_compat(NULL,
|
||||||
|
(Expr *) shardOpExpressions);
|
||||||
extendedBaseRestrictInfo = lappend(extendedBaseRestrictInfo,
|
extendedBaseRestrictInfo = lappend(extendedBaseRestrictInfo,
|
||||||
shardRestrictionList);
|
shardRestrictionList);
|
||||||
|
|
||||||
|
|
|
@ -2054,7 +2054,7 @@ GetRestrictInfoListForRelation(RangeTblEntry *rangeTblEntry,
|
||||||
* If the restriction involves multiple tables, we cannot add it to
|
* If the restriction involves multiple tables, we cannot add it to
|
||||||
* input relation's expression list.
|
* input relation's expression list.
|
||||||
*/
|
*/
|
||||||
Relids varnos = pull_varnos((Node *) restrictionClause);
|
Relids varnos = pull_varnos_compat(relationRestriction->plannerInfo, (Node *) restrictionClause);
|
||||||
if (bms_num_members(varnos) != 1)
|
if (bms_num_members(varnos) != 1)
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
|
|
Loading…
Reference in New Issue