21 #include "my_global.h"
22 #include "my_pthread.h"
27 #define COUNT_SETUP_TIMERS 4
32 { C_STRING_WITH_LEN(
"idle") },
36 { C_STRING_WITH_LEN(
"wait") },
40 { C_STRING_WITH_LEN(
"stage") },
44 { C_STRING_WITH_LEN(
"statement") },
49 THR_LOCK table_setup_timers::m_table_lock;
54 { C_STRING_WITH_LEN(
"NAME") },
55 { C_STRING_WITH_LEN(
"varchar(64)") },
59 { C_STRING_WITH_LEN(
"TIMER_NAME") },
60 { C_STRING_WITH_LEN(
"enum(\'CYCLE\',\'NANOSECOND\',\'MICROSECOND\',"
61 "\'MILLISECOND\',\'TICK\')") },
67 table_setup_timers::m_field_def=
73 { C_STRING_WITH_LEN(
"setup_timers") },
75 &table_setup_timers::create,
91 table_setup_timers::table_setup_timers()
93 m_row(NULL), m_pos(0), m_next_pos(0)
106 m_pos.
set_at(&m_next_pos);
108 if (m_pos.
m_index < COUNT_SETUP_TIMERS)
110 m_row= &all_setup_timers_data[m_pos.
m_index];
117 result= HA_ERR_END_OF_FILE;
126 DBUG_ASSERT(m_pos.
m_index < COUNT_SETUP_TIMERS);
127 m_row= &all_setup_timers_data[m_pos.
m_index];
141 DBUG_ASSERT(table->s->null_bytes == 0);
143 for (; (f= *fields) ; fields++)
145 if (read_all || bitmap_is_set(table->read_set, f->field_index))
147 switch(f->field_index)
165 const unsigned char *,
174 for (; (f= *fields) ; fields++)
176 if (bitmap_is_set(table->write_set, f->field_index))
178 switch(f->field_index)
181 return HA_ERR_WRONG_COMMAND;
187 return HA_ERR_WRONG_COMMAND;