polardbxengine/mysql-test/t/dd_upgrade_partition.test

143 lines
6.3 KiB
Plaintext

--echo #
--echo # Bug#25153261 : SEG FAULT IN UPGRADING PARTITIONED TABLE
--echo #
# This test contains zipped 5.7 data directory with innodb partitioned tables.
# Innodb does not recognizes partition table created in linux from windows
# due to difference in path format.
--source include/not_windows.inc
--source include/no_valgrind_without_big.inc
--disable_query_log
call mtr.add_suppression("Resizing redo log from");
call mtr.add_suppression("Upgrading redo log");
call mtr.add_suppression("Starting to delete and rewrite log files");
call mtr.add_suppression("New log files created");
call mtr.add_suppression("Unknown system variable 'show_compatibility_56'");
call mtr.add_suppression("You need to use --log-bin to make --binlog-format work");
call mtr.add_suppression("Creating routine without parsing routine body");
call mtr.add_suppression("Resolving dependency for the view");
call mtr.add_suppression("references invalid");
call mtr.add_suppression("doesn't exist");
call mtr.add_suppression("information_schema");
call mtr.add_suppression("Storage engine '.*' does not support system tables. \\[mysql.*\\]");
call mtr.add_suppression("Table 'mysql.component' doesn't exist");
call mtr.add_suppression("is expected to be transactional");
call mtr.add_suppression("table is missing or has an incorrect definition");
call mtr.add_suppression("ACL DDLs will not work unless mysql_upgrade is executed");
call mtr.add_suppression(".* Native table .* has the wrong structure");
call mtr.add_suppression("Column count of mysql.* is wrong");
call mtr.add_suppression("Cannot open table mysql/version from the internal data dictionary of InnoDB though the .frm file for the table exists");
call mtr.add_suppression("Column count of performance_schema.events_statements_summary_by_digest is wrong.*");
call mtr.add_suppression("The privilege system failed to initialize correctly.*");
call mtr.add_suppression(".*The system table mysql.global_grants is missing.*");
# InnoDB reports "Lock wait timeout" warnings when it tries to drop persistent
# statistics while persistent statistics table is altered during upgrade.
# This issue doesn't seem to cause any further trouble (as there is no persistent
# stats for persistent stats table anyway), so we ignore these warnings here.
call mtr.add_suppression("Unable to delete statistics for table mysql.");
# new fields were added to these tables
call mtr.add_suppression("Column count of performance_schema.replication_group_members is wrong. Expected 7, found 5.*");
call mtr.add_suppression("Column count of performance_schema.replication_group_member_stats is wrong. Expected 13, found 9.*");
call mtr.add_suppression("Column count of performance_schema.threads is wrong. Expected 18, found 17.*");
call mtr.add_suppression("ACL table mysql.[a-zA-Z_]* missing. Some operations may fail.");
call mtr.add_suppression("Info table is not ready to be used. Table 'mysql.slave_master_info' cannot be opened");
call mtr.add_suppression("Error in checking mysql.slave_master_info repository info type of TABLE");
call mtr.add_suppression("Error creating master info: Error checking repositories.");
call mtr.add_suppression("Slave: Failed to initialize the master info structure for channel");
call mtr.add_suppression("Failed to create or recover replication info repositories.");
--enable_query_log
#########################
# how to record this test JSON result content mismatch
# If required fix regex patterns in mysql-test/include/ibd2sdi.pl
# and mysql-test/suite/innodb/include/ibd2sdi_replace_pattern.inc,
# then run the test with --record option.
#########################
--echo # Set different paths for --datadir
let $MYSQLD_DATADIR1 = $MYSQL_TMP_DIR/data57_partition;
--echo # Copy the remote tablespace & DB zip files from suite location to working location.
--copy_file $MYSQLTEST_VARDIR/std_data/data57_partition.zip $MYSQL_TMP_DIR/data57_partition.zip
--echo # Check that the file exists in the working folder.
--file_exists $MYSQL_TMP_DIR/data57_partition.zip
--echo # Unzip the zip file.
--exec unzip -qo $MYSQL_TMP_DIR/data57_partition.zip -d $MYSQL_TMP_DIR
--let $MYSQLD_DATADIR=`SELECT @@datadir`
--echo # Stop DB server which was created by MTR default
--exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
--shutdown_server
--source include/wait_until_disconnected.inc
--echo # Create a bootstrap file in temp location
--replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR
--exec echo $MYSQL_TMP_DIR/bootstrap.log
--echo # Start the server. Without fix, there is a segmentation fault in this step.
--exec echo "restart: --loose-skip-log-bin --skip-log-slave-updates --datadir=$MYSQLD_DATADIR1" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
--enable_reconnect
--let $wait_counter= 6000
--source include/wait_until_connected_again.inc
SHOW CREATE TABLE partitions.t1;
--echo # Stop the server
--source include/shutdown_mysqld.inc
--echo # Check if .ibds have SDI after upgrade
--let $SRC_DIR=$MYSQL_TEST_DIR/std_data/dd/sdi/upgrade_partition
# Create a directory to store json generated
--let $DEST_DIR=$MYSQL_TMP_DIR/sdi_dest/
--error 0,1
--force-rmdir $DEST_DIR
--mkdir $DEST_DIR
--echo # Check SDI from sys_config.ibd
--let JSON_FILE_PATH = $DEST_DIR/sys_config.json
--exec $IBD2SDI $MYSQLD_DATADIR1/sys/sys_config.ibd -d $JSON_FILE_PATH 2>&1
--source suite/innodb/include/ibd2sdi_replace.inc
if ($MTR_RECORD == 0) {
--diff_files $SRC_DIR/sys_config.json $JSON_FILE_PATH
}
--echo # Check SDI from t1#P#p1.ibd
--let JSON_FILE_PATH = $DEST_DIR/t1#p#p1.json
--exec $IBD2SDI $MYSQLD_DATADIR1/partitions/t1#P#p1.ibd -d $JSON_FILE_PATH 2>&1
--source suite/innodb/include/ibd2sdi_replace.inc
if ($MTR_RECORD == 0) {
--diff_files $SRC_DIR/t1#p#p1.json $JSON_FILE_PATH
}
--echo # Check SDI from t1#P#p0.ibd
--let JSON_FILE_PATH = $DEST_DIR/t1#p#p0.json
--exec $IBD2SDI $MYSQLD_DATADIR1/partitions/t1#P#p0.ibd -d $JSON_FILE_PATH 2>&1
--source suite/innodb/include/ibd2sdi_replace.inc
if ($MTR_RECORD == 0) {
--diff_files $SRC_DIR/t1#p#p0.json $JSON_FILE_PATH
}
# If --record is used, save the json files created in the $DEST_DIR
# back to the $SRC_DIR.
if ($MTR_RECORD == 1) {
--copy_files_wildcard $DEST_DIR $SRC_DIR *.json
}
--echo # Remove json files
--force-rmdir $DEST_DIR
--echo # Remove copied files
--remove_file $MYSQL_TMP_DIR/data57_partition.zip
--force-rmdir $MYSQL_TMP_DIR/data57_partition
--echo # Restart the server with default options.
--let $restart_parameters=
--source include/start_mysqld.inc