Bug #19544 mysqldump does not backup TS and LG information correctly.
Submitted: 4 May 2006 19:29 Modified: 21 Jun 2006 5:01
Reporter: Nikolay Grishakin Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Backup Severity:S2 (Serious)
Version:5.1 OS:Linux (Linux)
Assigned to: Stewart Smith CPU Architecture:Any

[4 May 2006 19:29] Nikolay Grishakin
Description:
mysqldump does not store Log File Groups and Table Spaces information correctly. INITIAL_SIZE and UNDO_BUFFER_SIZE values stored incorrectly and it makes data restoration impossible.
Original LG and TS were created like this:

                           CREATE LOGFILE GROUP lg
                           ADD UNDOFILE './undofile.dat'
                           INITIAL_SIZE 250M
                           UNDO_BUFFER_SIZE = 4M
                           ENGINE=NDB;
                           
                           CREATE TABLESPACE ts
                           ADD DATAFILE './datafile.dat'
                           USE LOGFILE GROUP lg
                           INITIAL_SIZE 500M
                           ENGINE=NDB;
                 
                           CREATE TABLE tb (
                           a1 int NOT NULL AUTO_INCREMENT,
                           a2 char(80) DEFAULT NULL,
                           PRIMARY KEY (a1)
                           ) TABLESPACE ts STORAGE DISK ENGINE=ndbcluster;

Database was backed up with mysqldump:
mysqldump -u root -Y TPCB > tpcb_backup.sql 
Drop table tb and try to restore TPCB database:
$ mysql TPCB -u root < tpcb_backup.sql
The following error is returned: "ERROR 1507 (HY000) at line 22: Failed to create UNDOFILE"

I looked in tpcb_backup.sql and it showed wrong values for INITIAL_SIZE and UNDO_BUFFER_SIZE. Numbers are so big so CREATE LG and FG failed:

  CREATE LOGFILE GROUP lg
  ADD UNDOFILE './undofile.dat'
  UNDO_BUFFER_SIZE 4194304
  INITIAL_SIZE 2.62e+08
  ENGINE=ndbcluster;

  CREATE TABLESPACE ts
  ADD DATAFILE './datafile.dat'
  USE LOGFILE GROUP lg
  EXTENT_SIZE 1048576
  INITIAL_SIZE 5.24e+08
  ENGINE=ndbcluster;

How to repeat:
see above
[25 May 2006 7:35] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/6857
[6 Jun 2006 4:05] Stewart Smith
Pushed to 5.1.12
[6 Jun 2006 11:48] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/7323
[21 Jun 2006 5:01] Paul Dubois
Noted in 5.1.12 changelog.

In the INFORMATION_SCHEMA.FILES table, the INITIAL_SIZE,
MAXIMUM_SIZE, and AUTOEXTEND_SIZE columns incorrectly were being
stored as VARCHAR rather than BIGINT.