Skip to content

Commit adcc1ad

Browse files
committed
Implemented PS-9289 (Merge MySQL 8.0.39) (merge with conflicts)
https://jira.percona.com/browse/PS-9289
2 parents 273f84f + d69a12a commit adcc1ad

File tree

788 files changed

+115416
-6775
lines changed

Some content is hidden

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

788 files changed

+115416
-6775
lines changed

CMakeLists.txt

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -911,7 +911,7 @@ IF(WIN32)
911911
OPTION(WITH_MSCRT_DEBUG "MS Visual Studio Debug CRT instrumentation" OFF)
912912
ENDIF()
913913
IF(NOT WITHOUT_SERVER)
914-
IF(FPROFILE_GENERATE OR FPROFILE_USE)
914+
IF(FPROFILE_GENERATE)
915915
# Do not use data from unit testing when optimizing.
916916
OPTION(WITH_UNIT_TESTS "Compile MySQL with unit tests" OFF)
917917
ELSE()
@@ -1270,6 +1270,7 @@ ENDIF()
12701270
# You need to install the 'lld' RPM/DEB package.
12711271
# LTO build fails with lld, so turn it off by default.
12721272
IF(LINUX AND NOT ALTERNATIVE_LD AND
1273+
NOT ${CMAKE_LINKER} MATCHES "ld\.lld" AND
12731274
NOT WITH_LTO AND NOT CMAKE_COMPILER_FLAG_WITH_LTO)
12741275
OPTION(USE_LD_LLD "Use llvm lld linker" ON)
12751276
ELSE()
@@ -2075,6 +2076,12 @@ IF(LINUX)
20752076
HAVE_PTHREAD_SETNAME_NP)
20762077
ENDIF()
20772078

2079+
# The bundled version must be set up after all the configure stuff above.
2080+
IF(LINUX AND WITH_TCMALLOC STREQUAL "bundled")
2081+
ADD_SUBDIRECTORY(${CMAKE_SOURCE_DIR}/extra/gperftools)
2082+
SET(MALLOC_LIBRARY "${CMAKE_BINARY_DIR}/lib/libtcmalloc.so")
2083+
ENDIF()
2084+
20782085
# Cannot use system tirpc with custom OpenSSL
20792086
IF(WITH_SSL_PATH AND (LINUX_RHEL8 OR LINUX_RHEL9))
20802087
SET(WITH_TIRPC "bundled")
@@ -2252,6 +2259,10 @@ ADD_SUBDIRECTORY(sql-common/oci)
22522259
IF(NOT WITHOUT_SERVER)
22532260
IF(WITH_UNIT_TESTS)
22542261
IF(WIN32)
2262+
# static thread_local objects are not allowed in a .dll
2263+
SET(WITH_SHARED_UNITTEST_LIBRARY_DEFAULT OFF)
2264+
ELSEIF(APPLE AND WITH_SOME_SANITIZER)
2265+
# several down_cast<Json_something> will assert()
22552266
SET(WITH_SHARED_UNITTEST_LIBRARY_DEFAULT OFF)
22562267
ELSE()
22572268
SET(WITH_SHARED_UNITTEST_LIBRARY_DEFAULT ON)
@@ -2689,6 +2700,7 @@ ENDIF(DOXYGEN_FOUND)
26892700

26902701
MYSQL_ADD_EXECUTABLE(stack_direction
26912702
${CMAKE_SOURCE_DIR}/cmake/stack_direction.c
2703+
EXCLUDE_FROM_PGO
26922704
SKIP_INSTALL
26932705
)
26942706

LICENSE

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,25 @@
11
Licensing Information User Manual
22

3-
MySQL 8.0.37 Community
3+
MySQL 8.0.39 Community
44
__________________________________________________________________
55

66
Introduction
77

88
This License Information User Manual contains Oracle's product license
99
and other licensing information, including licensing information for
1010
third-party software which may be included in this distribution of
11-
MySQL 8.0.37 Community.
11+
MySQL 8.0.39 Community.
1212

13-
Last updated: March 2024
13+
Last updated: July 2024
1414

1515
Licensing Information
1616

17-
This release of MySQL 8.0.37 Community is brought to you by the MySQL
17+
This release of MySQL 8.0.39 Community is brought to you by the MySQL
1818
team at Oracle. This software is released under version 2 of the GNU
1919
General Public License (GPLv2), as set forth below, with the following
2020
additional permissions:
2121

22-
This distribution of MySQL 8.0.37 Community is designed to work with
22+
This distribution of MySQL 8.0.39 Community is designed to work with
2323
certain software (including but not limited to OpenSSL) that is
2424
licensed under separate terms, as designated in a particular file or
2525
component or in the license documentation. Without limiting your rights

MYSQL_VERSION

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
MYSQL_VERSION_MAJOR=8
22
MYSQL_VERSION_MINOR=0
3+
<<<<<<< HEAD
34
MYSQL_VERSION_PATCH=37
45
MYSQL_VERSION_EXTRA=-29
6+
||||||| 6dcee9fa4b1
7+
MYSQL_VERSION_PATCH=37
8+
MYSQL_VERSION_EXTRA=
9+
=======
10+
MYSQL_VERSION_PATCH=39
11+
MYSQL_VERSION_EXTRA=
12+
>>>>>>> mysql-8.0.39
513
MYSQL_VERSION_STABILITY="LTS"

cmake/copy_custom_library.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ STRING(REPLACE "patchelf" "" PATCHELF_VERSION "${PATCHELF_VERSION}")
5757

5858
IF(CMAKE_SYSTEM_PROCESSOR STREQUAL "aarch64" AND
5959
PATCHELF_VERSION VERSION_LESS "0.14.5")
60-
SET(PATCHELF_PAGE_SIZE_ARGS --page-size ${CPU_PAGE_SIZE})
60+
SET(PATCHELF_PAGE_SIZE_ARGS --page-size 65536)
6161
ENDIF()
6262

6363
# Patch RPATH so that we find NEEDED libraries at load time.

cmake/copy_openssl_binary.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ IF(LINUX)
5757

5858
IF(CMAKE_SYSTEM_PROCESSOR STREQUAL "aarch64" AND
5959
PATCHELF_VERSION VERSION_LESS "0.14.5")
60-
SET(PATCHELF_PAGE_SIZE_ARGS --page-size ${CPU_PAGE_SIZE})
60+
SET(PATCHELF_PAGE_SIZE_ARGS --page-size 65536)
6161
ENDIF()
6262

6363
EXECUTE_PROCESS(

cmake/googletest.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
# along with this program; if not, write to the Free Software
2222
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
2323

24-
SET(GOOGLETEST_RELEASE googletest-release-1.12.0)
24+
SET(GOOGLETEST_RELEASE googletest-1.14.0)
2525
SET(GMOCK_SOURCE_DIR
2626
${CMAKE_SOURCE_DIR}/extra/googletest/${GOOGLETEST_RELEASE}/googlemock)
2727
SET(GTEST_SOURCE_DIR

cmake/install_macros.cmake

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -648,7 +648,6 @@ FUNCTION(COPY_OPENSSL_BINARY executable_full_filename
648648
-DOPENSSL_VERSION="${OPENSSL_VERSION}"
649649
-DINSTALL_PRIV_LIBDIR="${INSTALL_PRIV_LIBDIR}"
650650
-DPATCHELF_EXECUTABLE="${PATCHELF_EXECUTABLE}"
651-
-DCPU_PAGE_SIZE="${CPU_PAGE_SIZE}"
652651
-DBUILD_IS_SINGLE_CONFIG="${BUILD_IS_SINGLE_CONFIG}"
653652
-DCMAKE_GENERATOR="${CMAKE_GENERATOR}"
654653
-DCMAKE_SYSTEM_PROCESSOR="${CMAKE_SYSTEM_PROCESSOR}"
@@ -755,7 +754,6 @@ FUNCTION(COPY_CUSTOM_SHARED_LIBRARY library_full_filename subdir
755754
-Dlibrary_version="${library_version}"
756755
-Dsubdir="${subdir}"
757756
-DPATCHELF_EXECUTABLE="${PATCHELF_EXECUTABLE}"
758-
-DCPU_PAGE_SIZE="${CPU_PAGE_SIZE}"
759757
-DCMAKE_SYSTEM_PROCESSOR="${CMAKE_SYSTEM_PROCESSOR}"
760758
-P ${CMAKE_SOURCE_DIR}/cmake/copy_custom_library.cmake
761759

cmake/libutils.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ FUNCTION(ADD_STATIC_LIBRARY TARGET)
9191
ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/archive_output_directory)
9292

9393
IF(ARG_EXCLUDE_FROM_PGO)
94-
IF(FPROFILE_GENERATE OR FPROFILE_USE)
94+
IF(FPROFILE_GENERATE)
9595
SET(ARG_EXCLUDE_FROM_ALL TRUE)
9696
ENDIF()
9797
ENDIF()

cmake/malloc_utils.cmake

Lines changed: 23 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,10 @@ FUNCTION(WARN_MISSING_SYSTEM_JEMALLOC)
4040
ENDFUNCTION()
4141

4242
FUNCTION(FIND_MALLOC_LIBRARY library_name)
43+
# Skip system tcmalloc, and build the bundled version instead.
44+
IF(WITH_TCMALLOC STREQUAL "bundled")
45+
RETURN()
46+
ENDIF()
4347
FIND_LIBRARY(MALLOC_LIBRARY ${library_name})
4448
IF(NOT MALLOC_LIBRARY)
4549
IF(library_name MATCHES "tcmalloc")
@@ -50,24 +54,24 @@ FUNCTION(FIND_MALLOC_LIBRARY library_name)
5054
MESSAGE(FATAL_ERROR "Library ${library_name} not found")
5155
ENDIF()
5256

53-
STRING_APPEND(CMAKE_C_FLAGS " -fno-builtin-malloc -fno-builtin-calloc")
54-
STRING_APPEND(CMAKE_C_FLAGS " -fno-builtin-realloc -fno-builtin-free")
55-
STRING_APPEND(CMAKE_CXX_FLAGS " -fno-builtin-malloc -fno-builtin-calloc")
56-
STRING_APPEND(CMAKE_CXX_FLAGS " -fno-builtin-realloc -fno-builtin-free")
57-
58-
STRING_APPEND(CMAKE_EXE_LINKER_FLAGS " -l${library_name}")
59-
STRING_APPEND(CMAKE_MODULE_LINKER_FLAGS " -l${library_name}")
60-
STRING_APPEND(CMAKE_SHARED_LINKER_FLAGS " -l${library_name}")
61-
62-
SET(FIND_MALLOC_LIBRARY_FLAG "-l${library_name}" CACHE STRING "" FORCE)
57+
# There are some special considerations when using the RedHat gcc toolsets:
58+
# https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/8/
59+
# html/developing_c_and_cpp_applications_in_rhel_8/
60+
# additional-toolsets-for-development_developing-applications
61+
#
62+
# For mysqld (and possibly other binaries),
63+
# we need tcmalloc to be the last library on the link line.
64+
# Or more specifically:
65+
# after any library that might pull in libstdc++_nonshared.a
66+
# Cmake will analyze target dependencies, and will add -ltcmalloc
67+
# somewhere on the compiler/linker command line accordingly.
68+
# There is no way to tell cmake to "link this library last",
69+
# so we modify CMAKE_CXX_LINK_EXECUTABLE instead.
70+
# For the original contents of CMAKE_CXX_LINK_EXECUTABLE,
71+
# see e.g. cmake-3.20.1/Modules/CMakeCXXInformation.cmake
72+
SET(ORIGINAL_CMAKE_CXX_LINK_EXECUTABLE "${CMAKE_CXX_LINK_EXECUTABLE}")
73+
SET(CMAKE_CXX_LINK_EXECUTABLE "${CMAKE_CXX_LINK_EXECUTABLE} -l${library_name}")
6374

64-
FOREACH(flag
65-
CMAKE_C_FLAGS
66-
CMAKE_CXX_FLAGS
67-
CMAKE_EXE_LINKER_FLAGS
68-
CMAKE_MODULE_LINKER_FLAGS
69-
CMAKE_SHARED_LINKER_FLAGS
70-
)
71-
SET(${flag} "${${flag}}" PARENT_SCOPE)
72-
ENDFOREACH()
75+
SET(ORIGINAL_CMAKE_CXX_LINK_EXECUTABLE "${ORIGINAL_CMAKE_CXX_LINK_EXECUTABLE}" PARENT_SCOPE)
76+
SET(CMAKE_CXX_LINK_EXECUTABLE "${CMAKE_CXX_LINK_EXECUTABLE}" PARENT_SCOPE)
7377
ENDFUNCTION()

cmake/mysql_add_executable.cmake

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ FUNCTION(MYSQL_ADD_EXECUTABLE target_arg)
8383
EXCLUDE_FROM_ALL # add target, but do not build it by default
8484
EXCLUDE_FROM_PGO # add target, but do not build for PGO
8585
SKIP_INSTALL # do not install it
86+
SKIP_TCMALLOC # do not link with tcmalloc
8687
)
8788
SET(EXECUTABLE_ONE_VALUE_KW
8889
ADD_TEST # add unit test, sets SKIP_INSTALL
@@ -121,6 +122,19 @@ FUNCTION(MYSQL_ADD_EXECUTABLE target_arg)
121122
ADD_EXECUTABLE(${target} ${sources})
122123
TARGET_COMPILE_FEATURES(${target} PUBLIC cxx_std_17)
123124

125+
IF(TARGET my_tcmalloc)
126+
IF(ARG_SKIP_TCMALLOC OR target MATCHES "^rpd")
127+
# nothing, use glibc malloc/free
128+
ELSE()
129+
IF(WITH_VALGRIND)
130+
TARGET_LINK_LIBRARIES(${target} my_tcmalloc_debug)
131+
ELSE()
132+
TARGET_LINK_LIBRARIES(${target} my_tcmalloc)
133+
ENDIF()
134+
ADD_INSTALL_RPATH(${target} "\$ORIGIN/../${INSTALL_PRIV_LIBDIR}")
135+
ENDIF()
136+
ENDIF()
137+
124138
SET_PATH_TO_CUSTOM_SSL_FOR_APPLE(${target})
125139

126140
IF(ARG_DEPENDENCIES)
@@ -144,7 +158,7 @@ FUNCTION(MYSQL_ADD_EXECUTABLE target_arg)
144158
ENDIF()
145159

146160
IF(ARG_EXCLUDE_FROM_PGO)
147-
IF(FPROFILE_GENERATE OR FPROFILE_USE)
161+
IF(FPROFILE_GENERATE)
148162
SET(ARG_EXCLUDE_FROM_ALL TRUE)
149163
SET(ARG_SKIP_INSTALL TRUE)
150164
UNSET(ARG_ADD_TEST)

extra/abseil/CMakeLists.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,13 @@
2121
# along with this program; if not, write to the Free Software
2222
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
2323

24+
DISABLE_MISSING_PROFILE_WARNING()
25+
26+
MY_CHECK_CXX_COMPILER_WARNING("-Wstringop-overflow" HAS_WARN_FLAG)
27+
IF(HAS_WARN_FLAG)
28+
STRING_APPEND(CMAKE_CXX_FLAGS " ${HAS_WARN_FLAG}")
29+
ENDIF()
30+
2431
MY_CHECK_CXX_COMPILER_WARNING("-Wmissing-profile" HAS_MISSING_PROFILE)
2532
IF(HAS_MISSING_PROFILE)
2633
STRING_APPEND(CMAKE_CXX_FLAGS " ${HAS_MISSING_PROFILE}")

extra/googletest/googletest-release-1.12.0/googlemock/CMakeLists.txt renamed to extra/googletest/googletest-1.14.0/googlemock/CMakeLists.txt

Lines changed: 10 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,7 @@ endif()
3636
# as ${gmock_SOURCE_DIR} and to the root binary directory as
3737
# ${gmock_BINARY_DIR}.
3838
# Language "C" is required for find_package(Threads).
39-
cmake_minimum_required(VERSION 3.5)
40-
cmake_policy(SET CMP0048 NEW)
39+
cmake_minimum_required(VERSION 3.13)
4140
project(gmock VERSION ${GOOGLETEST_VERSION} LANGUAGES CXX C)
4241

4342
if (COMMAND set_up_hermetic_build)
@@ -101,18 +100,14 @@ else()
101100
target_link_libraries(gmock_main PUBLIC gmock)
102101
set_target_properties(gmock_main PROPERTIES VERSION ${GOOGLETEST_VERSION})
103102
endif()
104-
# If the CMake version supports it, attach header directory information
105-
# to the targets for when we are part of a parent build (ie being pulled
106-
# in via add_subdirectory() rather than being a standalone build).
107-
if (DEFINED CMAKE_VERSION AND NOT "${CMAKE_VERSION}" VERSION_LESS "2.8.11")
108-
string(REPLACE ";" "$<SEMICOLON>" dirs "${gmock_build_include_dirs}")
109-
target_include_directories(gmock SYSTEM INTERFACE
110-
"$<BUILD_INTERFACE:${dirs}>"
111-
"$<INSTALL_INTERFACE:$<INSTALL_PREFIX>/${CMAKE_INSTALL_INCLUDEDIR}>")
112-
target_include_directories(gmock_main SYSTEM INTERFACE
113-
"$<BUILD_INTERFACE:${dirs}>"
114-
"$<INSTALL_INTERFACE:$<INSTALL_PREFIX>/${CMAKE_INSTALL_INCLUDEDIR}>")
115-
endif()
103+
104+
string(REPLACE ";" "$<SEMICOLON>" dirs "${gmock_build_include_dirs}")
105+
target_include_directories(gmock SYSTEM INTERFACE
106+
"$<BUILD_INTERFACE:${dirs}>"
107+
"$<INSTALL_INTERFACE:$<INSTALL_PREFIX>/${CMAKE_INSTALL_INCLUDEDIR}>")
108+
target_include_directories(gmock_main SYSTEM INTERFACE
109+
"$<BUILD_INTERFACE:${dirs}>"
110+
"$<INSTALL_INTERFACE:$<INSTALL_PREFIX>/${CMAKE_INSTALL_INCLUDEDIR}>")
116111

117112
########################################################################
118113
#
@@ -136,11 +131,7 @@ if (gmock_build_tests)
136131
enable_testing()
137132

138133
if (MINGW OR CYGWIN)
139-
if (CMAKE_VERSION VERSION_LESS "2.8.12")
140-
add_compile_options("-Wa,-mbig-obj")
141-
else()
142-
add_definitions("-Wa,-mbig-obj")
143-
endif()
134+
add_compile_options("-Wa,-mbig-obj")
144135
endif()
145136

146137
############################################################

0 commit comments

Comments
 (0)