diff options
author | unknown <ramil/ram@mysql.com/myoffice.izhnet.ru> | 2006-10-31 10:21:18 +0400 |
---|---|---|
committer | unknown <ramil/ram@mysql.com/myoffice.izhnet.ru> | 2006-10-31 10:21:18 +0400 |
commit | dfdb972e034c054c21630f710bb579fb4b5247ed (patch) | |
tree | 7d28d340608050b90f790409a16dec712073c8ec /mysql-test | |
parent | d2c90fcb8ecee24d68df83c83a70c0a8b8ab77c8 (diff) | |
parent | 9711d72205771130700a2af9b66183a0c75cdc15 (diff) | |
download | mariadb-git-dfdb972e034c054c21630f710bb579fb4b5247ed.tar.gz |
Merge rkalimullin@bk-internal.mysql.com:/home/bk/mysql-4.1-maint
into mysql.com:/usr/home/ram/work/bug23412/my41-bug23412
Diffstat (limited to 'mysql-test')
-rw-r--r-- | mysql-test/include/wait_for_query_to_suceed.inc | 25 | ||||
-rw-r--r-- | mysql-test/t/rename.test | 12 |
2 files changed, 33 insertions, 4 deletions
diff --git a/mysql-test/include/wait_for_query_to_suceed.inc b/mysql-test/include/wait_for_query_to_suceed.inc new file mode 100644 index 00000000000..6ac1144620e --- /dev/null +++ b/mysql-test/include/wait_for_query_to_suceed.inc @@ -0,0 +1,25 @@ +# +# Run a query over and over until it suceeds ot timeout occurs +# + + +let $counter= 100; + +disable_abort_on_error; +disable_query_log; +disable_result_log; +eval $query; +while ($mysql_errno) +{ + eval $query; + sleep 0.1; + dec $counter; + + if (!$counter) + { + die("Waited too long for query to suceed"); + } +} +enable_abort_on_error; +enable_query_log; +enable_result_log; diff --git a/mysql-test/t/rename.test b/mysql-test/t/rename.test index 5caecef176e..b0fb60c0ee4 100644 --- a/mysql-test/t/rename.test +++ b/mysql-test/t/rename.test @@ -43,8 +43,8 @@ select * from t3; drop table if exists t1,t2,t3,t4; # -# Test-case for Bug #2397 RENAME TABLES is not blocked by -# FLUSH TABLES WITH READ LOCK +# Bug #2397 RENAME TABLES is not blocked by +# FLUSH TABLES WITH READ LOCK # connect (con1,localhost,root,,); @@ -58,10 +58,14 @@ FLUSH TABLES WITH READ LOCK; connection con1; send RENAME TABLE t1 TO t2, t3 to t4; connection con2; -sleep 1; show tables; UNLOCK TABLES; -sleep 1; + +# Wait for the the tables to be renamed +# i.e the query below succeds +let $query= select * from t2, t4; +source include/wait_for_query_to_suceed.inc; + show tables; drop table t2, t4; |