Bug #11113 Not possible to restore backups with MERGE tables in the backup file.
Submitted: 6 Jun 2005 13:06 Modified: 9 Jun 2005 15:28
Reporter: William de Vos Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Administrator Severity:S3 (Non-critical)
Version:1.0.21 OS:Windows (WindowsXP SP2)
Assigned to: Vladimir Kolesnikov CPU Architecture:Any

[6 Jun 2005 13:06] William de Vos
Description:
Restoring a backup (which contains merge tables) gives an error.
It's been tested on WindowsXP SP2 with MySQL server 4.1.12a and MySQL Administrator 1.0.21 and on Linux with MySQL server 4.0.17 and MySQL administrator 1.0.21.

How to repeat:
Create tables as following:
use test;
CREATE TABLE contactpersons_p1 (
a INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
message CHAR(20)) TYPE=MYISAM;

CREATE TABLE contactpersons_p2 (
a INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
message CHAR(20)) TYPE=MYISAM;

CREATE TABLE contactpersons (
a INT NOT NULL AUTO_INCREMENT,
message CHAR(20), INDEX(a)) TYPE=MERGE UNION=(contactpersons_p1,contactpersons_p2) INSERT_METHOD=NO;

INSERT INTO contactpersons_p1 (message) VALUES ('Testing'),('table'),('t1');
INSERT INTO contactpersons_p2 (message) VALUES ('Testing'),('table'),('t2');

Create backup with MySQL Administrator.
Advanced options: Select: Add drop, complete inserts and comment.

Restore the created backup file into an empty database.

Suggested fix:
In this case the merge table contactpersons is processed before the tables contactpersons_p1 and contactpersons_p2. Further for all data records of the tables contactpersons_p1 and contactpersons_p2 SQL INSERT statements are created. This is not required as the data records are inserted into the MyISAM tables.

Creation of the MERGE table should be done at a point in the backup script were all related tables are processed.
[8 Jun 2005 5:36] Jorge del Conde
Thanks for your bug report.
[8 Jun 2005 5:36] Jorge del Conde
bug screenshot

Attachment: Image1.png (image/x-png, text), 11.02 KiB.

[9 Jun 2005 15:28] Vladimir Kolesnikov
Thank you for your bug report. This issue has been committed to our
source repository of that product and will be incorporated into the
next release.

If necessary, you can access the source repository and build the latest
available version, including the bugfix, yourself. More information 
about accessing the source trees is available at
    http://www.mysql.com/doc/en/Installing_source_tree.html