diff options
| author | Tomas Vondra | 2019-04-15 22:01:39 +0000 |
|---|---|---|
| committer | Tomas Vondra | 2019-04-15 22:01:39 +0000 |
| commit | 3824ca30d162611fdaade403d3aec449fecd0924 (patch) | |
| tree | e0d283b730858a43c31ccce486b20cd1d916b0ac /src/test/regress/expected/stats_ext.out | |
| parent | 4b40e44f07c727c7a82b291d3b60098dd99f3f64 (diff) | |
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
Diffstat (limited to 'src/test/regress/expected/stats_ext.out')
| -rw-r--r-- | src/test/regress/expected/stats_ext.out | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/test/regress/expected/stats_ext.out b/src/test/regress/expected/stats_ext.out index b32663459d6..add968abec2 100644 --- a/src/test/regress/expected/stats_ext.out +++ b/src/test/regress/expected/stats_ext.out @@ -717,6 +717,17 @@ SELECT * FROM check_estimated_rows('SELECT * FROM mcv_lists WHERE a IS NULL AND 50 | 50 (1 row) +-- test pg_mcv_list_items with a very simple (single item) MCV list +TRUNCATE mcv_lists; +INSERT INTO mcv_lists (a, b, c) SELECT 1, 2, 3 FROM generate_series(1,1000) s(i); +ANALYZE mcv_lists; +SELECT m.* FROM pg_statistic_ext, + pg_mcv_list_items(stxmcv) m WHERE stxname = 'mcv_lists_stats'; + index | values | nulls | frequency | base_frequency +-------+-----------+---------+-----------+---------------- + 0 | {1, 2, 3} | {f,f,f} | 1 | 1 +(1 row) + RESET random_page_cost; -- mcv with arrays CREATE TABLE mcv_lists_arrays ( |
