Bug #14945 | Truncate table doesn't reset the auto_increment counter | ||
---|---|---|---|
Submitted: | 15 Nov 2005 12:34 | Modified: | 8 Apr 2006 13:24 |
Reporter: | Arnold Greving | Email Updates: | |
Status: | Closed | Impact on me: | |
Category: | MySQL Server: Stored Routines | Severity: | S2 (Serious) |
Version: | 5.0.15/5.0.17 BK | OS: | Linux (Debian sid) |
Assigned to: | Sergey Vojtovich | CPU Architecture: | Any |
[15 Nov 2005 12:34]
Arnold Greving
[15 Nov 2005 12:53]
MySQL Verification Team
Thank you for the bug report.
[18 Jan 2006 9:34]
Giuseppe Maxia
Verified on MySQL 5.0.18. It affects MyISAM tables, but not InnoDB . How to repeat: create table test1 (id int not null auto_increment primary key) engine=MyISAM; create procedure test_truncate() deterministic truncate test1; insert into test1 values (null); select * from test1; +----+ | id | +----+ | 1 | +----+ call test_truncate(); insert into test1 values (null); select * from test1; +----+ | id | +----+ | 2 | +----+ truncate test1; insert into test1 values (null); select * from test1; +----+ | id | +----+ | 1 | +----+ Regards Giuseppe Maxia
[8 Mar 2006 8:57]
Magnus BlÄudd
Duplicate of bug#11932? Or at least caused by same problem.
[30 Mar 2006 7:15]
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/4312
[6 Apr 2006 10:19]
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/4549
[6 Apr 2006 18:40]
Sergey Vojtovich
Fixed in 5.0.21, 5.1.9. Please note that this problem still persists for ndb tables and will be tracked by BUG#18864. Actually ordinary TRUNCATE TABLE doesn't reset AUTO_INCREMENT value on ndb table.
[8 Apr 2006 13:24]
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 5.0.21 and 5.1.9 changelogs. Closed.