Bug #4984 UPDATE crashes with InnoDB
Submitted: 10 Aug 2004 22:51 Modified: 17 Aug 2004 1:14
Reporter: Georg Richter Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server Severity:S1 (Critical)
Version:5.0.2 OS:Linux (Linux Suse 9.1)
Assigned to: Sergey Petrunya CPU Architecture:Any

[10 Aug 2004 22:51] Georg Richter
Description:
Following update crashes server (works ok with MyISAM) 

How to repeat:
CREATE TABLE TVERM ( RUNID varchar(22) character set latin1 collate latin1_bin NOT NULL default 
'', SUBMITNR varchar(5) character set latin1 collate latin1_bin NOT NULL default '00000', ORDERNR 
char(1) character set latin1 collate latin1_bin NOT NULL default '0', PROGRAMM varchar(8) 
character set latin1 collate latin1_bin NOT NULL default '', TESTID varchar(4) character set latin1 
collate latin1_bin NOT NULL default '', UCCHECK char(1) character set latin1 collate latin1_bin NOT 
NULL default '', ETEXT varchar(80) character set latin1 collate latin1_bin NOT NULL default '', 
ETEXT_TYPE char(1) character set latin1 collate latin1_bin NOT NULL default '', INFO char(1) 
character set latin1 collate latin1_bin NOT NULL default '', SEVERITY tinyint(3) unsigned NOT NULL 
default '0', TADIRFLAG char(1) character set latin1 collate latin1_bin NOT NULL default '', PRIMARY 
KEY  (RUNID,SUBMITNR,ORDERNR,PROGRAMM,TESTID,UCCHECK), KEY `TVERM~KEY` 
(PROGRAMM,TESTID,UCCHECK)) ENGINE=InnoDB DEFAULT CHARSET=latin1; 
 
UPDATE `TVERM` SET `ETEXT` = '', `ETEXT_TYPE`='', `INFO`='', `SEVERITY`='', `TADIRFLAG`='' 
WHERE `RUNID`= '' AND `SUBMITNR`= '' AND `ORDERNR`='' AND `PROGRAMM`='' AND `TESTID`='' 
AND `UCCHECK`=''; 

Suggested fix:
[11 Aug 2004 6:06] Georg Richter
Stacktrace: 
0x816e08f handle_segfault + 459 
0xffffe420 _end + -139622320 
(nil) 
0x400dffe3 _end + 935044115 
0x8200cb1 QUICK_RANGE_SELECT::range_end() + 129 
0x8200f70 QUICK_RANGE_SELECT::~QUICK_RANGE_SELECT() + 90 
0x8201ff9 QUICK_ROR_INTERSECT_SELECT::~QUICK_ROR_INTERSECT_SELECT() + 101 
0x8200845 SQL_SELECT::cleanup() + 25 
0x82008a9 SQL_SELECT::~SQL_SELECT() + 17 
0x81d9c47 mysql_update(THD*, st_table_list*, List<Item>&, List<Item>&, Item*, unsigned int, 
st_order*, unsigned long, enum_duplicates) + 3531 
0x81861a8 mysql_execute_command(THD*) + 9870 
0x818a488 mysql_parse(THD*, char*, unsigned int) + 350 
0x818289f dispatch_command(enum_server_command, THD*, char*, unsigned int) + 1797 
0x818218e do_command(THD*) + 538 
0x8181602 handle_one_connection + 628 
0x4003a9dd _end + 934366733 
0x40176ffa _end + 935662634
[11 Aug 2004 11:57] Georg Richter
changed category
assigned to Sergey P.
[11 Aug 2004 15:03] Sergey Petrunya
ChangeSet@1.1719, 2004-08-11 16:40:46+04:00, sergefp@mysql.com
  Fix and testcase for BUG#4984
   The crash is eliminated but still it is weird/inefficent that ROR-intersection is used when performing updates in empty table.
[13 Aug 2004 3:15] Sergey Petrunya
Another fix for a similar problem.
[13 Aug 2004 3:16] Sergey Petrunya
ChangeSet@1.1720, 2004-08-13 05:12:56+04:00, sergefp@mysql.com
  Fixed another bug#4984-type problem. This probably isn't the last fix for this bug.
[17 Aug 2004 1:14] Sergey Petrunya
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
    http://www.mysql.com/doc/en/Installing_source_tree.html