diff options
author | Davi Arnaut <Davi.Arnaut@Sun.COM> | 2008-10-03 08:40:45 -0300 |
---|---|---|
committer | Davi Arnaut <Davi.Arnaut@Sun.COM> | 2008-10-03 08:40:45 -0300 |
commit | 30d46cac5addbed32a0a1a1f88dcbfe39025896c (patch) | |
tree | 0e0046a22a14632751b349189e11c3189e38bfe5 /mysql-test/r/status.result | |
parent | b0e03c1311be8b39d4ce805b1075bab45b265f7e (diff) | |
download | mariadb-git-30d46cac5addbed32a0a1a1f88dcbfe39025896c.tar.gz |
Bug#37481: status.test fails randomly
The problem was that the test was trying to obtain a lock on
a table in one connection without ensuring that a insert which
was executed in another connection had released the lock on the
same table.
The solution is to add a dummy select query after the insert to
ensure that the table is unlocked and closed by the time it tries
to lock it again. This is enough to prevent test failures described
in the bug report. As an extra safety measure, concurrent inserts
are disabled.
Remove comments that calculated the Table_locks_immediate. This
value is not tested anymore and it's calculation did not reflect
the actual value.
mysql-test/r/status.result:
Update test case result.
mysql-test/t/status.test:
Issue a dummy select to ensure that tables are unlocked after a
insert and disable concurrent inserts as a extra-safety.
Diffstat (limited to 'mysql-test/r/status.result')
-rw-r--r-- | mysql-test/r/status.result | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/mysql-test/r/status.result b/mysql-test/r/status.result index 97547ff7c47..1e758ce68c7 100644 --- a/mysql-test/r/status.result +++ b/mysql-test/r/status.result @@ -1,3 +1,5 @@ +set @old_concurrent_insert= @@global.concurrent_insert; +set @@global.concurrent_insert= 0; flush status; show status like 'Table_lock%'; Variable_name Value @@ -7,22 +9,31 @@ select * from information_schema.session_status where variable_name like 'Table_ VARIABLE_NAME VARIABLE_VALUE TABLE_LOCKS_IMMEDIATE 2 TABLE_LOCKS_WAITED 0 -SET SQL_LOG_BIN=0; +# Switched to connection: con1 +set sql_log_bin=0; set @old_general_log = @@global.general_log; set global general_log = 'OFF'; drop table if exists t1; create table t1(n int) engine=myisam; insert into t1 values(1); +select 1; +1 +1 +# Switched to connection: con2 lock tables t1 read; unlock tables; lock tables t1 read; +# Switched to connection: con1 update t1 set n = 3; +# Switched to connection: con2 unlock tables; +# Switched to connection: con1 show status like 'Table_locks_waited'; Variable_name Value Table_locks_waited 1 drop table t1; set global general_log = @old_general_log; +# Switched to connection: default select 1; 1 1 @@ -198,3 +209,4 @@ ERROR 42000: SELECT command denied to user 'mysqltest_1'@'localhost' for table ' drop database db37908; drop procedure proc37908; drop function func37908; +set @@global.concurrent_insert= @old_concurrent_insert; |