-
Notifications
You must be signed in to change notification settings - Fork 342
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
PXB-2797: Schema mismatch when importing table with full-text index f…
…rom xtrabackup backup https://jira.percona.com/browse/PXB-2797 When importing a single table (IMPORT TABLESPACE) from a backup made using xtrabackup and the table contains a full-text index the import process will error out with: `ERROR 1808 (HY000) at line 132: Schema mismatch (Index xxxxxx field xxxxxx is ascending which does not match metadata file which is descending)` The problem occurs because FTS tables are created internally by InnoDB Storage engine and they do not choose any ordering flag. Default is UNDEF. This patch solves the issue by treating UNDEF order as ASC when creating dict_table_t on `--prepare` step.
- Loading branch information
Showing
2 changed files
with
39 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
# | ||
# PXB-2797: Schema mismatch when importing table with full-text index from backup | ||
# | ||
|
||
start_server | ||
|
||
mysql test <<EOF | ||
CREATE TABLE test.t1 ( | ||
t1_id int NOT NULL AUTO_INCREMENT, | ||
t1_text varchar(50) DEFAULT NULL, | ||
PRIMARY KEY (t1_id), | ||
FULLTEXT KEY t1_textx (t1_text) | ||
) ENGINE=InnoDB; | ||
INSERT INTO test.t1 (t1_text) values ("text1"); | ||
EOF | ||
|
||
xtrabackup --backup --target-dir=$topdir/backup | ||
|
||
record_db_state test | ||
|
||
shutdown_server | ||
|
||
xtrabackup --prepare --export --target-dir=$topdir/backup | ||
|
||
start_server | ||
|
||
mysql -e "ALTER TABLE test.t1 DISCARD TABLESPACE;" | ||
cp $topdir/backup/test/t1.ibd $mysql_datadir/test/t1.ibd | ||
cp $topdir/backup/test/t1.cfg $mysql_datadir/test/t1.cfg | ||
mysql -e "ALTER TABLE test.t1 IMPORT TABLESPACE;" | ||
|
||
verify_db_state test |