From: Teodor Sigaev Date: Mon, 15 Jul 2024 18:27:58 +0000 (+0300) Subject: Fix tests, thanks to Ekaterina Sokolova. X-Git-Url: http://sigaev.ru/git/gitweb.cgi?a=commitdiff_plain;h=f4afd3fec80da9af1789e34cdd9f81c66ec1765a;p=online_analyze.git Fix tests, thanks to Ekaterina Sokolova. --- 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;