fixup! !!!!! DO NOT MERGE THIS COMMIT

testtalhapg14
Sait Talha Nisanci 2021-08-27 14:35:41 +03:00
parent 059090fdc0
commit 0d6168fc4c
2 changed files with 10 additions and 1 deletions

View File

@ -657,6 +657,8 @@ ShardsMatchingDeleteCriteria(Oid relationId, List *shardIntervalList,
Assert(deleteCriteria != NULL);
List *deleteCriteriaList = list_make1(deleteCriteria);
/* walk over shard list and check if shards can be dropped */
ShardInterval *shardInterval = NULL;
foreach_ptr(shardInterval, shardIntervalList)
@ -672,6 +674,13 @@ ShardsMatchingDeleteCriteria(Oid relationId, List *shardIntervalList,
Expr *lessThanExpr = (Expr *) linitial(andExpr->args);
Expr *greaterThanExpr = (Expr *) lsecond(andExpr->args);
/*
* 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,

View File

@ -747,7 +747,7 @@ RouterModifyTaskForShardInterval(Query *originalQuery,
continue;
}
shardRestrictionList = make_simple_restrictinfo_compat(NULL,
shardRestrictionList = make_simple_restrictinfo_compat(restriction->plannerInfo,
(Expr *) shardOpExpressions);
extendedBaseRestrictInfo = lappend(extendedBaseRestrictInfo,
shardRestrictionList);