From 7e1e34d9fe5d1ca59292e8d72d7ac29beba415e9 Mon Sep 17 00:00:00 2001 From: Varun Date: Mon, 14 Nov 2022 15:55:37 +0530 Subject: [PATCH] Bug#109076 COMPILATION FAILURE IN 5.7 SERVER WITH GCC 7.5.0 Fixes the compilation failure regarding the definition of mysql_thread_set_peer_port() method which was only compiled if HAVE_PSI_THREAD_INTERFACE was defined whereas the method call did not have the check since the definition itself did. So, the definition of the method is moved outside the #ifdef check block to have the method always defined but the contents compiled only if HAVE_PSI_THREAD_INTERFACE is set. --- include/mysql/psi/mysql_thread.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/mysql/psi/mysql_thread.h b/include/mysql/psi/mysql_thread.h index c25e90f2120..b5a0469e75e 100644 --- a/include/mysql/psi/mysql_thread.h +++ b/include/mysql/psi/mysql_thread.h @@ -1320,6 +1320,8 @@ static inline void inline_mysql_thread_set_psi_THD(THD *thd) } #endif /* __cplusplus */ +#endif /* HAVE_PSI_THREAD_INTERFACE */ + static inline void mysql_thread_set_peer_port(uint port MY_ATTRIBUTE ((unused))) { #ifdef HAVE_PSI_THREAD_INTERFACE struct PSI_thread *psi = PSI_THREAD_CALL(get_thread)(); @@ -1327,8 +1329,6 @@ static inline void mysql_thread_set_peer_port(uint port MY_ATTRIBUTE ((unused))) #endif } -#endif - #endif /* DISABLE_MYSQL_THREAD_H */ /** @} (end of group Thread_instrumentation) */ -- 2.34.1