Bug #2197 index_merge query causes crash with some server, table and query parameters.
Submitted: 23 Dec 2003 9:53 Modified: 21 Nov 2004 8:27
Reporter: Sergey Petrunya Email Updates:
Status: Duplicate Impact on me:
None 
Category:MySQL Server Severity:S2 (Serious)
Version:5.0-bk OS:
Assigned to: Assigned Account CPU Architecture:Any

[23 Dec 2003 9:53] Sergey Petrunya
Description:
Server crashes on any index_merge query for some particular combinations of (#_rows retrieved, sort_buffer_size, rowid length) values.

How to repeat:
Run the following test:

create table t0
(
  key1 int not null,
  INDEX i1(key1),
);

--disable_query_log
insert into t0 values (1),(2),(3),(4),(5),(6),(7),(8);

let $1=16;
set @d=8;
while ($1)
{
  eval insert into t0 select key1+@d from t0;
  eval set @d=@d*2;
  dec $1;
}
--enable_query_log

alter table t0 add key2 int not null;
alter table t0 add key3 int not null;
update t0 set key2=key1,key3=key1;
alter table t0 add index i2(key2), add index i3(key3);

set session sort_buffer_size=2097116;

select count(*) from t0 force index(i1,i2) where key1 < 100002 or key2 =4;
[21 Nov 2004 8:27] Sergey Petrunya
The problem is related to BUG#4177, a single fix will be made for both