[MDEV-20932] Create a way to reliably create a table for IMPORT Created: 2019-10-30  Updated: 2020-11-17  Resolved: 2020-11-17

Status: Closed
Project: MariaDB Server
Component/s: Backup, Storage Engine - InnoDB
Fix Version/s: N/A

Type: Task Priority: Major
Reporter: Hartmut Holzgraefe Assignee: Ralf Gebhardt
Resolution: Duplicate Votes: 0
Labels: None

Issue Links:
Duplicate
duplicates MDEV-18762 Support easy restore of partial backup Closed
Relates
relates to MDEV-20930 Document that SHOW CREATE TABLE on In... Closed

 Description   

Right now the procedure for a partial backup, and restore on another server, using transportable tablespaces, is:

  • take backup with mariabackup
  • take schema-only backup with `mysqldump --no-data`
  • prepare backup with `mariabackup --prepare --export`
  • create tables on target system, using the schema-only dump, or parts of it
  • DISCARD newly created tables
  • transfer .ibd and .cfg files from backup to correct location
  • IMPORT transferred files

This approach only works when the newly created table is exactly the same as on the original server. There are several cases though where that may not be the case:

  • table was created without explicit ROW_FORMAT, and the two servers having different innodb_default_row_format settings
  • different mysql56_temporal_types setting on both servers
  • table was originally created on a server version that did not have subsecond support, and contains a TIME, DATETIME or TIMESTAMP column

In all such cases IMPORT will not work, and the list may not even be complete ...

So my request is for a way to make sure a table can be created in exactly the same way as on the original server, without having to manually check for differences not covered by SHOW CREATE TABLE output.

Maybe adding a new SHOW FULL CREATE TABLE command, or an option to mysqldump that makes it gather additional information from the INFORMATION_SCHEMA to rewrite SHOW CREATE output by adding further create options.

Or have mariabackup itself create appropriate CREATE statement .sql files along with the .cfg files?



 Comments   
Comment by Geoff Montee (Inactive) [ 2019-11-04 ]

This looks like a duplicate of MDEV-18762.

Generated at Thu Feb 08 09:03:19 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.