1call mtr.add_suppression("InnoDB: Table `mysql`.`innodb_index_stats` not found");
2call mtr.add_suppression("InnoDB: Fetch of persistent statistics requested for table.*");
3CREATE TABLE test_ps_fetch_corrupted
4(a INT, PRIMARY KEY (a))
5ENGINE=INNODB STATS_PERSISTENT=1;
6ANALYZE TABLE test_ps_fetch_corrupted;
7Table	test.test_ps_fetch_corrupted
8Op	analyze
9Msg_type	status
10Msg_text	Engine-independent statistics collected
11Table	test.test_ps_fetch_corrupted
12Op	analyze
13Msg_type	status
14Msg_text	OK
15SELECT n_rows, clustered_index_size, sum_of_other_index_sizes
16FROM mysql.innodb_table_stats WHERE table_name = 'test_ps_fetch_corrupted';
17n_rows	0
18clustered_index_size	1
19sum_of_other_index_sizes	0
20ALTER TABLE mysql.innodb_index_stats RENAME TO mysql.innodb_index_stats_;
21FLUSH TABLE test_ps_fetch_corrupted;
22SELECT seq_in_index, column_name, cardinality
23FROM information_schema.statistics WHERE table_name = 'test_ps_fetch_corrupted'
24ORDER BY index_name, seq_in_index;
25seq_in_index	1
26column_name	a
27cardinality	0
28SELECT table_rows, avg_row_length, max_data_length, index_length
29FROM information_schema.tables WHERE table_name = 'test_ps_fetch_corrupted';
30table_rows	0
31avg_row_length	0
32max_data_length	0
33index_length	0
34ALTER TABLE mysql.innodb_index_stats_ RENAME TO mysql.innodb_index_stats;
35DROP TABLE test_ps_fetch_corrupted;
36# restart
37