-- 8.0.17 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_ushastry.sock --port=3333 --log-error=$PWD/96477/log.err --mysqlx-port=33330 --mysqlx-socket=/tmp/mysql_x_ushastry.sock --log-error-verbosity=3 --secure-file-priv=/tmp/ 2>&1 & # Create a schema and a table. # I am using many CHAR fields fo generate a big dataset quickly. bin/mysql -uroot -S /tmp/mysql_ushastry.sock <<< "CREATE DATABASE test_jfg" bin/mysql -uroot -S /tmp/mysql_ushastry.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_ushastry.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_ushastry.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. ########## [umshastr@hod03]/export/umesh/server/binaries/GABuilds/mysql-8.0.17: bin/mysql -uroot -S /tmp/mysql_ushastry.sock <<< "CREATE DATABASE test_jfg" [umshastr@hod03]/export/umesh/server/binaries/GABuilds/mysql-8.0.17: bin/mysql -uroot -S /tmp/mysql_ushastry.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-8.0.17: [umshastr@hod03]/export/umesh/server/binaries/GABuilds/mysql-8.0.17: for i in $(seq 9); do > bin/mysql -uroot -S /tmp/mysql_ushastry.sock test_jfg <<< "ALTER TABLE test_jfg.t ADD COLUMN c$i CHAR(255) DEFAULT ''" > done [umshastr@hod03]/export/umesh/server/binaries/GABuilds/mysql-8.0.17: [umshastr@hod03]/export/umesh/server/binaries/GABuilds/mysql-8.0.17: seq -f "INSERT INTO t(v) VALUES ('%f');" 1 1000000 | sed -e '1~1000s/^/COMMIT;BEGIN;/' | bin/mysql -uroot -S /tmp/mysql_ushastry.sock test_jfg [umshastr@hod03]/export/umesh/server/binaries/GABuilds/mysql-8.0.17: [umshastr@hod03]/export/umesh/server/binaries/GABuilds/mysql-8.0.17: [umshastr@hod03]/export/umesh/server/binaries/GABuilds/mysql-8.0.17: bin/mysql -uroot -S /tmp/mysql_ushastry.sock test_jfg Reading table information for completion of table and column names You can turn off this feature to get a quicker startup with -A Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 19 Server version: 8.0.17 MySQL Community Server - GPL Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. mysql> FLUSH TABLE t FOR EXPORT; Query OK, 0 rows affected (0.13 sec) mysql> umshastr@hod03]/export/umesh/server/binaries/GABuilds/mysql-8.0.17: [umshastr@hod03]/export/umesh/server/binaries/GABuilds/mysql-8.0.17: for s in cfg ibd; do cp $PWD/96477/test_jfg/t{,_}.$s; done [umshastr@hod03]/export/umesh/server/binaries/GABuilds/mysql-8.0.17: [umshastr@hod03]/export/umesh/server/binaries/GABuilds/mysql-8.0.17: mysql> UNLOCK TABLES; Query OK, 0 rows affected (0.00 sec) mysql> mysql> CREATE TABLE t2 LIKE t; ALTER TABLE t2 DISCARD TABLESPACE; Query OK, 0 rows affected (0.01 sec) Query OK, 0 rows affected (0.00 sec) mysql> [umshastr@hod03]/export/umesh/server/binaries/GABuilds/mysql-8.0.17: [umshastr@hod03]/export/umesh/server/binaries/GABuilds/mysql-8.0.17: for s in cfg ibd; do cp $PWD/96477/test_jfg/t{_,2}.$s; done [umshastr@hod03]/export/umesh/server/binaries/GABuilds/mysql-8.0.17: ysql> ALTER TABLE t2 IMPORT TABLESPACE; ERROR 1817 (HY000): Index corrupt: Clustered index validation failed, due to data file corruption. mysql> mysql>