21 #include "my_global.h"
22 #include "my_pthread.h"
29 THR_LOCK table_socket_instances::m_table_lock;
34 { C_STRING_WITH_LEN(
"EVENT_NAME") },
35 { C_STRING_WITH_LEN(
"varchar(128)") },
39 { C_STRING_WITH_LEN(
"OBJECT_INSTANCE_BEGIN") },
40 { C_STRING_WITH_LEN(
"bigint(20)") },
44 { C_STRING_WITH_LEN(
"THREAD_ID") },
45 { C_STRING_WITH_LEN(
"bigint(20)") },
49 { C_STRING_WITH_LEN(
"SOCKET_ID") },
50 { C_STRING_WITH_LEN(
"int(11)") },
54 { C_STRING_WITH_LEN(
"IP") },
55 { C_STRING_WITH_LEN(
"varchar(64)") },
59 { C_STRING_WITH_LEN(
"PORT") },
60 { C_STRING_WITH_LEN(
"int(11)") },
64 { C_STRING_WITH_LEN(
"STATE") },
65 { C_STRING_WITH_LEN(
"enum('IDLE','ACTIVE')") },
71 table_socket_instances::m_field_def=
77 { C_STRING_WITH_LEN(
"socket_instances") },
79 &table_socket_instances::create,
95 table_socket_instances::table_socket_instances()
97 m_row_exists(false), m_pos(0), m_next_pos(0)
110 for (m_pos.
set_at(&m_next_pos);
123 return HA_ERR_END_OF_FILE;
135 return HA_ERR_RECORD_DELETED;
141 void table_socket_instances::make_row(
PFS_socket *pfs)
151 safe_class= sanitize_socket_class(pfs->
m_class);
152 if (unlikely(safe_class == NULL))
164 : PSI_SOCKET_STATE_ACTIVE);
167 if (safe_thread != NULL)
180 int table_socket_instances::read_row_values(
TABLE *
table,
187 if (unlikely(!m_row_exists))
188 return HA_ERR_RECORD_DELETED;
191 DBUG_ASSERT(table->s->null_bytes == 1);
194 for (; (f= *fields) ; fields++)
196 if (read_all || bitmap_is_set(table->read_set, f->field_index))
198 switch(f->field_index)