aboutsummaryrefslogtreecommitdiff
path: root/src/tutorial/funcs.source
diff options
context:
space:
mode:
authorTomas Vondra <tomas.vondra@postgresql.org>2019-07-15 02:00:31 +0200
committerTomas Vondra <tomas.vondra@postgresql.org>2019-07-18 11:30:12 +0200
commit1c2acc32dc6cb15c6ea038a954af9a4db8d01f08 (patch)
treeafbf95aa9e9336399321ab77802c3b2d713bf426 /src/tutorial/funcs.source
parent42276976a1437c88fb6176fc1a876fd79a139eb0 (diff)
downloadpostgresql-1c2acc32dc6cb15c6ea038a954af9a4db8d01f08.tar.gz
postgresql-1c2acc32dc6cb15c6ea038a954af9a4db8d01f08.zip
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
Diffstat (limited to 'src/tutorial/funcs.source')
0 files changed, 0 insertions, 0 deletions