Debian Codegraph @

mysql-test/suite/innodb/t/upgrade_index_stats.test

raw
1 ##################################################################################
2 # Bug#30330448 upgrade from 5.7 to 8.0.17 causes duplicate entries for partitioned table
3 ##################################################################################
4
5 --source include/have_debug.inc
6 --source include/not_valgrind.inc
7 --source include/have_case_sensitive_file_system.inc
8
9 --echo #
10 --echo # This test upgrades a 5.7 database to 8.0 and validates that no
11 --echo # PRIMARY index entries are seen in mysql.innodb_index_stats
12 --echo # if there are no primary keys defined on the table
13 --echo #
14
15 --echo # Stop the running server
16 --source include/shutdown_mysqld.inc
17
18 --echo ##############################################################
19 --echo # Copy and unzip the datadir
20 --echo ##############################################################
21
22 --copy_file $MYSQLTEST_VARDIR/std_data/data57_index_stats.zip $MYSQL_TMP_DIR/data57_index_stats.zip
23 --file_exists $MYSQL_TMP_DIR/data57_index_stats.zip
24 --exec unzip -qo $MYSQL_TMP_DIR/data57_index_stats.zip -d $MYSQL_TMP_DIR
25 let $DATADIR1 = $MYSQL_TMP_DIR/data57_index_stats;
26
27 --echo # Restart the server with the unzipped datadir
28 --replace_result $DATADIR1 DATADIR
29 --let $wait_counter=3000
30 --let $restart_parameters = restart: --datadir=$DATADIR1 --innodb_page_size=16k
31 --source include/start_mysqld.inc
32
33 --echo # Check the contents of mysql.innodb_index_stats
34 SHOW CREATE TABLE t_nopart;
35 SHOW CREATE TABLE t_no_part_pk;
36 SHOW CREATE TABLE t_part;
37 SHOW CREATE TABLE t_part_pk;
38
39 SELECT lower(database_name), lower(table_name),
40 lower(index_name), lower(stat_name) FROM mysql.innodb_index_stats
41 ORDER BY lower(database_name), lower(table_name),
42 lower(index_name), lower(stat_name);
43
44 --echo # Cleanup
45 --echo # Shutdown server
46 --source include/shutdown_mysqld.inc
47
48 --echo # Remove copied files
49 --file_exists $MYSQL_TMP_DIR/data57_index_stats.zip
50 --force-rmdir $MYSQL_TMP_DIR/data57_index_stats
51 --remove_file $MYSQL_TMP_DIR/data57_index_stats.zip
52
53 --echo # Restart the server
54 let $restart_parameters =;
55 --source include/start_mysqld.inc