Bug #47865 SHOW CREATE TABLE does not show the current auto_increment number for ndb tables
Submitted: 6 Oct 2009 15:34 Modified: 16 Oct 2009 5:45
Reporter: Andrew Hutchings Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Cluster: Cluster (NDB) storage engine Severity:S3 (Non-critical)
Version:6.3.26 OS:Any
Assigned to: Martin Skold CPU Architecture:Any

[6 Oct 2009 15:34] Andrew Hutchings
Description:
When running a "SHOW CREATE TABLE" command on a cluster table the result does not include the current auto_increment count.  This can be useful with mysqldump.

How to repeat:
mysql> create table t1 (a int primary key auto_increment, b int);
Query OK, 0 rows affected (0.03 sec)

mysql> create table t2 (a int primary key auto_increment, b int) engine=ndb;
Query OK, 0 rows affected (0.75 sec)

mysql> insert into t1 values (null,1),(null,2),(null,3);
Query OK, 3 rows affected (0.00 sec)
Records: 3  Duplicates: 0  Warnings: 0

mysql> insert into t2 values (null,1),(null,2),(null,3);
Query OK, 3 rows affected (0.01 sec)
Records: 3  Duplicates: 0  Warnings: 0

mysql> show create table t1\G
*************************** 1. row ***************************
       Table: t1
Create Table: CREATE TABLE `t1` (
  `a` int(11) NOT NULL AUTO_INCREMENT,
  `b` int(11) DEFAULT NULL,
  PRIMARY KEY (`a`)
) ENGINE=MyISAM AUTO_INCREMENT=4 DEFAULT CHARSET=latin1
1 row in set (0.00 sec)

mysql> show create table t2\G
*************************** 1. row ***************************
       Table: t2
Create Table: CREATE TABLE `t2` (
  `a` int(11) NOT NULL AUTO_INCREMENT,
  `b` int(11) DEFAULT NULL,
  PRIMARY KEY (`a`)
) ENGINE=ndbcluster DEFAULT CHARSET=latin1
1 row in set (0.00 sec)
[7 Oct 2009 21:27] 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/86065

3016 Martin Skold	2009-10-07
      Bug#47865  SHOW CREATE TABLE does not show the current auto_increment number for ndb tables: reading auto_increment value in ha_ndbcluster::update_create_info
      modified:
        sql/ha_ndbcluster.cc
[8 Oct 2009 9:47] 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/86113

3016 Martin Skold	2009-10-08
      Bug#47865  SHOW CREATE TABLE does not show the current auto_increment number for ndb tables: reading auto_increment value in ha_ndbcluster::update_create_info
      modified:
        mysql-test/suite/ndb/r/ndb_alter_table_backup.result
        sql/ha_ndbcluster.cc
[8 Oct 2009 9:58] 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/86116

3017 Martin Skold	2009-10-08
      Bug#47865 SHOW CREATE TABLE does not show the current auto_increment number for ndb tables: added test case
      modified:
        mysql-test/suite/ndb/r/ndb_auto_increment.result
        mysql-test/suite/ndb/t/ndb_auto_increment.test
[14 Oct 2009 14:11] 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/86832

3104 Martin Skold	2009-10-14 [merge]
      Merge
      modified:
        mysql-test/suite/ndb/r/ndb_alter_table_backup.result
        mysql-test/suite/ndb/r/ndb_auto_increment.result
        mysql-test/suite/ndb/r/ndb_insert.result
        mysql-test/suite/ndb/t/ndb_auto_increment.test
        mysql-test/suite/ndb/t/ndb_insert.test
        sql/ha_ndbcluster.cc
[15 Oct 2009 12:58] 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/86978

3124 Martin Skold	2009-10-15 [merge]
      Merge
      modified:
        mysql-test/suite/ndb/r/ndb_alter_table_backup.result
        mysql-test/suite/ndb/r/ndb_auto_increment.result
        mysql-test/suite/ndb/r/ndb_insert.result
        mysql-test/suite/ndb/r/ndb_update.result
        mysql-test/suite/ndb/t/ndb_auto_increment.test
        mysql-test/suite/ndb/t/ndb_insert.test
        mysql-test/suite/ndb/t/ndb_update.test
        sql/ha_ndbcluster.cc
        sql/sql_update.cc
[15 Oct 2009 14:02] 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/86985

3080 Martin Skold	2009-10-15 [merge]
      Merge
      modified:
        mysql-test/suite/ndb/r/ndb_alter_table_backup.result
        mysql-test/suite/ndb/r/ndb_auto_increment.result
        mysql-test/suite/ndb/r/ndb_insert.result
        mysql-test/suite/ndb/r/ndb_update.result
        mysql-test/suite/ndb/t/ndb_auto_increment.test
        mysql-test/suite/ndb/t/ndb_insert.test
        mysql-test/suite/ndb/t/ndb_update.test
        sql/ha_ndbcluster.cc
        sql/sql_update.cc
[15 Oct 2009 14:03] Bugs System
Pushed into 5.1.39-ndb-7.1.0 (revid:martin.skold@mysql.com-20091015140324-53ll4ja07nf7f72q) (version source revid:martin.skold@mysql.com-20091015140324-53ll4ja07nf7f72q) (merge vers: 5.1.39-ndb-7.1.0) (pib:13)
[15 Oct 2009 14:08] Bugs System
Pushed into 5.1.39-ndb-7.0.9 (revid:martin.skold@mysql.com-20091015140912-ick0kiktabyhzkjh) (version source revid:martin.skold@mysql.com-20091015125902-uc7afycq0fxb1nvl) (merge vers: 5.1.39-ndb-7.0.9) (pib:13)
[15 Oct 2009 14:12] Bugs System
Pushed into 5.1.39-ndb-6.3.28 (revid:martin.skold@mysql.com-20091015141245-p900c5li04ydixyj) (version source revid:martin.skold@mysql.com-20091014141228-gdre1tljpuq8r910) (merge vers: 5.1.39-ndb-6.3.28) (pib:13)
[15 Oct 2009 20:36] Bugs System
Pushed into 5.1.39-ndb-6.2.19 (revid:martin.skold@mysql.com-20091015154556-3ezlvcu0fzjeu8dd) (version source revid:martin.skold@mysql.com-20091008095857-70mlq2hl18qszz7l) (merge vers: 5.1.39-ndb-6.2.19) (pib:13)
[16 Oct 2009 5:45] Jon Stephens
Documented bugfix in the NDB-6.2.19, 6.3.28, and 7.0.9 changelogs, as follows:

        SHOW CREATE TABLE did not show the AUTO_INCREMENT value for NDB
        tables having AUTO_INCREMENT columns.

Closed.