Skip to content

Commit 49193a2

Browse files
committed
add test
1 parent 9c04de8 commit 49193a2

File tree

1 file changed

+39
-0
lines changed

1 file changed

+39
-0
lines changed

tests/sqllogictests/suites/base/09_fuse_engine/09_0020_analyze.test

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -263,5 +263,44 @@ select count() from fuse_snapshot('db_09_0020', 't3');
263263
statement ok
264264
DROP TABLE t3;
265265

266+
statement ok
267+
create table t4(a int, b string) enable_auto_analyze = 0;
268+
269+
statement ok
270+
insert into t4 values(1, 'a'), (2, 'b');
271+
272+
statement ok
273+
insert into t4 values(3, 'a'), (2, 'c');
274+
275+
statement ok
276+
update t4 set a = 4 where b = 'c';
277+
278+
query T
279+
show statistics from table db_09_0020.t4;
280+
----
281+
db_09_0020 t4 a 5 4 4 0 4 (empty)
282+
db_09_0020 t4 b 5 4 3 0 13 (empty)
283+
284+
statement ok
285+
alter table t4 set options(enable_auto_analyze = 1);
286+
287+
query T
288+
show statistics from table db_09_0020.t4;
289+
----
290+
db_09_0020 t4 a 4 4 4 0 4 (empty)
291+
db_09_0020 t4 b 4 4 3 0 13 (empty)
292+
293+
statement ok
294+
delete from t4 where a = 4;
295+
296+
query T
297+
show statistics from table db_09_0020.t4;
298+
----
299+
db_09_0020 t4 a 3 3 3 0 4 (empty)
300+
db_09_0020 t4 b 3 3 2 0 13 (empty)
301+
302+
statement ok
303+
DROP TABLE t4 all;
304+
266305
statement ok
267306
DROP DATABASE db_09_0020

0 commit comments

Comments
 (0)