Debian Codegraph @

mysql-test/suite/perfschema/t/dml_setup_instruments.test

raw
1 # Tests for PERFORMANCE_SCHEMA
2
3 --source include/not_embedded.inc
4 --source include/have_perfschema.inc
5
6 # The query result are not re producible,
7 # due to variations in platforms and plugins
8 # We still execute the select statement, for:
9 # - code coverage
10 # - make sure it does not crash
11 # - valgrind coverage
12
13 --disable_result_log
14 select * from performance_schema.setup_instruments;
15 --enable_result_log
16
17 # DEBUG_SYNC::mutex is dependent on the build (DEBUG only)
18
19 select * from performance_schema.setup_instruments
20 where name like 'Wait/Synch/Mutex/sql/%'
21 and name not in ('wait/synch/mutex/sql/DEBUG_SYNC::mutex')
22 order by name limit 10;
23
24 # CRYPTO_dynlock_value::lock is dependent on the build (SSL)
25 # LOCK_named_pipe_full_access_group is dependent on the build (Windows)
26
27 select * from performance_schema.setup_instruments
28 where name like 'Wait/Synch/Rwlock/sql/%'
29 and name not in (
30 'wait/synch/rwlock/sql/CRYPTO_dynlock_value::lock',
31 'wait/synch/rwlock/sql/LOCK_named_pipe_full_access_group')
32 order by name limit 10;
33
34 # COND_handler_count is dependent on the build (Windows only)
35 # DEBUG_SYNC::cond is dependent on the build (DEBUG only)
36 # COND_main_thread_in_use is dependent on the build (non Windows)
37 # COND_start_signal_handler is dependent on the build (non Windows)
38
39 select * from performance_schema.setup_instruments
40 where name like 'Wait/Synch/Cond/sql/%'
41 and name not in (
42 'wait/synch/cond/sql/COND_open',
43 'wait/synch/cond/sql/COND_handler_count',
44 'wait/synch/cond/sql/DEBUG_SYNC::cond',
45 'wait/synch/cond/sql/COND_socket_listener_active',
46 'wait/synch/cond/sql/COND_start_signal_handler')
47 order by name limit 10;
48
49 --disable_result_log
50 select * from performance_schema.setup_instruments
51 where name='Wait';
52 --enable_result_log
53
54 --disable_result_log
55 select * from performance_schema.setup_instruments
56 where enabled='YES';
57 --enable_result_log
58
59 --error ER_TABLEACCESS_DENIED_ERROR
60 insert into performance_schema.setup_instruments
61 set name='FOO', enabled='YES', timed='YES';
62
63 --error ER_WRONG_PERFSCHEMA_USAGE
64 update performance_schema.setup_instruments
65 set name='FOO';
66
67 update performance_schema.setup_instruments
68 set enabled='NO';
69
70 update performance_schema.setup_instruments
71 set timed='NO';
72
73 --disable_result_log
74 select * from performance_schema.setup_instruments;
75 --enable_result_log
76
77 update performance_schema.setup_instruments
78 set enabled='YES', timed='YES';
79
80 --error ER_TABLEACCESS_DENIED_ERROR
81 delete from performance_schema.setup_instruments;
82
83 --error ER_TABLEACCESS_DENIED_ERROR
84 delete from performance_schema.setup_instruments
85 where name like 'Wait/Synch/%';
86
87 LOCK TABLES performance_schema.setup_instruments READ;
88 UNLOCK TABLES;
89
90 LOCK TABLES performance_schema.setup_instruments WRITE;
91 UNLOCK TABLES;
92
93 --echo #
94 --echo # Bug#13813193 ASSERTION `TABLE->READ_SET ==
95 --echo # &TABLE->DEF_READ_SET' FAILED / MYSQL_UPDATE
96 --echo #
97 UPDATE performance_schema.setup_instruments SET timed='NO'
98 ORDER BY RAND();
99
100 # Test cleanup
101
102 update performance_schema.setup_instruments
103 set enabled='YES', TIMED='YES';
104
105 --echo #
106 --echo # MDEV-25325 column_comment for performance_schema tables
107 --echo #
108 select column_name, column_comment
109 from information_schema.columns
110 where table_schema='performance_schema' and table_name='setup_instruments';