summaryrefslogtreecommitdiffstats
path: root/mysql-test/suite/perfschema/t/no_threads.test
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-04 18:07:14 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-04 18:07:14 +0000
commita175314c3e5827eb193872241446f2f8f5c9d33c (patch)
treecd3d60ca99ae00829c52a6ca79150a5b6e62528b /mysql-test/suite/perfschema/t/no_threads.test
parentInitial commit. (diff)
downloadmariadb-10.5-a175314c3e5827eb193872241446f2f8f5c9d33c.tar.xz
mariadb-10.5-a175314c3e5827eb193872241446f2f8f5c9d33c.zip
Adding upstream version 1:10.5.12.upstream/1%10.5.12upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'mysql-test/suite/perfschema/t/no_threads.test')
-rw-r--r--mysql-test/suite/perfschema/t/no_threads.test59
1 files changed, 59 insertions, 0 deletions
diff --git a/mysql-test/suite/perfschema/t/no_threads.test b/mysql-test/suite/perfschema/t/no_threads.test
new file mode 100644
index 00000000..b7b8767f
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/no_threads.test
@@ -0,0 +1,59 @@
+# Tests for PERFORMANCE_SCHEMA
+
+--source include/not_embedded.inc
+--source include/have_perfschema.inc
+
+
+# Setup : in this main thread
+
+update performance_schema.setup_instruments set enabled='NO';
+update performance_schema.setup_consumers set enabled='YES';
+update performance_schema.setup_instruments set enabled='YES'
+ where name like "wait/synch/mutex/mysys/THR_LOCK_myisam";
+
+--disable_warnings
+drop table if exists test.t1;
+--enable_warnings
+
+truncate table performance_schema.events_waits_current;
+truncate table performance_schema.events_waits_history;
+truncate table performance_schema.events_waits_history_long;
+
+show global variables like "thread_handling";
+
+# Make sure no thread instrumentation is lost
+show status like "Performance_schema_thread_instances_lost";
+
+# Code to test : in this main thread
+
+create table test.t1(a int) engine=MYISAM;
+
+show global variables like "performance_schema";
+show global variables like "performance_schema_max_thread%";
+
+# Verification : in this main thread
+
+select count(*) from performance_schema.threads
+ where name like "thread/sql/main";
+
+select count(*) from performance_schema.threads
+ where name like "thread/sql/OneConnection";
+
+select event_name, operation,
+ left(source, locate(":", source)) as short_source
+ from performance_schema.events_waits_current;
+
+select event_name, operation,
+ left(source, locate(":", source)) as short_source
+ from performance_schema.events_waits_history;
+
+select event_name, operation,
+ left(source, locate(":", source)) as short_source
+ from performance_schema.events_waits_history_long;
+
+# Cleanup
+
+update performance_schema.setup_instruments set enabled='YES';
+
+drop table test.t1;
+