21 #include "my_global.h"
22 #include "my_pthread.h"
31 THR_LOCK table_esms_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)") },
71 { C_STRING_WITH_LEN(
"SUM_LOCK_TIME") },
72 { C_STRING_WITH_LEN(
"bigint(20)") },
76 { C_STRING_WITH_LEN(
"SUM_ERRORS") },
77 { C_STRING_WITH_LEN(
"bigint(20)") },
81 { C_STRING_WITH_LEN(
"SUM_WARNINGS") },
82 { C_STRING_WITH_LEN(
"bigint(20)") },
86 { C_STRING_WITH_LEN(
"SUM_ROWS_AFFECTED") },
87 { C_STRING_WITH_LEN(
"bigint(20)") },
91 { C_STRING_WITH_LEN(
"SUM_ROWS_SENT") },
92 { C_STRING_WITH_LEN(
"bigint(20)") },
96 { C_STRING_WITH_LEN(
"SUM_ROWS_EXAMINED") },
97 { C_STRING_WITH_LEN(
"bigint(20)") },
101 { C_STRING_WITH_LEN(
"SUM_CREATED_TMP_DISK_TABLES") },
102 { C_STRING_WITH_LEN(
"bigint(20)") },
106 { C_STRING_WITH_LEN(
"SUM_CREATED_TMP_TABLES") },
107 { C_STRING_WITH_LEN(
"bigint(20)") },
111 { C_STRING_WITH_LEN(
"SUM_SELECT_FULL_JOIN") },
112 { C_STRING_WITH_LEN(
"bigint(20)") },
116 { C_STRING_WITH_LEN(
"SUM_SELECT_FULL_RANGE_JOIN") },
117 { C_STRING_WITH_LEN(
"bigint(20)") },
121 { C_STRING_WITH_LEN(
"SUM_SELECT_RANGE") },
122 { C_STRING_WITH_LEN(
"bigint(20)") },
126 { C_STRING_WITH_LEN(
"SUM_SELECT_RANGE_CHECK") },
127 { C_STRING_WITH_LEN(
"bigint(20)") },
131 { C_STRING_WITH_LEN(
"SUM_SELECT_SCAN") },
132 { C_STRING_WITH_LEN(
"bigint(20)") },
136 { C_STRING_WITH_LEN(
"SUM_SORT_MERGE_PASSES") },
137 { C_STRING_WITH_LEN(
"bigint(20)") },
141 { C_STRING_WITH_LEN(
"SUM_SORT_RANGE") },
142 { C_STRING_WITH_LEN(
"bigint(20)") },
146 { C_STRING_WITH_LEN(
"SUM_SORT_ROWS") },
147 { C_STRING_WITH_LEN(
"bigint(20)") },
151 { C_STRING_WITH_LEN(
"SUM_SORT_SCAN") },
152 { C_STRING_WITH_LEN(
"bigint(20)") },
156 { C_STRING_WITH_LEN(
"SUM_NO_INDEX_USED") },
157 { C_STRING_WITH_LEN(
"bigint(20)") },
161 { C_STRING_WITH_LEN(
"SUM_NO_GOOD_INDEX_USED") },
162 { C_STRING_WITH_LEN(
"bigint(20)") },
168 table_esms_by_host_by_event_name::m_field_def=
174 { C_STRING_WITH_LEN(
"events_statements_summary_by_host_by_event_name") },
176 table_esms_by_host_by_event_name::create,
178 table_esms_by_host_by_event_name::delete_all_rows,
188 table_esms_by_host_by_event_name::create(
void)
194 table_esms_by_host_by_event_name::delete_all_rows(
void)
202 table_esms_by_host_by_event_name::table_esms_by_host_by_event_name()
204 m_row_exists(false), m_pos(), m_next_pos()
224 for (m_pos.
set_at(&m_next_pos);
225 m_pos.has_more_host();
234 make_row(host, statement_class);
241 return HA_ERR_END_OF_FILE;
255 return HA_ERR_RECORD_DELETED;
260 make_row(host, statement_class);
264 return HA_ERR_RECORD_DELETED;
267 void table_esms_by_host_by_event_name
296 if (unlikely(! m_row_exists))
297 return HA_ERR_RECORD_DELETED;
300 DBUG_ASSERT(table->s->null_bytes == 1);
303 for (; (f= *fields) ; fields++)
305 if (read_all || bitmap_is_set(table->read_set, f->field_index))
307 switch(f->field_index)
310 m_row.m_host.set_field(f);
313 m_row.m_event_name.set_field(f);
316 m_row.m_stat.set_field(f->field_index - 2, f);