Bug #10114 KEY_NOT_FOUND with temporary disk table, filesort
Submitted: 23 Apr 2005 16:28 Modified: 27 May 2005 17:12
Reporter: Dean Ellis Email Updates:
Status: Can't repeat Impact on me:
None 
Category:MySQL Server Severity:S2 (Serious)
Version:4.1.12 OS:
Assigned to: Mikael Ronström CPU Architecture:Any

[23 Apr 2005 16:28] Dean Ellis
Description:
Receiving KEY_NOT_FOUND with a particular query once it involves enough rows to use a disk-based temporary table.

Only seems to affect 4.1 (testing 4.0.25 and 5.0.5 unsuccessfully).

How to repeat:
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 ( a INT, INDEX (a) ) ENGINE=MyISAM;
INSERT INTO t1 SELECT x.a + y.a FROM ( SELECT 0 a UNION SELECT 1 UNION
SELECT 2 UNION SELECT 3 UNION SELECT 4 UNION SELECT 5 UNION SELECT 6
UNION SELECT 7 UNION SELECT 8 UNION SELECT 9 ) x, ( SELECT 0 a UNION
SELECT 10 UNION SELECT 20 UNION SELECT 30 UNION SELECT 40 UNION SELECT
50 UNION SELECT 60 UNION SELECT 70 UNION SELECT 80 ) y;
SET tmp_table_size=1024;
SELECT a, COUNT(*) b FROM t1 GROUP BY a ORDER BY b;

Suggested fix:
n/a
[27 May 2005 17:12] Mikael Ronström
Worked for both Dean and Myself in latest 4.1 build, possibly fixed by other patch?