diff -urNpa mysql-8.4.4.orig/plugin/group_replication/libmysqlgcs/CMakeLists.txt mysql-8.4.4/plugin/group_replication/libmysqlgcs/CMakeLists.txt --- mysql-8.4.4.orig/plugin/group_replication/libmysqlgcs/CMakeLists.txt 2025-02-20 23:09:06.447177328 +0100 +++ mysql-8.4.4/plugin/group_replication/libmysqlgcs/CMakeLists.txt 2025-02-20 23:09:21.411364216 +0100 @@ -138,7 +138,6 @@ SET(GCS_SOURCES src/bindings/xcom/gcs_xcom_statistics_interface.cc src/bindings/xcom/gcs_xcom_proxy.cc src/bindings/xcom/gcs_xcom_communication_protocol_changer.cc - ${BUNDLED_LZ4_PATH}/xxhash.c # required by gcs_message_stage_split src/bindings/xcom/gcs_message_stage_split.cc src/bindings/xcom/gcs_xcom_synode.cc src/bindings/xcom/gcs_xcom_expels_in_progress.cc @@ -236,6 +235,7 @@ ADD_LIBRARY(mysqlgcs STATIC ${XCOM_SOURC # Dependency on mysys from gcs_logging_system.cc # but pick up symbols from the server: # TARGET_LINK_LIBRARIES(mysqlgcs mysys) +TARGET_LINK_LIBRARIES(mysqlgcs PUBLIC xxhash) # Lots of C-style casting in the interface to XDR functions. # xcom_xdr_free((xdrproc_t)proc ...) diff -urNpa mysql-8.4.4.orig/plugin/group_replication/libmysqlgcs/src/bindings/xcom/gcs_message_stage_split.cc mysql-8.4.4/plugin/group_replication/libmysqlgcs/src/bindings/xcom/gcs_message_stage_split.cc --- mysql-8.4.4.orig/plugin/group_replication/libmysqlgcs/src/bindings/xcom/gcs_message_stage_split.cc 2025-02-20 23:09:06.447177328 +0100 +++ mysql-8.4.4/plugin/group_replication/libmysqlgcs/src/bindings/xcom/gcs_message_stage_split.cc 2025-02-20 23:09:21.411364216 +0100 @@ -127,7 +127,7 @@ Gcs_sender_id calculate_sender_id(const std::string info(node.get_member_id().get_member_id()); info.append(node.get_member_uuid().actual_value); - return GCS_XXH64(info.c_str(), info.size(), 0); + return XXH64(info.c_str(), info.size(), 0); } bool Gcs_message_stage_split_v2::update_members_information( diff -urNpa mysql-8.4.4.orig/plugin/group_replication/libmysqlgcs/src/bindings/xcom/gcs_xxhash.h mysql-8.4.4/plugin/group_replication/libmysqlgcs/src/bindings/xcom/gcs_xxhash.h --- mysql-8.4.4.orig/plugin/group_replication/libmysqlgcs/src/bindings/xcom/gcs_xxhash.h 2025-02-20 23:09:06.451177377 +0100 +++ mysql-8.4.4/plugin/group_replication/libmysqlgcs/src/bindings/xcom/gcs_xxhash.h 2025-02-20 23:09:21.411364216 +0100 @@ -26,10 +26,6 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -// Define a namespace prefix to all xxhash functions. This is done to -// avoid conflict with xxhash symbols in liblz4. -#define XXH_NAMESPACE GCS_ - -#include "xxhash.h" +#include #endif // GCS_XXHASH_H_INCLUDED diff -urNpa mysql-8.4.4.orig/sql/CMakeLists.txt mysql-8.4.4/sql/CMakeLists.txt --- mysql-8.4.4.orig/sql/CMakeLists.txt 2025-02-20 23:09:06.635179676 +0100 +++ mysql-8.4.4/sql/CMakeLists.txt 2025-02-20 23:10:24.324149956 +0100 @@ -768,7 +768,6 @@ SET(SQL_SOURCE ${CONF_SOURCES} ${SQL_SHARED_SOURCES} ${SQL_HEADERS} - ${BUNDLED_LZ4_PATH}/xxhash.c ../libmysql/errmsg.cc ../sql-common/client.cc ../sql-common/client_plugin.cc @@ -834,19 +833,6 @@ IF(WIN32) ) ENDIF() -MY_ADD_COMPILE_DEFINITIONS( - ${BUNDLED_LZ4_PATH}/xxhash.c - COMPILE_DEFINITIONS XXH_NAMESPACE=MY_ - ) - -ADD_COMPILE_FLAGS( - ${BUNDLED_LZ4_PATH}/xxhash.c - iterators/hash_join_iterator.cc - iterators/composite_iterators.cc - rpl_write_set_handler.cc - COMPILE_FLAGS -I${CMAKE_SOURCE_DIR}/extra/lz4 -I${BUNDLED_LZ4_PATH} - ) - # Fixes "C1128: number of sections exceeded object file format limit" in MSVC IF(WIN32) ADD_COMPILE_FLAGS( @@ -943,7 +929,7 @@ TARGET_LINK_LIBRARIES(sql_main extra::un TARGET_LINK_LIBRARIES(sql_main ${MYSQLD_STATIC_PLUGIN_LIBS} mysql_server_component_services mysys strings vio - mysql_binlog_event ${LIBWRAP} ${LIBDL} OpenSSL::SSL OpenSSL::Crypto + mysql_binlog_event xxhash ${LIBWRAP} ${LIBDL} OpenSSL::SSL OpenSSL::Crypto extra::rapidjson extra::boost) # sql/immutable_string.h uses diff -urNpa mysql-8.4.4.orig/sql/iterators/composite_iterators.cc mysql-8.4.4/sql/iterators/composite_iterators.cc --- mysql-8.4.4.orig/sql/iterators/composite_iterators.cc 2025-02-20 23:09:06.747181074 +0100 +++ mysql-8.4.4/sql/iterators/composite_iterators.cc 2025-02-20 23:09:21.411364216 +0100 @@ -44,7 +44,7 @@ #include "my_dbug.h" #include "my_inttypes.h" #include "my_sys.h" -#include "my_xxhash.h" +#include #include "mysql_com.h" #include "mysqld_error.h" #include "prealloced_array.h" @@ -2932,7 +2932,7 @@ bool SpillState::compute_chunk_file_sets const ulonglong primary_hash = static_cast(m_materialized_table->hash_field->val_int()); const uint64_t chunk_hash = - MY_XXH64(&primary_hash, sizeof(primary_hash), m_hash_seed); + XXH64(&primary_hash, sizeof(primary_hash), m_hash_seed); const size_t chunk_index = hash_to_chunk_index(chunk_hash); m_offending_row.m_chunk_offset = chunk_offset(chunk_index); @@ -3009,7 +3009,7 @@ bool SpillState::spread_hash_map_to_HF_c const ulonglong primary_hash = static_cast(m_materialized_table->hash_field->val_int()); const uint64_t chunk_hash = - MY_XXH64(&primary_hash, sizeof(primary_hash), m_hash_seed); + XXH64(&primary_hash, sizeof(primary_hash), m_hash_seed); const size_t chunk_index = hash_to_chunk_index(chunk_hash); const size_t set_index = chunk_index_to_set(chunk_index); const size_t offset = chunk_offset(chunk_index); @@ -3074,7 +3074,7 @@ bool SpillState::append_hash_map_to_HF() const ulonglong primary_hash = static_cast(m_materialized_table->hash_field->val_int()); const uint64_t chunk_hash = - MY_XXH64(&primary_hash, sizeof(primary_hash), m_hash_seed); + XXH64(&primary_hash, sizeof(primary_hash), m_hash_seed); const size_t chunk_index = hash_to_chunk_index(chunk_hash); const size_t set_index = chunk_index_to_set(chunk_index); const size_t offset = chunk_offset(chunk_index); @@ -3168,7 +3168,7 @@ bool SpillState::save_operand_to_IF_chun m_materialized_table->hash_field->store( static_cast(primary_hash), true); const uint64_t chunk_hash = - MY_XXH64(&primary_hash, sizeof(primary_hash), m_hash_seed); + XXH64(&primary_hash, sizeof(primary_hash), m_hash_seed); const size_t chunk_index = hash_to_chunk_index(chunk_hash); const size_t set_index = chunk_index_to_set(chunk_index); const size_t offset = chunk_offset(chunk_index); @@ -3223,7 +3223,7 @@ bool SpillState::write_HF(THD *thd, size const ulonglong primary_hash = static_cast(m_materialized_table->hash_field->val_int()); const uint64_t chunk_hash = - MY_XXH64(&primary_hash, sizeof(primary_hash), m_hash_seed); + XXH64(&primary_hash, sizeof(primary_hash), m_hash_seed); const size_t chunk_index = hash_to_chunk_index(chunk_hash); const size_t set_index = chunk_index_to_set(chunk_index); assert(chunk_offset(chunk_index) == chunk_idx); @@ -3456,7 +3456,7 @@ int SpillState::read_next_row(const Oper const ulonglong primary_hash = static_cast( m_materialized_table->hash_field->val_int()); const uint64_t chunk_hash = - MY_XXH64(&primary_hash, sizeof(primary_hash), m_hash_seed); + XXH64(&primary_hash, sizeof(primary_hash), m_hash_seed); const size_t chunk_index = hash_to_chunk_index(chunk_hash); const size_t set_index = chunk_index_to_set(chunk_index); assert(chunk_offset(chunk_index) == m_current_chunk_idx); @@ -3489,7 +3489,7 @@ int SpillState::read_next_row(const Oper const ulonglong primary_hash = static_cast( m_materialized_table->hash_field->val_int()); const uint64_t chunk_hash = - MY_XXH64(&primary_hash, sizeof(primary_hash), m_hash_seed); + XXH64(&primary_hash, sizeof(primary_hash), m_hash_seed); const size_t chunk_index = hash_to_chunk_index(chunk_hash); assert(chunk_index_to_set(chunk_index) == set_idx); assert(chunk_offset(chunk_index) == m_current_chunk_idx); @@ -3578,7 +3578,7 @@ int SpillState::read_next_row_secondary_ const ulonglong primary_hash = static_cast( m_materialized_table->hash_field->val_int()); const uint64_t chunk_hash = - MY_XXH64(&primary_hash, sizeof(primary_hash), m_hash_seed); + XXH64(&primary_hash, sizeof(primary_hash), m_hash_seed); const size_t chunk_index = hash_to_chunk_index(chunk_hash); assert(chunk_index_to_set(chunk_index) == set_idx); assert(chunk_offset(chunk_index) == m_current_chunk_idx); diff -urNpa mysql-8.4.4.orig/sql/iterators/hash_join_iterator.cc mysql-8.4.4/sql/iterators/hash_join_iterator.cc --- mysql-8.4.4.orig/sql/iterators/hash_join_iterator.cc 2025-02-20 23:09:06.747181074 +0100 +++ mysql-8.4.4/sql/iterators/hash_join_iterator.cc 2025-02-20 23:09:21.411364216 +0100 @@ -38,7 +38,7 @@ #include "my_dbug.h" #include "my_inttypes.h" #include "my_sys.h" -#include "my_xxhash.h" +#include #include "mysql/components/services/bits/psi_bits.h" #include "mysqld_error.h" #include "sql/item.h" @@ -378,7 +378,7 @@ static bool WriteRowToChunk( const uint64_t join_key_hash = join_key_and_row_buffer->length() == 0 ? kZeroKeyLengthHash - : MY_XXH64(join_key_and_row_buffer->ptr(), + : XXH64(join_key_and_row_buffer->ptr(), join_key_and_row_buffer->length(), xxhash_seed); assert((chunks->size() & (chunks->size() - 1)) == 0); diff -urNpa mysql-8.4.4.orig/sql/rpl_write_set_handler.cc mysql-8.4.4/sql/rpl_write_set_handler.cc --- mysql-8.4.4.orig/sql/rpl_write_set_handler.cc 2025-02-20 23:09:06.823182024 +0100 +++ mysql-8.4.4/sql/rpl_write_set_handler.cc 2025-02-20 23:09:21.411364216 +0100 @@ -37,7 +37,7 @@ #include "my_dbug.h" #include "my_inttypes.h" #include "my_murmur3.h" // murmur3_32 -#include "my_xxhash.h" // IWYU pragma: keep +#include #include "mysql/strings/m_ctype.h" #include "mysql_com.h" #include "sql-common/json_binary.h" @@ -682,7 +682,7 @@ static bool generate_hash_pke(const std: ) { DBUG_TRACE; - uint64 hash = MY_XXH64(pke.c_str(), pke.size(), 0); + uint64 hash = XXH64(pke.c_str(), pke.size(), 0); if (thd->get_transaction()->get_transaction_write_set_ctx()->add_write_set( hash)) return true; diff -urNpa mysql-8.4.4.orig/unittest/gunit/hash_join-t.cc mysql-8.4.4/unittest/gunit/hash_join-t.cc --- mysql-8.4.4.orig/unittest/gunit/hash_join-t.cc 2025-02-20 23:09:08.883207753 +0100 +++ mysql-8.4.4/unittest/gunit/hash_join-t.cc 2025-02-20 23:09:21.411364216 +0100 @@ -38,7 +38,7 @@ #include "my_config.h" #include "my_inttypes.h" #include "my_murmur3.h" -#include "my_xxhash.h" +#include #include "mysql/components/services/bits/psi_bits.h" #include "prealloced_array.h" #include "sql/field.h" @@ -228,7 +228,7 @@ static void BM_XXHash64ShortData(size_t size_t sum = 0; for (size_t i = 0; i < num_iterations; ++i) { - sum += MY_XXH64(&data[0], data.size(), 0); + sum += XXH64(&data[0], data.size(), 0); } StopBenchmarkTiming(); @@ -247,7 +247,7 @@ static void BM_XXHash64LongData(size_t n size_t sum = 0; for (size_t i = 0; i < num_iterations; ++i) { - sum += MY_XXH64(&data[0], data.size(), 0); + sum += XXH64(&data[0], data.size(), 0); } StopBenchmarkTiming(); diff -urNpa mysql-8.4.4.orig/unittest/gunit/innodb/ut0rnd-t.cc mysql-8.4.4/unittest/gunit/innodb/ut0rnd-t.cc --- mysql-8.4.4.orig/unittest/gunit/innodb/ut0rnd-t.cc 2025-02-20 23:09:08.887207802 +0100 +++ mysql-8.4.4/unittest/gunit/innodb/ut0rnd-t.cc 2025-02-20 23:09:21.411364216 +0100 @@ -34,7 +34,7 @@ #include "storage/innobase/include/ut0crc32.h" #include "storage/innobase/include/ut0rnd.h" -#include "my_xxhash.h" +#include namespace innodb_ut0rnd_unittest {