21 #include "my_global.h"
23 #include "mysys_err.h"
46 static void destroy_pfs_thread(
void *key);
49 static void cleanup_performance_schema(
void);
57 PFS_table_stat::g_reset_template.
reset();
62 pfs_automated_sizing(param);
76 init_event_name_sizing(param);
77 register_global_classes();
79 if (pthread_key_create(&THR_PFS, destroy_pfs_thread))
112 init_digest(param) ||
119 cleanup_performance_schema();
137 flag_statements_digest= param->m_consumer_statement_digest_enabled;
143 static void destroy_pfs_thread(
void *key)
162 static void cleanup_performance_schema(
void)
197 cleanup_performance_schema();
205 my_pthread_setspecific_ptr(THR_PFS, NULL);
206 pthread_key_delete(THR_PFS);
219 pfs_instr_config_state= PFS_INSTR_CONFIG_ALLOCATED;
228 int desired_state= PFS_INSTR_CONFIG_ALLOCATED;
231 if (my_atomic_cas32(&pfs_instr_config_state, &desired_state, PFS_INSTR_CONFIG_DEALLOCATED))
247 int name_length= strlen(name);
248 int value_length= strlen(value);
252 + name_length + 1 + value_length + 1, MYF(MY_WME));
257 memcpy(e->m_name, name, name_length);
258 e->m_name_length= name_length;
259 e->m_name[name_length]=
'\0';
262 if (!my_strcasecmp(&my_charset_latin1, value,
"counted"))
268 if (!my_strcasecmp(&my_charset_latin1, value,
"true") ||
269 !my_strcasecmp(&my_charset_latin1, value,
"on") ||
270 !my_strcasecmp(&my_charset_latin1, value,
"1") ||
271 !my_strcasecmp(&my_charset_latin1, value,
"yes"))
277 if (!my_strcasecmp(&my_charset_latin1, value,
"false") ||
278 !my_strcasecmp(&my_charset_latin1, value,
"off") ||
279 !my_strcasecmp(&my_charset_latin1, value,
"0") ||
280 !my_strcasecmp(&my_charset_latin1, value,
"no"))