21 #include "my_global.h"
22 #include "my_pthread.h"
30 THR_LOCK table_esgs_by_account_by_event_name::m_table_lock;
35 { C_STRING_WITH_LEN(
"USER") },
36 { C_STRING_WITH_LEN(
"char(16)") },
40 { C_STRING_WITH_LEN(
"HOST") },
41 { C_STRING_WITH_LEN(
"char(60)") },
45 { C_STRING_WITH_LEN(
"EVENT_NAME") },
46 { C_STRING_WITH_LEN(
"varchar(128)") },
50 { C_STRING_WITH_LEN(
"COUNT_STAR") },
51 { C_STRING_WITH_LEN(
"bigint(20)") },
55 { C_STRING_WITH_LEN(
"SUM_TIMER_WAIT") },
56 { C_STRING_WITH_LEN(
"bigint(20)") },
60 { C_STRING_WITH_LEN(
"MIN_TIMER_WAIT") },
61 { C_STRING_WITH_LEN(
"bigint(20)") },
65 { C_STRING_WITH_LEN(
"AVG_TIMER_WAIT") },
66 { C_STRING_WITH_LEN(
"bigint(20)") },
70 { C_STRING_WITH_LEN(
"MAX_TIMER_WAIT") },
71 { C_STRING_WITH_LEN(
"bigint(20)") },
77 table_esgs_by_account_by_event_name::m_field_def=
83 { C_STRING_WITH_LEN(
"events_stages_summary_by_account_by_event_name") },
85 table_esgs_by_account_by_event_name::create,
87 table_esgs_by_account_by_event_name::delete_all_rows,
97 table_esgs_by_account_by_event_name::create(
void)
103 table_esgs_by_account_by_event_name::delete_all_rows(
void)
110 table_esgs_by_account_by_event_name::table_esgs_by_account_by_event_name()
112 m_row_exists(false), m_pos(), m_next_pos()
132 for (m_pos.
set_at(&m_next_pos);
133 m_pos.has_more_account();
134 m_pos.next_account())
136 account= &account_array[m_pos.
m_index_1];
142 make_row(account, stage_class);
149 return HA_ERR_END_OF_FILE;
159 DBUG_ASSERT(m_pos.
m_index_1 < account_max);
161 account= &account_array[m_pos.
m_index_1];
163 return HA_ERR_RECORD_DELETED;
168 make_row(account, stage_class);
172 return HA_ERR_RECORD_DELETED;
175 void table_esgs_by_account_by_event_name
204 if (unlikely(! m_row_exists))
205 return HA_ERR_RECORD_DELETED;
208 DBUG_ASSERT(table->s->null_bytes == 1);
211 for (; (f= *fields) ; fields++)
213 if (read_all || bitmap_is_set(table->read_set, f->field_index))
215 switch(f->field_index)
219 m_row.m_account.set_field(f->field_index, f);
222 m_row.m_event_name.set_field(f);
225 m_row.m_stat.set_field(f->field_index - 3, f);