21 #include "my_global.h"
22 #include "my_pthread.h"
31 THR_LOCK table_esgs_by_host_by_event_name::m_table_lock;
36 { C_STRING_WITH_LEN(
"HOST") },
37 { C_STRING_WITH_LEN(
"char(60)") },
41 { C_STRING_WITH_LEN(
"EVENT_NAME") },
42 { C_STRING_WITH_LEN(
"varchar(128)") },
46 { C_STRING_WITH_LEN(
"COUNT_STAR") },
47 { C_STRING_WITH_LEN(
"bigint(20)") },
51 { C_STRING_WITH_LEN(
"SUM_TIMER_WAIT") },
52 { C_STRING_WITH_LEN(
"bigint(20)") },
56 { C_STRING_WITH_LEN(
"MIN_TIMER_WAIT") },
57 { C_STRING_WITH_LEN(
"bigint(20)") },
61 { C_STRING_WITH_LEN(
"AVG_TIMER_WAIT") },
62 { C_STRING_WITH_LEN(
"bigint(20)") },
66 { C_STRING_WITH_LEN(
"MAX_TIMER_WAIT") },
67 { C_STRING_WITH_LEN(
"bigint(20)") },
73 table_esgs_by_host_by_event_name::m_field_def=
79 { C_STRING_WITH_LEN(
"events_stages_summary_by_host_by_event_name") },
81 table_esgs_by_host_by_event_name::create,
83 table_esgs_by_host_by_event_name::delete_all_rows,
93 table_esgs_by_host_by_event_name::create(
void)
99 table_esgs_by_host_by_event_name::delete_all_rows(
void)
107 table_esgs_by_host_by_event_name::table_esgs_by_host_by_event_name()
109 m_row_exists(false), m_pos(), m_next_pos()
129 for (m_pos.
set_at(&m_next_pos);
130 m_pos.has_more_host();
139 make_row(host, stage_class);
146 return HA_ERR_END_OF_FILE;
160 return HA_ERR_RECORD_DELETED;
165 make_row(host, stage_class);
169 return HA_ERR_RECORD_DELETED;
172 void table_esgs_by_host_by_event_name
201 if (unlikely(! m_row_exists))
202 return HA_ERR_RECORD_DELETED;
205 DBUG_ASSERT(table->s->null_bytes == 1);
208 for (; (f= *fields) ; fields++)
210 if (read_all || bitmap_is_set(table->read_set, f->field_index))
212 switch(f->field_index)
215 m_row.m_host.set_field(f);
218 m_row.m_event_name.set_field(f);
221 m_row.m_stat.set_field(f->field_index - 2, f);