From 5baa257c9149329a4e88cd337b1b4531c58d1147 Mon Sep 17 00:00:00 2001 From: Jason Petersen Date: Fri, 22 Mar 2019 20:14:20 -0600 Subject: [PATCH] Add second assert to guard against future changes This isn't entirely necessary but I feel safer with it here. --- src/backend/distributed/planner/shard_pruning.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/backend/distributed/planner/shard_pruning.c b/src/backend/distributed/planner/shard_pruning.c index 487685ee5..d43ab9a9d 100644 --- a/src/backend/distributed/planner/shard_pruning.c +++ b/src/backend/distributed/planner/shard_pruning.c @@ -806,6 +806,19 @@ AddPartitionKeyRestrictionToInstance(ClauseWalkerContext *context, OpExpr *opCla case ROWCOMPARE_NE: { + /* + * This case should only arise when ALL list elements have this + * "strategy" number set. Skipping to the end of the list might + * protect us if that assumption is violated, and an Assert can + * notify us if it ever is... + */ + + /* should see this value immediately */ + Assert(btreeInterpretationCell == btreeInterpretationList->head); + + /* stop processing early, would only see unsupported nodes anyhow */ + btreeInterpretationCell = btreeInterpretationList->tail; + /* TODO: could add support for this, if we feel like it */ matchedOp = false; break;