Details
-
New Feature
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Fixed
-
None
Description
This came up in an InnoDB Birds of a Feather session.
mariabackup --export is internally executing FLUSH TABLES…EXPORT on the backed-up files to allow the files to be imported to another server instance. But it does not appear to generate a script file that could be conveniently executed by the user in order to import the tables.
It would be nice to have a sequence of SQL statements and shell commands for importing the exported tables. Maybe we could generate several files:
- create.sql with CREATE OR REPLACE TABLE…;ALTER TABLE…DISCARD TABLESPACE statements (not needed starting with
MDEV-26137in MariaDB Server 11.2) - move.sh or move.bat for moving the files to the data directory
- import.sql containing the ALTER TABLE…IMPORT TABLESPACE statements.
Attachments
Issue Links
- is blocked by
-
MDEV-18543 IMPORT TABLESPACE fails after instant DROP COLUMN
-
- Closed
-
-
MDEV-21407 Crash when restarting server after IMPORT TABLESPACE
-
- Closed
-
-
MDEV-21549 IMPORT TABLESPACE fails to adjust all tablespace ID in root pages
-
- Closed
-
-
MDEV-26137 ALTER TABLE IMPORT enhancement
-
- Closed
-
- is duplicated by
-
MDEV-18329 Backup/Restore Single Database as Different Name
-
- Open
-
-
MDEV-20932 Create a way to reliably create a table for IMPORT
-
- Closed
-
-
MDEV-27908 Help the user to write back partial backup
-
- Open
-
- relates to
-
MDEV-11658 Simpler, faster IMPORT of InnoDB tables
-
- Open
-
-
MDEV-15049 Importing InnoDB table from 10.1 to 10.2 causes Schema mismatch (Expected FSP_SPACE_FLAGS=0x21, .ibd file contains 0x0
-
- Closed
-
-
MDEV-15225 Can't import .ibd file with temporal type format differing from mysql56_temporal_format
-
- Closed
-
-
MDEV-20930 Document that SHOW CREATE TABLE on InnoDB tables only shows ROW_FORMAT when explicitly set
-
- Closed
-
-
TENT-334 Loading...
As part of this, we should also handle tables that use the DATA DIRECTORY attribute. Based on a discussion with the same user, I was wondering if there is a bug that we refuse IMPORT TABLESPACE if you import a table whose DATA DIRECTORY attribute in the .cfg file disagrees with the current table definition, but it appears to be OK in 10.2:
--source include/have_innodb.inc
--let $MYSQLD_DATADIR= `select @@datadir`
--move_file $MYSQLD_DATADIR/test/t1.cfg $MYSQL_TMP_DIR/test/t2.cfg
--copy_file $MYSQLD_DATADIR/test/t1.ibd $MYSQL_TMP_DIR/test/t2.ibd
UNLOCK TABLES;
--let $MYSQLD_DATADIR= `select @@datadir`
--move_file $MYSQL_TMP_DIR/test/t2.cfg $MYSQLD_DATADIR/test/t1.cfg
--copy_file $MYSQL_TMP_DIR/test/t2.ibd $MYSQLD_DATADIR/test/t1.ibd
UNLOCK TABLES;
The only surprise here is that the .cfg file must be located in the directory specified by DATA DIRECTORY, plus the name corresponding to the schema name (USE test was implied in this case).