postgresql/src
Alvaro Herrera d758d9702e Fix assorted partition pruning bugs
match_clause_to_partition_key failed to consider COERCION_PATH_ARRAYCOERCE
cases in scalar-op-array expressions, so it was possible to crash the
server easily.  To handle this case properly (ie. prune partitions) we
would need to run a bit of executor code during planning.  Maybe it can
be improved, but for now let's just not crash.  Add a test case that
used to trigger the crash.
Author: Michaël Paquier

match_clause_to_partition_key failed to indicate that operators that
don't have a commutator in a btree opclass are unsupported.  It is
possible for this to cause a crash later if such an operator is used in
a scalar-op-array expression.  Add a test case that used to the crash.
Author: Amit Langote

One caller of gen_partprune_steps_internal in
match_clause_to_partition_key was too optimistic about the former never
returning an empty step list.  Rid it of its innocence.  (Having fixed
the bug above, I no longer know how to exploit this, so no test case for
it, but it remained a bug.)  Revise code flow a little bit, for
succintness.
Author: Álvaro Herrera

Reported-by: Marina Polyakova
Reviewed-by: Michaël Paquier
Reviewed-by: Amit Langote
Reviewed-by: Álvaro Herrera
Discussion: https://postgr.es/m/ff8f9bfa485ff961d6bb43e54120485b@postgrespro.ru
2018-05-09 11:27:04 -03:00
..
backend Fix assorted partition pruning bugs 2018-05-09 11:27:04 -03:00
bin Restrict vertical tightness to parentheses in Perl code 2018-05-09 10:14:46 -04:00
common Enlarge find_other_exec's meager fgets buffer 2018-04-19 10:45:15 -03:00
fe_utils Post-feature-freeze pgindent run. 2018-04-26 14:47:16 -04:00
include Make gen_partprune_steps static 2018-05-09 10:40:25 -03:00
interfaces Further -Wimplicit-fallthrough cleanup. 2018-05-01 19:53:48 -07:00
makefiles Remove Windows module-list-dumping code. 2018-04-30 13:20:13 -04:00
pl Clean up some perlcritic warnings 2018-05-07 15:35:32 -04:00
port Further improve code for probing the availability of ARM CRC instructions. 2018-05-03 11:32:57 -04:00
template Force "restrict" not to be used when compiling with xlc. 2017-10-13 12:15:06 -07:00
test Fix assorted partition pruning bugs 2018-05-09 11:27:04 -03:00
timezone Sync our copy of the timezone library with IANA release tzcode2018e. 2018-05-04 12:26:25 -04:00
tools Restrict vertical tightness to parentheses in Perl code 2018-05-09 10:14:46 -04:00
tutorial Update copyright for 2018 2018-01-02 23:30:12 -05:00
.gitignore Convert cvsignore to gitignore, and add .gitignore for build targets. 2010-09-22 12:57:04 +02:00
DEVELOPERS
Makefile Fix partial-build problems introduced by having more generated headers. 2018-04-09 16:42:10 -04:00
Makefile.global.in Un-break contrib install with llvm. 2018-04-28 14:45:39 -04:00
Makefile.shlib Prevent accidental linking of system-supplied copies of libpq.so etc. 2018-04-03 16:26:05 -04:00
nls-global.mk nls-global.mk: search build dir for source files, too 2016-06-07 18:55:18 -04:00