diff options
Diffstat (limited to 'mysql-test/main/func_misc.test')
-rw-r--r-- | mysql-test/main/func_misc.test | 59 |
1 files changed, 58 insertions, 1 deletions
diff --git a/mysql-test/main/func_misc.test b/mysql-test/main/func_misc.test index 7d19c9e58af..a471d224677 100644 --- a/mysql-test/main/func_misc.test +++ b/mysql-test/main/func_misc.test @@ -1,7 +1,7 @@ # # Testing of misc functions # - +--source include/have_metadata_lock_info.inc --source include/default_optimizer_switch.inc --disable_warnings DROP TABLE IF EXISTS t1, t2; @@ -1278,3 +1278,60 @@ DROP TABLE t1; --echo # --echo # End of 10.4 tests --echo # + +--echo # +--echo # MDEV-10569 Add RELEASE_ALL_LOCKS SQL-function +--echo # + +--echo # Test function without any locks +SELECT RELEASE_ALL_LOCKS(); + +--echo # Test function with one lock only +SELECT GET_LOCK('l1',10); +SELECT RELEASE_ALL_LOCKS(); +SELECT LOCK_MODE, LOCK_TYPE, TABLE_SCHEMA +FROM information_schema.metadata_lock_info WHERE thread_id>0 ORDER BY TABLE_SCHEMA; + +--echo # Test function with multiple locks +SELECT GET_LOCK('l01',10), + GET_LOCK('l02',10), + GET_LOCK('l03',10), + GET_LOCK('l04',10), + GET_LOCK('l05',10), + GET_LOCK('l06',10), + GET_LOCK('l07',10), + GET_LOCK('l08',10), + GET_LOCK('l09',10), + GET_LOCK('l10',10), + GET_LOCK('l11',10), + GET_LOCK('l12',10), + GET_LOCK('l13',10), + GET_LOCK('l14',10), + GET_LOCK('l15',10); +SELECT LOCK_MODE, LOCK_TYPE, TABLE_SCHEMA +FROM information_schema.metadata_lock_info WHERE thread_id>0 ORDER BY TABLE_SCHEMA; +SELECT RELEASE_ALL_LOCKS(); +SELECT LOCK_MODE, LOCK_TYPE, TABLE_SCHEMA +FROM information_schema.metadata_lock_info WHERE thread_id>0 ORDER BY TABLE_SCHEMA; + +--echo # Test function with recursive locks +SELECT GET_LOCK('l1',10), + GET_LOCK('l2',10), + GET_LOCK('l2',10), + GET_LOCK('l3',10), + GET_LOCK('l3',10), + GET_LOCK('l3',10), + GET_LOCK('l4',10), + GET_LOCK('l4',10), + GET_LOCK('l4',10), + GET_LOCK('l4',10), + GET_LOCK('l5',10), + GET_LOCK('l5',10), + GET_LOCK('l5',10), + GET_LOCK('l5',10), + GET_LOCK('l5',10); +SELECT LOCK_MODE, LOCK_TYPE, TABLE_SCHEMA +FROM information_schema.metadata_lock_info WHERE thread_id>0 ORDER BY TABLE_SCHEMA; +SELECT RELEASE_ALL_LOCKS(); +SELECT LOCK_MODE, LOCK_TYPE, TABLE_SCHEMA +FROM information_schema.metadata_lock_info WHERE thread_id>0 ORDER BY TABLE_SCHEMA; |