Commit 987142e4 authored by vasil's avatar vasil

branches/5.1:

In innodb_bug38231.test: replace the fragile sleep 0.2 that depends on timing
with a more robust condition which waits for the TRUNCATE and LOCK commands
to appear in information_schema.processlist. This could also break if there
are other sessions executing the same SQL commands, but there are none during
the execution of the mysql test.
parent ddf7dd09
......@@ -37,9 +37,20 @@ LOCK TABLE bug38231 WRITE;
TRUNCATE TABLE bug38231;
-- connection con1
# give time to TRUNCATE and others to be executed; without sleep, sometimes
# UNLOCK executes before TRUNCATE
-- sleep 0.2
# Wait for TRUNCATE and the other two LOCKs to be executed; without this,
# sometimes UNLOCK executes before them. We assume there are no other
# sessions executing at the same time with the same SQL commands.
let $wait_condition =
SELECT COUNT(*) = 1 FROM information_schema.processlist
WHERE info = 'TRUNCATE TABLE bug38231';
-- source include/wait_condition.inc
let $wait_condition =
SELECT COUNT(*) = 2 FROM information_schema.processlist
WHERE info = 'LOCK TABLE bug38231 WRITE';
-- source include/wait_condition.inc
# the above enables query log, re-disable it
-- disable_query_log
# this crashes the server if the bug is present
UNLOCK TABLES;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment