21 #include "my_global.h"
22 #include "my_pthread.h"
29 THR_LOCK table_file_summary_by_instance::m_table_lock;
34 { C_STRING_WITH_LEN(
"FILE_NAME") },
35 { C_STRING_WITH_LEN(
"varchar(512)") },
39 { C_STRING_WITH_LEN(
"EVENT_NAME") },
40 { C_STRING_WITH_LEN(
"varchar(128)") },
44 { C_STRING_WITH_LEN(
"OBJECT_INSTANCE_BEGIN") },
45 { C_STRING_WITH_LEN(
"bigint(20)") },
49 { C_STRING_WITH_LEN(
"COUNT_STAR") },
50 { C_STRING_WITH_LEN(
"bigint(20)") },
54 { C_STRING_WITH_LEN(
"SUM_TIMER_WAIT") },
55 { C_STRING_WITH_LEN(
"bigint(20)") },
59 { C_STRING_WITH_LEN(
"MIN_TIMER_WAIT") },
60 { C_STRING_WITH_LEN(
"bigint(20)") },
64 { C_STRING_WITH_LEN(
"AVG_TIMER_WAIT") },
65 { C_STRING_WITH_LEN(
"bigint(20)") },
69 { C_STRING_WITH_LEN(
"MAX_TIMER_WAIT") },
70 { C_STRING_WITH_LEN(
"bigint(20)") },
76 { C_STRING_WITH_LEN(
"COUNT_READ") },
77 { C_STRING_WITH_LEN(
"bigint(20)") },
81 { C_STRING_WITH_LEN(
"SUM_TIMER_READ") },
82 { C_STRING_WITH_LEN(
"bigint(20)") },
86 { C_STRING_WITH_LEN(
"MIN_TIMER_READ") },
87 { C_STRING_WITH_LEN(
"bigint(20)") },
91 { C_STRING_WITH_LEN(
"AVG_TIMER_READ") },
92 { C_STRING_WITH_LEN(
"bigint(20)") },
96 { C_STRING_WITH_LEN(
"MAX_TIMER_READ") },
97 { C_STRING_WITH_LEN(
"bigint(20)") },
101 { C_STRING_WITH_LEN(
"SUM_NUMBER_OF_BYTES_READ") },
102 { C_STRING_WITH_LEN(
"bigint(20)") },
108 { C_STRING_WITH_LEN(
"COUNT_WRITE") },
109 { C_STRING_WITH_LEN(
"bigint(20)") },
113 { C_STRING_WITH_LEN(
"SUM_TIMER_WRITE") },
114 { C_STRING_WITH_LEN(
"bigint(20)") },
118 { C_STRING_WITH_LEN(
"MIN_TIMER_WRITE") },
119 { C_STRING_WITH_LEN(
"bigint(20)") },
123 { C_STRING_WITH_LEN(
"AVG_TIMER_WRITE") },
124 { C_STRING_WITH_LEN(
"bigint(20)") },
128 { C_STRING_WITH_LEN(
"MAX_TIMER_WRITE") },
129 { C_STRING_WITH_LEN(
"bigint(20)") },
133 { C_STRING_WITH_LEN(
"SUM_NUMBER_OF_BYTES_WRITE") },
134 { C_STRING_WITH_LEN(
"bigint(20)") },
140 { C_STRING_WITH_LEN(
"COUNT_MISC") },
141 { C_STRING_WITH_LEN(
"bigint(20)") },
145 { C_STRING_WITH_LEN(
"SUM_TIMER_MISC") },
146 { C_STRING_WITH_LEN(
"bigint(20)") },
150 { C_STRING_WITH_LEN(
"MIN_TIMER_MISC") },
151 { C_STRING_WITH_LEN(
"bigint(20)") },
155 { C_STRING_WITH_LEN(
"AVG_TIMER_MISC") },
156 { C_STRING_WITH_LEN(
"bigint(20)") },
160 { C_STRING_WITH_LEN(
"MAX_TIMER_MISC") },
161 { C_STRING_WITH_LEN(
"bigint(20)") },
167 table_file_summary_by_instance::m_field_def=
173 { C_STRING_WITH_LEN(
"file_summary_by_instance") },
175 &table_file_summary_by_instance::create,
177 table_file_summary_by_instance::delete_all_rows,
191 int table_file_summary_by_instance::delete_all_rows(
void)
197 table_file_summary_by_instance::table_file_summary_by_instance()
199 m_row_exists(false), m_pos(0), m_next_pos(0)
212 for (m_pos.
set_at(&m_next_pos);
225 return HA_ERR_END_OF_FILE;
237 return HA_ERR_RECORD_DELETED;
247 void table_file_summary_by_instance::make_row(
PFS_file *pfs)
257 safe_class= sanitize_file_class(pfs->
m_class);
258 if (unlikely(safe_class == NULL))
275 int table_file_summary_by_instance::read_row_values(
TABLE *
table,
282 if (unlikely(! m_row_exists))
283 return HA_ERR_RECORD_DELETED;
286 DBUG_ASSERT(table->s->null_bytes == 0);
288 for (; (f= *fields) ; fields++)
290 if (read_all || bitmap_is_set(table->read_set, f->field_index))
292 switch(f->field_index)