16 #include "my_global.h"
17 #include "my_pthread.h"
18 #include "table_threads.h"
19 #include "sql_parse.h"
23 THR_LOCK table_threads::m_table_lock;
28 { C_STRING_WITH_LEN(
"THREAD_ID") },
29 { C_STRING_WITH_LEN(
"bigint(20)") },
33 { C_STRING_WITH_LEN(
"NAME") },
34 { C_STRING_WITH_LEN(
"varchar(128)") },
38 { C_STRING_WITH_LEN(
"TYPE") },
39 { C_STRING_WITH_LEN(
"varchar(10)") },
43 { C_STRING_WITH_LEN(
"PROCESSLIST_ID") },
44 { C_STRING_WITH_LEN(
"bigint(20)") },
48 { C_STRING_WITH_LEN(
"PROCESSLIST_USER") },
49 { C_STRING_WITH_LEN(
"varchar(16)") },
53 { C_STRING_WITH_LEN(
"PROCESSLIST_HOST") },
54 { C_STRING_WITH_LEN(
"varchar(60)") },
58 { C_STRING_WITH_LEN(
"PROCESSLIST_DB") },
59 { C_STRING_WITH_LEN(
"varchar(64)") },
63 { C_STRING_WITH_LEN(
"PROCESSLIST_COMMAND") },
64 { C_STRING_WITH_LEN(
"varchar(16)") },
68 { C_STRING_WITH_LEN(
"PROCESSLIST_TIME") },
69 { C_STRING_WITH_LEN(
"bigint(20)") },
73 { C_STRING_WITH_LEN(
"PROCESSLIST_STATE") },
74 { C_STRING_WITH_LEN(
"varchar(64)") },
78 { C_STRING_WITH_LEN(
"PROCESSLIST_INFO") },
79 { C_STRING_WITH_LEN(
"longtext") },
83 { C_STRING_WITH_LEN(
"PARENT_THREAD_ID") },
84 { C_STRING_WITH_LEN(
"bigint(20)") },
88 { C_STRING_WITH_LEN(
"ROLE") },
89 { C_STRING_WITH_LEN(
"varchar(64)") },
93 { C_STRING_WITH_LEN(
"INSTRUMENTED") },
94 { C_STRING_WITH_LEN(
"enum(\'YES\',\'NO\')") },
100 table_threads::m_field_def=
106 { C_STRING_WITH_LEN(
"threads") },
124 table_threads::table_threads()
142 safe_class= sanitize_thread_class(pfs->
m_class);
143 if (unlikely(safe_class == NULL))
217 if (stage_class != NULL)
240 if (unlikely(! m_row_exists))
241 return HA_ERR_RECORD_DELETED;
244 DBUG_ASSERT(table->s->null_bytes == 2);
248 for (; (f= *fields) ; fields++)
250 if (read_all || bitmap_is_set(table->read_set, f->field_index))
252 switch(f->field_index)
303 time_t now= my_time(0);
345 const unsigned char *old_buf,
346 unsigned char *new_buf,
352 for (; (f= *fields) ; fields++)
354 if (bitmap_is_set(table->write_set, f->field_index))
356 switch(f->field_index)
371 return HA_ERR_WRONG_COMMAND;