rename table mysql.table_stats to mysql.table_stats_save; flush tables; set use_stat_tables= PREFERABLY; create table t1 (a int) engine=InnoDB; start transaction; insert t1 values (1); insert t1 values (2); commit; select * from t1; a 1 2 drop table t1; rename table mysql.table_stats_save to mysql.table_stats; flush tables; # # MDEV-32667 dict_stats_save_index_stat() reads uninitialized # index->stats_error_printed # call mtr.add_suppression("InnoDB: Cannot save index statistics for table"); CREATE TABLE t1(a INT) ENGINE=InnoDB STATS_PERSISTENT=1 STATS_AUTO_RECALC=1; BEGIN; SELECT COUNT(*)>=0 FROM mysql.innodb_index_stats LOCK IN SHARE MODE; COUNT(*)>=0 1 INSERT INTO t1 VALUES(0),(0); SELECT sleep(1); sleep(1) 0 COMMIT; DROP TABLE t1;