diff options
-rw-r--r-- | include/mysql/psi/mysql_table.h | 6 | ||||
-rw-r--r-- | sql/sql_base.cc | 8 |
2 files changed, 10 insertions, 4 deletions
diff --git a/include/mysql/psi/mysql_table.h b/include/mysql/psi/mysql_table.h index bd703d75e1f..bf744ec664c 100644 --- a/include/mysql/psi/mysql_table.h +++ b/include/mysql/psi/mysql_table.h @@ -30,6 +30,9 @@ */ #ifdef HAVE_PSI_TABLE_INTERFACE +#define MYSQL_UNBIND_TABLE(handler) (handler)->unbind_psi() +#define MYSQL_REBIND_TABLE(handler) (handler)->rebind_psi() + #define PSI_CALL_unbind_table PSI_TABLE_CALL(unbind_table) #define PSI_CALL_rebind_table PSI_TABLE_CALL(rebind_table) #define PSI_CALL_open_table PSI_TABLE_CALL(open_table) @@ -38,6 +41,9 @@ #define PSI_CALL_release_table_share PSI_TABLE_CALL(release_table_share) #define PSI_CALL_drop_table_share PSI_TABLE_CALL(drop_table_share) #else +#define MYSQL_UNBIND_TABLE(handler) /* no-op */ +#define MYSQL_REBIND_TABLE(handler) /* no-op */ + #define PSI_CALL_unbind_table(A1) /* no-op */ #define PSI_CALL_rebind_table(A1,A2,A3) NULL #define PSI_CALL_close_table(A1) /* no-op */ diff --git a/sql/sql_base.cc b/sql/sql_base.cc index 96d317e2b57..848020c1846 100644 --- a/sql/sql_base.cc +++ b/sql/sql_base.cc @@ -1100,7 +1100,7 @@ void close_thread_table(THD *thd, TABLE **table_ptr) critical section. */ if (table->file != NULL) - table->file->unbind_psi(); + MYSQL_UNBIND_TABLE(table->file); tc_release_table(table); DBUG_VOID_RETURN; @@ -1635,8 +1635,8 @@ use_temporary_table(THD *thd, TABLE *table, TABLE **out_table) thread to another, we need to let the performance schema know that, for aggregates per thread to work properly. */ - table->file->unbind_psi(); - table->file->rebind_psi(); + MYSQL_UNBIND_TABLE(table->file); + MYSQL_REBIND_TABLE(table->file); } #endif } @@ -2530,7 +2530,7 @@ retry_share: if (table) { DBUG_ASSERT(table->file != NULL); - table->file->rebind_psi(); + MYSQL_REBIND_TABLE(table->file); } else { |