# Create a schema and a table. # I am using many CHAR fields fo generate a big dataset quickly. bin/mysql -uroot -S /tmp/mysql_5727.sock <<< "CREATE DATABASE test_jfg" bin/mysql -uroot -S /tmp/mysql_5727.sock test_jfg <<< " CREATE TABLE test_jfg.t(id INT UNSIGNED AUTO_INCREMENT PRIMARY KEY); ALTER TABLE test_jfg.t ADD COLUMN v VARCHAR(255);" for i in $(seq 9); do bin/mysql -uroot -S /tmp/mysql_5727.sock test_jfg <<< "ALTER TABLE test_jfg.t ADD COLUMN c$i CHAR(255) DEFAULT ''" done # Generate ~2 GB of data in that table. seq -f "INSERT INTO t(v) VALUES ('%f');" 1 1000000 | sed -e '1~1000s/^/COMMIT;BEGIN;/' | bin/mysql -uroot -S /tmp/mysql_5727.sock test_jfg # Contrarily to Bug#96475, I will run all next steps manually to show things are broken. -- In the mysql client, run FLUSH TABLE [...] FOR EXPORT. FLUSH TABLE t FOR EXPORT; # In bash, copy the files. for s in cfg ibd; do cp $PWD/96477/test_jfg/t{,_}.$s; done -- In the . mysql client, UNLOCK TABLE and prepare import. UNLOCK TABLES; CREATE TABLE t2 LIKE t; ALTER TABLE t2 DISCARD TABLESPACE; # In bash, copy the files. for s in cfg ibd; do cp $PWD/96477/test_jfg/t{_,2}.$s; done -- In the mysql client, import the table. ALTER TABLE t2 IMPORT TABLESPACE; ERROR 1817 (HY000): Index corrupt: Clustered index validation failed, due to data file corruption. -- In above, we can see that things fail, but I would expect them to succeed. ####### 5.7.27 - no issues noted rm -rf 96477 bin/mysqld --initialize-insecure --basedir=$PWD --datadir=$PWD/96477 --log-error-verbosity=3 bin/mysqld --no-defaults --basedir=$PWD --datadir=$PWD/96477 --core-file --socket=/tmp/mysql_5727.sock --port=6666 --log-error=$PWD/96477/log.err --log-error-verbosity=3 --secure-file-priv="" 2>&1 & [umshastr@hod03]/export/umesh/server/binaries/GABuilds/mysql-5.7.27: bin/mysql -uroot -S /tmp/mysql_5727.sock <<< "CREATE DATABASE test_jfg" [umshastr@hod03]/export/umesh/server/binaries/GABuilds/mysql-5.7.27: bin/mysql -uroot -S /tmp/mysql_5727.sock test_jfg <<< " > CREATE TABLE test_jfg.t(id INT UNSIGNED AUTO_INCREMENT PRIMARY KEY); > ALTER TABLE test_jfg.t ADD COLUMN v VARCHAR(255);" [umshastr@hod03]/export/umesh/server/binaries/GABuilds/mysql-5.7.27: [umshastr@hod03]/export/umesh/server/binaries/GABuilds/mysql-5.7.27: for i in $(seq 9); do > bin/mysql -uroot -S /tmp/mysql_5727.sock test_jfg <<< "ALTER TABLE test_jfg.t ADD COLUMN c$i CHAR(255) DEFAULT ''" > done [umshastr@hod03]/export/umesh/server/binaries/GABuilds/mysql-5.7.27: [umshastr@hod03]/export/umesh/server/binaries/GABuilds/mysql-5.7.27: seq -f "INSERT INTO t(v) VALUES ('%f');" 1 1000000 | sed -e '1~1000s/^/COMMIT;BEGIN;/' | bin/mysql -uroot -S /tmp/mysql_5727.sock test_jfg [umshastr@hod03]/export/umesh/server/binaries/GABuilds/mysql-5.7.27: [umshastr@hod03]/export/umesh/server/binaries/GABuilds/mysql-5.7.27: [umshastr@hod03]/export/umesh/server/binaries/GABuilds/mysql-5.7.27: [umshastr@hod03]/export/umesh/server/binaries/GABuilds/mysql-5.7.27: for s in cfg ibd; do cp $PWD/96477/test_jfg/t{,_}.$s; done mysql> UNLOCK TABLES; Query OK, 0 rows affected (0.00 sec) mysql> CREATE TABLE t2 LIKE t; ALTER TABLE t2 DISCARD TABLESPACE; Query OK, 0 rows affected (0.00 sec) Query OK, 0 rows affected (0.01 sec) [umshastr@hod03]/export/umesh/server/binaries/GABuilds/mysql-5.7.27: [umshastr@hod03]/export/umesh/server/binaries/GABuilds/mysql-5.7.27: for s in cfg ibd; do cp $PWD/96477/test_jfg/t{_,2}.$s; done [umshastr@hod03]/export/umesh/server/binaries/GABuilds/mysql-5.7.27: mysql> ALTER TABLE t2 IMPORT TABLESPACE; Query OK, 0 rows affected (8.65 sec)