| 1 |
call mtr.add_suppression("InnoDB: Table .*innodb_index_stats.* not found"); |
| 2 |
call mtr.add_suppression("InnoDB: Fetch of persistent statistics requested for table .*"); |
| 3 |
call mtr.add_suppression("InnoDB: Unexpected length of mysql\\.innodb_index_stats\\.stat_description"); |
| 4 |
call mtr.add_suppression("InnoDB: Column stat_description in table mysql\\.innodb_index_stats is VARCHAR"); |
| 5 |
ALTER TABLE mysql.innodb_index_stats RENAME TO mysql.innodb_index_stats_; |
| 6 |
CREATE TABLE test_ps_create_on_corrupted |
| 7 |
(a INT, PRIMARY KEY (a)) |
| 8 |
ENGINE=INNODB STATS_PERSISTENT=1; |
| 9 |
SELECT seq_in_index, column_name, cardinality |
| 10 |
FROM information_schema.statistics WHERE table_name = 'test_ps_create_on_corrupted' |
| 11 |
ORDER BY index_name, seq_in_index; |
| 12 |
seq_in_index 1 |
| 13 |
column_name a |
| 14 |
cardinality 0 |
| 15 |
SELECT table_rows, avg_row_length, max_data_length, index_length |
| 16 |
FROM information_schema.tables WHERE table_name = 'test_ps_create_on_corrupted'; |
| 17 |
table_rows 0 |
| 18 |
avg_row_length 0 |
| 19 |
max_data_length 0 |
| 20 |
index_length 0 |
| 21 |
ALTER TABLE mysql.innodb_index_stats_ RENAME TO mysql.innodb_index_stats; |
| 22 |
SET old_mode=''; |
| 23 |
ALTER TABLE mysql.innodb_index_stats |
| 24 |
MODIFY stat_description VARCHAR(1024) COLLATE utf8_bin; |
| 25 |
CREATE TABLE t (a INT) ENGINE=InnoDB STATS_PERSISTENT=1; |
| 26 |
ALTER TABLE mysql.innodb_index_stats |
| 27 |
MODIFY stat_description VARCHAR(1024) COLLATE utf8mb3_bin NOT NULL; |
| 28 |
DROP TABLE t; |
| 29 |
# restart |
| 30 |
SELECT seq_in_index, column_name, cardinality |
| 31 |
FROM information_schema.statistics WHERE table_name = 'test_ps_create_on_corrupted' |
| 32 |
ORDER BY index_name, seq_in_index; |
| 33 |
seq_in_index 1 |
| 34 |
column_name a |
| 35 |
cardinality 0 |
| 36 |
SELECT table_rows, avg_row_length, max_data_length, index_length |
| 37 |
FROM information_schema.tables WHERE table_name = 'test_ps_create_on_corrupted'; |
| 38 |
table_rows 0 |
| 39 |
avg_row_length 0 |
| 40 |
max_data_length 0 |
| 41 |
index_length 0 |
| 42 |
DROP TABLE test_ps_create_on_corrupted; |