]> TLD Linux GIT Repositories - packages/mysql.git/blob - mysql-system-xxhash.patch
- keep common dirs for mysqlrouter in mysql-common, fix /var/{lib,log} dirs
[packages/mysql.git] / mysql-system-xxhash.patch
1 diff -ur mysql-8.2.0.orig/plugin/group_replication/libmysqlgcs/CMakeLists.txt mysql-8.2.0/plugin/group_replication/libmysqlgcs/CMakeLists.txt
2 --- mysql-8.2.0.orig/plugin/group_replication/libmysqlgcs/CMakeLists.txt        2023-12-18 01:19:34.054277743 +0100
3 +++ mysql-8.2.0/plugin/group_replication/libmysqlgcs/CMakeLists.txt     2023-12-18 01:20:07.130718562 +0100
4 @@ -137,7 +137,6 @@
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 @@ -235,6 +234,7 @@
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 xxhash)
17  
18  IF(LINUX AND WITH_TIRPC STREQUAL "bundled")
19    ADD_DEPENDENCIES(mysqlgcs tirpc_ext)
20 diff -ur mysql-8.2.0.orig/plugin/group_replication/libmysqlgcs/src/bindings/xcom/gcs_message_stage_split.cc mysql-8.2.0/plugin/group_replication/libmysqlgcs/src/bindings/xcom/gcs_message_stage_split.cc
21 --- mysql-8.2.0.orig/plugin/group_replication/libmysqlgcs/src/bindings/xcom/gcs_message_stage_split.cc  2023-12-18 01:19:34.056277770 +0100
22 +++ mysql-8.2.0/plugin/group_replication/libmysqlgcs/src/bindings/xcom/gcs_message_stage_split.cc       2023-12-18 01:20:07.117718388 +0100
23 @@ -126,7 +126,7 @@
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 -ur mysql-8.2.0.orig/plugin/group_replication/libmysqlgcs/src/bindings/xcom/gcs_xxhash.h mysql-8.2.0/plugin/group_replication/libmysqlgcs/src/bindings/xcom/gcs_xxhash.h
33 --- mysql-8.2.0.orig/plugin/group_replication/libmysqlgcs/src/bindings/xcom/gcs_xxhash.h        2023-12-18 01:19:34.068277930 +0100
34 +++ mysql-8.2.0/plugin/group_replication/libmysqlgcs/src/bindings/xcom/gcs_xxhash.h     2023-12-18 01:20:07.130718562 +0100
35 @@ -25,10 +25,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 -ur mysql-8.2.0.orig/sql/CMakeLists.txt mysql-8.2.0/sql/CMakeLists.txt
48 --- mysql-8.2.0.orig/sql/CMakeLists.txt 2023-12-18 01:19:34.892288911 +0100
49 +++ mysql-8.2.0/sql/CMakeLists.txt      2023-12-18 01:22:41.637779746 +0100
50 @@ -766,7 +766,6 @@
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 @@ -831,11 +830,6 @@
59        )
60  ENDIF()
61  
62 -MY_ADD_COMPILE_DEFINITIONS(
63 -  ${BUNDLED_LZ4_PATH}/xxhash.c
64 -  COMPILE_DEFINITIONS XXH_NAMESPACE=MY_
65 -  )
66 -
67  # Workaround for Apple Clang bug on ARM.
68  # When linking mysqld (and executables using server_unittest_library)
69  # we get linker warnings about
70 @@ -860,14 +854,6 @@
71      )
72  ENDIF()
73  
74 -ADD_COMPILE_FLAGS(
75 -  ${BUNDLED_LZ4_PATH}/xxhash.c
76 -  iterators/hash_join_iterator.cc
77 -  iterators/composite_iterators.cc
78 -  rpl_write_set_handler.cc
79 -  COMPILE_FLAGS -I${CMAKE_SOURCE_DIR}/extra/lz4 -I${BUNDLED_LZ4_PATH}
80 -  )
81 -
82  # Fixes "C1128: number of sections exceeded object file format limit" in MSVC
83  IF(WIN32)
84    ADD_COMPILE_FLAGS(
85 @@ -961,7 +947,7 @@
86  
87  TARGET_LINK_LIBRARIES(sql_main ${MYSQLD_STATIC_PLUGIN_LIBS}
88    mysql_server_component_services mysys strings vio
89 -  mysql_binlog_event ${LIBWRAP} ${LIBDL} OpenSSL::SSL OpenSSL::Crypto
90 +  mysql_binlog_event xxhash ${LIBWRAP} ${LIBDL} OpenSSL::SSL OpenSSL::Crypto
91    extra::rapidjson)
92  
93  # sql/immutable_string.h uses
94 diff -ur mysql-8.2.0.orig/sql/iterators/composite_iterators.cc mysql-8.2.0/sql/iterators/composite_iterators.cc
95 --- mysql-8.2.0.orig/sql/iterators/composite_iterators.cc       2023-12-18 01:19:35.299294336 +0100
96 +++ mysql-8.2.0/sql/iterators/composite_iterators.cc    2023-12-18 02:13:09.216002357 +0100
97 @@ -35,7 +35,7 @@
98  #include "my_dbug.h"
99  #include "my_inttypes.h"
100  #include "my_sys.h"
101 -#include "my_xxhash.h"
102 +#include <xxhash.h>
103  #include "mysqld_error.h"
104  #include "prealloced_array.h"
105  #include "scope_guard.h"
106 @@ -2255,7 +2255,7 @@
107    const ulonglong primary_hash =
108        static_cast<ulonglong>(m_materialized_table->hash_field->val_int());
109    const uint64_t chunk_hash =
110 -      MY_XXH64(&primary_hash, sizeof(primary_hash), m_hash_seed);
111 +      XXH64(&primary_hash, sizeof(primary_hash), m_hash_seed);
112  
113    const size_t chunk_index = hash_to_chunk_index(chunk_hash);
114    m_offending_row.m_chunk_offset = chunk_offset(chunk_index);
115 @@ -2331,7 +2331,7 @@
116          const ulonglong primary_hash =
117              static_cast<ulonglong>(m_materialized_table->hash_field->val_int());
118          const uint64_t chunk_hash =
119 -            MY_XXH64(&primary_hash, sizeof(primary_hash), m_hash_seed);
120 +            XXH64(&primary_hash, sizeof(primary_hash), m_hash_seed);
121          const size_t chunk_index = hash_to_chunk_index(chunk_hash);
122          const size_t set_index = chunk_index_to_set(chunk_index);
123          const size_t offset = chunk_offset(chunk_index);
124 @@ -2396,7 +2396,7 @@
125        const ulonglong primary_hash =
126            static_cast<ulonglong>(m_materialized_table->hash_field->val_int());
127        const uint64_t chunk_hash =
128 -          MY_XXH64(&primary_hash, sizeof(primary_hash), m_hash_seed);
129 +          XXH64(&primary_hash, sizeof(primary_hash), m_hash_seed);
130        const size_t chunk_index = hash_to_chunk_index(chunk_hash);
131        const size_t set_index = chunk_index_to_set(chunk_index);
132        const size_t offset = chunk_offset(chunk_index);
133 @@ -2491,7 +2491,7 @@
134        m_materialized_table->hash_field->store(
135            static_cast<longlong>(primary_hash), true);
136        const uint64_t chunk_hash =
137 -          MY_XXH64(&primary_hash, sizeof(primary_hash), m_hash_seed);
138 +          XXH64(&primary_hash, sizeof(primary_hash), m_hash_seed);
139        const size_t chunk_index = hash_to_chunk_index(chunk_hash);
140        const size_t set_index = chunk_index_to_set(chunk_index);
141        const size_t offset = chunk_offset(chunk_index);
142 @@ -2548,7 +2548,7 @@
143      const ulonglong primary_hash =
144          static_cast<ulonglong>(m_materialized_table->hash_field->val_int());
145      const uint64_t chunk_hash =
146 -        MY_XXH64(&primary_hash, sizeof(primary_hash), m_hash_seed);
147 +        XXH64(&primary_hash, sizeof(primary_hash), m_hash_seed);
148      const size_t chunk_index = hash_to_chunk_index(chunk_hash);
149      const size_t set_index = chunk_index_to_set(chunk_index);
150      assert(chunk_offset(chunk_index) == chunk_idx);
151 @@ -2787,7 +2787,7 @@
152              const ulonglong primary_hash = static_cast<ulonglong>(
153                  m_materialized_table->hash_field->val_int());
154              const uint64_t chunk_hash =
155 -                MY_XXH64(&primary_hash, sizeof(primary_hash), m_hash_seed);
156 +                XXH64(&primary_hash, sizeof(primary_hash), m_hash_seed);
157              const size_t chunk_index = hash_to_chunk_index(chunk_hash);
158              const size_t set_index = chunk_index_to_set(chunk_index);
159              assert(chunk_offset(chunk_index) == m_current_chunk_idx);
160 @@ -2820,7 +2820,7 @@
161              const ulonglong primary_hash = static_cast<ulonglong>(
162                  m_materialized_table->hash_field->val_int());
163              const uint64_t chunk_hash =
164 -                MY_XXH64(&primary_hash, sizeof(primary_hash), m_hash_seed);
165 +                XXH64(&primary_hash, sizeof(primary_hash), m_hash_seed);
166              const size_t chunk_index = hash_to_chunk_index(chunk_hash);
167              assert(chunk_index_to_set(chunk_index) == set_idx);
168              assert(chunk_offset(chunk_index) == m_current_chunk_idx);
169 @@ -2909,7 +2909,7 @@
170            const ulonglong primary_hash = static_cast<ulonglong>(
171                m_materialized_table->hash_field->val_int());
172            const uint64_t chunk_hash =
173 -              MY_XXH64(&primary_hash, sizeof(primary_hash), m_hash_seed);
174 +              XXH64(&primary_hash, sizeof(primary_hash), m_hash_seed);
175            const size_t chunk_index = hash_to_chunk_index(chunk_hash);
176            assert(chunk_index_to_set(chunk_index) == set_idx);
177            assert(chunk_offset(chunk_index) == m_current_chunk_idx);
178 diff -ur mysql-8.2.0.orig/sql/iterators/hash_join_iterator.cc mysql-8.2.0/sql/iterators/hash_join_iterator.cc
179 --- mysql-8.2.0.orig/sql/iterators/hash_join_iterator.cc        2023-12-18 01:19:35.299294336 +0100
180 +++ mysql-8.2.0/sql/iterators/hash_join_iterator.cc     2023-12-18 01:20:07.132718589 +0100
181 @@ -32,7 +32,7 @@
182  #include "field_types.h"
183  #include "my_alloc.h"
184  #include "my_bit.h"
185 -#include "my_xxhash.h"
186 +#include <xxhash.h>
187  
188  #include "my_inttypes.h"
189  #include "my_sys.h"
190 @@ -356,7 +356,7 @@
191    const uint64_t join_key_hash =
192        join_key_and_row_buffer->length() == 0
193            ? kZeroKeyLengthHash
194 -          : MY_XXH64(join_key_and_row_buffer->ptr(),
195 +          : XXH64(join_key_and_row_buffer->ptr(),
196                       join_key_and_row_buffer->length(), xxhash_seed);
197  
198    assert((chunks->size() & (chunks->size() - 1)) == 0);
199 diff -ur mysql-8.2.0.orig/sql/rpl_write_set_handler.cc mysql-8.2.0/sql/rpl_write_set_handler.cc
200 --- mysql-8.2.0.orig/sql/rpl_write_set_handler.cc       2023-12-18 01:19:35.612298508 +0100
201 +++ mysql-8.2.0/sql/rpl_write_set_handler.cc    2023-12-18 01:23:09.729155640 +0100
202 @@ -36,7 +36,7 @@
203  #include "my_dbug.h"
204  #include "my_inttypes.h"
205  #include "my_murmur3.h"  // murmur3_32
206 -#include "my_xxhash.h"   // IWYU pragma: keep
207 +#include <xxhash.h>
208  #include "mysql/strings/m_ctype.h"
209  #include "mysql_com.h"
210  #include "sql-common/json_binary.h"
211 @@ -75,7 +75,7 @@
212    if (algorithm == HASH_ALGORITHM_MURMUR32)
213      return (murmur3_32((const uchar *)T, len, 0));
214    else
215 -    return (MY_XXH64((const uchar *)T, len, 0));
216 +    return (XXH64((const uchar *)T, len, 0));
217  }
218  
219  #ifndef NDEBUG
220 diff -ur mysql-8.2.0.orig/unittest/gunit/hash_join-t.cc mysql-8.2.0/unittest/gunit/hash_join-t.cc
221 --- mysql-8.2.0.orig/unittest/gunit/hash_join-t.cc      2023-12-18 01:19:41.381375395 +0100
222 +++ mysql-8.2.0/unittest/gunit/hash_join-t.cc   2023-12-18 01:20:51.800313888 +0100
223 @@ -37,7 +37,7 @@
224  #include "my_config.h"
225  #include "my_inttypes.h"
226  #include "my_murmur3.h"
227 -#include "my_xxhash.h"
228 +#include <xxhash.h>
229  #include "mysql/components/services/bits/psi_bits.h"
230  #include "prealloced_array.h"
231  #include "sql/field.h"
232 @@ -226,7 +226,7 @@
233  
234    size_t sum = 0;
235    for (size_t i = 0; i < num_iterations; ++i) {
236 -    sum += MY_XXH64(&data[0], data.size(), 0);
237 +    sum += XXH64(&data[0], data.size(), 0);
238    }
239    StopBenchmarkTiming();
240  
241 @@ -245,7 +245,7 @@
242  
243    size_t sum = 0;
244    for (size_t i = 0; i < num_iterations; ++i) {
245 -    sum += MY_XXH64(&data[0], data.size(), 0);
246 +    sum += XXH64(&data[0], data.size(), 0);
247    }
248    StopBenchmarkTiming();
249  
250 diff -ur mysql-8.2.0.orig/unittest/gunit/innodb/ut0rnd-t.cc mysql-8.2.0/unittest/gunit/innodb/ut0rnd-t.cc
251 --- mysql-8.2.0.orig/unittest/gunit/innodb/ut0rnd-t.cc  2023-12-18 01:19:41.600378312 +0100
252 +++ mysql-8.2.0/unittest/gunit/innodb/ut0rnd-t.cc       2023-12-18 01:20:07.134718615 +0100
253 @@ -33,7 +33,7 @@
254  #include "storage/innobase/include/ut0crc32.h"
255  #include "storage/innobase/include/ut0rnd.h"
256  
257 -#include "my_xxhash.h"
258 +#include <xxhash.h>
259  
260  namespace innodb_ut0rnd_unittest {
261