Skip to content

Commit

Permalink
and more
Browse files Browse the repository at this point in the history
  • Loading branch information
vuvova committed Mar 28, 2024
1 parent 2f1d761 commit 66b8d30
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
4 changes: 4 additions & 0 deletions sql/sql_connect.cc
Expand Up @@ -45,6 +45,8 @@
#include "proxy_protocol.h"
#include <ssl_compat.h>

#include "../storage/perfschema/pfs_server.h"

HASH global_user_stats, global_client_stats, global_table_stats;
HASH global_index_stats;
/* Protects the above global stats */
Expand Down Expand Up @@ -1570,6 +1572,8 @@ THD *CONNECT::create_thd(THD *thd)
/* Attach PSI instrumentation to the new THD */

PSI_thread *psi= PSI_CALL_get_thread();
extern my_bool pfs_enabled;
DBUG_ASSERT(psi || !pfs_enabled || !pfs_param.m_thread_sizing || !pfs_param.m_thread_class_sizing);
PSI_CALL_set_thread_os_id(psi);
PSI_CALL_set_thread_THD(psi, thd);
PSI_CALL_set_thread_id(psi, thd->thread_id);
Expand Down
12 changes: 6 additions & 6 deletions storage/perfschema/pfs.cc
Expand Up @@ -1935,19 +1935,19 @@ pfs_drop_table_share_v1(my_bool temporary,
/* Ignore temporary tables. */
if (temporary)
return;
{
THD *thd= current_thd;
if (thd)
fprintf(stderr, "PFS: %.*s\n", (int)thd->query_string.length(),
thd->query_string.str());
}
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);
Expand Down

0 comments on commit 66b8d30

Please sign in to comment.