pgsql: Fix yet another issue with step generation in partition pruning.

From: Etsuro Fujita <efujita(at)postgresql(dot)org>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Fix yet another issue with step generation in partition pruning.
Date: 2020-08-07 05:49:07
Message-ID: E1k3vFb-0007Jj-65@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Fix yet another issue with step generation in partition pruning.

Commit 13838740f fixed some issues with step generation in partition
pruning, but there was yet another one: get_steps_using_prefix() assumes
that clauses in the passed-in prefix list are sorted in ascending order
of their partition key numbers, but the caller failed to ensure this for
range partitioning, which led to an assertion failure in debug builds.
Adjust the caller function to arrange the clauses in the prefix list in
the required order for range partitioning.

Back-patch to v11, like the previous commit.

Patch by me, reviewed by Amit Langote.

Discussion: https://postgr.es/m/CAPmGK16jkXiFG0YqMbU66wte-oJTfW6D1HaNvQf%3D%2B5o9%3Dm55wQ%40mail.gmail.com

Branch
------
REL_12_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/4f26932296057721d7668ec13cfd6af2bb8410ec

Modified Files
--------------
src/backend/partitioning/partprune.c | 138 +++++++++++++++-----------
src/test/regress/expected/partition_prune.out | 10 ++
src/test/regress/sql/partition_prune.sql | 5 +
3 files changed, 96 insertions(+), 57 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Peter Geoghegan 2020-08-07 16:53:55 pgsql: Rename nbtree split REDO routine variables.
Previous Message Peter Geoghegan 2020-08-06 23:25:36 pgsql: Remove obsolete amcheck comment.