Bug #20841 mysqldump fails to store right info with --compatible=mysql40 option
Submitted: 4 Jul 2006 3:46 Modified: 21 Sep 2006 2:16
Reporter: Nikolay Grishakin Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: mysqldump Command-line Client Severity:S3 (Non-critical)
Version:5.1 OS:Linux (Linux)
Assigned to: Magnus BlÄudd CPU Architecture:Any
Tags: Test blocking

[4 Jul 2006 3:46] Nikolay Grishakin
Description:
Cannot restore database in mysql 4.1 saved by mysqldump in mysql-5.1
The following comand still saves information about TABLESPACE even if --compatible option is used.
$ mysqldump -u root --compatible=mysql40 test1 > backup-4.0.sql

How to repeat:
Using mysql-5.1 build.
From mysql-test directory run:

perl mysql-test-run.pl --start-and-exit ndb_basic

mysql -uroot -h127.0.0.1 -P9306

mysql> CREATE DATABASE test1;

mysql>CREATE LOGFILE GROUP lg
ADD UNDOFILE 'undofile.dat'
INITIAL_SIZE 10M
UNDO_BUFFER_SIZE = 4M
ENGINE=NDB;

mysql>CREATE TABLESPACE ts
ADD DATAFILE 'datafile.dat'
USE LOGFILE GROUP lg
INITIAL_SIZE 10M
ENGINE=NDB;

mysql> CREATE TABLE test1.t1 (a1 INT NOT NULL, a2 VARCHAR(256)) TABLESPACE ts
STORAGE DISK  ENGINE=NDB;
mysql>INSERT INTO test1.t1 VALUES(1, "aaaaa");
mysql> quit

$ ../client/mysqldump -u root --compatible=mysql40 test1   --socket=./var/tmp/master.sock > backup40.sql

Look at backup40.sql:
CREATE TABLE `t1` (
  `a1` int(11) NOT NULL,
  `a2` varchar(256) DEFAULT NULL
) TABLESPACE ts STORAGE DISK TYPE=ndbcluster;

Still has TABLESPACE in CTREATE TABLE statment.
[24 Aug 2006 12:28] 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/10824

ChangeSet@1.2230, 2006-08-24 14:27:57+02:00, msvensson@neptunus.(none) +6 -0
  Bug#20841 mysqldump fails to store right info with --compatible=mysql40 option
   - Add "not in version before" commensta around new syntax "WITH PARSER" and "TABLESPACE xxx STORAGE DISK"
[13 Sep 2006 8:40] Timothy Smith
Pushed to 5.1.12
[21 Sep 2006 2:16] Paul Dubois
Noted in 5.1.12 changelog.

mysqldump did not add version-specific comments around WITH PARSER
and TABLESPACE ... STORAGE DISK clauses for CREATE TABLE statements,
causing the dump file to fail when loaded into older servers.
[5 Oct 2006 13:54] Jonathan Miller
This patch has been verified through the new NDB upgrade/downgrade automation framework.
/jeb