diff options
Diffstat (limited to 'src/backend/statistics/mcv.c')
-rw-r--r-- | src/backend/statistics/mcv.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/backend/statistics/mcv.c b/src/backend/statistics/mcv.c index 2a00fb48483..9ab3e81a91d 100644 --- a/src/backend/statistics/mcv.c +++ b/src/backend/statistics/mcv.c @@ -1575,6 +1575,8 @@ mcv_match_expression(Node *expr, Bitmapset *keys, List *exprs, Oid *collid) (idx <= bms_num_members(keys) + list_length(exprs))); } + Assert((idx >= 0) && (idx < bms_num_members(keys) + list_length(exprs))); + return idx; } @@ -1654,6 +1656,8 @@ mcv_get_match_bitmap(PlannerInfo *root, List *clauses, /* match the attribute/expression to a dimension of the statistic */ idx = mcv_match_expression(clause_expr, keys, exprs, &collid); + Assert((idx >= 0) && (idx < bms_num_members(keys) + list_length(exprs))); + /* * Walk through the MCV items and evaluate the current clause. We * can skip items that were already ruled out, and terminate if |