21 #include "my_global.h"
22 #include "my_pthread.h"
32 THR_LOCK table_esms_global_by_event_name::m_table_lock;
37 { C_STRING_WITH_LEN(
"EVENT_NAME") },
38 { C_STRING_WITH_LEN(
"varchar(128)") },
42 { C_STRING_WITH_LEN(
"COUNT_STAR") },
43 { C_STRING_WITH_LEN(
"bigint(20)") },
47 { C_STRING_WITH_LEN(
"SUM_TIMER_WAIT") },
48 { C_STRING_WITH_LEN(
"bigint(20)") },
52 { C_STRING_WITH_LEN(
"MIN_TIMER_WAIT") },
53 { C_STRING_WITH_LEN(
"bigint(20)") },
57 { C_STRING_WITH_LEN(
"AVG_TIMER_WAIT") },
58 { C_STRING_WITH_LEN(
"bigint(20)") },
62 { C_STRING_WITH_LEN(
"MAX_TIMER_WAIT") },
63 { C_STRING_WITH_LEN(
"bigint(20)") },
67 { C_STRING_WITH_LEN(
"SUM_LOCK_TIME") },
68 { C_STRING_WITH_LEN(
"bigint(20)") },
72 { C_STRING_WITH_LEN(
"SUM_ERRORS") },
73 { C_STRING_WITH_LEN(
"bigint(20)") },
77 { C_STRING_WITH_LEN(
"SUM_WARNINGS") },
78 { C_STRING_WITH_LEN(
"bigint(20)") },
82 { C_STRING_WITH_LEN(
"SUM_ROWS_AFFECTED") },
83 { C_STRING_WITH_LEN(
"bigint(20)") },
87 { C_STRING_WITH_LEN(
"SUM_ROWS_SENT") },
88 { C_STRING_WITH_LEN(
"bigint(20)") },
92 { C_STRING_WITH_LEN(
"SUM_ROWS_EXAMINED") },
93 { C_STRING_WITH_LEN(
"bigint(20)") },
97 { C_STRING_WITH_LEN(
"SUM_CREATED_TMP_DISK_TABLES") },
98 { C_STRING_WITH_LEN(
"bigint(20)") },
102 { C_STRING_WITH_LEN(
"SUM_CREATED_TMP_TABLES") },
103 { C_STRING_WITH_LEN(
"bigint(20)") },
107 { C_STRING_WITH_LEN(
"SUM_SELECT_FULL_JOIN") },
108 { C_STRING_WITH_LEN(
"bigint(20)") },
112 { C_STRING_WITH_LEN(
"SUM_SELECT_FULL_RANGE_JOIN") },
113 { C_STRING_WITH_LEN(
"bigint(20)") },
117 { C_STRING_WITH_LEN(
"SUM_SELECT_RANGE") },
118 { C_STRING_WITH_LEN(
"bigint(20)") },
122 { C_STRING_WITH_LEN(
"SUM_SELECT_RANGE_CHECK") },
123 { C_STRING_WITH_LEN(
"bigint(20)") },
127 { C_STRING_WITH_LEN(
"SUM_SELECT_SCAN") },
128 { C_STRING_WITH_LEN(
"bigint(20)") },
132 { C_STRING_WITH_LEN(
"SUM_SORT_MERGE_PASSES") },
133 { C_STRING_WITH_LEN(
"bigint(20)") },
137 { C_STRING_WITH_LEN(
"SUM_SORT_RANGE") },
138 { C_STRING_WITH_LEN(
"bigint(20)") },
142 { C_STRING_WITH_LEN(
"SUM_SORT_ROWS") },
143 { C_STRING_WITH_LEN(
"bigint(20)") },
147 { C_STRING_WITH_LEN(
"SUM_SORT_SCAN") },
148 { C_STRING_WITH_LEN(
"bigint(20)") },
152 { C_STRING_WITH_LEN(
"SUM_NO_INDEX_USED") },
153 { C_STRING_WITH_LEN(
"bigint(20)") },
157 { C_STRING_WITH_LEN(
"SUM_NO_GOOD_INDEX_USED") },
158 { C_STRING_WITH_LEN(
"bigint(20)") },
164 table_esms_global_by_event_name::m_field_def=
170 { C_STRING_WITH_LEN(
"events_statements_summary_global_by_event_name") },
172 table_esms_global_by_event_name::create,
174 table_esms_global_by_event_name::delete_all_rows,
184 table_esms_global_by_event_name::create(
void)
190 table_esms_global_by_event_name::delete_all_rows(
void)
200 table_esms_global_by_event_name::table_esms_global_by_event_name()
202 m_row_exists(false), m_pos(1), m_next_pos(1)
221 if (global_instr_class_statements_array == NULL)
222 return HA_ERR_END_OF_FILE;
224 m_pos.
set_at(&m_next_pos);
229 make_row(statement_class);
234 return HA_ERR_END_OF_FILE;
244 if (global_instr_class_statements_array == NULL)
245 return HA_ERR_END_OF_FILE;
250 make_row(statement_class);
254 return HA_ERR_RECORD_DELETED;
258 void table_esms_global_by_event_name
266 true,
true, & visitor);
278 if (unlikely(! m_row_exists))
279 return HA_ERR_RECORD_DELETED;
282 DBUG_ASSERT(table->s->null_bytes == 0);
284 for (; (f= *fields) ; fields++)
286 if (read_all || bitmap_is_set(table->read_set, f->field_index))
288 switch(f->field_index)
291 m_row.m_event_name.set_field(f);
294 m_row.m_stat.set_field(f->field_index - 1, f);