21 #include "my_global.h"
22 #include "my_pthread.h"
29 THR_LOCK table_os_global_by_type::m_table_lock;
34 { C_STRING_WITH_LEN(
"OBJECT_TYPE") },
35 { C_STRING_WITH_LEN(
"varchar(64)") },
39 { C_STRING_WITH_LEN(
"OBJECT_SCHEMA") },
40 { C_STRING_WITH_LEN(
"varchar(64)") },
44 { C_STRING_WITH_LEN(
"OBJECT_NAME") },
45 { C_STRING_WITH_LEN(
"varchar(64)") },
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 table_os_global_by_type::m_field_def=
82 { C_STRING_WITH_LEN(
"objects_summary_global_by_type") },
84 table_os_global_by_type::create,
86 table_os_global_by_type::delete_all_rows,
96 table_os_global_by_type::create(
void)
102 table_os_global_by_type::delete_all_rows(
void)
104 reset_table_waits_by_table_handle();
105 reset_table_waits_by_table();
109 table_os_global_by_type::table_os_global_by_type()
111 m_row_exists(false), m_pos(), m_next_pos()
124 for (m_pos.
set_at(&m_next_pos);
125 m_pos.has_more_view();
129 case pos_os_global_by_type::VIEW_TABLE:
135 make_row(table_share);
146 return HA_ERR_END_OF_FILE;
157 case pos_os_global_by_type::VIEW_TABLE:
162 make_row(table_share);
170 return HA_ERR_RECORD_DELETED;
190 safe_key_count= sanitize_index_count(share->
m_key_count);
192 share->
m_table_stat.sum(& cumulated_stat, safe_key_count);
199 if (share->get_refcount() > 0)
204 for ( ; table < table_last ; table++)
212 table->
m_table_stat.sum(& cumulated_stat, safe_key_count);
218 m_row.
m_stat.
set(normalizer, &cumulated_stat);
228 if (unlikely(! m_row_exists))
229 return HA_ERR_RECORD_DELETED;
232 DBUG_ASSERT(table->s->null_bytes == 1);
235 for (; (f= *fields) ; fields++)
237 if (read_all || bitmap_is_set(table->read_set, f->field_index))
239 switch(f->field_index)