| 1 |
# |
| 2 |
# This test upgrades a 5.7 database to 8.0 and validates that no |
| 3 |
# PRIMARY index entries are seen in mysql.innodb_index_stats |
| 4 |
# if there are no primary keys defined on the table |
| 5 |
# |
| 6 |
# Stop the running server |
| 7 |
############################################################## |
| 8 |
# Copy and unzip the datadir |
| 9 |
############################################################## |
| 10 |
# Restart the server with the unzipped datadir |
| 11 |
# restart: --datadir=DATADIR --innodb_page_size=16k |
| 12 |
# Check the contents of mysql.innodb_index_stats |
| 13 |
SHOW CREATE TABLE t_nopart; |
| 14 |
Table Create Table |
| 15 |
t_nopart CREATE TABLE `t_nopart` ( |
| 16 |
`c1` int DEFAULT NULL, |
| 17 |
`c2` int DEFAULT NULL |
| 18 |
) ENGINE=InnoDB DEFAULT CHARSET=latin1 |
| 19 |
SHOW CREATE TABLE t_no_part_pk; |
| 20 |
Table Create Table |
| 21 |
t_no_part_pk CREATE TABLE `t_no_part_pk` ( |
| 22 |
`c1` int NOT NULL, |
| 23 |
`c2` int DEFAULT NULL, |
| 24 |
PRIMARY KEY (`c1`) |
| 25 |
) ENGINE=InnoDB DEFAULT CHARSET=latin1 |
| 26 |
SHOW CREATE TABLE t_part; |
| 27 |
Table Create Table |
| 28 |
t_part CREATE TABLE `t_part` ( |
| 29 |
`c1` int DEFAULT NULL, |
| 30 |
`c2` int DEFAULT NULL |
| 31 |
) ENGINE=InnoDB DEFAULT CHARSET=latin1 |
| 32 |
/*!50100 PARTITION BY RANGE (`c1`) |
| 33 |
(PARTITION t_part_p1 VALUES LESS THAN (20) ENGINE = InnoDB, |
| 34 |
PARTITION t_part_p2 VALUES LESS THAN (100) ENGINE = InnoDB) */ |
| 35 |
SHOW CREATE TABLE t_part_pk; |
| 36 |
Table Create Table |
| 37 |
t_part_pk CREATE TABLE `t_part_pk` ( |
| 38 |
`c1` int NOT NULL, |
| 39 |
`c2` int DEFAULT NULL, |
| 40 |
PRIMARY KEY (`c1`) |
| 41 |
) ENGINE=InnoDB DEFAULT CHARSET=latin1 |
| 42 |
/*!50100 PARTITION BY RANGE (`c1`) |
| 43 |
(PARTITION t_part_p1 VALUES LESS THAN (20) ENGINE = InnoDB, |
| 44 |
PARTITION t_part_p2 VALUES LESS THAN (100) ENGINE = InnoDB) */ |
| 45 |
SELECT lower(database_name), lower(table_name), |
| 46 |
lower(index_name), lower(stat_name) FROM mysql.innodb_index_stats |
| 47 |
ORDER BY lower(database_name), lower(table_name), |
| 48 |
lower(index_name), lower(stat_name); |
| 49 |
lower(database_name) lower(table_name) lower(index_name) lower(stat_name) |
| 50 |
mysql component primary n_diff_pfx01 |
| 51 |
mysql component primary n_leaf_pages |
| 52 |
mysql component primary size |
| 53 |
sys sys_config primary n_diff_pfx01 |
| 54 |
sys sys_config primary n_leaf_pages |
| 55 |
sys sys_config primary size |
| 56 |
test t_no_part_pk primary n_diff_pfx01 |
| 57 |
test t_no_part_pk primary n_leaf_pages |
| 58 |
test t_no_part_pk primary size |
| 59 |
test t_nopart gen_clust_index n_diff_pfx01 |
| 60 |
test t_nopart gen_clust_index n_leaf_pages |
| 61 |
test t_nopart gen_clust_index size |
| 62 |
test t_part#p#t_part_p1 gen_clust_index n_diff_pfx01 |
| 63 |
test t_part#p#t_part_p1 gen_clust_index n_leaf_pages |
| 64 |
test t_part#p#t_part_p1 gen_clust_index size |
| 65 |
test t_part#p#t_part_p2 gen_clust_index n_diff_pfx01 |
| 66 |
test t_part#p#t_part_p2 gen_clust_index n_leaf_pages |
| 67 |
test t_part#p#t_part_p2 gen_clust_index size |
| 68 |
test t_part_pk#p#t_part_p1 primary n_diff_pfx01 |
| 69 |
test t_part_pk#p#t_part_p1 primary n_leaf_pages |
| 70 |
test t_part_pk#p#t_part_p1 primary size |
| 71 |
test t_part_pk#p#t_part_p2 primary n_diff_pfx01 |
| 72 |
test t_part_pk#p#t_part_p2 primary n_leaf_pages |
| 73 |
test t_part_pk#p#t_part_p2 primary size |
| 74 |
# Cleanup |
| 75 |
# Shutdown server |
| 76 |
# Remove copied files |
| 77 |
# Restart the server |
| 78 |
# restart |