aboutsummaryrefslogtreecommitdiff
path: root/src/backend/parser/parse_utilcmd.c
diff options
context:
space:
mode:
authorDavid Rowley <drowley@postgresql.org>2024-02-20 12:49:37 +1300
committerDavid Rowley <drowley@postgresql.org>2024-02-20 12:49:37 +1300
commit4c2369ac5d0a108df4d65a2886657efa010d67ca (patch)
tree3597729d9e868a50834196e36c3aa9c196372ed7 /src/backend/parser/parse_utilcmd.c
parent0e162810df7657bac24ba4657460a87104523fc6 (diff)
downloadpostgresql-4c2369ac5d0a108df4d65a2886657efa010d67ca.tar.gz
postgresql-4c2369ac5d0a108df4d65a2886657efa010d67ca.zip
Fix incorrect pruning of NULL partition for boolean IS NOT clauses
Partition pruning wrongly assumed that, for a table partitioned on a boolean column, a clause in the form "boolcol IS NOT false" and "boolcol IS NOT true" could be inverted to correspondingly become "boolcol IS true" and "boolcol IS false". These are not equivalent as the NOT version matches the opposite boolean value *and* NULLs. This incorrect assumption meant that partition pruning pruned away partitions that could contain NULL values. Here we fix this by correctly not pruning partitions which could store NULLs. To be affected by this, the table must be partitioned by a NULLable boolean column and queries would have to contain "boolcol IS NOT false" or "boolcol IS NOT true". This could result in queries filtering out NULL values with a LIST partitioned table and "ERROR: invalid strategy number 0" for RANGE and HASH partitioned tables. Reported-by: Alexander Lakhin Bug: #18344 Discussion: https://postgr.es/m/18344-8d3f00bada6d09c6@postgresql.org Backpatch-through: 12
Diffstat (limited to 'src/backend/parser/parse_utilcmd.c')
0 files changed, 0 insertions, 0 deletions