Обсуждение: pgsql: Fix pg_mcv_list deserialization

Поиск
Список
Период
Сортировка

pgsql: Fix pg_mcv_list deserialization

От
Tomas Vondra
Дата:
Fix pg_mcv_list deserialization

The memcpy() was copying type OIDs in the wrong direction, so the
deserialized MCV list always had them as 0. This is mostly harmless
except when printing the data in pg_mcv_list_items(), in which case
it reported

    ERROR:  cache lookup failed for type 0

Also added a simple regression test for pg_mcv_list_items() function,
printing a single-item MCV list.

Reported-By: Dean Rasheed
Discussion: https://postgr.es/m/CAEZATCX6T0iDTTZrqyec4Cd6b4yuL7euu4=rQRXaVBAVrUi1Cg@mail.gmail.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/3824ca30d162611fdaade403d3aec449fecd0924

Modified Files
--------------
src/backend/statistics/mcv.c            |  2 +-
src/test/regress/expected/stats_ext.out | 11 +++++++++++
src/test/regress/sql/stats_ext.sql      |  8 ++++++++
3 files changed, 20 insertions(+), 1 deletion(-)