21 #include "my_global.h"
22 #include "my_pthread.h"
30 THR_LOCK table_esgs_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)") },
72 table_esgs_by_thread_by_event_name::m_field_def=
78 { C_STRING_WITH_LEN(
"events_stages_summary_by_thread_by_event_name") },
80 table_esgs_by_thread_by_event_name::create,
82 table_esgs_by_thread_by_event_name::delete_all_rows,
92 table_esgs_by_thread_by_event_name::create(
void)
98 table_esgs_by_thread_by_event_name::delete_all_rows(
void)
104 table_esgs_by_thread_by_event_name::table_esgs_by_thread_by_event_name()
106 m_row_exists(false), m_pos(), m_next_pos()
126 for (m_pos.
set_at(&m_next_pos);
127 m_pos.has_more_thread();
141 make_row(thread, stage_class);
148 return HA_ERR_END_OF_FILE;
162 return HA_ERR_RECORD_DELETED;
167 make_row(thread, stage_class);
171 return HA_ERR_RECORD_DELETED;
174 void table_esgs_by_thread_by_event_name
202 if (unlikely(! m_row_exists))
203 return HA_ERR_RECORD_DELETED;
206 DBUG_ASSERT(table->s->null_bytes == 0);
208 for (; (f= *fields) ; fields++)
210 if (read_all || bitmap_is_set(table->read_set, f->field_index))
212 switch(f->field_index)
215 set_field_ulonglong(f, m_row.m_thread_internal_id);
218 m_row.m_event_name.set_field(f);
221 m_row.m_stat.set_field(f->field_index - 2, f);