diff options
author | Elena Stepanova <elenst@ubuntu11.home> | 2012-09-03 22:01:52 +0400 |
---|---|---|
committer | Elena Stepanova <elenst@ubuntu11.home> | 2012-09-03 22:01:52 +0400 |
commit | dab998d0e155edbd38b892eaa1478a9f4a0a85b1 (patch) | |
tree | f361eadd9961b3d5352460eaf3ae2a425d15b7a6 /mysql-test/t/mdev-504.test | |
parent | cfde11fc4f02e701b856311769d70ccc47d16539 (diff) | |
download | mariadb-git-dab998d0e155edbd38b892eaa1478a9f4a0a85b1.tar.gz |
Preliminary test case for MDEV-504 in order to reproduce the problem
Diffstat (limited to 'mysql-test/t/mdev-504.test')
-rw-r--r-- | mysql-test/t/mdev-504.test | 75 |
1 files changed, 75 insertions, 0 deletions
diff --git a/mysql-test/t/mdev-504.test b/mysql-test/t/mdev-504.test new file mode 100644 index 00000000000..5193581cc47 --- /dev/null +++ b/mysql-test/t/mdev-504.test @@ -0,0 +1,75 @@ +CREATE TABLE A ( + pk INTEGER AUTO_INCREMENT PRIMARY KEY, + fdate DATE +) ENGINE=MyISAM; + +--delimiter | + +CREATE PROCEDURE p_analyze() +BEGIN + DECLARE attempts INTEGER DEFAULT 100; + wl_loop: WHILE attempts > 0 DO + ANALYZE TABLE A; + SET attempts = attempts - 1; + END WHILE wl_loop; +END | + +CREATE FUNCTION rnd3() RETURNS INT +BEGIN + RETURN ROUND(3 * RAND() + 0.5); +END | + +--delimiter ; + +SET GLOBAL use_stat_tables = PREFERABLY; + +--let $trial = 100 + +--disable_query_log +--disable_result_log +--disable_warnings +while ($trial) +{ + + --connect (con1,localhost,root,,) + --send CALL p_analyze() + + --connect (con2,localhost,root,,) + --send CALL p_analyze() + + --let $run = 100 + + while ($run) + { + --connect (con3,localhost,root,,) + + let $query = `SELECT CASE rnd3() + WHEN 1 THEN 'INSERT INTO A (pk) VALUES (NULL)' + WHEN 2 THEN 'DELETE FROM A LIMIT 1' + ELSE 'UPDATE A SET fdate = 2 LIMIT 1' END`; + --eval $query + --disconnect con3 + --dec $run + } + + --connection con2 + --reap + --disconnect con2 + --connection con1 + --reap + --disconnect con1 + + --dec $trial +} + +--enable_query_log +--enable_result_log +--enable_warnings + +# Cleanup +--connection default +DROP TABLE A; +DROP PROCEDURE p_analyze; +DROP FUNCTION rnd3; +SET GLOBAL use_stat_tables = DEFAULT; + |