Bug #134 Server crashes when sorting with some sort parameters setting
Submitted: 7 Mar 2003 22:33 Modified: 13 Mar 2003 9:53
Reporter: Igor Babaev Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server Severity:S3 (Non-critical)
Version:4.0.x OS:Any (All)
Assigned to: Igor Babaev CPU Architecture:Any

[7 Mar 2003 22:33] Igor Babaev
Description:
A query that requires sorting with very long keys such that the sort buffer cannot contain more than 6 keys causes a crash of the server.

How to repeat:
1. Start the server with the following parameter setting:
--sort_buffer_size=32K --max_sort_length=8096

2. Run the following script by the mysql utility:

use test;

drop table if exists t;
create table t (a char(8096));
insert into t values ('Y'), ('Z'),
  ('Q'), ('R'), ('S'), ('T'), ('U'), ('V'), ('W'), ('X'),
  ('I'), ('J'), ('K'), ('L'), ('M'), ('N'), ('O'), ('P'),
  ('A'), ('B'), ('C'), ('D'), ('E'), ('F'), ('G'), ('H')
;
select left(a, 2) from t;
select left(a, 2) from t order by a; 

drop table t;