Bug #31137 Assertion failed: primary_key_no == -1 || primary_key_no == 0, file .\ha_innodb.
| Submitted: | 21 Sep 2007 17:21 | Modified: | 23 Jan 2008 16:00 |
|---|---|---|---|
| Reporter: | Shane Bester (Platinum Quality Contributor) | Email Updates: | |
| Status: | Closed | Impact on me: | |
| Category: | MySQL Server: General | Severity: | S2 (Serious) |
| Version: | 5.0.45, 5.1.23 | OS: | Any |
| Assigned to: | Ramil Kalimullin | CPU Architecture: | Any |
[21 Sep 2007 17:21]
Shane Bester
[21 Sep 2007 17:26]
Shane Bester
please use a debug build to test it. non-debug build didn't appear to crash
[24 Sep 2007 11:24]
Heikki Tuuri
Shane, Sunny, the assertion used to be true in old versions of MySQL. I see that the table has a unique NOT NULL key. Old versions of MySQL would promote that to the internal primary key and number it as key number 0. What has changed? Regards, Heikki
[25 Oct 2007 9:55]
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/36326 ChangeSet@1.2552, 2007-10-25 14:55:03+05:00, ramil@mysql.com +3 -0 Fix for bug #31137: Assertion failed: primary_key_no == -1 || primary_key_no == 0, file .\ha_innodb. Problem: if a partial unique key followed by a non-partial one we declare the second one as a primary key. Fix: declaring an unique key as primary, check if it's the first key. Note: I doubt we can change the order in the sort_keys() in the 5.x as some clients may depend on the current behaviour.
[26 Oct 2007 10:38]
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/36424 ChangeSet@1.2552, 2007-10-26 15:37:38+05:00, ramil@mysql.com +7 -0 Fix for bug #31137: Assertion failed: primary_key_no == -1 || primary_key_no == 0, file .\ha_innodb. Problem: if a partial unique key followed by a non-partial one we declare the second one as a primary key. Fix: sort non-partial unique keys before partial ones.
[7 Dec 2007 23:07]
Bugs System
Pushed into 6.0.5-alpha
[7 Dec 2007 23:09]
Bugs System
Pushed into 5.1.23-rc
[7 Dec 2007 23:10]
Bugs System
Pushed into 5.0.54
[23 Jan 2008 16:00]
Paul DuBois
Noted in 5.0.54, 5.1.23, 6.0.5 changelogs. MySQL declares a UNIQUE key as a PRIMARY key if it doesn't have NULL columns and is not a partial key, and the PRIMARY key must alway be the first key. However, in some cases, a non-first key could be reported as PRIMARY, leading to an assert failure by InnoDB. This is fixed by correcting the key sort order.
[3 Dec 2010 5:55]
Shane Bester
if you still see this bug symptoms refer yourself to bug 58650
Portions of this website are copyright © 2001, 2002 The PHP Group
Page generated in 0.070 sec. using MySQL 8.4.7-u6-cloud
Timestamp references displayed by the system are UTC.
Content reproduced on this site is the property of the
respective copyright holders.
It is not reviewed in advance
by Oracle and does not necessarily represent the opinion of
Oracle or any other party.