From: Jørn Dahl-Stamnes Date: January 14 2011 9:48pm Subject: Re: Incorrect key file for table List-Archive: http://lists.mysql.com/mysql/224067 Message-Id: <201101142248.51436.sql06@dahl-stamnes.net> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable On Friday 14 January 2011 14:03, Johan De Meersman wrote: > Check your free diskspace on your temp location. About 900+ Mb free. But I don't think that a full filesystem was the problem (I don't think the= =20 mysqld server was able to fill the disk with 900 Mb in 1-2 seconds). After= =20 some debugging I found that it was an error in the SQL statment: mysql> describe SELECT images.* FROM images, albums, accesses WHERE=20 images.IMAGE_CATEGORY_ID=3D22 AND albums.ACCESS_ID=3Daccesses.ID; +----+-------------+----------+-------+---------------+-------------+------= =2D--+-----------------------+------+--------------------------------+ | id | select_type | table | type | possible_keys | key | key_l= en=20 | ref | rows | Extra | +----+-------------+----------+-------+---------------+-------------+------= =2D--+-----------------------+------+--------------------------------+ | 1 | SIMPLE | accesses | index | PRIMARY | PRIMARY | 4 = =20 | NULL | 3 | Using index | | 1 | SIMPLE | albums | ref | albums_FI_4 | albums_FI_4 | 4 = =20 | photo_dev.accesses.id | 68 | Using index | | 1 | SIMPLE | images | ALL | images_FI_2 | NULL | NULL = =20 | NULL | 9712 | Using where; Using join buffer | +----+-------------+----------+-------+---------------+-------------+------= =2D--+-----------------------+------+--------------------------------+ A join was missing. Strange that this passed the syntax check because the=20 select statment does not make sense (in the application). It should containt a "AND images.ALBUM_ID=3Dalbums.ID'. When I fixed this, = it=20 worked :) Thanx anyway. =2D-=20 J=F8rn Dahl-Stamnes homepage: http://www.dahl-stamnes.net/dahls/