Skip to content

Commit e6b0997

Browse files
committed
replace nparts assert with elogs in PartitionFilter
1 parent 1b2bb7c commit e6b0997

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/partition_filter.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,11 @@ partition_filter_exec(CustomScanState *node)
156156

157157
ranges = walk_expr_tree((Expr *) &state->temp_const, &wcxt)->rangeset;
158158
parts = get_partition_oids(ranges, &nparts, state->prel);
159-
Assert(nparts == 1); /* there has to be only 1 partition */
159+
160+
if (nparts > 1)
161+
elog(ERROR, "PartitionFilter selected more than one partition");
162+
else if (nparts == 0)
163+
elog(ERROR, "PartitionFilter could not select suitable partition");
160164

161165
estate->es_result_relation_info = getResultRelInfo(parts[0], state);
162166

@@ -192,7 +196,6 @@ void
192196
partition_filter_rescan(CustomScanState *node)
193197
{
194198
Assert(list_length(node->custom_ps) == 1);
195-
196199
ExecReScan((PlanState *) linitial(node->custom_ps));
197200
}
198201

0 commit comments

Comments
 (0)