Bug #97968 ALTER TABLE .. IMPORT TABLESPACE schema mismatch (Column x precise type mismatch
Submitted: 12 Dec 2019 12:37 Modified: 12 Dec 2019 15:10
Reporter: Nagy András Email Updates:
Status: Unsupported Impact on me:
None 
Category:MySQL Server: InnoDB storage engine Severity:S3 (Non-critical)
Version:8.0.16 OS:Ubuntu (Ubuntu 18.04.2 LTS)
Assigned to: CPU Architecture:x86 (Ver 8.0.16 for Linux on x86_64 (MySQL Community Server - GPL))

[12 Dec 2019 12:37] Nagy András
Description:
If I export/import individual tables with DATE or DECIMAL fields from a source to destination server using ALTER TABLE .. IMPORT TABLESPACE, then import fails with 
"schema mismatch (Column x precise type mismatch)" error message, where x type is DATE or DECIMAL. Other types seem to be working.

Both servers are Ubuntu 18.04.2 LTS, MySQL Ver 8.0.16 for Linux on x86_64 (MySQL Community Server - GPL), InnoDB engine, following attributes set:
innodb_page_size = 16384
innodb_default_row_format = dynamic
innodb_file_per_table = 1

How to repeat:
On source server:
CREATE TABLE testschema.test_table_date_and_decimal (
datefield DATE,
decimalfield DECIMAL(10,2)
) ENGINE=INNODB;
INSERT testschema.test_table_date_and_decimal VALUES('2019-12-12', 12.111);

xtrabackup --backup --tables="test_table_date_and_decimal" --target-dir=~/backup/

xtrabackup --prepare --export --target-dir=~/backup/testschema

scp ~/backup/testschema/test_table_date_and_decimal* destination-user@destination-host:~/backup/

On target server:
CREATE TABLE test_table_date_and_decimal (
datefield DATE,
decimalfield DECIMAL(10,2)
) ENGINE=INNODB;

ALTER TABLE test_table_date_and_decimal DISCARD TABLESPACE;

cp ~/backup/testschema/test_table_date_and_decimal* /var/lib/mysql/testschema

ALTER TABLE test_table_date_and_decimal IMPORT TABLESPACE;
[12 Dec 2019 15:10] MySQL Verification Team
Hi Mr. Andras,

Thank you for your bug report.

However, you have reported this bug to the wrong forum. XtraBackup is a tool made by Percona, not by MySQL.

Hence, you should report this bug to their bug forum.

If you experience the same problem with our MySQL Enterprise Backup or with mysqldump, then, please create another bug report.

Not supported by us.