postgresql/src/test/regress
David Rowley 30a268ed2e Fix RANGE partition pruning with multiple boolean partition keys
match_clause_to_partition_key incorrectly would return
PARTCLAUSE_UNSUPPORTED if a bool qual could not be matched to the current
partition key.  This was a problem, as it causes the calling function to
discard the qual and not try to match it to any other partition key.  If
there was another partition key which did match this qual, then the qual
would not be checked again and we could fail to prune some partitions.

The worst this could do was to cause partitions not to be pruned when they
could have been, so there was no danger of incorrect query results here.

Fix this by changing match_boolean_partition_clause to have it return a
PartClauseMatchStatus rather than a boolean value.  This allows it to
communicate if the qual is unsupported or if it just does not match this
particular partition key, previously these two cases were treated the
same.  Now, if match_clause_to_partition_key is unable to match the qual
to any other qual type then we can simply return the value from the
match_boolean_partition_clause call so that the calling function properly
treats the qual as either unmatched or unsupported.

Reported-by: Rares Salcudean
Reviewed-by: Amit Langote
Backpatch-through: 11 where partition pruning was introduced
Discussion: https://postgr.es/m/CAHp_FN2xwEznH6oyS0hNTuUUZKp5PvegcVv=Co6nBXJ+mC7Y5w@mail.gmail.com
2019-07-12 19:11:45 +12:00
..
data
expected Fix RANGE partition pruning with multiple boolean partition keys 2019-07-12 19:11:45 +12:00
input Fix handling of COMMENT for domain constraints 2019-06-12 11:30:11 +09:00
output Fix handling of COMMENT for domain constraints 2019-06-12 11:30:11 +09:00
sql Fix RANGE partition pruning with multiple boolean partition keys 2019-07-12 19:11:45 +12:00
.gitignore
GNUmakefile Move logging.h and logging.c from src/fe_utils/ to src/common/. 2019-05-14 14:20:10 -04:00
Makefile Fix non-GNU makefiles for AIX make. 2017-11-30 00:57:22 -08:00
parallel_schedule Move rolenames test out of the core regression tests. 2019-06-30 12:51:12 -04:00
pg_regress_main.c tableam: introduce table AM infrastructure. 2019-03-06 09:54:38 -08:00
pg_regress.c Blind attempt to fix SSPI-auth case in 010_dump_connstr.pl. 2019-06-30 13:34:45 -04:00
pg_regress.h Phase 2 pgindent run for v12. 2019-05-22 13:04:48 -04:00
README
regress.c Initial pgindent run for v12. 2019-05-22 12:55:34 -04:00
regressplans.sh
resultmap Cygwin and Mingw floating-point fixes. 2019-02-16 01:50:16 +00:00
serial_schedule Move rolenames test out of the core regression tests. 2019-06-30 12:51:12 -04:00
standby_schedule

Documentation concerning how to run these regression tests and interpret
the results can be found in the PostgreSQL manual, in the chapter
"Regression Tests".