]> granicus.if.org Git - postgresql/commit
Change bms_add_range to be a no-op for empty ranges
authorAlvaro Herrera <alvherre@alvh.no-ip.org>
Mon, 30 Jul 2018 21:18:42 +0000 (17:18 -0400)
committerAlvaro Herrera <alvherre@alvh.no-ip.org>
Mon, 30 Jul 2018 22:44:33 +0000 (18:44 -0400)
commit1b68010518c9d2ede24e6c721a9c0dc82c358fb1
tree7b3bb44508f4b9aa7bfaccdec19adda31df7a9ae
parent7dc5a96aa21816ef1223be9c23e10a88db857d8f
Change bms_add_range to be a no-op for empty ranges

In commit 84940644de93, bms_add_range was added with an API to fail with
an error if an empty range was specified.  This seems arbitrary and
unhelpful, so turn that case into a no-op instead.  Callers that require
further verification on the arguments or result can apply them by
themselves.

This fixes the bug that partition pruning throws an API error for a case
involving the default partition of a default partition, as in the
included test case.

Reported-by: Rajkumar Raghuwanshi <rajkumar.raghuwanshi@enterprisedb.com>
Diagnosed-by: Tom Lane <tgl@sss.pgh.pa.us>
Discussion: https://postgr.es/m/16590.1532622503@sss.pgh.pa.us
src/backend/nodes/bitmapset.c
src/test/regress/expected/partition_prune.out
src/test/regress/sql/partition_prune.sql