From: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
---|---|
To: | pgsql-committers(at)lists(dot)postgresql(dot)org |
Subject: | pgsql: Fix handling of bare boolean expressions in mcv_get_match_bitmap |
Date: | 2022-08-05 19:00:18 |
Message-ID: | E1oK2YU-000T1F-5l@gemulon.postgresql.org |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-committers |
Fix handling of bare boolean expressions in mcv_get_match_bitmap.
Since v14, the extended stats machinery will try to estimate for
otherwise-unsupported boolean expressions if they match an expression
available from an extended stats object. mcv.c did not get the memo
about this, and would spit up with "unknown clause type". Fortunately
the case is easy to handle, since we can expect the expression yields
boolean.
While here, replace some not-terribly-on-point assertions with
simpler runtime tests for lookup failure. That seems appropriate
so that we get an elog not a crash if we somehow get to the new
it-should-be-a-bool-expression code with a subexpression that
doesn't match any stats column.
Per report from Danny Shemesh. Thanks to Justin Pryzby for
preliminary investigation.
Discussion: https://postgr.es/m/CAFZC=QqD6=27wQPOW1pbRa98KPyuyn+7cL_Ay_Ck-roZV84vHg@mail.gmail.com
Branch
------
REL_15_STABLE
Details
-------
https://git.postgresql.org/pg/commitdiff/43f76fb1944ea5219856819535e2386362ccad49
Modified Files
--------------
src/backend/statistics/mcv.c | 51 ++++++++++++++++++++++-----------
src/test/regress/expected/stats_ext.out | 19 ++++++++----
src/test/regress/sql/stats_ext.sql | 17 +++++++----
3 files changed, 60 insertions(+), 27 deletions(-)
From | Date | Subject | |
---|---|---|---|
Next Message | Tom Lane | 2022-08-05 19:57:59 | pgsql: Partially undo commit 94da73281. |
Previous Message | Tom Lane | 2022-08-05 17:59:07 | pgsql: Fix non-bulletproof ScalarArrayOpExpr code for extended statisti |