diff --git a/plugin/thread_pool/numa_affinity_manager.cc b/plugin/thread_pool/numa_affinity_manager.cc index f2304c50462e4b5c2d18c60f9773796daab6c06a..acc99439c1bd00f33e5701f2dbafea4422810216 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 b10e65b3de0954d8ec4496b50653ea6131c4ea24..be5f005fe48e312d7eec0ff4ccc472521ff827ea 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 e2c58bf55d21704b9afc5a976c6f9f5b864d6fa0..1647f8c97db44306e9ae22f468cac92e30148d1b 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 ce9dfb657e6a695a74f4c336c8ed592840d7be9a..ac00d9d180aa1fec209dd53b43ea1a2155a4ee1d 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 425cdc3b56a6c5cc05fafe9c6fd9e0d7c5deccb4..db980ef1e4429b22d99973507f482568b4cee639 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 68b9eb9427203f02d7e6db718c9d0dcda4ad1fd6..3c561f2da75484170dd86029185be7e786973c93 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