]> TLD Linux GIT Repositories - packages/mysql.git/blob - mysql-system-xxhash.patch
- fix bcond comment (breaks build)
[packages/mysql.git] / mysql-system-xxhash.patch
1 diff -ur mysql-8.0.35.orig/plugin/group_replication/libmysqlgcs/CMakeLists.txt mysql-8.0.35/plugin/group_replication/libmysqlgcs/CMakeLists.txt
2 --- mysql-8.0.35.orig/plugin/group_replication/libmysqlgcs/CMakeLists.txt       2023-12-17 22:05:20.830721323 +0100
3 +++ mysql-8.0.35/plugin/group_replication/libmysqlgcs/CMakeLists.txt    2023-12-17 22:07:25.296271792 +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 @@ -230,6 +229,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.0.35.orig/plugin/group_replication/libmysqlgcs/src/bindings/xcom/gcs_message_stage_split.cc mysql-8.0.35/plugin/group_replication/libmysqlgcs/src/bindings/xcom/gcs_message_stage_split.cc
21 --- mysql-8.0.35.orig/plugin/group_replication/libmysqlgcs/src/bindings/xcom/gcs_message_stage_split.cc 2023-12-17 22:05:20.832721348 +0100
22 +++ mysql-8.0.35/plugin/group_replication/libmysqlgcs/src/bindings/xcom/gcs_message_stage_split.cc      2023-12-17 22:07:25.295271780 +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.0.35.orig/plugin/group_replication/libmysqlgcs/src/bindings/xcom/gcs_xxhash.h mysql-8.0.35/plugin/group_replication/libmysqlgcs/src/bindings/xcom/gcs_xxhash.h
33 --- mysql-8.0.35.orig/plugin/group_replication/libmysqlgcs/src/bindings/xcom/gcs_xxhash.h       2023-12-17 22:05:20.834721373 +0100
34 +++ mysql-8.0.35/plugin/group_replication/libmysqlgcs/src/bindings/xcom/gcs_xxhash.h    2023-12-17 22:07:25.296271792 +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.0.35.orig/sql/CMakeLists.txt mysql-8.0.35/sql/CMakeLists.txt
48 --- mysql-8.0.35.orig/sql/CMakeLists.txt        2023-12-17 22:05:21.077724399 +0100
49 +++ mysql-8.0.35/sql/CMakeLists.txt     2023-12-17 22:08:35.180142336 +0100
50 @@ -762,7 +762,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 @@ -818,11 +817,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 @@ -847,13 +841,6 @@
71      )
72  ENDIF()
73  
74 -ADD_COMPILE_FLAGS(
75 -  ${BUNDLED_LZ4_PATH}/xxhash.c
76 -  iterators/hash_join_iterator.cc
77 -  rpl_write_set_handler.cc
78 -  COMPILE_FLAGS -I${CMAKE_SOURCE_DIR}/extra/lz4 -I${BUNDLED_LZ4_PATH}
79 -  )
80 -
81  # Fixes "C1128: number of sections exceeded object file format limit" in MSVC
82  IF(WIN32)
83    ADD_COMPILE_FLAGS(
84 @@ -941,7 +928,7 @@
85  ADD_DEPENDENCIES(sql_main GenSysSchema)
86  TARGET_LINK_LIBRARIES(sql_main ${MYSQLD_STATIC_PLUGIN_LIBS}
87    mysql_server_component_services mysys strings vio
88 -  binlogevents_static ${LIBWRAP} ${LIBDL} ${SSL_LIBRARIES}
89 +  binlogevents_static xxhash ${LIBWRAP} ${LIBDL} ${SSL_LIBRARIES}
90    extra::rapidjson)
91  
92  # sql/immutable_string.h uses
93 diff -ur mysql-8.0.35.orig/sql/iterators/hash_join_iterator.cc mysql-8.0.35/sql/iterators/hash_join_iterator.cc
94 --- mysql-8.0.35.orig/sql/iterators/hash_join_iterator.cc       2023-12-17 22:05:21.366728000 +0100
95 +++ mysql-8.0.35/sql/iterators/hash_join_iterator.cc    2023-12-17 22:07:25.297271805 +0100
96 @@ -32,7 +32,7 @@
97  #include "field_types.h"
98  #include "my_alloc.h"
99  #include "my_bit.h"
100 -#include "my_xxhash.h"
101 +#include <xxhash.h>
102  
103  #include "my_inttypes.h"
104  #include "my_sys.h"
105 @@ -307,7 +307,7 @@
106    const uint64_t join_key_hash =
107        join_key_and_row_buffer->length() == 0
108            ? kZeroKeyLengthHash
109 -          : MY_XXH64(join_key_and_row_buffer->ptr(),
110 +          : XXH64(join_key_and_row_buffer->ptr(),
111                       join_key_and_row_buffer->length(), xxhash_seed);
112  
113    assert((chunks->size() & (chunks->size() - 1)) == 0);
114 diff -ur mysql-8.0.35.orig/sql/rpl_write_set_handler.cc mysql-8.0.35/sql/rpl_write_set_handler.cc
115 --- mysql-8.0.35.orig/sql/rpl_write_set_handler.cc      2023-12-17 22:05:21.611731051 +0100
116 +++ mysql-8.0.35/sql/rpl_write_set_handler.cc   2023-12-17 22:07:25.297271805 +0100
117 @@ -37,7 +37,7 @@
118  #include "my_dbug.h"
119  #include "my_inttypes.h"
120  #include "my_murmur3.h"  // murmur3_32
121 -#include "my_xxhash.h"   // IWYU pragma: keep
122 +#include <xxhash.h>
123  #include "mysql_com.h"
124  #include "sql-common/json_binary.h"
125  #include "sql-common/json_dom.h"
126 @@ -75,7 +75,7 @@
127    if (algorithm == HASH_ALGORITHM_MURMUR32)
128      return (murmur3_32((const uchar *)T, len, 0));
129    else
130 -    return (MY_XXH64((const uchar *)T, len, 0));
131 +    return (XXH64((const uchar *)T, len, 0));
132  }
133  
134  #ifndef NDEBUG
135 diff -ur mysql-8.0.35.orig/unittest/gunit/hash_join-t.cc mysql-8.0.35/unittest/gunit/hash_join-t.cc
136 --- mysql-8.0.35.orig/unittest/gunit/hash_join-t.cc     2023-12-17 22:05:25.668781591 +0100
137 +++ mysql-8.0.35/unittest/gunit/hash_join-t.cc  2023-12-17 22:08:05.509772732 +0100
138 @@ -37,7 +37,7 @@
139  #include "my_config.h"
140  #include "my_inttypes.h"
141  #include "my_murmur3.h"
142 -#include "my_xxhash.h"
143 +#include <xxhash.h>
144  #include "mysql/components/services/bits/psi_bits.h"
145  #include "prealloced_array.h"
146  #include "sql/field.h"
147 @@ -226,7 +226,7 @@
148  
149    size_t sum = 0;
150    for (size_t i = 0; i < num_iterations; ++i) {
151 -    sum += MY_XXH64(&data[0], data.size(), 0);
152 +    sum += XXH64(&data[0], data.size(), 0);
153    }
154    StopBenchmarkTiming();
155  
156 @@ -245,7 +245,7 @@
157  
158    size_t sum = 0;
159    for (size_t i = 0; i < num_iterations; ++i) {
160 -    sum += MY_XXH64(&data[0], data.size(), 0);
161 +    sum += XXH64(&data[0], data.size(), 0);
162    }
163    StopBenchmarkTiming();
164  
165 diff -ur mysql-8.0.35.orig/unittest/gunit/innodb/ut0rnd-t.cc mysql-8.0.35/unittest/gunit/innodb/ut0rnd-t.cc
166 --- mysql-8.0.35.orig/unittest/gunit/innodb/ut0rnd-t.cc 2023-12-17 22:05:25.830783608 +0100
167 +++ mysql-8.0.35/unittest/gunit/innodb/ut0rnd-t.cc      2023-12-17 22:07:25.298271817 +0100
168 @@ -33,7 +33,7 @@
169  #include "storage/innobase/include/ut0crc32.h"
170  #include "storage/innobase/include/ut0rnd.h"
171  
172 -#include "my_xxhash.h"
173 +#include <xxhash.h>
174  
175  namespace innodb_ut0rnd_unittest {
176