Bug #42106 INSERT INTO ... SELECT gives error "Incorrect key file"
Submitted: 14 Jan 2009 11:38 Modified: 21 Aug 2013 7:25
Reporter: Oli Sennhauser Email Updates:
Status: Can't repeat Impact on me:
None 
Category:MySQL Server: DML Severity:S3 (Non-critical)
Version:5.0.68 OS:IBM AIX (AIX sup-aix53 3 5 0003F7BAD300)
Assigned to: CPU Architecture:Any

[14 Jan 2009 11:38] Oli Sennhauser
Description:
When I did some other test on 5.0.68 on AIX I run into the following problem:

insert into test select null, data, null from test;
ERROR 126 (HY000): Incorrect key file for table '/tmp/#sql_47050_0.MYI'; try to repair it

I believe this is an AIX specific problem because I have never seen before on linux and I do this test quite often.

How to repeat:
This problem was consistently reproducible at will. Also restart the database did not change the behavior:

restart database
check table test;
+-----------+-------+----------+----------+
| Table     | Op    | Msg_type | Msg_text |
+-----------+-------+----------+----------+
| test.test | check | status   | OK       |
+-----------+-------+----------+----------+
1 row in set (10.50 sec)
insert into test select null, data, null from test;
ERROR 126 (HY000): Incorrect key file for table '/tmp/#sql_610fc_0.MYI'; try to repair it

Suggested fix:
no idea
[14 Jan 2009 13:21] Oli Sennhauser
I found, that it is most probably caused by this limitation:

ulimit -f
524287

But anyway: I would then expect an other error message...
[7 May 2009 18:27] Rich Roberts
Same error: ERROR 126 (HY000): Incorrect key file for table '/tmp/#sql_508c_0.MYI'; try to repair  on linux platform.
[21 Aug 2013 7:25] Erlend Dahl
We can't reproduce this on later 5.1+.