Skip to content

Commit 47f906a

Browse files
committed
Merge branch 'mysql-5.7-cluster-7.5' into mysql-5.7-cluster-7.6
(Merge tag 'clone-5.7.35-build' into mysql-5.7-cluster-7.5) Change-Id: I6ec640ee39231b445eb0c389b9f1cda5b8443dc6
2 parents a909a4e + 20a5645 commit 47f906a

File tree

179 files changed

+11942
-6115
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

179 files changed

+11942
-6115
lines changed

CMakeLists.txt

+15-1
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,18 @@ IF(CMAKE_GENERATOR MATCHES "Visual Studio" OR CMAKE_GENERATOR STREQUAL "Xcode")
168168
SET(BUILD_IS_SINGLE_CONFIG FALSE)
169169
ENDIF()
170170

171+
IF(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
172+
SET(MY_COMPILER_IS_CLANG 1)
173+
ELSEIF(CMAKE_CXX_COMPILER_ID MATCHES "GNU")
174+
SET(MY_COMPILER_IS_GNU 1)
175+
ELSEIF(CMAKE_CXX_COMPILER_ID MATCHES "SunPro")
176+
SET(MY_COMPILER_IS_SUNPRO 1)
177+
ENDIF()
178+
179+
IF(MY_COMPILER_IS_CLANG OR MY_COMPILER_IS_GNU)
180+
SET(MY_COMPILER_IS_GNU_OR_CLANG 1)
181+
ENDIF()
182+
171183
# Maintainer mode is default on only for debug builds using GCC/G++
172184
IF(CMAKE_BUILD_TYPE MATCHES "Debug" OR WITH_DEBUG)
173185
IF(CMAKE_COMPILER_IS_GNUCC AND CMAKE_COMPILER_IS_GNUCXX)
@@ -332,6 +344,8 @@ MACRO(MY_SANITIZER_CHECK SAN_OPT RESULT)
332344
MY_CHECK_C_COMPILER_FLAG("${SAN_OPT}" C_RESULT)
333345
MY_CHECK_CXX_COMPILER_FLAG("${SAN_OPT}" CXX_RESULT)
334346
IF(C_RESULT AND CXX_RESULT)
347+
STRING_APPEND(CMAKE_C_FLAGS " ${SAN_OPT}")
348+
STRING_APPEND(CMAKE_CXX_FLAGS " ${SAN_OPT}")
335349
# We switch on basic optimization also for debug builds.
336350
# We disable inlining for stack trace readability.
337351
# With optimization we may get some warnings, so we switch off -Werror
@@ -348,10 +362,10 @@ MACRO(MY_SANITIZER_CHECK SAN_OPT RESULT)
348362
ENDMACRO()
349363

350364
OPTION(WITH_ASAN "Enable address sanitizer" OFF)
351-
OPTION(WITH_ASAN_SCOPE "Enable -fsanitize-address-use-after-scope" OFF)
352365
IF(WITH_ASAN)
353366
MY_SANITIZER_CHECK("-fsanitize=address" WITH_ASAN_OK)
354367
IF(WITH_ASAN_OK)
368+
OPTION(WITH_ASAN_SCOPE "Enable -fsanitize-address-use-after-scope" ON)
355369
SET(HAVE_ASAN 1)
356370
# This works with clang, but not gcc it seems.
357371
MY_CHECK_CXX_COMPILER_FLAG(

LICENSE

+33-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Introduction
1010
third-party software which may be included in this distribution of
1111
MySQL NDB Cluster 7.6.12 (and later).
1212

13-
Last updated: March 2021
13+
Last updated: April 2021
1414

1515
Licensing Information
1616

@@ -1672,6 +1672,38 @@ THE SOFTWARE.
16721672
======================================================================
16731673
======================================================================
16741674

1675+
jemalloc
1676+
1677+
jemalloc
1678+
Copyright (C) 2002-present Jason Evans <jasone@canonware.com>.
1679+
All rights reserved.
1680+
Copyright (C) 2007-2012 Mozilla Foundation. All rights reserved.
1681+
Copyright (C) 2009-present Facebook, Inc. All rights reserved.
1682+
1683+
Redistribution and use in source and binary forms, with or without
1684+
modification, are permitted provided that the following conditions are met:
1685+
1. Redistributions of source code must retain the above copyright notice(s),
1686+
this list of conditions and the following disclaimer.
1687+
2. Redistributions in binary form must reproduce the above copyright
1688+
notice(s),
1689+
this list of conditions and the following disclaimer in the documentation
1690+
and/or other materials provided with the distribution.
1691+
1692+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER(S) ``AS IS'' AND ANY
1693+
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
1694+
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
1695+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) BE LIABLE FOR ANY
1696+
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
1697+
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
1698+
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
1699+
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
1700+
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
1701+
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
1702+
SUCH DAMAGE.
1703+
1704+
======================================================================
1705+
======================================================================
1706+
16751707
lib_sql.cc
16761708

16771709
lib_sql.cc

VERSION

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
MYSQL_VERSION_MAJOR=5
22
MYSQL_VERSION_MINOR=7
3-
MYSQL_VERSION_PATCH=34
3+
MYSQL_VERSION_PATCH=35
44
MYSQL_VERSION_EXTRA=-ndb-7.6.19

client/CMakeLists.txt

-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ INCLUDE_DIRECTORIES(
2424
${CMAKE_SOURCE_DIR}/client
2525
${CMAKE_SOURCE_DIR}/include
2626
${CMAKE_SOURCE_DIR}/mysys_ssl
27-
${LZ4_INCLUDE_DIR}
2827
${SSL_INCLUDE_DIRS}
2928
${CMAKE_SOURCE_DIR}/libmysql
3029
${CMAKE_SOURCE_DIR}/libbinlogevents/include

client/dump/CMakeLists.txt

-5
Original file line numberDiff line numberDiff line change
@@ -140,11 +140,6 @@ ADD_CONVENIENCE_LIBRARY(mysqlpump_lib ${MYSQLPUMP_LIB_SOURCES})
140140
TARGET_LINK_LIBRARIES(mysqlpump_lib
141141
client_base ${LZ4_LIBRARY})
142142

143-
ADD_COMPILE_FLAGS(
144-
compression_writer.cc
145-
mysqldump_tool_chain_maker.cc
146-
COMPILE_FLAGS -I${LZ4_INCLUDE_DIR}
147-
)
148143
MYSQL_ADD_EXECUTABLE(mysqlpump program.cc)
149144

150145
TARGET_LINK_LIBRARIES(mysqlpump mysqlpump_lib ${LOCAL_BOOST_LIB})

cmake/build_configurations/compiler_options.cmake

+15
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,21 @@ IF(UNIX)
174174
STRING_PREPEND(CMAKE_CXX_FLAGS_RELEASE "${SECTIONS_FLAG} ")
175175
STRING_PREPEND(CMAKE_CXX_FLAGS_MINSIZEREL "${SECTIONS_FLAG} ")
176176

177+
# We need -O3 by default for RelWithDebInfo in order to avoid
178+
# performance regressions from earlier releases.
179+
# To disable this (and everything else in this file),
180+
# do 'cmake -DWITH_DEFAULT_COMPILER_OPTIONS=NO'.
181+
IF(LINUX)
182+
FOREACH(flag
183+
CMAKE_C_FLAGS_RELEASE
184+
CMAKE_C_FLAGS_RELWITHDEBINFO
185+
CMAKE_CXX_FLAGS_RELEASE
186+
CMAKE_CXX_FLAGS_RELWITHDEBINFO
187+
)
188+
STRING(REPLACE "-O2" "-O3" "${flag}" "${${flag}}")
189+
ENDFOREACH()
190+
ENDIF()
191+
177192
ENDIF()
178193

179194
SET(CMAKE_C_FLAGS_DEBUG

cmake/lz4.cmake

+21-12
Original file line numberDiff line numberDiff line change
@@ -24,29 +24,38 @@
2424
# bundled is the default
2525

2626
MACRO (FIND_SYSTEM_LZ4)
27-
FIND_PATH(PATH_TO_LZ4 NAMES lz4frame.h)
28-
FIND_LIBRARY(LZ4_SYSTEM_LIBRARY NAMES lz4)
29-
IF (PATH_TO_LZ4 AND LZ4_SYSTEM_LIBRARY)
27+
FIND_PATH(LZ4_INCLUDE_DIR
28+
NAMES lz4frame.h)
29+
FIND_LIBRARY(LZ4_SYSTEM_LIBRARY
30+
NAMES lz4)
31+
IF (LZ4_INCLUDE_DIR AND LZ4_SYSTEM_LIBRARY)
3032
SET(SYSTEM_LZ4_FOUND 1)
31-
SET(LZ4_INCLUDE_DIR ${PATH_TO_LZ4})
3233
SET(LZ4_LIBRARY ${LZ4_SYSTEM_LIBRARY})
33-
MESSAGE(STATUS "LZ4_INCLUDE_DIR ${LZ4_INCLUDE_DIR}")
34-
MESSAGE(STATUS "LZ4_LIBRARY ${LZ4_LIBRARY}")
3534
ENDIF()
3635
ENDMACRO()
3736

37+
SET(LZ4_VERSION "lz4-1.9.3")
38+
SET(BUNDLED_LZ4_PATH "${CMAKE_SOURCE_DIR}/extra/lz4/${LZ4_VERSION}")
39+
3840
MACRO (MYSQL_USE_BUNDLED_LZ4)
41+
SET(WITH_LZ4 "bundled" CACHE STRING "Bundled lz4 library")
3942
SET(BUILD_BUNDLED_LZ4 1)
40-
SET(LZ4_INCLUDE_DIR ${CMAKE_SOURCE_DIR}/extra/lz4)
43+
INCLUDE_DIRECTORIES(BEFORE SYSTEM ${BUNDLED_LZ4_PATH})
4144
SET(LZ4_LIBRARY lz4_lib)
45+
ADD_CONVENIENCE_LIBRARY(lz4_lib
46+
${BUNDLED_LZ4_PATH}/lz4.c
47+
${BUNDLED_LZ4_PATH}/lz4frame.c
48+
${BUNDLED_LZ4_PATH}/lz4hc.c
49+
${BUNDLED_LZ4_PATH}/xxhash.c
50+
)
4251
ENDMACRO()
4352

44-
IF (NOT WITH_LZ4)
45-
SET(WITH_LZ4 "bundled" CACHE STRING "By default use bundled lz4 library")
46-
ENDIF()
47-
4853
MACRO (MYSQL_CHECK_LZ4)
49-
IF (WITH_LZ4 STREQUAL "bundled")
54+
IF(NOT WITH_LZ4)
55+
SET(WITH_LZ4 "bundled" CACHE STRING "By default use bundled lz4 library")
56+
ENDIF()
57+
58+
IF(WITH_LZ4 STREQUAL "bundled")
5059
MYSQL_USE_BUNDLED_LZ4()
5160
ELSEIF(WITH_LZ4 STREQUAL "system")
5261
FIND_SYSTEM_LZ4()

configure.cmake

+9
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,15 @@ IF(UNIX)
150150
ENDIF()
151151
MY_SEARCH_LIBS(gethostbyname_r "nsl_r;nsl" LIBNSL)
152152
MY_SEARCH_LIBS(bind "bind;socket" LIBBIND)
153+
# Feature test broken with -fsanitize=address, look for lib first.
154+
IF(CMAKE_C_FLAGS MATCHES "-fsanitize=")
155+
CHECK_LIBRARY_EXISTS(crypt crypt "" HAVE_crypt_IN_crypt)
156+
# If found, do not look in libc.
157+
IF(HAVE_crypt_IN_crypt)
158+
SET(LIBCRYPT crypt)
159+
SET(${LIBCRYPT} 1)
160+
ENDIF()
161+
ENDIF()
153162
MY_SEARCH_LIBS(crypt crypt LIBCRYPT)
154163
MY_SEARCH_LIBS(setsockopt socket LIBSOCKET)
155164
MY_SEARCH_LIBS(dlopen dl LIBDL)

extra/CMakeLists.txt

+1-12
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222

2323
INCLUDE_DIRECTORIES(
2424
${CMAKE_SOURCE_DIR}/include
25-
${LZ4_INCLUDE_DIR}
2625
# Following is for perror, in case NDB is compiled in.
2726
${CMAKE_SOURCE_DIR}/storage/ndb/include
2827
${CMAKE_BINARY_DIR}/storage/ndb/include
@@ -40,15 +39,6 @@ IF(NOT CMAKE_CROSSCOMPILING)
4039
SET_TARGET_PROPERTIES(comp_err PROPERTIES LINKER_LANGUAGE CXX)
4140
ENDIF()
4241

43-
IF (BUILD_BUNDLED_LZ4)
44-
ADD_CONVENIENCE_LIBRARY(lz4_lib
45-
lz4/lz4.c
46-
lz4/lz4frame.c
47-
lz4/lz4hc.c
48-
lz4/xxhash.c
49-
)
50-
ENDIF()
51-
5242
ADD_CUSTOM_COMMAND(OUTPUT ${PROJECT_BINARY_DIR}/include/mysqld_error.h
5343
${PROJECT_BINARY_DIR}/sql/share/english/errmsg.sys
5444
COMMAND comp_err
@@ -102,9 +92,8 @@ TARGET_LINK_LIBRARIES(zlib_decompress ${ZLIB_LIBRARY})
10292

10393
IF(WITH_INNOBASE_STORAGE_ENGINE)
10494

105-
IF(LZ4_INCLUDE_DIR AND LZ4_LIBRARY)
95+
IF(LZ4_LIBRARY)
10696
ADD_DEFINITIONS(-DHAVE_LZ4=1)
107-
INCLUDE_DIRECTORIES(${LZ4_INCLUDE_DIR})
10897
ENDIF()
10998

11099
# Add path to the InnoDB headers

extra/lz4/LICENSE renamed to extra/lz4/lz4-1.9.3/LICENSE

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
LZ4 Library
2-
Copyright (c) 2011-2014, Yann Collet
2+
Copyright (c) 2011-2016, Yann Collet
33
All rights reserved.
44

55
Redistribution and use in source and binary forms, with or without modification,

0 commit comments

Comments
 (0)