Hi,

I'm making some tests with mysql and I got the errors below when I
run these selects:

SELECT id, COUNT(*) FROM error_test WHERE info = 1 GROUP BY id LIMIT 10;
ERROR 1034: Incorrect key file for table: '#sql17adb_41f_4'. Try to
repair it

SELECT id, COUNT(*) FROM error_test WHERE info = 1 GROUP BY id HAVING
COUNT(*) > 8;
ERROR 1030: Got error 12 from table handler

If I run the same queries without the where clause it's ok.

I don't know if it's a problem with mysql or it's something I'm
missing on configuration parameters.

Below, I provide some information that can be useful to reproduce the
problem.

TIA,
Hugo


How to repeat: run the sql script generated by the perl code below

--begin--
#!/usr/bin/perl

open(DESC, "> error_test.sql");
print DESC<<FIM;
CREATE TABLE error_test (
  id int(11) NOT NULL default '0',
  info int(11) NOT NULL default '0',
  KEY error_test_id (id)
) TYPE=MyISAM;
FIM
    
for ($i = 1; $i < 500000; $i++) {
    $id = int(rand 300000);
    print DESC "INSERT INTO error_test VALUES (".$id.",1);\n";
}

print DESC "SELECT id, COUNT(*) FROM error_test GROUP BY id LIMIT 10;\n";
print DESC "SELECT id, COUNT(*) FROM error_test GROUP BY id HAVING COUNT(*) > 8;\n";
print DESC "SELECT id, COUNT(*) FROM error_test WHERE info = 1 GROUP BY id LIMIT 
10;\n";
print DESC "SELECT id, COUNT(*) FROM error_test WHERE info = 1 GROUP BY id HAVING 
COUNT(*) > 8;\n";

close(DESC);
--end--

Release: mysql-3.23.42, compiled from source
 CFLAGS="-O3" CXX=gcc CXXFLAGS="-O3 -felide-constructors
 -fno-exceptions -fno-rtti" ./configure --prefix=/usr/local/mysql
 --with-berkeley-db --with-innodb --without-debug --with-libwrap
 --with-mit-threads=no --without-readline --enable-assembler
 --with-mysqld-ldflags=-all-static --enable-thread-safe-client

Environment: FreeBSD 4.3-RELEASE, Dual PIII Xeon 550MHz, 1GB RAM

mysqld started with "bin/safe_mysqld -u mysql -O key_buffer=64M -O
table_cache=256 -O sort_buffer=4M -O record_buffer=1M
--log-slow-queries"


---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to