From: Tomas Vondra <tomas.vondra@postgresql.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Fix handling of clauses incompatible with extended statistics
Date: Tue, 06 Apr 2021 14:56:46 +0000
Message-ID: <E1lTn8I-0007GC-IR@gemulon.postgresql.org> (raw)
Fix handling of clauses incompatible with extended statistics
Handling of incompatible clauses while applying extended statistics was
a bit confused - while handling a mix of compatible and incompatible
clauses it sometimes incorrectly treated the incompatible clauses as
compatible, resulting in a crash.
Fixed by reworking the code applying the selected statistics object to
make it easier to understand, and adding a proper compatibility check.
Reported-by: David Rowley
Discussion: https://postgr.es/m/CAApHDvpYT10-nkSp8xXe-nbO3jmoaRyRFHbzh-RWMfAJynqgpQ%40mail.gmail.com
Branch
------
master
Details
-------
https://git.postgresql.org/pg/commitdiff/518442c7f334f3b05ea28b7ef50f1b551cfcc23e
Modified Files
--------------
src/backend/statistics/extended_stats.c | 86 ++++++++++++++++++++++-----------
src/backend/statistics/mcv.c | 4 ++
src/test/regress/expected/stats_ext.out | 19 ++++++++
src/test/regress/sql/stats_ext.sql | 19 ++++++++
4 files changed, 100 insertions(+), 28 deletions(-)
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-committers@postgresql.org
Cc: tomas.vondra@postgresql.org
Subject: Re: pgsql: Fix handling of clauses incompatible with extended statistics
In-Reply-To: <E1lTn8I-0007GC-IR@gemulon.postgresql.org>
References: <E1lTn8I-0007GC-IR@gemulon.postgresql.org>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox