diff options
author | Vicențiu Ciorbaru <cvicentiu@gmail.com> | 2021-09-29 11:24:05 +0300 |
---|---|---|
committer | Vicențiu Ciorbaru <cvicentiu@gmail.com> | 2023-02-03 16:27:16 +0200 |
commit | cd873c8688a6f21b3c859068d3146e9fd90120b0 (patch) | |
tree | 98f32a36a871d7dc179b36c1a441364c50f869e1 /mysql-test/main | |
parent | 8885225de66906dc424be8f6ffc4d1b68e54ebca (diff) | |
download | mariadb-git-cd873c8688a6f21b3c859068d3146e9fd90120b0.tar.gz |
debug_sync: Implement NO_CLEAR_EVENT syntax
When waiting on a signal, NO_CLEAR_EVENT allows one to not clear the
signal, effectively allowing other threads to wait for the same signal.
Diffstat (limited to 'mysql-test/main')
-rw-r--r-- | mysql-test/main/debug_sync.result | 16 | ||||
-rw-r--r-- | mysql-test/main/debug_sync.test | 11 |
2 files changed, 27 insertions, 0 deletions
diff --git a/mysql-test/main/debug_sync.result b/mysql-test/main/debug_sync.result index 45cdc40e241..9b6699f9bc2 100644 --- a/mysql-test/main/debug_sync.result +++ b/mysql-test/main/debug_sync.result @@ -299,4 +299,20 @@ disconnect con1; disconnect con2; connection default; DROP TABLE t1; +# +# Test NO_CLEAR_EVENT flag. The signal should still be visible after +# the wait has completed succesfully. +# +SET DEBUG_SYNC= 'now SIGNAL s1'; +SHOW VARIABLES LIKE 'DEBUG_SYNC'; +Variable_name Value +debug_sync ON - current signals: 's1' +SET DEBUG_SYNC= 'now WAIT_FOR s1 NO_CLEAR_EVENT'; +SHOW VARIABLES LIKE 'DEBUG_SYNC'; +Variable_name Value +debug_sync ON - current signals: 's1' +SET DEBUG_SYNC= 'now WAIT_FOR s1'; +SHOW VARIABLES LIKE 'DEBUG_SYNC'; +Variable_name Value +debug_sync ON - current signals: '' SET DEBUG_SYNC= 'RESET'; diff --git a/mysql-test/main/debug_sync.test b/mysql-test/main/debug_sync.test index 0e57071e08a..0ea637a393a 100644 --- a/mysql-test/main/debug_sync.test +++ b/mysql-test/main/debug_sync.test @@ -428,6 +428,17 @@ disconnect con2; connection default; DROP TABLE t1; +--echo # +--echo # Test NO_CLEAR_EVENT flag. The signal should still be visible after +--echo # the wait has completed succesfully. +--echo # +SET DEBUG_SYNC= 'now SIGNAL s1'; +SHOW VARIABLES LIKE 'DEBUG_SYNC'; +SET DEBUG_SYNC= 'now WAIT_FOR s1 NO_CLEAR_EVENT'; +SHOW VARIABLES LIKE 'DEBUG_SYNC'; +SET DEBUG_SYNC= 'now WAIT_FOR s1'; +SHOW VARIABLES LIKE 'DEBUG_SYNC'; + # # Cleanup after test case. # Otherwise signal would contain 'flushed' here, |