summaryrefslogtreecommitdiff
path: root/mysql-test/r/lock_multi.result
diff options
context:
space:
mode:
authorunknown <davi@mysql.com/endora.local>2008-01-28 10:52:41 -0200
committerunknown <davi@mysql.com/endora.local>2008-01-28 10:52:41 -0200
commit3d5e32b27d35655ab509f5567be7eeda58418052 (patch)
treeeb13b53670327ef9ba649f2f2999242d099b0310 /mysql-test/r/lock_multi.result
parent8f9e655dab1802d31be5c01ea5b5e9ccee01363c (diff)
downloadmariadb-git-3d5e32b27d35655ab509f5567be7eeda58418052.tar.gz
Bug#30331 Table_locks_waited shows inaccurate values
The problem is that the Table_locks_waited was incremented only when the lock request succeed. If a thread waiting for the lock gets killed or the lock request is aborted, the variable would not be incremented, leading to inaccurate values in the variable. The solution is to increment the Table_locks_waited whenever the lock request is queued. This reflects better the intended behavior of the variable -- show how many times a lock was waited. mysql-test/r/lock_multi.result: Add test case result for Bug#30331 mysql-test/t/lock_multi.test: Add test case for Bug#30331 mysys/thr_lock.c: Increment locks_waited whenever the thread is supposed to wait for the lock.
Diffstat (limited to 'mysql-test/r/lock_multi.result')
-rw-r--r--mysql-test/r/lock_multi.result12
1 files changed, 12 insertions, 0 deletions
diff --git a/mysql-test/r/lock_multi.result b/mysql-test/r/lock_multi.result
index 9c4f1b17dcc..e17b56e0695 100644
--- a/mysql-test/r/lock_multi.result
+++ b/mysql-test/r/lock_multi.result
@@ -143,4 +143,16 @@ connection: default
flush tables;
unlock tables;
drop table t1;
+drop table if exists t1,t2;
+create table t1 (a int);
+flush status;
+lock tables t1 read;
+show status like 'Table_locks_waited';
+Variable_name Value
+Table_locks_waited 0
+insert into t1 values(1);;
+drop table t1;
+show status like 'Table_locks_waited';
+Variable_name Value
+Table_locks_waited 1
End of 5.1 tests