Bug #53109 mysqldump does not dump LG and TS if no table uses disk storage yet
Submitted: 23 Apr 2010 11:56 Modified: 16 Sep 2010 7:24
Reporter: Hartmut Holzgraefe Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Cluster: Disk Data Severity:S3 (Non-critical)
Version:mysql-5.1-telco-7.0 OS:Linux
Assigned to: CPU Architecture:Any
Tags: any?, mysql-cluster-7.0.13

[23 Apr 2010 11:56] Hartmut Holzgraefe
Description:
mysqldump only dumps create statements for log groups and tablespaces when there are tables that actually use the table space for storage.

This prevents restoring a dump of a fresh cluster setup where a table space has been set up but no tables have been created yet.

How to repeat:
Create a log group and table space, then run mysqldump to see that the create information is not included.

Create a table using STORAGE DISK and redo the mysqldump, now the LG and TS creation statements are included.

Suggested fix:
Always include create statements for existing LGs and TSs.
[16 May 2010 17:51] Andrew Hutchings
Can't reproduce in 7.1.3, on a clean cluster I created a tablespace and logfile group.  No tables (apart from 'mysql'):

shell> mysqldump -A -uroot

...

--
-- Logfile group: lg_1
--

CREATE LOGFILE GROUP lg_1
  ADD UNDOFILE 'undo_1.log'
  UNDO_BUFFER_SIZE 2097152
  INITIAL_SIZE 16777216
  ENGINE=ndbcluster;

--
-- Tablespace: ts_1
--

CREATE TABLESPACE ts_1
  ADD DATAFILE 'data_1.dat'
  USE LOGFILE GROUP lg_1
  EXTENT_SIZE 1048576
  INITIAL_SIZE 33554432
  ENGINE=ndbcluster;

...
[16 May 2010 17:53] Andrew Hutchings
Also this works:

shell> mysqldump -uroot --all-tablespaces test