aboutsummaryrefslogtreecommitdiff
path: root/src/backend/utils/adt/ruleutils.c
diff options
context:
space:
mode:
authorDavid Rowley <drowley@postgresql.org>2023-10-13 01:12:31 +1300
committerDavid Rowley <drowley@postgresql.org>2023-10-13 01:12:31 +1300
commitd9e46dfb78abf4d3be6071b8c4495df9e1bb4706 (patch)
tree01fad33c58a41445c75b9c9e5bfb8b7afafc0ab6 /src/backend/utils/adt/ruleutils.c
parentdab5538f0bfc4cca76396f5d510e2df6f5350d4c (diff)
downloadpostgresql-d9e46dfb78abf4d3be6071b8c4495df9e1bb4706.tar.gz
postgresql-d9e46dfb78abf4d3be6071b8c4495df9e1bb4706.zip
Fix runtime partition pruning for HASH partitioned tables
This could only affect HASH partitioned tables with at least 2 partition key columns. If partition pruning was delayed until execution and the query contained an IS NULL qual on one of the partitioned keys, and some subsequent partitioned key was being compared to a non-Const, then this could result in a crash due to the incorrect keyno being used to calculate the stateidx for the expression evaluation code. Here we fix this by properly skipping partitioned keys which have a nullkey set. Effectively, this must be the same as what's going on inside perform_pruning_base_step(). Sergei Glukhov also provided a patch, but that's not what's being used here. Reported-by: Sergei Glukhov Reviewed-by: tender wang, Sergei Glukhov Discussion: https://postgr.es/m/d05b26fa-af54-27e1-f693-6c31590802fa@postgrespro.ru Backpatch-through: 11, where runtime partition pruning was added.
Diffstat (limited to 'src/backend/utils/adt/ruleutils.c')
0 files changed, 0 insertions, 0 deletions