Bug #9571 Primary key creation causes server crash
Submitted: 1 Apr 2005 19:21 Modified: 11 Apr 2005 2:26
Reporter: philip antoniades Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server Severity:S1 (Critical)
Version:5.0.3 OS:Linux (Linux)
Assigned to: Ramil Kalimullin CPU Architecture:Any

[1 Apr 2005 19:21] philip antoniades
Description:
Something about some tables makes them die when you add a PK. I have repeated this on customer system (Mandrake 9.2) with both mysql-5.0.3-standard and from bk source (pulled 4/1) and on my system (RedHat FC 3) with mysql-5.0.3-standard. Stack trace from source build:

0x817b94e handle_segfault + 542
0x4002b4ec _end + 934314200
0x8163917 _ZN9Field_bit5storeEPKcjP15charset_info_st + 487
0x80f9d02 _ZN11Item_string13save_in_fieldEP5Fieldb + 66
0x820c705 _Z14make_empty_reci7db_typejR4ListI12create_fieldEjj + 741
0x820b497 _Z16mysql_create_frmP3THDPcP24st_ha_create_informationR4ListI12create_fieldEjP6st_keyP7handler + 887
0x820b605 _Z16rea_create_tableP3THDPcP24st_ha_create_informationR4ListI12create_fieldEjP6st_key + 37
0x8238343 _Z18mysql_create_tableP3THDPKcS2_P24st_ha_create_informationR4ListI12create_fieldERS5_I3KeyEbj + 819

How to repeat:
CREATE TABLE `agt` (   `guid` char(16) NOT NULL,   `id` smallint(6) NOT NULL,   `name` char(16) NOT NULL,   `agt_type` smallint(6) NOT NULL,   `super` bit(1) NOT NULL,   `auto_logout` bit(1) NOT NULL,   `auto_ans` bit(1) NOT NULL,   `start_login` datetime NOT NULL,   `end_login` datetime default NULL );

alter table agt add constraint pk_agt primary key (guid);
[1 Apr 2005 19:28] MySQL Verification Team
Verified on 5.0.4 BK:

mysql> alter table agt add constraint pk_agt primary key (guid);
ERROR 2013 (HY000): Lost connection to MySQL server during query
mysql>
[5 Apr 2005 8:40] 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/internals/23653
[5 Apr 2005 9:46] Ramil Kalimullin
Fixed in 5.0.4
[11 Apr 2005 2:26] Paul DuBois
Noted in 5.0.4 changelog.