From a83664afd3f882149b788b46f260c76785d24c19 Mon Sep 17 00:00:00 2001 From: liangwenjia <1757640220@qq.com> Date: Tue, 23 Apr 2024 16:25:43 +0800 Subject: [PATCH] adaptation 8.0.30 --- plugin/thread_pool/numa_affinity_manager.cc | 16 +++++++++++----- plugin/thread_pool/numa_affinity_manager.h | 1 + plugin/thread_pool/threadpool.h | 1 + plugin/thread_pool/threadpool_common.cc | 5 +++-- plugin/thread_pool/threadpool_unix.cc | 11 +++++++---- plugin/thread_pool/threadpool_unix.h | 1 - 6 files changed, 23 insertions(+), 12 deletions(-) diff --git a/plugin/thread_pool/numa_affinity_manager.cc b/plugin/thread_pool/numa_affinity_manager.cc index f2304c504..acc99439c 100644 --- a/plugin/thread_pool/numa_affinity_manager.cc +++ b/plugin/thread_pool/numa_affinity_manager.cc @@ -15,8 +15,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include "numa_affinity_manager.h" -#include "sql/log.h" // need remove -#include "threadpool.h" + #include #include #include @@ -24,6 +23,9 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include #include +#include "threadpool.h" +#include "sql/log.h" // need remove + using namespace std; static const std::string THREAD_NAME_LOG_WRITER = "thread/innodb/log_writer_thread"; @@ -354,9 +356,13 @@ void numa_affinity_manager::fetch_background_threads() { // HA_ERR_RECORD_DELETED continue; } - - std::cout << safe_class->m_name << " " << pfs->m_thread_os_id << std::endl; - auto itp = background_threads.find(safe_class->m_name); +#if (MYSQL_VERSION_ID>80025) + const char *nameInstrument = safe_class->m_name.str(); +#else + const char *nameInstrument = safe_class->m_name; +#endif + std::cout << nameInstrument << " " << pfs->m_thread_os_id << std::endl; + auto itp = background_threads.find(nameInstrument); if (itp != background_threads.end()) { itp->second.push_back(pfs->m_thread_os_id); } diff --git a/plugin/thread_pool/numa_affinity_manager.h b/plugin/thread_pool/numa_affinity_manager.h index b10e65b3d..be5f005fe 100644 --- a/plugin/thread_pool/numa_affinity_manager.h +++ b/plugin/thread_pool/numa_affinity_manager.h @@ -23,6 +23,7 @@ #include #include #include + #include "storage/perfschema/pfs_buffer_container.h" #include "storage/perfschema/pfs_engine_table.h" #include "threadpool_rwlock.h" diff --git a/plugin/thread_pool/threadpool.h b/plugin/thread_pool/threadpool.h index e2c58bf55..1647f8c97 100644 --- a/plugin/thread_pool/threadpool.h +++ b/plugin/thread_pool/threadpool.h @@ -20,6 +20,7 @@ #include "sql/mysqld_thd_manager.h" #include "sql/conn_handler/connection_handler_manager.h" #include "sql/conn_handler/channel_info.h" +#include "mysql_version.h" #include "threadpool_rwlock.h" struct SHOW_VAR; diff --git a/plugin/thread_pool/threadpool_common.cc b/plugin/thread_pool/threadpool_common.cc index ce9dfb657..ac00d9d18 100644 --- a/plugin/thread_pool/threadpool_common.cc +++ b/plugin/thread_pool/threadpool_common.cc @@ -14,6 +14,9 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include +#include + #include "threadpool.h" #include "threadpool_unix.h" #include "my_thread_local.h" @@ -31,8 +34,6 @@ #include "sql/field.h" #include "sql/sql_show.h" #include "sql/sql_class.h" -#include -#include #define MYSQL_SERVER 1 diff --git a/plugin/thread_pool/threadpool_unix.cc b/plugin/thread_pool/threadpool_unix.cc index 425cdc3b5..db980ef1e 100644 --- a/plugin/thread_pool/threadpool_unix.cc +++ b/plugin/thread_pool/threadpool_unix.cc @@ -13,7 +13,14 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + #include "threadpool_unix.h" + +#include +#include +#include + +#include "threadpool.h" #include "numa_affinity_manager.h" #include "sql/debug_sync.h" #include "sql/log.h" @@ -23,10 +30,6 @@ #include "my_systime.h" #include "mysql/thread_pool_priv.h" // thd_is_transaction_active() #include "mysql/plugin.h" -#include "threadpool.h" -#include -#include -#include #define MYSQL_SERVER 1 diff --git a/plugin/thread_pool/threadpool_unix.h b/plugin/thread_pool/threadpool_unix.h index 68b9eb942..3c561f2da 100644 --- a/plugin/thread_pool/threadpool_unix.h +++ b/plugin/thread_pool/threadpool_unix.h @@ -24,7 +24,6 @@ #include "threadpool.h" #include "violite.h" #include "numa_affinity_manager.h" -#include "mysql_version.h" #ifdef __linux__ #include -- Gitee