Skip to content

Commit

Permalink
MDEV-9970 - main.sp-threads fails sporadically
Browse files Browse the repository at this point in the history
Added proper waiting for thread to enter required state. Also reduced amount of
information dumped from processlist.
  • Loading branch information
Sergey Vojtovich committed Apr 22, 2016
1 parent bd75ee7 commit 618e300
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
9 changes: 3 additions & 6 deletions mysql-test/r/sp-threads.result
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,9 @@ update t1, t2 set val= 1 where id1=id2;
call bug9486();
lock tables t2 write;
call bug9486();
show processlist;
Id User Host db Command Time State Info Progress
# root localhost test Sleep # NULL 0.000
# root localhost test Query # Waiting for table metadata lock update t1, t2 set val= 1 where id1=id2 0.000
# root localhost test Query # NULL show processlist 0.000
# root localhost test Sleep # NULL 0.000
SELECT state,info FROM information_schema.processlist WHERE id=con1root_id;
state info
Waiting for table metadata lock update t1, t2 set val= 1 where id1=id2
unlock tables;
drop procedure bug9486;
drop table t1, t2;
Expand Down
9 changes: 6 additions & 3 deletions mysql-test/t/sp-threads.test
Original file line number Diff line number Diff line change
Expand Up @@ -77,12 +77,15 @@ call bug9486();
connection con2root;
lock tables t2 write;
connection con1root;
let $con1root_id=`SELECT CONNECTION_ID()`;
send call bug9486();
connection con2root;
--sleep 2
# There should be call statement in locked state.
--replace_column 1 # 3 localhost 6 #
show processlist;
let $wait_condition=SELECT COUNT(*)=1 FROM information_schema.processlist WHERE
id=$con1root_id AND state='Waiting for table metadata lock';
--source include/wait_condition.inc
--replace_result $con1root_id con1root_id
eval SELECT state,info FROM information_schema.processlist WHERE id=$con1root_id;
unlock tables;
connection con1root;
reap;
Expand Down

0 comments on commit 618e300

Please sign in to comment.