postgresql/src
Tomas Vondra 1c2acc32dc Fix handling of NULLs in MCV items and constants
There were two issues in how the extended statistics handled NULL values
in opclauses. Firstly, the code was oblivious to the possibility that
Const may be NULL (constisnull=true) in which case the constvalue is
undefined. We need to treat this as a mismatch, and not call the proc.

Secondly, the MCV item itself may contain NULL values too - the code
already did check that, and updated the match bitmap accordingly, but
failed to ensure we won't call the operator procedure anyway. It did
work for AND-clauses, because in that case false in the bitmap stops
evaluation of further clauses. But for OR-clauses ir was not easy to
get incorrect estimates or even trigger a crash.

This fixes both issues by extending the existing check so that it looks
at constisnull too, and making sure it skips calling the procedure.

Discussion: https://postgr.es/m/8736jdhbhc.fsf%40ansel.ydns.eu
2019-07-18 11:30:12 +02:00
..
backend Fix handling of NULLs in MCV items and constants 2019-07-18 11:30:12 +02:00
bin Revive test of concurrent OID generation. 2019-07-13 13:34:38 -07:00
common In pg_log_generic(), be more paranoid about preserving errno. 2019-07-06 11:25:48 -04:00
fe_utils Update stale comments, and fix comment typos. 2019-06-08 10:12:26 -07:00
include Fix handling of opclauses in extended statistics 2019-07-18 11:30:12 +02:00
interfaces Fix small memory leak in ecpglib ecpg_update_declare_statement() is called the 2019-07-08 08:30:31 +02:00
makefiles Define WIN32_STACK_RLIMIT throughout win32 and cygwin builds. 2019-04-09 08:25:39 -07:00
pl Ensure plpgsql result tuples have the right composite type marking. 2019-07-03 18:08:53 -04:00
port Fix more typos and inconsistencies in the tree 2019-06-17 16:13:16 +09:00
template Yet further rethinking of build changes for macOS Mojave. 2018-11-02 18:54:00 -04:00
test Fix handling of NULLs in MCV items and constants 2019-07-18 11:30:12 +02:00
timezone Update time zone data files to tzdata release 2019b. 2019-07-17 19:15:35 -04:00
tools Add support for Visual Studio 2019 in build scripts 2019-07-03 08:57:22 +09:00
tutorial Phase 2 pgindent run for v12. 2019-05-22 13:04:48 -04:00
.gitignore
DEVELOPERS Replace a couple of references to files that no longer exist in the source 2009-05-04 08:08:47 +00:00
Makefile Fix partial-build problems introduced by having more generated headers. 2018-04-09 16:42:10 -04:00
Makefile.global.in Consistently test for in-use shared memory. 2019-04-12 22:36:38 -07:00
Makefile.shlib Ensure static libraries have correct mod time even if ranlib messes it up. 2018-11-29 15:53:44 -05:00
nls-global.mk Move logging.h and logging.c from src/fe_utils/ to src/common/. 2019-05-14 14:20:10 -04:00