Bug #2103 "Lost connection to MySQL server during query" on UPDATE
Submitted: 12 Dec 2003 3:28 Modified: 12 Dec 2003 9:37
Reporter: Andreas Granstedt Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server Severity:S2 (Serious)
Version:4.0.13 OS:Linux (Linux/Debian)
Assigned to: Sinisa Milivojevic

[12 Dec 2003 3:28] Andreas Granstedt
Description:
When runnning the attached test case, the result is "Lost connection to MySQL server during query" 

I think there's something to do with the WHERE clause below:
... UPDATE <table1>, <table2> SET <table1>.<field of type string> = '' WHERE '' <> '' ....

Attached a test case!

How to repeat:
CREATE TABLE client (
  id int(11) NOT NULL auto_increment,
  name varchar(100) NOT NULL default '',
  address varchar(255) default NULL,
  zipCode varchar(20) default NULL,
  state varchar(50) default NULL,
  phone varchar(30) default NULL,
  fax varchar(30) default NULL,
  www varchar(100) default NULL,
  notes text,
  parent_id int(11) default NULL,
  user_id int(11) default NULL,
  regDate date NOT NULL default '0000-00-00',
  regTime time NOT NULL default '00:00:00',
  regBy int(11) NOT NULL default '0',
  active int(11) NOT NULL default '1',
  par_id int(11) default NULL,
  PRIMARY KEY  (id),
  KEY user_id (user_id),
  KEY regBy (regBy)
) TYPE=MyISAM;

CREATE TABLE client_contact (
  id int(11) NOT NULL auto_increment,
  name varchar(50) NOT NULL default '',
  phone varchar(30) default NULL,
  cellPhone varchar(30) default NULL,
  email varchar(50) default NULL,
  title varchar(50) default NULL,
  notes text,
  client_id int(11) NOT NULL default '0',
  regDate date NOT NULL default '0000-00-00',
  regTime time NOT NULL default '00:00:00',
  par_id int(11) default NULL,
  active int(11) NOT NULL default '1',
  PRIMARY KEY  (id),
  KEY client_id (client_id)
) TYPE=MyISAM;

UPDATE client, client_contact SET client.phone = '' WHERE '' <> '' AND client.name = 'Testforetaget' AND client_contact.name = 'Person A' AND client_contact.client_id = client.id;
[12 Dec 2003 7:03] Dean Ellis
Verified against 4.0.17/Linux.  Thank you.

mysqld crashes, stack dump:

0x80fee03 handle_segfault + 645
0x40167d69 _end + 937402465
0x813f41d _ZN12multi_update10do_updatesEb + 73
0x813f973 _ZN12multi_update8send_eofEv + 679
0x812f054 _Z16return_zero_rowsP4JOINP13select_resultP13st_table_listR4ListI4ItemEbjPKcPS6_P9Procedure + 300
0x8129e27 _Z12mysql_selectP3THDP13st_table_listR4ListI4ItemEPS4_P8st_orderS9_S7_S9_mP13select_result + 1287
0x813e45c _Z18mysql_multi_updateP3THDP13st_table_listP4ListI4ItemES6_PS4_m15enum_duplicates + 350
0x810c837 _Z21mysql_execute_commandv + 3901
0x81107cc _Z11mysql_parseP3THDPcj + 334
0x810ac8c _Z16dispatch_command19enum_server_commandP3THDPcj + 1168
0x810a7b1 _Z10do_commandP3THD + 125
0x810a06b handle_one_connection + 855
0x40162dc7 _end + 937382079
0x403a9a2a _end + 939769122
[12 Dec 2003 9:37] Sinisa Milivojevic
Thank you for your bug report. This issue has been fixed in the latest
development tree for that product. You can find more information about
accessing our development trees at 
    http://www.mysql.com/doc/en/Installing_source_tree.html

A fix will be available in 4.0.17