From f4afd3fec80da9af1789e34cdd9f81c66ec1765a Mon Sep 17 00:00:00 2001 From: Teodor Sigaev Date: Mon, 15 Jul 2024 21:27:58 +0300 Subject: [PATCH] Fix tests, thanks to Ekaterina Sokolova. --- expected/online_analyze.out | 24 ++++++++++++++++-------- sql/online_analyze.sql | 8 +++++--- 2 files changed, 21 insertions(+), 11 deletions(-) diff --git a/expected/online_analyze.out b/expected/online_analyze.out index a47858f..a75e90b 100644 --- a/expected/online_analyze.out +++ b/expected/online_analyze.out @@ -53,20 +53,28 @@ CREATE TABLE copy_tbl( foo int, bar text ); -INSERT INTO insert_tbl VALUES (1,'a'); +INSERT INTO insert_tbl VALUES (1,'a'), (2, 'b'); COPY copy_tbl (foo, bar) FROM stdin; SELECT * FROM copy_tbl; foo | bar -----+----- 1 | a -(1 row) + 2 | b +(2 rows) + +-- Both must be completed +SELECT stavalues1 FROM pg_statistic WHERE starelid = 'insert_tbl'::regclass; + stavalues1 +------------ + {1,2} + {a,b} +(2 rows) --- Both must be true -SELECT last_analyze IS NOT NULL AS analyzed, relname FROM pg_stat_user_tables ORDER BY relname; - analyzed | relname -----------+------------ - t | copy_tbl - t | insert_tbl +SELECT stavalues1 FROM pg_statistic WHERE starelid = 'copy_tbl'::regclass; + stavalues1 +------------ + {1,2} + {a,b} (2 rows) SET online_analyze.enable = off; diff --git a/sql/online_analyze.sql b/sql/online_analyze.sql index 0ef8f86..c3028e5 100644 --- a/sql/online_analyze.sql +++ b/sql/online_analyze.sql @@ -28,12 +28,14 @@ CREATE TABLE copy_tbl( foo int, bar text ); -INSERT INTO insert_tbl VALUES (1,'a'); +INSERT INTO insert_tbl VALUES (1,'a'), (2, 'b'); COPY copy_tbl (foo, bar) FROM stdin; 1 a +2 b \. SELECT * FROM copy_tbl; --- Both must be true -SELECT last_analyze IS NOT NULL AS analyzed, relname FROM pg_stat_user_tables ORDER BY relname; +-- Both must be completed +SELECT stavalues1 FROM pg_statistic WHERE starelid = 'insert_tbl'::regclass; +SELECT stavalues1 FROM pg_statistic WHERE starelid = 'copy_tbl'::regclass; SET online_analyze.enable = off; -- 2.46.1