]> git.ipfire.org Git - thirdparty/postgresql.git/commit
Fix yet another issue with step generation in partition pruning.
authorEtsuro Fujita <efujita@postgresql.org>
Fri, 7 Aug 2020 05:45:04 +0000 (14:45 +0900)
committerEtsuro Fujita <efujita@postgresql.org>
Fri, 7 Aug 2020 05:45:04 +0000 (14:45 +0900)
commit1db9c80f835e436ca3c27bccf43135ebf7e3c62b
treed40fd7d5f63fe91d93331bb93c7f2f534b09c5d5
parent495a9b1fbfe890d5da2aaf52ee06a8fd4f4fe339
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
src/backend/partitioning/partprune.c
src/test/regress/expected/partition_prune.out
src/test/regress/sql/partition_prune.sql