I created a bash version of the ruby reproducer, the table has fewer fields.
It reproduces the table marked as crashed error reliably (for me), using MariaDB 5.3.6, I will try it with the latest 5.3 next
function dbs_size {
for i in {1..200}
do
run_cmd "SELECT table_schema , data_length , index_length FROM information_schema.TABLES WHERE table_schema='$DATABASE'"
done
}
function many_table_run {
for i in {1..20}
do
table_run $i &
done
}
dbs_size &
many_table_run
# produces in mysqld error log:
# 120515 11:31:23 [ERROR] mysqld: Table './test/table_5' is marked as crashed and should be repaired
# 120515 11:31:23 [ERROR] mysqld: Table 'table_5' is marked as crashed and should be repaired
I created a bash version of the ruby reproducer, the table has fewer fields.
It reproduces the table marked as crashed error reliably (for me), using MariaDB 5.3.6, I will try it with the latest 5.3 next
#!/bin/sh
HOST=localhost /usr/bin/ mysql
PORT=3306
USER=root
PASSWORD=
DATABASE=test
MYSQL_CLIENT=
function run_cmd { $PASSWORD --database= $DATABASE --exec="$1" > /dev/null
$MYSQL_CLIENT --host=$HOST --user=$USER --password=
}
function dbs_size { schema. TABLES WHERE table_schema= '$DATABASE' "
for i in {1..200}
do
run_cmd "SELECT table_schema , data_length , index_length FROM information_
done
}
function table_run {
IDX="$1"
run_cmd "CREATE TABLE table_$IDX (\`id\` int, PRIMARY KEY (\`id\`)) ENGINE=MyISAM CHARSET=latin1"
run_cmd "alter table table_$IDX disable keys"
run_cmd "alter table table_$IDX enable keys"
run_cmd "drop table table_$IDX"
}
function many_table_run {
for i in {1..20}
do
table_run $i &
done
}
dbs_size &
many_table_run
# produces in mysqld error log:
# 120515 11:31:23 [ERROR] mysqld: Table './test/table_5' is marked as crashed and should be repaired
# 120515 11:31:23 [ERROR] mysqld: Table 'table_5' is marked as crashed and should be repaired