Bug #40346 MySQL Cluster 6.3.18 mysqldump result not restorable
Submitted: 27 Oct 2008 14:09 Modified: 2 Nov 2008 22:17
Reporter: Bogdan Kecman Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Cluster: Cluster (NDB) storage engine Severity:S2 (Serious)
Version:mysql-5.1.28 ndb-6.3.18 OS:Any
Assigned to: Tomas Ulin CPU Architecture:Any
Tags: regression

[27 Oct 2008 14:09] Bogdan Kecman
Description:
mysqldump generated from mysql-5.1.28 ndb-6.3.18 cannot be restored to mysql-5.1.28 ndb-6.3.18 (it can be restored to previous version of MySQL Cluster)

How to repeat:
start mysql cluster (simple 2 data nodes, 1mgm node, 1sql node, all on single box)

mysql> use test;
mysql> create table t1 (f1 int auto_increment primary key, f2 int, f3 int) engine=ndbcluster;
mysql> insert into t1 (f2, f3) values (2,3);
mysql> insert into t1 (f2, f3) select f3, f2 from t1;
mysql> insert into t1 (f2, f3) select f3, f2 from t1;
mysql> insert into t1 (f2, f3) select f3, f2 from t1;
mysql> insert into t1 (f2, f3) select f3, f2 from t1;
mysql> quit;

shell> mysqldump -uroot > delete.sqldump
shell> mysql -uroot test < delete.sqldump

ERROR 1192 (HY000) at line 38: Can't execute the given command because you have active locked tables or an active transaction

The line dump file:
...
37: LOCK TABLES `t1` WRITE;
38: /*!40000 ALTER TABLE `t1` DISABLE KEYS */;
39: INSERT INTO `t1` VALUES (....
...

Suggested fix:
.
[27 Oct 2008 15:09] Tomas Ulin
Unfortunately all our regression testing of mysqldump on cluster uses the:

--compact 

switch.  And then this issue does not come up.

You can use the --compact switch as a workaround.

Another workaround is to use --add-locks=0, the locks in the dump are not functional for MySQL Cluster anyways.

BR,

Tomas
[29 Oct 2008 14:08] 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/57319

2711 Tomas Ulin	2008-10-29
      Bug#40346 - correction for embedded
[29 Oct 2008 14:09] Bugs System
Pushed into 5.1.29-ndb-6.2.17  (revid:tomas.ulin@sun.com-20081029140735-3a1xyu8x7a1e7pcr) (version source revid:tomas.ulin@sun.com-20081029140735-3a1xyu8x7a1e7pcr) (pib:5)
[29 Oct 2008 14:14] Bugs System
Pushed into 5.1.29-ndb-6.3.19  (revid:tomas.ulin@sun.com-20081029140735-3a1xyu8x7a1e7pcr) (version source revid:tomas.ulin@sun.com-20081029141228-dnku4ds3glbvru7y) (pib:5)
[29 Oct 2008 14:15] Tomas Ulin
fixed in upcoming 6.2.17 and 6.3.19
[1 Nov 2008 9:44] Bugs System
Pushed into 5.1.29-ndb-6.4.0  (revid:tomas.ulin@sun.com-20081029140735-3a1xyu8x7a1e7pcr) (version source revid:jonas@mysql.com-20081101082305-qx5a1bj0z7i8ueys) (pib:5)
[2 Nov 2008 8:57] Tomas Ulin
original patch was given the wrong bug#40246

the patch here correct the original patch
[2 Nov 2008 22:12] Jon Stephens
Original patch is here: http://lists.mysql.com/commits/57308
[2 Nov 2008 22:17] Jon Stephens
Documented bug fix in the NDB-6,2,17 and NDB-6.3.19 changelogs as follows:

        Restoring a MySQL Cluster from a dump made using mysqldump failed due to
        a spurious error: Can't execute the given command because you have active
        locked tables or an active transaction.
[12 Dec 2008 23:27] Bugs System
Pushed into 6.0.9-alpha  (revid:tomas.ulin@sun.com-20081029140735-3a1xyu8x7a1e7pcr) (version source revid:tomas.ulin@sun.com-20081209185954-9svcixh2p5hsfi6w) (pib:5)