diff options
author | Michael Widenius <monty@askmonty.org> | 2013-01-10 23:40:18 +0200 |
---|---|---|
committer | Michael Widenius <monty@askmonty.org> | 2013-01-10 23:40:18 +0200 |
commit | 396f4d62c69335b8f7aefd43bbe099e8bb9e6905 (patch) | |
tree | a89563c90889e0e94cac96411bb51342204ec265 /mysql-test/t/create_delayed.test | |
parent | f6d22b3915dc930ef9d33cbfa33ed28fd6484b7f (diff) | |
download | mariadb-git-396f4d62c69335b8f7aefd43bbe099e8bb9e6905.tar.gz |
Fix for MDEV-4009: main.delayed sporadically fails with "query 'REPLACE DELAYED t1 VALUES (5)' failed: 1317: Query execution was interrupted"
- Fixed broadcast without a proper mutex
- Don't break existing locks if we are just testing if we can get the lock
mysql-test/r/create_delayed.result:
Added test case for failures with INSERT DELAYED with CREATE and DROP TABLE
mysql-test/t/create_delayed.test:
Added test case for failures with INSERT DELAYED with CREATE and DROP TABLE
sql/mdl.cc:
Don't break existing locks for timeout=0 (ie, just check if there are conflicting locks).
This fixed the bug that INSERT DELAYED didn't work properly with CREATE TABLE
sql/sql_base.cc:
One neads to hold the mutex before doing a mysql_cond_broadcast()
This fixed the bug that INSERT DELAYED didn't work properly with DROP TABLE
sql/sql_insert.cc:
Protect setting of mysys_var->current_mutex.
Diffstat (limited to 'mysql-test/t/create_delayed.test')
-rw-r--r-- | mysql-test/t/create_delayed.test | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/mysql-test/t/create_delayed.test b/mysql-test/t/create_delayed.test new file mode 100644 index 00000000000..e99886d97d1 --- /dev/null +++ b/mysql-test/t/create_delayed.test @@ -0,0 +1,34 @@ +# +# Ensure that INSERT DELAYED works with CREATE TABLE on existing table +# + +-- source include/big_test.inc + +--disable_warnings +drop table if exists t1; +--enable_warnings + +--disable_query_log +--disable_result_log + +--let $run=1000 + +--echo Starting test + +while ($run) +{ +# --echo # $run attempts left... + CREATE TABLE t1 ( f1 INTEGER AUTO_INCREMENT, PRIMARY KEY (f1)) ENGINE=MyISAM; + INSERT DELAYED t1 VALUES (4); +--error ER_TABLE_EXISTS_ERROR + CREATE TABLE t1 AS SELECT 1 AS f1; + + REPLACE DELAYED t1 VALUES (5); + DROP TABLE t1; +--dec $run +} + +--enable_query_log +--enable_result_log + +--echo # All done |