Server IP : 172.67.216.182 / Your IP : 172.68.164.75 Web Server : Apache System : Linux krdc-ubuntu-s-2vcpu-4gb-amd-blr1-01.localdomain 5.15.0-142-generic #152-Ubuntu SMP Mon May 19 10:54:31 UTC 2025 x86_64 User : www ( 1000) PHP Version : 7.4.33 Disable Function : passthru,exec,system,putenv,chroot,chgrp,chown,shell_exec,popen,proc_open,pcntl_exec,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,imap_open,apache_setenv MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /www/server/mysql/src/mysql-test/suite/innodb/t/ |
Upload File : |
# Test "ALTER TABLE ... IMPORT TABLESPACE" in InnoDB --source include/have_lowercase0.inc --source include/have_innodb_16k.inc --source include/have_punch_hole.inc --source include/not_embedded.inc --echo # --echo # Bug#31313533 : IMPORT FAILS FOR ENCRYPT AND COMPRESSION ENABLED TDE TABLES --echo # --disable_query_log call mtr.add_suppression("Resizing redo log"); call mtr.add_suppression("Starting to delete and rewrite log files"); call mtr.add_suppression("New log files created"); # Table 'performance_schema'.'processlist' was added in 5.7.39 # It is not present in the 5.7.32 import test file. call mtr.add_suppression("Optional native table 'performance_schema'.'processlist' has the wrong structure or is missing"); --enable_query_log --echo # SETUP let $MYSQLD_DATADIR= `SELECT @@datadir`; --echo # RESTART WITH KEYRING PLUGIN let $restart_parameters = restart: --early-plugin-load=keyring_file=$KEYRING_PLUGIN --loose-keyring_file_data=$MYSQL_TMP_DIR/mysecret_keyring $KEYRING_PLUGIN_OPT; --replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR $KEYRING_PLUGIN_OPT KEYRING_PLUGIN_OPT --source include/restart_mysqld.inc --echo --echo # Test 1 : Check that EXPORT and IMPORT is working fine on same FS --echo CREATE TABLE t1(c1 int NOT NULL AUTO_INCREMENT, c2 varchar(65000) DEFAULT NULL, c3 varchar(255) GENERATED ALWAYS AS (substr(c2,2,100)) STORED, c4 varchar(255) GENERATED ALWAYS AS (substr(c2,10,200)) VIRTUAL, b bit(64) DEFAULT NULL, p_c1 bigint DEFAULT NULL, PRIMARY KEY (c1)) ENGINE=Innodb AUTO_INCREMENT=50001 DEFAULT CHARSET=latin1 COMPRESSION='zlib' ENCRYPTION='Y'; --disable_query_log --let $i = 1 while ($i < 6000) { INSERT INTO t1(c2,b,p_c1) VALUES(AES_ENCRYPT("5dd0786a3c7adf503202b8e234a95cbe643bc752028e1792ca8e6ef86c69582eb1cc478670c8e5d6c0133d1b4e5c98017aeb893f9db5f1bff397bc9e0f5fde48","abc"),10,100); --inc $i } --enable_query_log SELECT c1, SUBSTRING(c2, 10, 10), SUBSTRING(c3, 10, 10), SUBSTRING(c4, 10, 10), b FROM t1 ORDER BY c1 limit 10; --echo # Flush tables for export FLUSH TABLES t1 FOR EXPORT; --echo # Copy .cfp .cfg .ibd file to temp --copy_file $MYSQLD_DATADIR/test/t1.cfp $MYSQLTEST_VARDIR/tmp/t1.cfp --copy_file $MYSQLD_DATADIR/test/t1.cfg $MYSQLTEST_VARDIR/tmp/t1.cfg --copy_file $MYSQLD_DATADIR/test/t1.ibd $MYSQLTEST_VARDIR/tmp/t1.ibd UNLOCK TABLES; DROP TABLE t1; CREATE TABLE t1(c1 int NOT NULL AUTO_INCREMENT, c2 varchar(65000) DEFAULT NULL, c3 varchar(255) GENERATED ALWAYS AS (substr(c2,2,100)) STORED, c4 varchar(255) GENERATED ALWAYS AS (substr(c2,10,200)) VIRTUAL, b bit(64) DEFAULT NULL, p_c1 bigint DEFAULT NULL, PRIMARY KEY (c1)) ENGINE=Innodb AUTO_INCREMENT=50001 DEFAULT CHARSET=latin1 COMPRESSION='zlib' ENCRYPTION='Y'; ALTER TABLE t1 DISCARD TABLESPACE; --echo # Copy .cfp/.cfg and .ibd files from temp to datadir --copy_file $MYSQLTEST_VARDIR/tmp/t1.cfp $MYSQLD_DATADIR/test/t1.cfp --copy_file $MYSQLTEST_VARDIR/tmp/t1.cfg $MYSQLD_DATADIR/test/t1.cfg --copy_file $MYSQLTEST_VARDIR/tmp/t1.ibd $MYSQLD_DATADIR/test/t1.ibd --echo # Start import ALTER TABLE t1 IMPORT TABLESPACE; SELECT c1, SUBSTRING(c2, 10, 10), SUBSTRING(c3, 10, 10), SUBSTRING(c4, 10, 10), b FROM t1 ORDER BY c1 limit 10; --echo # Cleanup DROP TABLE t1; --remove_file $MYSQLTEST_VARDIR/tmp/t1.cfp --remove_file $MYSQLTEST_VARDIR/tmp/t1.cfg --remove_file $MYSQLTEST_VARDIR/tmp/t1.ibd --echo --echo # Test 2 : Check that EXPORT and IMPORT is working fine on different FS --echo let $MYSQLD_DATADIR= `SELECT @@datadir`; --echo # Copy and unzip the dir having cfg/cfg/ibd file from a different FS Block Size --copy_file $MYSQLTEST_VARDIR/std_data/import2_57_32.zip $MYSQL_TMP_DIR/import2_57_32.zip --file_exists $MYSQL_TMP_DIR/import2_57_32.zip --exec unzip -qo $MYSQL_TMP_DIR/import2_57_32.zip -d $MYSQL_TMP_DIR --file_exists $MYSQL_TMP_DIR/import2_57_32/t1.cfp --file_exists $MYSQL_TMP_DIR/import2_57_32/t1.cfg --file_exists $MYSQL_TMP_DIR/import2_57_32/t1.ibd CREATE TABLE t1(c1 int NOT NULL AUTO_INCREMENT, c2 varchar(65000) DEFAULT NULL, c3 varchar(255) GENERATED ALWAYS AS (substr(c2,2,100)) STORED, c4 varchar(255) GENERATED ALWAYS AS (substr(c2,10,200)) VIRTUAL, b bit(64) DEFAULT NULL, p_c1 bigint DEFAULT NULL, PRIMARY KEY (c1)) ENGINE=Innodb AUTO_INCREMENT=50001 DEFAULT CHARSET=latin1 COMPRESSION='zlib' ENCRYPTION='Y'; ALTER TABLE t1 DISCARD TABLESPACE; --echo # Copy .cfp/.cfg and .ibd files from temp to datadir --copy_file $MYSQL_TMP_DIR/import2_57_32/t1.cfp $MYSQLD_DATADIR/test/t1.cfp --copy_file $MYSQL_TMP_DIR/import2_57_32/t1.cfg $MYSQLD_DATADIR/test/t1.cfg --copy_file $MYSQL_TMP_DIR/import2_57_32/t1.ibd $MYSQLD_DATADIR/test/t1.ibd --echo # Start import ALTER TABLE t1 IMPORT TABLESPACE; SELECT c1, SUBSTRING(c2, 10, 10), SUBSTRING(c3, 10, 10), SUBSTRING(c4, 10, 10), b FROM t1 ORDER BY c1 limit 10; --echo # Cleanup DROP TABLE t1; --echo # Remove copied files --file_exists $MYSQL_TMP_DIR/import2_57_32.zip #--rmdir $MYSQL_TMP_DIR/import2_57_32 --remove_file $MYSQL_TMP_DIR/import2_57_32.zip --echo --echo # Test 3 : Check that IMPORT works fine from previous version on same FS --echo let $MYSQLD_DATADIR= `SELECT @@datadir`; --echo # Copy and unzip the dir having cfg/cfg/ibd file from previous version. --copy_file $MYSQLTEST_VARDIR/std_data/import_57_32.zip $MYSQL_TMP_DIR/import_57_32.zip --file_exists $MYSQL_TMP_DIR/import_57_32.zip --exec unzip -qo $MYSQL_TMP_DIR/import_57_32.zip -d $MYSQL_TMP_DIR --file_exists $MYSQL_TMP_DIR/import_57_32/t1.cfp --file_exists $MYSQL_TMP_DIR/import_57_32/t1.cfg --file_exists $MYSQL_TMP_DIR/import_57_32/t1.ibd CREATE TABLE t1(c1 int NOT NULL AUTO_INCREMENT, c2 varchar(65000) DEFAULT NULL, c3 varchar(255) GENERATED ALWAYS AS (substr(c2,2,100)) STORED, c4 varchar(255) GENERATED ALWAYS AS (substr(c2,10,200)) VIRTUAL, b bit(64) DEFAULT NULL, p_c1 bigint DEFAULT NULL, PRIMARY KEY (c1)) ENGINE=Innodb AUTO_INCREMENT=50001 DEFAULT CHARSET=latin1 COMPRESSION='zlib' ENCRYPTION='Y'; ALTER TABLE t1 DISCARD TABLESPACE; --echo # Copy .cfp/.cfg and .ibd files from temp to datadir --copy_file $MYSQL_TMP_DIR/import_57_32/t1.cfp $MYSQLD_DATADIR/test/t1.cfp --copy_file $MYSQL_TMP_DIR/import_57_32/t1.cfg $MYSQLD_DATADIR/test/t1.cfg --copy_file $MYSQL_TMP_DIR/import_57_32/t1.ibd $MYSQLD_DATADIR/test/t1.ibd --echo # Start import ALTER TABLE t1 IMPORT TABLESPACE; SELECT c1, SUBSTRING(c2, 10, 10), SUBSTRING(c3, 10, 10), SUBSTRING(c4, 10, 10), b FROM t1 ORDER BY c1 limit 10; --echo # Cleanup DROP TABLE t1; --echo # Remove copied files --file_exists $MYSQL_TMP_DIR/import_57_32.zip #--rmdir $MYSQL_TMP_DIR/import_57_32 --remove_file $MYSQL_TMP_DIR/import_57_32.zip --source include/force_restart.inc