]> TLD Linux GIT Repositories - packages/mysql.git/blob - mysql-system-xxhash.patch
- updated to 8.4.4, use %patch -P
[packages/mysql.git] / mysql-system-xxhash.patch
1 diff -urNpa mysql-8.4.4.orig/plugin/group_replication/libmysqlgcs/CMakeLists.txt mysql-8.4.4/plugin/group_replication/libmysqlgcs/CMakeLists.txt
2 --- mysql-8.4.4.orig/plugin/group_replication/libmysqlgcs/CMakeLists.txt        2025-02-20 23:09:06.447177328 +0100
3 +++ mysql-8.4.4/plugin/group_replication/libmysqlgcs/CMakeLists.txt     2025-02-20 23:09:21.411364216 +0100
4 @@ -138,7 +138,6 @@ SET(GCS_SOURCES
5    src/bindings/xcom/gcs_xcom_statistics_interface.cc
6    src/bindings/xcom/gcs_xcom_proxy.cc
7    src/bindings/xcom/gcs_xcom_communication_protocol_changer.cc
8 -  ${BUNDLED_LZ4_PATH}/xxhash.c # required by gcs_message_stage_split
9    src/bindings/xcom/gcs_message_stage_split.cc
10    src/bindings/xcom/gcs_xcom_synode.cc
11    src/bindings/xcom/gcs_xcom_expels_in_progress.cc
12 @@ -236,6 +235,7 @@ ADD_LIBRARY(mysqlgcs STATIC ${XCOM_SOURC
13  # Dependency on mysys from gcs_logging_system.cc
14  # but pick up symbols from the server:
15  # TARGET_LINK_LIBRARIES(mysqlgcs mysys)
16 +TARGET_LINK_LIBRARIES(mysqlgcs PUBLIC xxhash)
17  
18  # Lots of C-style casting in the interface to XDR functions.
19  #   xcom_xdr_free((xdrproc_t)proc ...)
20 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
21 --- 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
22 +++ mysql-8.4.4/plugin/group_replication/libmysqlgcs/src/bindings/xcom/gcs_message_stage_split.cc       2025-02-20 23:09:21.411364216 +0100
23 @@ -127,7 +127,7 @@ Gcs_sender_id calculate_sender_id(const
24    std::string info(node.get_member_id().get_member_id());
25    info.append(node.get_member_uuid().actual_value);
26  
27 -  return GCS_XXH64(info.c_str(), info.size(), 0);
28 +  return XXH64(info.c_str(), info.size(), 0);
29  }
30  
31  bool Gcs_message_stage_split_v2::update_members_information(
32 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
33 --- mysql-8.4.4.orig/plugin/group_replication/libmysqlgcs/src/bindings/xcom/gcs_xxhash.h        2025-02-20 23:09:06.451177377 +0100
34 +++ mysql-8.4.4/plugin/group_replication/libmysqlgcs/src/bindings/xcom/gcs_xxhash.h     2025-02-20 23:09:21.411364216 +0100
35 @@ -26,10 +26,6 @@
36    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301  USA
37  */
38  
39 -// Define a namespace prefix to all xxhash functions. This is done to
40 -// avoid conflict with xxhash symbols in liblz4.
41 -#define XXH_NAMESPACE GCS_
42 -
43 -#include "xxhash.h"
44 +#include <xxhash.h>
45  
46  #endif  // GCS_XXHASH_H_INCLUDED
47 diff -urNpa mysql-8.4.4.orig/sql/CMakeLists.txt mysql-8.4.4/sql/CMakeLists.txt
48 --- mysql-8.4.4.orig/sql/CMakeLists.txt 2025-02-20 23:09:06.635179676 +0100
49 +++ mysql-8.4.4/sql/CMakeLists.txt      2025-02-20 23:10:24.324149956 +0100
50 @@ -768,7 +768,6 @@ SET(SQL_SOURCE
51    ${CONF_SOURCES}
52    ${SQL_SHARED_SOURCES}
53    ${SQL_HEADERS}
54 -  ${BUNDLED_LZ4_PATH}/xxhash.c
55    ../libmysql/errmsg.cc
56    ../sql-common/client.cc
57    ../sql-common/client_plugin.cc
58 @@ -834,19 +833,6 @@ IF(WIN32)
59        )
60  ENDIF()
61  
62 -MY_ADD_COMPILE_DEFINITIONS(
63 -  ${BUNDLED_LZ4_PATH}/xxhash.c
64 -  COMPILE_DEFINITIONS XXH_NAMESPACE=MY_
65 -  )
66 -
67 -ADD_COMPILE_FLAGS(
68 -  ${BUNDLED_LZ4_PATH}/xxhash.c
69 -  iterators/hash_join_iterator.cc
70 -  iterators/composite_iterators.cc
71 -  rpl_write_set_handler.cc
72 -  COMPILE_FLAGS -I${CMAKE_SOURCE_DIR}/extra/lz4 -I${BUNDLED_LZ4_PATH}
73 -  )
74 -
75  # Fixes "C1128: number of sections exceeded object file format limit" in MSVC
76  IF(WIN32)
77    ADD_COMPILE_FLAGS(
78 @@ -943,7 +929,7 @@ TARGET_LINK_LIBRARIES(sql_main extra::un
79  
80  TARGET_LINK_LIBRARIES(sql_main ${MYSQLD_STATIC_PLUGIN_LIBS}
81    mysql_server_component_services mysys strings vio
82 -  mysql_binlog_event ${LIBWRAP} ${LIBDL} OpenSSL::SSL OpenSSL::Crypto
83 +  mysql_binlog_event xxhash ${LIBWRAP} ${LIBDL} OpenSSL::SSL OpenSSL::Crypto
84    extra::rapidjson extra::boost)
85  
86  # sql/immutable_string.h uses
87 diff -urNpa mysql-8.4.4.orig/sql/iterators/composite_iterators.cc mysql-8.4.4/sql/iterators/composite_iterators.cc
88 --- mysql-8.4.4.orig/sql/iterators/composite_iterators.cc       2025-02-20 23:09:06.747181074 +0100
89 +++ mysql-8.4.4/sql/iterators/composite_iterators.cc    2025-02-20 23:09:21.411364216 +0100
90 @@ -44,7 +44,7 @@
91  #include "my_dbug.h"
92  #include "my_inttypes.h"
93  #include "my_sys.h"
94 -#include "my_xxhash.h"
95 +#include <xxhash.h>
96  #include "mysql_com.h"
97  #include "mysqld_error.h"
98  #include "prealloced_array.h"
99 @@ -2932,7 +2932,7 @@ bool SpillState::compute_chunk_file_sets
100    const ulonglong primary_hash =
101        static_cast<ulonglong>(m_materialized_table->hash_field->val_int());
102    const uint64_t chunk_hash =
103 -      MY_XXH64(&primary_hash, sizeof(primary_hash), m_hash_seed);
104 +      XXH64(&primary_hash, sizeof(primary_hash), m_hash_seed);
105  
106    const size_t chunk_index = hash_to_chunk_index(chunk_hash);
107    m_offending_row.m_chunk_offset = chunk_offset(chunk_index);
108 @@ -3009,7 +3009,7 @@ bool SpillState::spread_hash_map_to_HF_c
109          const ulonglong primary_hash =
110              static_cast<ulonglong>(m_materialized_table->hash_field->val_int());
111          const uint64_t chunk_hash =
112 -            MY_XXH64(&primary_hash, sizeof(primary_hash), m_hash_seed);
113 +            XXH64(&primary_hash, sizeof(primary_hash), m_hash_seed);
114          const size_t chunk_index = hash_to_chunk_index(chunk_hash);
115          const size_t set_index = chunk_index_to_set(chunk_index);
116          const size_t offset = chunk_offset(chunk_index);
117 @@ -3074,7 +3074,7 @@ bool SpillState::append_hash_map_to_HF()
118        const ulonglong primary_hash =
119            static_cast<ulonglong>(m_materialized_table->hash_field->val_int());
120        const uint64_t chunk_hash =
121 -          MY_XXH64(&primary_hash, sizeof(primary_hash), m_hash_seed);
122 +          XXH64(&primary_hash, sizeof(primary_hash), m_hash_seed);
123        const size_t chunk_index = hash_to_chunk_index(chunk_hash);
124        const size_t set_index = chunk_index_to_set(chunk_index);
125        const size_t offset = chunk_offset(chunk_index);
126 @@ -3168,7 +3168,7 @@ bool SpillState::save_operand_to_IF_chun
127        m_materialized_table->hash_field->store(
128            static_cast<longlong>(primary_hash), true);
129        const uint64_t chunk_hash =
130 -          MY_XXH64(&primary_hash, sizeof(primary_hash), m_hash_seed);
131 +          XXH64(&primary_hash, sizeof(primary_hash), m_hash_seed);
132        const size_t chunk_index = hash_to_chunk_index(chunk_hash);
133        const size_t set_index = chunk_index_to_set(chunk_index);
134        const size_t offset = chunk_offset(chunk_index);
135 @@ -3223,7 +3223,7 @@ bool SpillState::write_HF(THD *thd, size
136      const ulonglong primary_hash =
137          static_cast<ulonglong>(m_materialized_table->hash_field->val_int());
138      const uint64_t chunk_hash =
139 -        MY_XXH64(&primary_hash, sizeof(primary_hash), m_hash_seed);
140 +        XXH64(&primary_hash, sizeof(primary_hash), m_hash_seed);
141      const size_t chunk_index = hash_to_chunk_index(chunk_hash);
142      const size_t set_index = chunk_index_to_set(chunk_index);
143      assert(chunk_offset(chunk_index) == chunk_idx);
144 @@ -3456,7 +3456,7 @@ int SpillState::read_next_row(const Oper
145              const ulonglong primary_hash = static_cast<ulonglong>(
146                  m_materialized_table->hash_field->val_int());
147              const uint64_t chunk_hash =
148 -                MY_XXH64(&primary_hash, sizeof(primary_hash), m_hash_seed);
149 +                XXH64(&primary_hash, sizeof(primary_hash), m_hash_seed);
150              const size_t chunk_index = hash_to_chunk_index(chunk_hash);
151              const size_t set_index = chunk_index_to_set(chunk_index);
152              assert(chunk_offset(chunk_index) == m_current_chunk_idx);
153 @@ -3489,7 +3489,7 @@ int SpillState::read_next_row(const Oper
154              const ulonglong primary_hash = static_cast<ulonglong>(
155                  m_materialized_table->hash_field->val_int());
156              const uint64_t chunk_hash =
157 -                MY_XXH64(&primary_hash, sizeof(primary_hash), m_hash_seed);
158 +                XXH64(&primary_hash, sizeof(primary_hash), m_hash_seed);
159              const size_t chunk_index = hash_to_chunk_index(chunk_hash);
160              assert(chunk_index_to_set(chunk_index) == set_idx);
161              assert(chunk_offset(chunk_index) == m_current_chunk_idx);
162 @@ -3578,7 +3578,7 @@ int SpillState::read_next_row_secondary_
163            const ulonglong primary_hash = static_cast<ulonglong>(
164                m_materialized_table->hash_field->val_int());
165            const uint64_t chunk_hash =
166 -              MY_XXH64(&primary_hash, sizeof(primary_hash), m_hash_seed);
167 +              XXH64(&primary_hash, sizeof(primary_hash), m_hash_seed);
168            const size_t chunk_index = hash_to_chunk_index(chunk_hash);
169            assert(chunk_index_to_set(chunk_index) == set_idx);
170            assert(chunk_offset(chunk_index) == m_current_chunk_idx);
171 diff -urNpa mysql-8.4.4.orig/sql/iterators/hash_join_iterator.cc mysql-8.4.4/sql/iterators/hash_join_iterator.cc
172 --- mysql-8.4.4.orig/sql/iterators/hash_join_iterator.cc        2025-02-20 23:09:06.747181074 +0100
173 +++ mysql-8.4.4/sql/iterators/hash_join_iterator.cc     2025-02-20 23:09:21.411364216 +0100
174 @@ -38,7 +38,7 @@
175  #include "my_dbug.h"
176  #include "my_inttypes.h"
177  #include "my_sys.h"
178 -#include "my_xxhash.h"
179 +#include <xxhash.h>
180  #include "mysql/components/services/bits/psi_bits.h"
181  #include "mysqld_error.h"
182  #include "sql/item.h"
183 @@ -378,7 +378,7 @@ static bool WriteRowToChunk(
184    const uint64_t join_key_hash =
185        join_key_and_row_buffer->length() == 0
186            ? kZeroKeyLengthHash
187 -          : MY_XXH64(join_key_and_row_buffer->ptr(),
188 +          : XXH64(join_key_and_row_buffer->ptr(),
189                       join_key_and_row_buffer->length(), xxhash_seed);
190  
191    assert((chunks->size() & (chunks->size() - 1)) == 0);
192 diff -urNpa mysql-8.4.4.orig/sql/rpl_write_set_handler.cc mysql-8.4.4/sql/rpl_write_set_handler.cc
193 --- mysql-8.4.4.orig/sql/rpl_write_set_handler.cc       2025-02-20 23:09:06.823182024 +0100
194 +++ mysql-8.4.4/sql/rpl_write_set_handler.cc    2025-02-20 23:09:21.411364216 +0100
195 @@ -37,7 +37,7 @@
196  #include "my_dbug.h"
197  #include "my_inttypes.h"
198  #include "my_murmur3.h"  // murmur3_32
199 -#include "my_xxhash.h"   // IWYU pragma: keep
200 +#include <xxhash.h>
201  #include "mysql/strings/m_ctype.h"
202  #include "mysql_com.h"
203  #include "sql-common/json_binary.h"
204 @@ -682,7 +682,7 @@ static bool generate_hash_pke(const std:
205  ) {
206    DBUG_TRACE;
207  
208 -  uint64 hash = MY_XXH64(pke.c_str(), pke.size(), 0);
209 +  uint64 hash = XXH64(pke.c_str(), pke.size(), 0);
210    if (thd->get_transaction()->get_transaction_write_set_ctx()->add_write_set(
211            hash))
212      return true;
213 diff -urNpa mysql-8.4.4.orig/unittest/gunit/hash_join-t.cc mysql-8.4.4/unittest/gunit/hash_join-t.cc
214 --- mysql-8.4.4.orig/unittest/gunit/hash_join-t.cc      2025-02-20 23:09:08.883207753 +0100
215 +++ mysql-8.4.4/unittest/gunit/hash_join-t.cc   2025-02-20 23:09:21.411364216 +0100
216 @@ -38,7 +38,7 @@
217  #include "my_config.h"
218  #include "my_inttypes.h"
219  #include "my_murmur3.h"
220 -#include "my_xxhash.h"
221 +#include <xxhash.h>
222  #include "mysql/components/services/bits/psi_bits.h"
223  #include "prealloced_array.h"
224  #include "sql/field.h"
225 @@ -228,7 +228,7 @@ static void BM_XXHash64ShortData(size_t
226  
227    size_t sum = 0;
228    for (size_t i = 0; i < num_iterations; ++i) {
229 -    sum += MY_XXH64(&data[0], data.size(), 0);
230 +    sum += XXH64(&data[0], data.size(), 0);
231    }
232    StopBenchmarkTiming();
233  
234 @@ -247,7 +247,7 @@ static void BM_XXHash64LongData(size_t n
235  
236    size_t sum = 0;
237    for (size_t i = 0; i < num_iterations; ++i) {
238 -    sum += MY_XXH64(&data[0], data.size(), 0);
239 +    sum += XXH64(&data[0], data.size(), 0);
240    }
241    StopBenchmarkTiming();
242  
243 diff -urNpa mysql-8.4.4.orig/unittest/gunit/innodb/ut0rnd-t.cc mysql-8.4.4/unittest/gunit/innodb/ut0rnd-t.cc
244 --- mysql-8.4.4.orig/unittest/gunit/innodb/ut0rnd-t.cc  2025-02-20 23:09:08.887207802 +0100
245 +++ mysql-8.4.4/unittest/gunit/innodb/ut0rnd-t.cc       2025-02-20 23:09:21.411364216 +0100
246 @@ -34,7 +34,7 @@
247  #include "storage/innobase/include/ut0crc32.h"
248  #include "storage/innobase/include/ut0rnd.h"
249  
250 -#include "my_xxhash.h"
251 +#include <xxhash.h>
252  
253  namespace innodb_ut0rnd_unittest {
254