Bug #2023 Lost connection when using UPDATE REPLACE() on invalid enum value
Submitted: 5 Dec 2003 9:43 Modified: 12 Dec 2003 10:22
Reporter: Michael Winston Email Updates:
Status: Closed Impact on me:
Category:MySQL Server: Command-line Clients Severity:S2 (Serious)
Version:4.0.16 OS:max os x 10.x
Assigned to: Bugs System CPU Architecture:Any

[5 Dec 2003 9:43] Michael Winston
I manage to get:
ERROR 2013: Lost connection to MySQL server during query
when I try to do an update on an ENUM column that contains an invalid value.  The update *must* 
contain the REPLACE function.

I'm unable to provide a backtrace because of my limited access to the server. Sorry!

How to repeat:
#create a table with an enum column
CREATE  TABLE  `test` ( `id` INT NOT  NULL  AUTO_INCREMENT ,`stuff` ENUM(  '0',  '1'  )  NOT 
NULL , PRIMARY  KEY (  `id`  ) );
# insert an illegal value into the enum
INSERT INTO `test` SET stuff = 'foobar';
#update using the replace string function
UPDATE test SET stuff = REPLACE(stuff, 'x','y');
ERROR 2013: Lost connection to MySQL server during query
[5 Dec 2003 10:00] Dean Ellis
Verified in 4.0.17/Linux.

Using REPLACE() on an ENUM column which is set to an empty string crashes mysqld.

Thank you.
[12 Dec 2003 9:39] Victor Vagin
bk commit - 4.0 tree (vva:1.1641)
[12 Dec 2003 10:22] Victor Vagin
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

Additional info:

Fix will be in 4.0.17