1--source include/have_innodb.inc
2--source include/have_sequence.inc
3--source include/have_stat_tables.inc
4--source include/have_debug_sync.inc
5--source include/not_embedded.inc
6
7--echo #
8--echo # MDEV-7901: re-implement analyze table for low impact
9--echo #
10
11create table t1 (a int, b int, c int, key IDX1(a), key IDX2(a,b)) engine=innodb;
12insert into t1 select seq/10, seq/2, seq from seq_0_to_9;
13
14
15SET DEBUG_SYNC='statistics_collection_start1 SIGNAL analyzing WAIT_FOR written';
16
17send analyze table t1 persistent for all;
18connect (con1, localhost, root,,);
19--connection con1
20
21SET DEBUG_SYNC= 'now WAIT_FOR analyzing';
22
23select count(*) from t1;
24# insert will work even with MyISAM because it allow to append file
25insert into t1 values (333,333,333);
26# but update now hang for MyISAM bacause can't get lock (InnoDB/XtraDB works)
27update t1 set a=1;
28
29SET DEBUG_SYNC= 'now SIGNAL written';
30
31--connection default
32--reap
33select count(*) from t1;
34
35set debug_sync='RESET';
36drop table t1;
37