198 lines
7.7 KiB
Plaintext
198 lines
7.7 KiB
Plaintext
#
|
|
# This testcase is related to WL5980, to test the portability feature.
|
|
# Create a DB & tables with all kinds Non-Partition & partition on
|
|
# Windows platform. Zip the entire DB and tablespaces on Windows.
|
|
# Bring the zip file to Linux. Unzip the DB and modify the *.isl files
|
|
# with the proper path of the *.ibd files. Restart the DB & check the
|
|
# DB with a few DML operations. Test and validate the Windows DB on
|
|
# Linux platform.
|
|
# Prerequisite : portability_wl5980_linux.zip
|
|
# should exist in "suite/innodb/t"
|
|
|
|
--source include/have_innodb_16k.inc
|
|
--source include/not_embedded.inc
|
|
--source include/linux.inc
|
|
--source include/have_util_unzip.inc
|
|
|
|
--echo # Set the environmental variables
|
|
LET MYSQL_BASEDIR= `select @@basedir`;
|
|
LET $MYSQLD_DATADIR = `select @@datadir`;
|
|
LET $INNODB_PAGE_SIZE = `select @@innodb_page_size`;
|
|
|
|
--echo # Stop server
|
|
-- exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
|
|
-- shutdown_server 30
|
|
-- source include/wait_until_disconnected.inc
|
|
|
|
--echo # Copy the remote tablespace & DB zip files from suite location to working location.
|
|
#--copy_file $MYSQLTEST_VARDIR/../mysql-test/suite/innodb/t/portability_wl5980_linux.zip $MYSQL_TMP_DIR/portability_wl5980_linux.zip
|
|
|
|
perl;
|
|
use File::Find;
|
|
use File::Copy;
|
|
sub find_zip () {
|
|
if (/portability_wl5980_linux\.zip/) {
|
|
my $dest_dir = $ENV{'MYSQL_TMP_DIR'};
|
|
my $src_file = $File::Find::name;
|
|
my $srcfile = File::Spec->catfile("$src_file") ;
|
|
my $destfile = File::Spec->catfile("$dest_dir", "portability_wl5980_linux.zip");
|
|
if (! -e $destfile) {
|
|
copy($srcfile,$destfile) or die "copy @args failed: $!";
|
|
}
|
|
}
|
|
}
|
|
my $search_dir = $ENV{'MYSQL_BASEDIR'};
|
|
find(\&find_zip,"$search_dir");
|
|
EOF
|
|
|
|
--echo # Check that the file exists in the working folder.
|
|
--file_exists $MYSQL_TMP_DIR/portability_wl5980_linux.zip
|
|
|
|
--echo # Unzip the zip file.
|
|
--exec unzip -qo $MYSQL_TMP_DIR/portability_wl5980_linux.zip -d $MYSQL_TMP_DIR
|
|
|
|
--echo # Remove the DOS based *.isl files from the MySql Data directory.
|
|
--remove_file $MYSQL_TMP_DIR/mysqld.5980/data/test/emp2#p#p1.isl
|
|
--remove_file $MYSQL_TMP_DIR/mysqld.5980/data/test/emp2#p#p2.isl
|
|
|
|
--remove_file $MYSQL_TMP_DIR/mysqld.5980/data/test/emp3.isl
|
|
|
|
--remove_file $MYSQL_TMP_DIR/mysqld.5980/data/test/emp4#p#p1.isl
|
|
--remove_file $MYSQL_TMP_DIR/mysqld.5980/data/test/emp4#p#p2.isl
|
|
|
|
--remove_file $MYSQL_TMP_DIR/mysqld.5980/data/test/purchase#p#p0#sp#s0.isl
|
|
--remove_file $MYSQL_TMP_DIR/mysqld.5980/data/test/purchase#p#p0#sp#s1.isl
|
|
--remove_file $MYSQL_TMP_DIR/mysqld.5980/data/test/purchase#p#p1#sp#s2.isl
|
|
--remove_file $MYSQL_TMP_DIR/mysqld.5980/data/test/purchase#p#p1#sp#s3.isl
|
|
|
|
--echo # Check that the *.ibd files are in the required location.
|
|
--file_exists $MYSQL_TMP_DIR/mysqld.5980/tab1/test/emp2#p#p1.ibd
|
|
--file_exists $MYSQL_TMP_DIR/mysqld.5980/tab2/test/emp2#p#p2.ibd
|
|
|
|
--file_exists $MYSQL_TMP_DIR/mysqld.5980/tab3/test/emp3.ibd
|
|
|
|
--file_exists $MYSQL_TMP_DIR/mysqld.5980/tab4/test/emp4#p#p1.ibd
|
|
--file_exists $MYSQL_TMP_DIR/mysqld.5980/tab5/test/emp4#p#p2.ibd
|
|
|
|
--file_exists $MYSQL_TMP_DIR/mysqld.5980/part0/test/purchase#p#p0#sp#s0.ibd
|
|
--file_exists $MYSQL_TMP_DIR/mysqld.5980/part1/test/purchase#p#p0#sp#s1.ibd
|
|
--file_exists $MYSQL_TMP_DIR/mysqld.5980/part2/test/purchase#p#p1#sp#s2.ibd
|
|
--file_exists $MYSQL_TMP_DIR/mysqld.5980/part3/test/purchase#p#p1#sp#s3.ibd
|
|
|
|
|
|
--echo # Create new *.isl files with the correct path to the *.ibd files,
|
|
--exec echo $MYSQL_TMP_DIR/mysqld.5980/tab1/test/emp2#p#p1.ibd > $MYSQL_TMP_DIR/mysqld.5980/data/test/emp2#p#p1.isl
|
|
--exec echo $MYSQL_TMP_DIR/mysqld.5980/tab2/test/emp2#p#p2.ibd > $MYSQL_TMP_DIR/mysqld.5980/data/test/emp2#p#p2.isl
|
|
|
|
--exec echo $MYSQL_TMP_DIR/mysqld.5980/tab3/test/emp3.ibd > $MYSQL_TMP_DIR/mysqld.5980/data/test/emp3.isl
|
|
|
|
--exec echo $MYSQL_TMP_DIR/mysqld.5980/tab4/test/emp4#p#p1.ibd > $MYSQL_TMP_DIR/mysqld.5980/data/test/emp4#p#p1.isl
|
|
--exec echo $MYSQL_TMP_DIR/mysqld.5980/tab5/test/emp4#p#p2.ibd > $MYSQL_TMP_DIR/mysqld.5980/data/test/emp4#p#p2.isl
|
|
|
|
--exec echo $MYSQL_TMP_DIR/mysqld.5980/part0/test/purchase#p#p0#sp#s0.ibd > $MYSQL_TMP_DIR/mysqld.5980/data/test/purchase#p#p0#sp#s0.isl
|
|
--exec echo $MYSQL_TMP_DIR/mysqld.5980/part1/test/purchase#p#p0#sp#s1.ibd > $MYSQL_TMP_DIR/mysqld.5980/data/test/purchase#p#p0#sp#s1.isl
|
|
--exec echo $MYSQL_TMP_DIR/mysqld.5980/part2/test/purchase#p#p1#sp#s2.ibd > $MYSQL_TMP_DIR/mysqld.5980/data/test/purchase#p#p1#sp#s2.isl
|
|
--exec echo $MYSQL_TMP_DIR/mysqld.5980/part3/test/purchase#p#p1#sp#s3.ibd > $MYSQL_TMP_DIR/mysqld.5980/data/test/purchase#p#p1#sp#s3.isl
|
|
|
|
--echo # Restart the DB server from unzip location Data Dir.
|
|
--echo # Note that lower case option is required because the
|
|
--echo # partition tables will be stored in mixed (Upper & Lower) format on Linux,
|
|
--echo # but on Windows the partition table names are stored in lower case only.
|
|
|
|
--echo # Restarting the server with skip-grant-tables and updating mysql.user
|
|
--echo # table to deal with the restriction added to plugin value for users
|
|
--echo # in WL6982.
|
|
|
|
-- exec echo "restart:--lower_case_table_names=1 --datadir=$MYSQL_TMP_DIR/mysqld.5980/data/ --skip-grant-tables" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
|
|
-- enable_reconnect
|
|
-- source include/wait_until_connected_again.inc
|
|
-- disable_reconnect
|
|
|
|
-- exec $MYSQL -e "UPDATE mysql.user SET plugin = 'mysql_native_password'"
|
|
|
|
--echo Run mysql_upgrade once
|
|
--exec $MYSQL_UPGRADE --skip-verbose --force 2>&1
|
|
|
|
-- echo # Stop server
|
|
-- source include/shutdown_mysqld.inc
|
|
|
|
-- exec echo "restart:--lower_case_table_names=1 --datadir=$MYSQL_TMP_DIR/mysqld.5980/data/ " > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
|
|
-- enable_reconnect
|
|
-- source include/wait_until_connected_again.inc
|
|
-- disable_reconnect
|
|
|
|
--echo # Check the DB & tables with DML statements.
|
|
use test;
|
|
--replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR
|
|
SHOW CREATE TABLE emp1;
|
|
--replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR
|
|
SHOW CREATE TABLE emp2;
|
|
--replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR
|
|
SHOW CREATE TABLE emp3;
|
|
--replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR
|
|
SHOW CREATE TABLE emp4;
|
|
--replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR
|
|
SHOW CREATE TABLE purchase;
|
|
|
|
SELECT COUNT(*) FROM emp1;
|
|
SELECT COUNT(*) FROM emp2;
|
|
SELECT COUNT(*) FROM emp3;
|
|
SELECT COUNT(*) FROM emp4;
|
|
SELECT COUNT(*) FROM purchase;
|
|
|
|
DELETE FROM emp1;
|
|
DELETE FROM emp2;
|
|
DELETE FROM emp3;
|
|
DELETE FROM emp4;
|
|
DELETE FROM purchase;
|
|
|
|
SELECT COUNT(*) FROM emp1;
|
|
SELECT COUNT(*) FROM emp2;
|
|
SELECT COUNT(*) FROM emp3;
|
|
SELECT COUNT(*) FROM emp4;
|
|
SELECT COUNT(*) FROM purchase;
|
|
|
|
--echo # Check the system tables have the proper entry of the tables.
|
|
--source suite/innodb/include/show_i_s_tablespaces.inc
|
|
--source suite/innodb/include/show_i_s_tables.inc
|
|
|
|
--echo #
|
|
--echo # Cleanup
|
|
--echo #
|
|
|
|
DROP TABLE emp1;
|
|
DROP TABLE emp2;
|
|
DROP TABLE emp3;
|
|
DROP TABLE emp4;
|
|
DROP TABLE purchase;
|
|
|
|
# The following lines of code just to dupe the MTR frame work nothing to do with WL,
|
|
# As MTR thinks that it was a failure, When the server logs contains error/warnings
|
|
# even though there are no result mismatch.It is an expected behavior of the server.
|
|
|
|
CREATE DATABASE mtr;
|
|
DELIMITER |;
|
|
CREATE PROCEDURE mtr.check_warnings(OUT result INT)
|
|
BEGIN
|
|
SELECT 0 INTO RESULT;
|
|
END|
|
|
|
|
--rmdir $MYSQL_TMP_DIR/mysqld.5980/tab1/test
|
|
--rmdir $MYSQL_TMP_DIR/mysqld.5980/tab2/test
|
|
--rmdir $MYSQL_TMP_DIR/mysqld.5980/tab3/test
|
|
--rmdir $MYSQL_TMP_DIR/mysqld.5980/tab4/test
|
|
--rmdir $MYSQL_TMP_DIR/mysqld.5980/tab5/test
|
|
--rmdir $MYSQL_TMP_DIR/mysqld.5980/part0/test
|
|
--rmdir $MYSQL_TMP_DIR/mysqld.5980/part1/test
|
|
--rmdir $MYSQL_TMP_DIR/mysqld.5980/part2/test
|
|
--rmdir $MYSQL_TMP_DIR/mysqld.5980/part3/test
|
|
--rmdir $MYSQL_TMP_DIR/mysqld.5980/tab1
|
|
--rmdir $MYSQL_TMP_DIR/mysqld.5980/tab2
|
|
--rmdir $MYSQL_TMP_DIR/mysqld.5980/tab3
|
|
--rmdir $MYSQL_TMP_DIR/mysqld.5980/tab4
|
|
--rmdir $MYSQL_TMP_DIR/mysqld.5980/tab5
|
|
--rmdir $MYSQL_TMP_DIR/mysqld.5980/part0
|
|
--rmdir $MYSQL_TMP_DIR/mysqld.5980/part1
|
|
--rmdir $MYSQL_TMP_DIR/mysqld.5980/part2
|
|
--rmdir $MYSQL_TMP_DIR/mysqld.5980/part3
|