Skip to content

Commit ce45c63

Browse files
committed
Merge tag 'clone-5.7.22-build' into mysql-5.7-cluster-7.5
Change-Id: Ib863957070763c17ccffd9a926bf5ce99e7221da
2 parents 3673a4c + ce64929 commit ce45c63

File tree

434 files changed

+15524
-2783
lines changed

Some content is hidden

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

434 files changed

+15524
-2783
lines changed

CMakeLists.txt

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@
1515

1616
IF(WIN32)
1717
# CMake 2.8.12 is needed for Visual Studio 2013
18-
CMAKE_MINIMUM_REQUIRED(VERSION 2.8.12)
18+
# CMake 3.1.0 is needed for $<TARGET_PDB_FILE:${target}>
19+
CMAKE_MINIMUM_REQUIRED(VERSION 3.1.0)
1920
ELSE()
2021
# There's a bug in unzipping prior to 2.8.2
2122
# Debian 7 has the oldest cmake we need to support
@@ -33,12 +34,10 @@ IF(CMAKE_VERSION VERSION_EQUAL "2.8.12" OR
3334
CMAKE_POLICY(SET CMP0022 OLD)
3435
ENDIF()
3536

36-
# We use the LOCATION target property (CMP0026)
37-
# and get_target_property() for non-existent targets (CMP0045)
37+
# We use get_target_property() for non-existent targets (CMP0045)
3838
# and INSTALL_NAME_DIR (CMP0042)
3939
IF(CMAKE_VERSION VERSION_EQUAL "3.0.0" OR
4040
CMAKE_VERSION VERSION_GREATER "3.0.0")
41-
CMAKE_POLICY(SET CMP0026 OLD)
4241
CMAKE_POLICY(SET CMP0045 OLD)
4342
CMAKE_POLICY(SET CMP0042 OLD)
4443
ENDIF()

Docs/ChangeLog

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
You can find a detailed list of changes at
2+
to https://github.com/mysql/mysql-server/commits/5.7

VERSION

Lines changed: 1 addition & 1 deletion
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=21
3+
MYSQL_VERSION_PATCH=22
44
MYSQL_VERSION_EXTRA=-ndb-7.5.10

client/mysqladmin.cc

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
2+
Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved.
33
44
This program is free software; you can redistribute it and/or modify
55
it under the terms of the GNU General Public License as published by
@@ -1092,12 +1092,14 @@ static int execute_commands(MYSQL *mysql,int argc, char **argv)
10921092

10931093
/* Warn about password being set in non ssl connection */
10941094
#if defined(HAVE_OPENSSL) && !defined(EMBEDDED_LIBRARY)
1095-
uint ssl_mode;
1096-
if (!mysql_get_option(mysql, MYSQL_OPT_SSL_MODE, &ssl_mode) &&
1097-
ssl_mode <= SSL_MODE_PREFERRED)
10981095
{
1099-
fprintf(stderr, "Warning: Since password will be sent to server in "
1100-
"plain text, use ssl connection to ensure password safety.\n");
1096+
uint ssl_mode= 0;
1097+
if (!mysql_get_option(mysql, MYSQL_OPT_SSL_MODE, &ssl_mode) &&
1098+
ssl_mode <= SSL_MODE_PREFERRED)
1099+
{
1100+
fprintf(stderr, "Warning: Since password will be sent to server in "
1101+
"plain text, use ssl connection to ensure password safety.\n");
1102+
}
11011103
}
11021104
#endif
11031105
memset(buff, 0, sizeof(buff));

client/mysqlbinlog.cc

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
2+
Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved.
33
44
This program is free software; you can redistribute it and/or modify
55
it under the terms of the GNU General Public License as published by
@@ -1167,11 +1167,14 @@ void end_binlog(PRINT_EVENT_INFO *print_event_info)
11671167
Print the given event, and either delete it or delegate the deletion
11681168
to someone else.
11691169
1170-
The deletion may be delegated in two cases: (1) the event is a
1171-
Format_description_log_event, and is saved in
1172-
glob_description_event; (2) the event is a Create_file_log_event,
1173-
and is saved in load_processor.
1174-
1170+
The deletion may be delegated in these cases:
1171+
(1) the event is a Format_description_log_event, and is saved in
1172+
glob_description_event.
1173+
(2) the event is a Create_file_log_event, and is saved in load_processor.
1174+
(3) the event is an Intvar, Rand or User_var event, it will be kept until
1175+
the subsequent Query_log_event.
1176+
(4) the event is a Table_map_log_event, it will be kept until the subsequent
1177+
Rows_log_event.
11751178
@param[in,out] print_event_info Parameters and context state
11761179
determining how to print.
11771180
@param[in] ev Log_event to process.

client/mysqltest.cc

Lines changed: 24 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
1+
/* Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved.
22
33
This program is free software; you can redistribute it and/or modify
44
it under the terms of the GNU General Public License as published by
@@ -50,6 +50,7 @@
5050

5151
#include <welcome_copyright_notice.h> // ORACLE_WELCOME_COPYRIGHT_NOTICE
5252

53+
#include <sstream>
5354
#include <string>
5455
#include <algorithm>
5556
#include <functional>
@@ -8224,8 +8225,8 @@ void run_query_stmt(MYSQL *mysql, struct st_command *command,
82248225
/* Init dynamic strings for warnings */
82258226
if (!disable_warnings)
82268227
{
8227-
init_dynamic_string(&ds_prepare_warnings, NULL, 0, 256);
8228-
init_dynamic_string(&ds_execute_warnings, NULL, 0, 256);
8228+
init_dynamic_string(&ds_prepare_warnings, "", 0, 256);
8229+
init_dynamic_string(&ds_execute_warnings, "", 0, 256);
82298230
}
82308231

82318232
/*
@@ -8327,13 +8328,6 @@ void run_query_stmt(MYSQL *mysql, struct st_command *command,
83278328
append_stmt_result(ds, stmt, fields, num_fields);
83288329

83298330
mysql_free_result(res); /* Free normal result set with meta data */
8330-
8331-
/*
8332-
Clear prepare warnings if there are execute warnings,
8333-
since they are probably duplicated.
8334-
*/
8335-
if (ds_execute_warnings.length || mysql->warning_count)
8336-
dynstr_set(&ds_prepare_warnings, NULL);
83378331
}
83388332
else
83398333
{
@@ -8368,8 +8362,26 @@ void run_query_stmt(MYSQL *mysql, struct st_command *command,
83688362
dynstr_append_mem(ds, ds_warnings->str,
83698363
ds_warnings->length);
83708364
if (ds_prepare_warnings.length)
8371-
dynstr_append_mem(ds, ds_prepare_warnings.str,
8372-
ds_prepare_warnings.length);
8365+
{
8366+
/* Split the string to get each warning */
8367+
std::stringstream prepare_warnings(ds_prepare_warnings.str);
8368+
std::string prepare_warning;
8369+
/*
8370+
If the warning is already present in the execute phase,
8371+
do not append it
8372+
*/
8373+
while (std::getline(prepare_warnings, prepare_warning))
8374+
{
8375+
std::string execute_warnings(ds_execute_warnings.str);
8376+
if ((execute_warnings + "\n").find(prepare_warning + "\n") ==
8377+
std::string::npos)
8378+
{
8379+
dynstr_append_mem(ds, prepare_warning.c_str(),
8380+
prepare_warning.length());
8381+
dynstr_append_mem(ds, "\n", 1);
8382+
}
8383+
}
8384+
}
83738385
if (ds_execute_warnings.length)
83748386
dynstr_append_mem(ds, ds_execute_warnings.str,
83758387
ds_execute_warnings.length);

cmake/install_macros.cmake

Lines changed: 105 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@
1616
GET_FILENAME_COMPONENT(MYSQL_CMAKE_SCRIPT_DIR ${CMAKE_CURRENT_LIST_FILE} PATH)
1717
INCLUDE(${MYSQL_CMAKE_SCRIPT_DIR}/cmake_parse_arguments.cmake)
1818

19+
# For windows: install .pdf file for each target.
1920
MACRO (INSTALL_DEBUG_SYMBOLS targets)
2021
IF(MSVC)
2122
FOREACH(target ${targets})
22-
GET_TARGET_PROPERTY(location ${target} LOCATION)
2323
GET_TARGET_PROPERTY(type ${target} TYPE)
2424
IF(NOT INSTALL_LOCATION)
2525
IF(type MATCHES "STATIC_LIBRARY"
@@ -33,22 +33,16 @@ MACRO (INSTALL_DEBUG_SYMBOLS targets)
3333
"cannot determine type of ${target}. Don't now where to install")
3434
ENDIF()
3535
ENDIF()
36-
STRING(REPLACE ".exe" ".pdb" pdb_location ${location})
37-
STRING(REPLACE ".dll" ".pdb" pdb_location ${pdb_location})
38-
STRING(REPLACE ".lib" ".pdb" pdb_location ${pdb_location})
39-
IF(CMAKE_GENERATOR MATCHES "Visual Studio")
40-
STRING(REPLACE
41-
"${CMAKE_CFG_INTDIR}" "\${CMAKE_INSTALL_CONFIG_NAME}"
42-
pdb_location ${pdb_location})
43-
ENDIF()
36+
4437
IF(target STREQUAL "mysqld")
45-
SET(comp Server)
38+
SET(comp Server)
4639
ELSE()
4740
SET(comp Debuginfo)
48-
ENDIF()
41+
ENDIF()
42+
4943
# No .pdb file for static libraries.
5044
IF(NOT type MATCHES "STATIC_LIBRARY")
51-
INSTALL(FILES ${pdb_location}
45+
INSTALL(FILES $<TARGET_PDB_FILE:${target}>
5246
DESTINATION ${INSTALL_LOCATION} COMPONENT ${comp})
5347
ENDIF()
5448
ENDFOREACH()
@@ -110,41 +104,112 @@ FUNCTION(MYSQL_INSTALL_TARGETS)
110104
SET(INSTALL_LOCATION)
111105
ENDFUNCTION()
112106

113-
# Optionally install mysqld/client/embedded from debug build run. outside of the current build dir
107+
# Optionally install mysqld/client/embedded from debug build run.
108+
# outside of the current build dir
114109
# (unless multi-config generator is used like Visual Studio or Xcode).
115110
# For single-config generators like Makefile generators we default Debug
116111
# build directory to ${buildroot}/../debug.
117112
GET_FILENAME_COMPONENT(BINARY_PARENTDIR ${CMAKE_BINARY_DIR} PATH)
118-
SET(DEBUGBUILDDIR "${BINARY_PARENTDIR}/debug" CACHE INTERNAL "Directory of debug build")
113+
SET(DEBUGBUILDDIR "${BINARY_PARENTDIR}/debug" CACHE INTERNAL
114+
"Directory of debug build")
119115

120116

121117
FUNCTION(INSTALL_DEBUG_TARGET target)
122-
MYSQL_PARSE_ARGUMENTS(ARG
123-
"DESTINATION;RENAME;PDB_DESTINATION;COMPONENT;SUFFIX"
124-
""
125-
${ARGN}
126-
)
118+
MYSQL_PARSE_ARGUMENTS(ARG
119+
"DESTINATION;RENAME;COMPONENT"
120+
""
121+
${ARGN}
122+
)
123+
124+
# Relevant only for RelWithDebInfo builds
125+
IF(BUILD_IS_SINGLE_CONFIG AND CMAKE_BUILD_TYPE STREQUAL "Debug")
126+
RETURN()
127+
ENDIF()
128+
127129
GET_TARGET_PROPERTY(target_type ${target} TYPE)
130+
GET_TARGET_PROPERTY(target_name ${target} DEBUG_OUTPUT_NAME)
131+
IF(NOT target_name)
132+
GET_TARGET_PROPERTY(target_name ${target} OUTPUT_NAME)
133+
IF(NOT target_name)
134+
SET(target_name "${target}")
135+
ENDIF()
136+
ENDIF()
137+
138+
# On windows we install client libraries
139+
IF(target_type STREQUAL "STATIC_LIBRARY")
140+
SET(debug_target_location
141+
"${CMAKE_BINARY_DIR}/archive_output_directory/Debug/${target_name}.lib")
142+
# On UNIX we install mysqlserver which has name libmysqld.a
143+
IF(UNIX)
144+
IF(BUILD_IS_SINGLE_CONFIG)
145+
SET(debug_target_location
146+
"${DEBUGBUILDDIR}/archive_output_directory/lib${target_name}.a")
147+
ELSE()
148+
SET(debug_target_location
149+
"${CMAKE_BINARY_DIR}/archive_output_directory/Debug/lib${target_name}.a")
150+
ENDIF()
151+
MESSAGE(STATUS
152+
"library target ${target} debug_target ${debug_target_location}")
153+
ENDIF()
154+
# mysqld or mysqld-debug
155+
ELSEIF(target_type STREQUAL "EXECUTABLE")
156+
GET_TARGET_PROPERTY(runtime_output_directory ${target}
157+
RUNTIME_OUTPUT_DIRECTORY)
158+
IF(NOT runtime_output_directory)
159+
MESSAGE(FATAL_ERROR "unknown executable!!")
160+
ENDIF()
161+
162+
STRING(REPLACE
163+
"${CMAKE_BINARY_DIR}/" "" RELATIVE_DIR ${runtime_output_directory})
164+
165+
SET(EXE_SUFFIX "${CMAKE_EXECUTABLE_SUFFIX}")
166+
IF(BUILD_IS_SINGLE_CONFIG)
167+
SET(debug_target_location
168+
"${DEBUGBUILDDIR}/${RELATIVE_DIR}/${target_name}${EXE_SUFFIX}")
169+
ELSE()
170+
SET(debug_target_location
171+
"${CMAKE_BINARY_DIR}/${RELATIVE_DIR}/Debug/${target_name}${EXE_SUFFIX}")
172+
ENDIF()
173+
MESSAGE(STATUS
174+
"executable target ${target} debug_target ${debug_target_location}")
175+
176+
# Plugins and components
177+
ELSEIF(target_type STREQUAL "MODULE_LIBRARY")
178+
SET(DLL_SUFFIX "${CMAKE_SHARED_LIBRARY_SUFFIX}")
179+
IF(APPLE)
180+
SET(DLL_SUFFIX ".so") # we do not use .dylib
181+
ENDIF()
182+
GET_TARGET_PROPERTY(
183+
target_output_directory ${target} LIBRARY_OUTPUT_DIRECTORY)
184+
IF(NOT target_output_directory)
185+
MESSAGE(FATAL_ERROR "unknown module!!")
186+
ENDIF()
187+
188+
STRING(REPLACE
189+
"${CMAKE_BINARY_DIR}/" "" RELATIVE_DIR ${target_output_directory})
190+
191+
IF(BUILD_IS_SINGLE_CONFIG)
192+
SET(debug_target_location
193+
"${DEBUGBUILDDIR}/${RELATIVE_DIR}/${target_name}${DLL_SUFFIX}")
194+
ELSE()
195+
SET(debug_target_location
196+
"${CMAKE_BINARY_DIR}/${RELATIVE_DIR}/Debug/${target_name}${DLL_SUFFIX}")
197+
ENDIF()
198+
# MESSAGE(STATUS
199+
# "module target ${target} debug_target ${debug_target_location}")
200+
ENDIF()
201+
202+
# This is only used for mysqld / mysqld-debug / libmysqlserver.a
128203
IF(ARG_RENAME)
129-
SET(RENAME_PARAM RENAME ${ARG_RENAME}${CMAKE_${target_type}_SUFFIX})
204+
SET(RENAME_PARAM RENAME ${ARG_RENAME})
130205
ELSE()
131206
SET(RENAME_PARAM)
132207
ENDIF()
208+
133209
IF(NOT ARG_DESTINATION)
134210
MESSAGE(FATAL_ERROR "Need DESTINATION parameter for INSTALL_DEBUG_TARGET")
135211
ENDIF()
136-
GET_TARGET_PROPERTY(target_location ${target} LOCATION)
137-
IF(BUILD_IS_SINGLE_CONFIG)
138-
STRING(REPLACE "${CMAKE_BINARY_DIR}" "${DEBUGBUILDDIR}" debug_target_location "${target_location}")
139-
ELSE()
140-
STRING(REPLACE "${CMAKE_CFG_INTDIR}" "Debug" debug_target_location "${target_location}" )
141-
ENDIF()
142-
IF(ARG_SUFFIX)
143-
GET_FILENAME_COMPONENT(ext ${debug_target_location} EXT)
144-
GET_FILENAME_COMPONENT(fn ${debug_target_location} NAME_WE)
145-
STRING(REPLACE "${fn}${ext}" "${fn}${ARG_SUFFIX}${ext}"
146-
debug_target_location "${debug_target_location}" )
147-
ENDIF()
212+
148213
IF(NOT ARG_COMPONENT)
149214
SET(ARG_COMPONENT DebugBinaries)
150215
ENDIF()
@@ -187,20 +252,18 @@ FUNCTION(INSTALL_DEBUG_TARGET target)
187252
COMPONENT ${ARG_COMPONENT}
188253
OPTIONAL)
189254

190-
IF(MSVC)
255+
# For windows, install .pdb files for .exe and .dll files.
256+
IF(MSVC AND NOT target_type STREQUAL "STATIC_LIBRARY")
191257
GET_FILENAME_COMPONENT(ext ${debug_target_location} EXT)
192-
STRING(REPLACE "${ext}" ".pdb" debug_pdb_target_location "${debug_target_location}" )
258+
STRING(REPLACE "${ext}" ".pdb"
259+
debug_pdb_target_location "${debug_target_location}" )
193260
IF (RENAME_PARAM)
194-
IF(NOT ARG_PDB_DESTINATION)
195-
STRING(REPLACE "${ext}" ".pdb" "${ARG_RENAME}" pdb_rename)
196-
SET(PDB_RENAME_PARAM RENAME "${pdb_rename}")
197-
ENDIF()
198-
ENDIF()
199-
IF(NOT ARG_PDB_DESTINATION)
200-
SET(ARG_PDB_DESTINATION "${ARG_DESTINATION}")
261+
STRING(REPLACE "${ext}" ".pdb" pdb_rename "${ARG_RENAME}")
262+
SET(PDB_RENAME_PARAM RENAME "${pdb_rename}")
201263
ENDIF()
264+
202265
INSTALL(FILES ${debug_pdb_target_location}
203-
DESTINATION ${ARG_PDB_DESTINATION}
266+
DESTINATION ${ARG_DESTINATION}
204267
${PDB_RENAME_PARAM}
205268
CONFIGURATIONS Release RelWithDebInfo
206269
COMPONENT ${ARG_COMPONENT}

cmake/libevent.cmake

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,7 @@ MACRO (MYSQL_USE_BUNDLED_LIBEVENT)
1919
SET(LIBEVENT_FOUND TRUE)
2020
ADD_DEFINITIONS("-DHAVE_LIBEVENT1")
2121
SET(WITH_LIBEVENT "bundled" CACHE STRING "Use bundled libevent")
22-
# Use EXCLUDE_FROM_ALL to build only if another component
23-
# which dependens on libevent is built
24-
ADD_SUBDIRECTORY(libevent EXCLUDE_FROM_ALL)
22+
ADD_SUBDIRECTORY(libevent)
2523
GET_TARGET_PROPERTY(src libevent SOURCES)
2624
FOREACH(file ${src})
2725
SET(LIBEVENT_SOURCES ${LIBEVENT_SOURCES} ${CMAKE_SOURCE_DIR}/libevent/${file})

cmake/libutils.cmake

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -228,9 +228,6 @@ MACRO(MERGE_CONVENIENCE_LIBRARIES)
228228
SET(LIBS ${ARG_DEFAULT_ARGS})
229229
LIST(REMOVE_AT LIBS 0)
230230

231-
MESSAGE(STATUS "MERGE_CONVENIENCE_LIBRARIES TARGET ${TARGET}")
232-
MESSAGE(STATUS "MERGE_CONVENIENCE_LIBRARIES LIBS ${LIBS}")
233-
234231
SET(SOURCE_FILE
235232
${CMAKE_BINARY_DIR}/archive_output_directory/${TARGET}_depends.c)
236233
ADD_LIBRARY(${TARGET} STATIC ${SOURCE_FILE})

cmake/mysql_add_executable.cmake

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Copyright (c) 2009, 2017, Oracle and/or its affiliates. All rights reserved.
2-
#
2+
#
33
# This program is free software; you can redistribute it and/or modify
44
# it under the terms of the GNU General Public License as published by
55
# the Free Software Foundation; version 2 of the License.
@@ -17,12 +17,11 @@
1717
# Usage (same as for standard CMake's ADD_EXECUTABLE)
1818
#
1919
# MYSQL_ADD_EXECUTABLE(target source1...sourceN)
20-
#
2120
# MySQL specifics:
22-
# - instruct CPack to install executable under ${CMAKE_INSTALL_PREFIX}/bin directory
21+
# - instruct CPack to install executable under
22+
# ${CMAKE_INSTALL_PREFIX}/bin directory
2323
# On Windows :
2424
# - add version resource
25-
# - instruct CPack to do autenticode signing if SIGNCODE is set
2625

2726
INCLUDE(cmake_parse_arguments)
2827

0 commit comments

Comments
 (0)