Bug #47274 | assert in open_table on CREATE TABLE <already existing> | ||
---|---|---|---|
Submitted: | 11 Sep 2009 16:43 | Modified: | 18 Dec 2009 13:23 |
Reporter: | Matthias Leich | Email Updates: | |
Status: | Closed | Impact on me: | |
Category: | MySQL Server: Locking | Severity: | S3 (Non-critical) |
Version: | 5.4 | OS: | Any |
Assigned to: | Jon Olav Hauglid | CPU Architecture: | Any |
Tags: | locking |
[11 Sep 2009 16:43]
Matthias Leich
[14 Sep 2009 13:34]
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/83191 2817 Jon Olav Hauglid 2009-09-14 Bug #47274 assert in open_table on CREATE TABLE <already existing> The problem was an assertion during execution of CREATE TABLES. This assertion would occur if INSERT DELAYED or REPLACE DELAYED were used to update a table containing an AUTO_INCREMENT column and if the inserted row had a user-supplied value for that column. Any CREATE TABLE statement (including CREATE TABLE SELECT and CREATE TABLE LIKE) trying to create the same table and which followed the INSERT/REPLACED would cause the assertion. The problem was only noticeable on debug builds of the server and not present in the mysql-5.1 tree. The cause of the problem was that the code for delayed insert did not properly reset the TABLE->auto_increment_if_null flag after insert. The flag is used to indicate that a non-null value of an auto_increment field has been provided by the user or retrieved from a current record. Open_tables() contains an assertion that tests this flag, and this was triggered by CREATE TABLE. This patch fixes the problem by resetting the auto_increment_if_null field to FALSE once INSERT/REPLACE DELAYED has updated the table, similar to what is done already for regular INSERT statements. Test case added to delayed.test.
[25 Sep 2009 11:03]
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/84614 2841 Jon Olav Hauglid 2009-09-25 Bug #47274 assert in open_table on CREATE TABLE <already existing> The problem was an assertion during execution of CREATE TABLES. This assertion would occur if INSERT DELAYED or REPLACE DELAYED were used to update a table containing an AUTO_INCREMENT column and if the inserted row had a user-supplied value for that column. Any CREATE TABLE statement (including CREATE TABLE SELECT and CREATE TABLE LIKE) trying to create the same table and which followed the INSERT/REPLACED would cause the assertion. The problem was only noticeable on debug builds of the server and not present in the mysql-5.1 tree. The cause of the problem was that the code for delayed insert did not properly reset the TABLE->auto_increment_if_null flag after insert. The flag is used to indicate that a non-null value of an auto_increment field has been provided by the user or retrieved from a current record. Open_tables() contains an assertion that tests this flag, and this was triggered by CREATE TABLE. This patch fixes the problem by resetting the auto_increment_if_null field to FALSE once INSERT/REPLACE DELAYED has updated the table, similar to what is done already for regular INSERT statements. Test case added to delayed.test.
[25 Sep 2009 11:04]
Jon Olav Hauglid
Pushed to mysql-6.0-codebase-bugfixing (version 6.0.14-alpha)
[30 Sep 2009 8:17]
Bugs System
Pushed into 6.0.14-alpha (revid:alik@sun.com-20090929093622-1mooerbh12e97zux) (version source revid:alik@sun.com-20090927203924-087s36mrs0uxepwb) (merge vers: 6.0.14-alpha) (pib:11)
[1 Oct 2009 17:28]
Paul DuBois
Noted in 6.0.14 changelog. An assertion could be raised for CREATE TABLE if there was a pending INSERT DELAYED or REPLACE DELAYED for the same table. Setting NDI pending push into 5.4.x.
[14 Oct 2009 12:52]
Jon Olav Hauglid
Pushed to mysql-next-mr-runtime (version 5.5.0)
[14 Oct 2009 17:02]
Paul DuBois
Noted in 5.5.0 changelog.
[3 Nov 2009 7:16]
Bugs System
Pushed into 6.0.14-alpha (revid:alik@sun.com-20091102151658-j9o4wgro47m5v84d) (version source revid:alik@sun.com-20091023064702-2f8jdmny61bdl94u) (merge vers: 6.0.14-alpha) (pib:13)
[4 Nov 2009 9:26]
Bugs System
Pushed into 5.1.41 (revid:joro@sun.com-20091104092152-qz96bzlf2o1japwc) (version source revid:kristofer.pettersson@sun.com-20091103162305-08l4gkeuif2ozsoj) (merge vers: 5.1.41) (pib:13)
[5 Nov 2009 1:59]
Paul DuBois
Noted in 5.1.41 changelog.
[11 Nov 2009 6:54]
Bugs System
Pushed into 6.0.14-alpha (revid:alik@sun.com-20091110093407-rw5g8dys2baqkt67) (version source revid:alik@sun.com-20091109080109-7dxapd5y5pxlu08w) (merge vers: 6.0.14-alpha) (pib:13)
[11 Nov 2009 7:02]
Bugs System
Pushed into 5.5.0-beta (revid:alik@sun.com-20091109115615-nuohp02h8mdrz8m2) (version source revid:alik@sun.com-20091105092041-sp6eyod7sdlfuj3b) (merge vers: 5.5.0-beta) (pib:13)
[12 Nov 2009 8:21]
Bugs System
Pushed into 5.5.0-beta (revid:alik@sun.com-20091110093229-0bh5hix780cyeicl) (version source revid:mikael@mysql.com-20091103113702-p61dlwc6ml6fxg18) (merge vers: 5.5.0-beta) (pib:13)
[18 Dec 2009 10:38]
Bugs System
Pushed into 5.1.41-ndb-7.1.0 (revid:jonas@mysql.com-20091218102229-64tk47xonu3dv6r6) (version source revid:jonas@mysql.com-20091218095730-26gwjidfsdw45dto) (merge vers: 5.1.41-ndb-7.1.0) (pib:15)
[18 Dec 2009 10:54]
Bugs System
Pushed into 5.1.41-ndb-6.2.19 (revid:jonas@mysql.com-20091218100224-vtzr0fahhsuhjsmt) (version source revid:jonas@mysql.com-20091217101452-qwzyaig50w74xmye) (merge vers: 5.1.41-ndb-6.2.19) (pib:15)
[18 Dec 2009 11:09]
Bugs System
Pushed into 5.1.41-ndb-6.3.31 (revid:jonas@mysql.com-20091218100616-75d9tek96o6ob6k0) (version source revid:jonas@mysql.com-20091217154335-290no45qdins5bwo) (merge vers: 5.1.41-ndb-6.3.31) (pib:15)
[18 Dec 2009 11:23]
Bugs System
Pushed into 5.1.41-ndb-7.0.11 (revid:jonas@mysql.com-20091218101303-ga32mrnr15jsa606) (version source revid:jonas@mysql.com-20091218064304-ezreonykd9f4kelk) (merge vers: 5.1.41-ndb-7.0.11) (pib:15)
[18 Dec 2009 13:23]
MC Brown
Already noted in earlier changelogs.