Fix handling of clauses incompatible with extended statistics
Tomas Vondra <tomas.vondra@postgresql.org>
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
Files
| Path | Change | +/− |
|---|---|---|
| src/backend/statistics/extended_stats.c | modified | +58 −28 |
| src/backend/statistics/mcv.c | modified | +4 −0 |
| src/test/regress/expected/stats_ext.out | modified | +19 −0 |
| src/test/regress/sql/stats_ext.sql | modified | +19 −0 |
Discussion
Cited messages not in the archive:
CAApHDvpYT10-nkSp8xXe-nbO3jmoaRyRFHbzh-RWMfAJynqgpQ@mail.gmail.com