Bug #3183 UPDATE or DELETE query with index_merge OR condition can cause error or crash
Submitted: 15 Mar 2004 22:09 Modified: 16 Mar 2004 15:45
Reporter: Sergey Petrunya Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server Severity:S2 (Serious)
Version:5.0-bk OS:
Assigned to: Sergey Petrunya CPU Architecture:Any

[15 Mar 2004 22:09] Sergey Petrunya
Description:
UPDATE or DELETE query with index_merge OR condition can fail with "Got error 124 from storage engine" message or server crash.

How to repeat:
Apply the following patch to mysql-test/t/index_merge.test

===== t/index_merge.test 1.3 vs edited =====
47a48,52
> create table t1 like t0;
> insert into t1 select * from t0;
> delete from t1 where key1 < 3 or key2 > 1022;
> drop table t1;
> 

then run t/index_merge.test.

Suggested fix:
QUICK_SELECT_I::reset() function is never called for quick selects in UPDATE and DELETE queries. This is ok for range quick selects. For index_merge quick select calling get_next() without prior reset() call causes use of initialized data with error or crash.
[16 Mar 2004 15:45] 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