Bug #18864 TRUNCATE TABLE doesn't reset AUTO_INCREMENT value on ndb table
Submitted: 6 Apr 2006 18:35 Modified: 13 Jun 2006 23:43
Reporter: Sergey Vojtovich Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Cluster: Cluster (NDB) storage engine Severity:S3 (Non-critical)
Version: OS:Linux (Debian)
Assigned to: Martin Skold CPU Architecture:Any

[6 Apr 2006 18:35] Sergey Vojtovich
Description:
MySQL manual says:
For other storage engines, TRUNCATE TABLE  differs from DELETE
in the following ways in MySQL 5.0:
...
* The table handler does not remember the last used AUTO_INCREMENT
  value, but starts counting from the beginning. This is true
  even for MyISAM and InnoDB, which normally do not reuse sequence
  values.

However TRUNCATE TABLE doesn't reset AUTO_INCREMENT value on ndb table.
So I assume it is either ndb bug or documentation bug.

How to repeat:
create table t2(a int unsigned not null primary key auto_increment) engine=ndbcluster;
insert into t2 values(null);
select * from t2;
a
1
truncate table t2;
insert into t2 values(null);
select * from t2;
a
2
[2 Jun 2006 5:31] 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/7197
[2 Jun 2006 7:44] 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/7203
[13 Jun 2006 23:43] Jon Stephens
Thank you for your bug report. This issue has been committed to our
source repository of that product and will be incorporated into the
next release.

If necessary, you can access the source repository and build the latest
available version, including the bugfix, yourself. More information 
about accessing the source trees is available at
    http://www.mysql.com/doc/en/Installing_source_tree.html

Additional info:

Documented bugfix in 4.1.21/5.0.23/5.1.12 changelogs. Closed.