21 #include "my_global.h"
22 #include "my_pthread.h"
32 THR_LOCK table_ews_global_by_event_name::m_table_lock;
37 { C_STRING_WITH_LEN(
"EVENT_NAME") },
38 { C_STRING_WITH_LEN(
"varchar(128)") },
42 { C_STRING_WITH_LEN(
"COUNT_STAR") },
43 { C_STRING_WITH_LEN(
"bigint(20)") },
47 { C_STRING_WITH_LEN(
"SUM_TIMER_WAIT") },
48 { C_STRING_WITH_LEN(
"bigint(20)") },
52 { C_STRING_WITH_LEN(
"MIN_TIMER_WAIT") },
53 { C_STRING_WITH_LEN(
"bigint(20)") },
57 { C_STRING_WITH_LEN(
"AVG_TIMER_WAIT") },
58 { C_STRING_WITH_LEN(
"bigint(20)") },
62 { C_STRING_WITH_LEN(
"MAX_TIMER_WAIT") },
63 { C_STRING_WITH_LEN(
"bigint(20)") },
69 table_ews_global_by_event_name::m_field_def=
75 { C_STRING_WITH_LEN(
"events_waits_summary_global_by_event_name") },
77 table_ews_global_by_event_name::create,
79 table_ews_global_by_event_name::delete_all_rows,
89 table_ews_global_by_event_name::create(
void)
95 table_ews_global_by_event_name::delete_all_rows(
void)
98 reset_table_waits_by_table_handle();
99 reset_table_waits_by_table();
104 table_ews_global_by_event_name::table_ews_global_by_event_name()
106 m_row_exists(false), m_pos(), m_next_pos()
124 for (m_pos.
set_at(&m_next_pos);
125 m_pos.has_more_view();
130 case pos_ews_global_by_event_name::VIEW_MUTEX:
134 make_mutex_row(mutex_class);
139 case pos_ews_global_by_event_name::VIEW_RWLOCK:
143 make_rwlock_row(rwlock_class);
148 case pos_ews_global_by_event_name::VIEW_COND:
152 make_cond_row(cond_class);
157 case pos_ews_global_by_event_name::VIEW_FILE:
161 make_file_row(file_class);
166 case pos_ews_global_by_event_name::VIEW_TABLE:
180 case pos_ews_global_by_event_name::VIEW_SOCKET:
184 make_socket_row(socket_class);
189 case pos_ews_global_by_event_name::VIEW_IDLE:
190 instr_class= find_idle_class(m_pos.
m_index_2);
193 make_idle_row(instr_class);
203 return HA_ERR_END_OF_FILE;
220 case pos_ews_global_by_event_name::VIEW_MUTEX:
224 make_mutex_row(mutex_class);
228 case pos_ews_global_by_event_name::VIEW_RWLOCK:
232 make_rwlock_row(rwlock_class);
236 case pos_ews_global_by_event_name::VIEW_COND:
240 make_cond_row(cond_class);
244 case pos_ews_global_by_event_name::VIEW_FILE:
248 make_file_row(file_class);
252 case pos_ews_global_by_event_name::VIEW_TABLE:
260 case pos_ews_global_by_event_name::VIEW_SOCKET:
264 make_socket_row(socket_class);
268 case pos_ews_global_by_event_name::VIEW_IDLE:
269 instr_class= find_idle_class(m_pos.
m_index_2);
272 make_idle_row(instr_class);
278 return HA_ERR_RECORD_DELETED;
281 void table_ews_global_by_event_name
294 void table_ews_global_by_event_name
307 void table_ews_global_by_event_name
320 void table_ews_global_by_event_name
333 void table_ews_global_by_event_name
346 void table_ews_global_by_event_name
359 void table_ews_global_by_event_name
372 void table_ews_global_by_event_name
393 if (unlikely(! m_row_exists))
394 return HA_ERR_RECORD_DELETED;
397 DBUG_ASSERT(table->s->null_bytes == 0);
399 for (; (f= *fields) ; fields++)
401 if (read_all || bitmap_is_set(table->read_set, f->field_index))
403 switch(f->field_index)
406 m_row.m_event_name.set_field(f);
409 m_row.m_stat.set_field(f->field_index - 1, f);