21 #include "my_global.h"
22 #include "my_pthread.h"
30 THR_LOCK table_esms_by_thread_by_event_name::m_table_lock;
35 { C_STRING_WITH_LEN(
"THREAD_ID") },
36 { C_STRING_WITH_LEN(
"bigint(20)") },
40 { C_STRING_WITH_LEN(
"EVENT_NAME") },
41 { C_STRING_WITH_LEN(
"varchar(128)") },
45 { C_STRING_WITH_LEN(
"COUNT_STAR") },
46 { C_STRING_WITH_LEN(
"bigint(20)") },
50 { C_STRING_WITH_LEN(
"SUM_TIMER_WAIT") },
51 { C_STRING_WITH_LEN(
"bigint(20)") },
55 { C_STRING_WITH_LEN(
"MIN_TIMER_WAIT") },
56 { C_STRING_WITH_LEN(
"bigint(20)") },
60 { C_STRING_WITH_LEN(
"AVG_TIMER_WAIT") },
61 { C_STRING_WITH_LEN(
"bigint(20)") },
65 { C_STRING_WITH_LEN(
"MAX_TIMER_WAIT") },
66 { C_STRING_WITH_LEN(
"bigint(20)") },
70 { C_STRING_WITH_LEN(
"SUM_LOCK_TIME") },
71 { C_STRING_WITH_LEN(
"bigint(20)") },
75 { C_STRING_WITH_LEN(
"SUM_ERRORS") },
76 { C_STRING_WITH_LEN(
"bigint(20)") },
80 { C_STRING_WITH_LEN(
"SUM_WARNINGS") },
81 { C_STRING_WITH_LEN(
"bigint(20)") },
85 { C_STRING_WITH_LEN(
"SUM_ROWS_AFFECTED") },
86 { C_STRING_WITH_LEN(
"bigint(20)") },
90 { C_STRING_WITH_LEN(
"SUM_ROWS_SENT") },
91 { C_STRING_WITH_LEN(
"bigint(20)") },
95 { C_STRING_WITH_LEN(
"SUM_ROWS_EXAMINED") },
96 { C_STRING_WITH_LEN(
"bigint(20)") },
100 { C_STRING_WITH_LEN(
"SUM_CREATED_TMP_DISK_TABLES") },
101 { C_STRING_WITH_LEN(
"bigint(20)") },
105 { C_STRING_WITH_LEN(
"SUM_CREATED_TMP_TABLES") },
106 { C_STRING_WITH_LEN(
"bigint(20)") },
110 { C_STRING_WITH_LEN(
"SUM_SELECT_FULL_JOIN") },
111 { C_STRING_WITH_LEN(
"bigint(20)") },
115 { C_STRING_WITH_LEN(
"SUM_SELECT_FULL_RANGE_JOIN") },
116 { C_STRING_WITH_LEN(
"bigint(20)") },
120 { C_STRING_WITH_LEN(
"SUM_SELECT_RANGE") },
121 { C_STRING_WITH_LEN(
"bigint(20)") },
125 { C_STRING_WITH_LEN(
"SUM_SELECT_RANGE_CHECK") },
126 { C_STRING_WITH_LEN(
"bigint(20)") },
130 { C_STRING_WITH_LEN(
"SUM_SELECT_SCAN") },
131 { C_STRING_WITH_LEN(
"bigint(20)") },
135 { C_STRING_WITH_LEN(
"SUM_SORT_MERGE_PASSES") },
136 { C_STRING_WITH_LEN(
"bigint(20)") },
140 { C_STRING_WITH_LEN(
"SUM_SORT_RANGE") },
141 { C_STRING_WITH_LEN(
"bigint(20)") },
145 { C_STRING_WITH_LEN(
"SUM_SORT_ROWS") },
146 { C_STRING_WITH_LEN(
"bigint(20)") },
150 { C_STRING_WITH_LEN(
"SUM_SORT_SCAN") },
151 { C_STRING_WITH_LEN(
"bigint(20)") },
155 { C_STRING_WITH_LEN(
"SUM_NO_INDEX_USED") },
156 { C_STRING_WITH_LEN(
"bigint(20)") },
160 { C_STRING_WITH_LEN(
"SUM_NO_GOOD_INDEX_USED") },
161 { C_STRING_WITH_LEN(
"bigint(20)") },
167 table_esms_by_thread_by_event_name::m_field_def=
173 { C_STRING_WITH_LEN(
"events_statements_summary_by_thread_by_event_name") },
175 table_esms_by_thread_by_event_name::create,
177 table_esms_by_thread_by_event_name::delete_all_rows,
187 table_esms_by_thread_by_event_name::create(
void)
193 table_esms_by_thread_by_event_name::delete_all_rows(
void)
199 table_esms_by_thread_by_event_name::table_esms_by_thread_by_event_name()
201 m_row_exists(false), m_pos(), m_next_pos()
221 for (m_pos.
set_at(&m_next_pos);
222 m_pos.has_more_thread();
236 make_row(thread, statement_class);
243 return HA_ERR_END_OF_FILE;
257 return HA_ERR_RECORD_DELETED;
262 make_row(thread, statement_class);
266 return HA_ERR_RECORD_DELETED;
269 void table_esms_by_thread_by_event_name
298 if (unlikely(! m_row_exists))
299 return HA_ERR_RECORD_DELETED;
302 DBUG_ASSERT(table->s->null_bytes == 0);
304 for (; (f= *fields) ; fields++)
306 if (read_all || bitmap_is_set(table->read_set, f->field_index))
308 switch(f->field_index)
311 set_field_ulonglong(f, m_row.m_thread_internal_id);
314 m_row.m_event_name.set_field(f);
317 m_row.m_stat.set_field(f->field_index - 2, f);