diff --git a/storage/perfschema/pfs.cc b/storage/perfschema/pfs.cc index 1373f9dd43d92..5d5ddb31353c8 100644 --- a/storage/perfschema/pfs.cc +++ b/storage/perfschema/pfs.cc @@ -1937,7 +1937,17 @@ pfs_drop_table_share_v1(my_bool temporary, return; PFS_thread *pfs_thread= my_thread_get_THR_PFS(); if (unlikely(pfs_thread == NULL)) + { + fprintf(stderr, "PFS: thread=0 %.*s.%.*s\n", schema_name_length, schema_name, + table_name_length, table_name); return; + } + { + THD *thd= current_thd; + if (thd) + fprintf(stderr, "PFS: %.*s\n", (int)thd->query_string.length(), + thd->query_string.str()); + } /* TODO: temporary tables */ drop_table_share(pfs_thread, temporary, schema_name, schema_name_length, table_name, table_name_length); diff --git a/storage/perfschema/pfs_instr_class.cc b/storage/perfschema/pfs_instr_class.cc index 2b1a80d3e1171..4cd26a30d92bb 100644 --- a/storage/perfschema/pfs_instr_class.cc +++ b/storage/perfschema/pfs_instr_class.cc @@ -1952,7 +1952,11 @@ void drop_table_share(PFS_thread *thread, PFS_table_share_key key; LF_PINS* pins= get_table_share_hash_pins(thread); if (unlikely(pins == NULL)) + { + fprintf(stderr, "PFS: pins=0 %.*s.%.*s\n", schema_name_length, schema_name, + table_name_length, table_name); return; + } set_table_share_key(&key, temporary, schema_name, schema_name_length, table_name, table_name_length); PFS_table_share **entry; @@ -1969,6 +1973,11 @@ void drop_table_share(PFS_thread *thread, pfs->m_lock.allocated_to_free(); } + else + { + fprintf(stderr, "PFS: entry=%p %.*s.%.*s\n", entry, schema_name_length, schema_name, + table_name_length, table_name); + } lf_hash_search_unpin(pins); } diff --git a/storage/perfschema/unittest/pfs_server_stubs.cc b/storage/perfschema/unittest/pfs_server_stubs.cc index 1ec84c2538efb..1577703c12a69 100644 --- a/storage/perfschema/unittest/pfs_server_stubs.cc +++ b/storage/perfschema/unittest/pfs_server_stubs.cc @@ -61,3 +61,5 @@ enum sys_var::where get_sys_var_value_origin(void *ptr) } MY_TIMER_INFO sys_timer_info; + +THD *_current_thd() { return 0; }