diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-04 18:00:34 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-04 18:00:34 +0000 |
commit | 3f619478f796eddbba6e39502fe941b285dd97b1 (patch) | |
tree | e2c7b5777f728320e5b5542b6213fd3591ba51e2 /mysql-test/main/thread_pool_info.test | |
parent | Initial commit. (diff) | |
download | mariadb-3f619478f796eddbba6e39502fe941b285dd97b1.tar.xz mariadb-3f619478f796eddbba6e39502fe941b285dd97b1.zip |
Adding upstream version 1:10.11.6.upstream/1%10.11.6upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'mysql-test/main/thread_pool_info.test')
-rw-r--r-- | mysql-test/main/thread_pool_info.test | 97 |
1 files changed, 97 insertions, 0 deletions
diff --git a/mysql-test/main/thread_pool_info.test b/mysql-test/main/thread_pool_info.test new file mode 100644 index 00000000..5e4866f4 --- /dev/null +++ b/mysql-test/main/thread_pool_info.test @@ -0,0 +1,97 @@ +source include/not_embedded.inc; +source include/not_aix.inc; + +-- source include/no_view_protocol.inc + +let $have_plugin = `SELECT COUNT(*) FROM INFORMATION_SCHEMA.PLUGINS WHERE PLUGIN_STATUS='ACTIVE' AND PLUGIN_NAME = 'THREAD_POOL_GROUPS'`; +if(!$have_plugin) +{ + --skip Need thread_pool_groups plugin +} + +#I_S.THREAD_POOL_GROUPS +DESC INFORMATION_SCHEMA.THREAD_POOL_GROUPS; +SELECT COUNT(*)=@@thread_pool_size FROM INFORMATION_SCHEMA.THREAD_POOL_GROUPS; +SELECT SUM(CONNECTIONS) FROM INFORMATION_SCHEMA.THREAD_POOL_GROUPS; +SELECT SUM(THREADS) > 0 FROM INFORMATION_SCHEMA.THREAD_POOL_GROUPS; +SELECT SUM(ACTIVE_THREADS) > 0 FROM INFORMATION_SCHEMA.THREAD_POOL_GROUPS; +SELECT SUM(QUEUE_LENGTH) FROM INFORMATION_SCHEMA.THREAD_POOL_GROUPS; +SELECT SUM(IS_STALLED) FROM INFORMATION_SCHEMA.THREAD_POOL_GROUPS; + + +# I_S.THREAD_POOL_STATS +DESC INFORMATION_SCHEMA.THREAD_POOL_STATS; +# The following query does not reliably give results, after FLUSH +# so if the test runs with --repeat, it would fail +#SELECT SUM(THREAD_CREATIONS) > 0 FROM INFORMATION_SCHEMA.THREAD_POOL_STATS; +SELECT SUM(DEQUEUES_BY_LISTENER+DEQUEUES_BY_WORKER) > 0 FROM INFORMATION_SCHEMA.THREAD_POOL_STATS; +SELECT SUM(POLLS_BY_LISTENER+POLLS_BY_WORKER) > 0 FROM INFORMATION_SCHEMA.THREAD_POOL_STATS; +--disable_ps_protocol +FLUSH THREAD_POOL_STATS; +SELECT SUM(DEQUEUES_BY_LISTENER+DEQUEUES_BY_WORKER) FROM INFORMATION_SCHEMA.THREAD_POOL_STATS; +SELECT SUM(POLLS_BY_LISTENER) FROM INFORMATION_SCHEMA.THREAD_POOL_STATS; +SELECT SUM(POLLS_BY_WORKER) FROM INFORMATION_SCHEMA.THREAD_POOL_STATS; +--enable_ps_protocol + +#I_S.THREAD_POOL_WAITS +DESC INFORMATION_SCHEMA.THREAD_POOL_WAITS; +SELECT REASON FROM INFORMATION_SCHEMA.THREAD_POOL_WAITS; +SELECT COUNT FROM INFORMATION_SCHEMA.THREAD_POOL_WAITS WHERE REASON='Sleep'; +--disable_ps2_protocol +SELECT SLEEP(0.01); +--enable_ps2_protocol +SELECT COUNT FROM INFORMATION_SCHEMA.THREAD_POOL_WAITS WHERE REASON='Sleep'; +FLUSH THREAD_POOL_WAITS; + + +# I_S.THREAD_POOL_QUEUES +DESC INFORMATION_SCHEMA.THREAD_POOL_QUEUES; +let $extra_port=`select @@port+1`; + +let $restart_parameters=--extra-port=$extra_port; +let $restart_noprint=1; +source include/restart_mysqld.inc; + +connect (con1, localhost, root,,test); +connection con1; +let $con1_id=`SELECT CONNECTION_ID()`; + +connect (con2, localhost, root,,test); +connection con2; +let $con2_id=`SELECT CONNECTION_ID()`; + +connect(extra_con,127.0.0.1,root,,test,$extra_port,); + +connection con1; +send SELECT SLEEP(1000); + +connection extra_con; +let $wait_condition= + SELECT COUNT(*) > 0 FROM INFORMATION_SCHEMA.PROCESSLIST + WHERE STATE='User sleep' AND ID=$con1_id; +--source include/wait_condition.inc + +connection con2; +send DO 1; + + +connection extra_con; +let $wait_condition= + SELECT COUNT(*) > 0 FROM INFORMATION_SCHEMA.THREAD_POOL_QUEUES + WHERE CONNECTION_ID IS NOT NULL; +--source include/wait_condition.inc + +--replace_result $con1_id con1_id +eval KILL QUERY $con1_id; +disconnect extra_con; + +connection con1; +error 0,ER_QUERY_INTERRUPTED; +reap; +disconnect con1; + +connection con2; +reap; +disconnect con2; + +connection default; |