| 1 |
# Tests for PERFORMANCE_SCHEMA |
| 2 |
|
| 3 |
# This test verifies that the mysys and server instruments are properly |
| 4 |
# initialized and recorded by the performance schema during the bootstrap |
| 5 |
# sequence in mysqld main(). |
| 6 |
# Note that some globals mutexes/rwlocks/conds that depend on #ifdef options |
| 7 |
# or runtime options are not tested here, to have a predictable result. |
| 8 |
|
| 9 |
use performance_schema; |
| 10 |
|
| 11 |
# Verify that these global mutexes have been properly initilized in mysys |
| 12 |
|
| 13 |
select count(name) from mutex_instances |
| 14 |
where name like "wait/synch/mutex/mysys/THR_LOCK_malloc"; |
| 15 |
|
| 16 |
select count(name) from mutex_instances |
| 17 |
where name like "wait/synch/mutex/mysys/THR_LOCK_open"; |
| 18 |
|
| 19 |
select count(name) from mutex_instances |
| 20 |
where name like "wait/synch/mutex/mysys/THR_LOCK_myisam"; |
| 21 |
|
| 22 |
select count(name) from mutex_instances |
| 23 |
where name like "wait/synch/mutex/mysys/THR_LOCK_heap"; |
| 24 |
|
| 25 |
select count(name) from mutex_instances |
| 26 |
where name like "wait/synch/mutex/mysys/THR_LOCK_net"; |
| 27 |
|
| 28 |
select count(name) from mutex_instances |
| 29 |
where name like "wait/synch/mutex/mysys/THR_LOCK_charset"; |
| 30 |
|
| 31 |
# There are no global rwlock in mysys |
| 32 |
|
| 33 |
# There are no global conditions in mysys |
| 34 |
# (THR_COND_threads is only present in debug builds |
| 35 |
|
| 36 |
# Verify that these global mutexes have been properly initilized in sql |
| 37 |
|
| 38 |
select count(name) from mutex_instances |
| 39 |
where name like "wait/synch/mutex/sql/LOCK_open"; |
| 40 |
|
| 41 |
select count(name) from mutex_instances |
| 42 |
where name like "wait/synch/mutex/sql/LOCK_thd_list"; |
| 43 |
|
| 44 |
select count(name) from mutex_instances |
| 45 |
where name like "wait/synch/mutex/sql/LOCK_log_throttle_qni"; |
| 46 |
|
| 47 |
select count(name) from mutex_instances |
| 48 |
where name like "wait/synch/mutex/sql/LOCK_status"; |
| 49 |
|
| 50 |
select count(name) from mutex_instances |
| 51 |
where name like "wait/synch/mutex/sql/LOCK_uuid_generator"; |
| 52 |
|
| 53 |
select count(name) from mutex_instances |
| 54 |
where name like "wait/synch/mutex/sql/LOCK_crypt"; |
| 55 |
|
| 56 |
select count(name) from mutex_instances |
| 57 |
where name like "wait/synch/mutex/sql/LOCK_replica_list"; |
| 58 |
|
| 59 |
select count(name) from mutex_instances |
| 60 |
where name like "wait/synch/mutex/sql/LOCK_manager"; |
| 61 |
|
| 62 |
select count(name) from mutex_instances |
| 63 |
where name like "wait/synch/mutex/sql/LOCK_global_system_variables"; |
| 64 |
|
| 65 |
select count(name) from mutex_instances |
| 66 |
where name like "wait/synch/mutex/sql/LOCK_user_conn"; |
| 67 |
|
| 68 |
select count(name) from mutex_instances |
| 69 |
where name like "wait/synch/mutex/sql/LOCK_prepared_stmt_count"; |
| 70 |
|
| 71 |
select count(name) from mutex_instances |
| 72 |
where name like "wait/synch/mutex/sql/LOCK_connection_count"; |
| 73 |
|
| 74 |
select count(name) from mutex_instances |
| 75 |
where name like "wait/synch/mutex/sql/LOCK_server_started"; |
| 76 |
|
| 77 |
# LOG_INFO object are created on demand, and are not global. |
| 78 |
# select count(name) from mutex_instances |
| 79 |
# where name like "wait/synch/mutex/sql/LOG_INFO::lock"; |
| 80 |
|
| 81 |
# The event scheduler may be disabled |
| 82 |
# select count(name) from mutex_instances |
| 83 |
# where name like "wait/synch/mutex/sql/Event_scheduler::LOCK_scheduler_state"; |
| 84 |
|
| 85 |
select count(name) from mutex_instances |
| 86 |
where name like "wait/synch/mutex/sql/LOCK_event_queue"; |
| 87 |
|
| 88 |
select count(name) from mutex_instances |
| 89 |
where name like "wait/synch/mutex/sql/LOCK_item_func_sleep"; |
| 90 |
|
| 91 |
select count(name) from mutex_instances |
| 92 |
where name like "wait/synch/mutex/sql/LOCK_audit_mask"; |
| 93 |
|
| 94 |
select count(name) from mutex_instances |
| 95 |
where name like "wait/synch/mutex/sql/LOCK_transaction_cache"; |
| 96 |
|
| 97 |
select count(name) from mutex_instances |
| 98 |
where name like "wait/synch/mutex/sql/LOCK_plugin"; |
| 99 |
|
| 100 |
select count(name) from mutex_instances |
| 101 |
where name like "wait/synch/mutex/sql/tz_LOCK"; |
| 102 |
|
| 103 |
# Verify that these global rwlocks have been properly initilized in sql |
| 104 |
|
| 105 |
select count(name) from rwlock_instances |
| 106 |
where name like "wait/synch/rwlock/sql/LOCK_sys_init_connect"; |
| 107 |
|
| 108 |
select count(name) from rwlock_instances |
| 109 |
where name like "wait/synch/rwlock/sql/LOCK_sys_init_replica"; |
| 110 |
|
| 111 |
select count(name) from rwlock_instances |
| 112 |
where name like "wait/synch/rwlock/sql/LOCK_system_variables_hash"; |
| 113 |
|
| 114 |
# Verify that these global conditions have been properly initilized in sql |
| 115 |
|
| 116 |
select count(name) from cond_instances |
| 117 |
where name like "wait/synch/cond/sql/COND_server_started"; |
| 118 |
|
| 119 |
select count(name) from cond_instances |
| 120 |
where name like "wait/synch/cond/sql/COND_refresh"; |
| 121 |
|
| 122 |
select count(name) from cond_instances |
| 123 |
where name like "wait/synch/cond/sql/COND_thread_count"; |
| 124 |
|
| 125 |
select count(name) from cond_instances |
| 126 |
where name like "wait/synch/cond/sql/COND_manager"; |
| 127 |
|
| 128 |
select count(name) from cond_instances |
| 129 |
where name like "wait/synch/cond/sql/COND_thread_cache"; |
| 130 |
|
| 131 |
select count(name) from cond_instances |
| 132 |
where name like "wait/synch/cond/sql/COND_flush_thread_cache"; |
| 133 |
|
| 134 |
# The event scheduler may be disabled |
| 135 |
# select count(name) from cond_instances |
| 136 |
# where name like "wait/synch/cond/sql/Event_scheduler::COND_state"; |
| 137 |
|
| 138 |
select count(name) from cond_instances |
| 139 |
where name like "wait/synch/cond/sql/COND_queue_state"; |
| 140 |
|