summaryrefslogtreecommitdiff
path: root/mysql-test/t/lock.test
diff options
context:
space:
mode:
authorMichael Widenius <monty@askmonty.org>2011-06-06 16:39:06 +0300
committerMichael Widenius <monty@askmonty.org>2011-06-06 16:39:06 +0300
commit6ae42b75b894b5c8a338536861601f2d6d3db686 (patch)
tree15dd677d92bbae3e363e0fdd2e4e878c2d9232bf /mysql-test/t/lock.test
parent00752ba43c9034fd77e03a65f2a6be9ea15032d2 (diff)
downloadmariadb-git-6ae42b75b894b5c8a338536861601f2d6d3db686.tar.gz
Fixed lock sorting and lock check issues with thr_lock that caused warnings when running test suite.
Safety check that could cause core dump when doing create table with virtual column. mysql-test/mysql-test-run.pl: Show also warnings from thr_lock (which starts with just Warning, not Warning:) mysql-test/r/lock.result: Added test that showed not relevant warning when using table locks. mysql-test/t/lock.test: Added test that showed not relevant warning when using table locks. mysys/thr_lock.c: Fixed sorting of locks. (Old sort code didn't handle case where TL_WRITE_CONCURRENT_INSERT must be sorted before TL_WRITE) Added more information to check_locks warning output. Fixed wrong testing of multiple different write locks for same table. sql/item_cmpfunc.cc: Safety check that could cause core dump when doing create table with virtual column.
Diffstat (limited to 'mysql-test/t/lock.test')
-rw-r--r--mysql-test/t/lock.test25
1 files changed, 25 insertions, 0 deletions
diff --git a/mysql-test/t/lock.test b/mysql-test/t/lock.test
index 30f4d4d6c61..fdacb9c57d4 100644
--- a/mysql-test/t/lock.test
+++ b/mysql-test/t/lock.test
@@ -245,3 +245,28 @@ UNLOCK TABLES;
DROP TABLE t1,t2;
--echo End of 5.1 tests.
+
+#
+# Test concurrent lock and read locks
+# This gave a warning:
+# Warning at 'read lock with old write lock' for lock: 5:
+# Found lock of type 8 that is write and read locked. Read_no_write_count: 1
+#
+create table t1 (a int) engine=myisam;
+lock tables t1 write concurrent, t1 as t2 read;
+connect (con1,localhost,root,,);
+connection con1;
+lock tables t1 read local;
+unlock tables;
+connection default;
+unlock tables;
+connection con1;
+lock tables t1 read local;
+connection default;
+lock tables t1 write concurrent, t1 as t2 read;
+unlock tables;
+connection con1;
+unlock tables;
+disconnect con1;
+connection default;
+drop table t1;