Skip to content

Commit b565b3e

Browse files
committed
Merge branch '11.4' into 11.8
2 parents 982535b + c4ed889 commit b565b3e

File tree

380 files changed

+11125
-2763
lines changed

Some content is hidden

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

380 files changed

+11125
-2763
lines changed

CMakeLists.txt

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -341,7 +341,13 @@ SET(WITH_SAFEMALLOC "AUTO" CACHE STRING "Use safemalloc memory debugger. Will re
341341

342342
IF(WITH_SAFEMALLOC MATCHES "ON")
343343
ADD_DEFINITIONS( -DSAFEMALLOC)
344-
ELSEIF(WITH_SAFEMALLOC MATCHES "AUTO" AND NOT WIN32 AND NOT WITH_VALGRIND)
344+
ELSEIF(WITH_SAFEMALLOC MATCHES "AUTO"
345+
AND NOT WIN32
346+
AND NOT WITH_VALGRIND
347+
AND NOT WITH_ASAN
348+
AND NOT WITH_UBSAN
349+
AND NOT WITH_TSAN
350+
AND NOT WITH_MSAN)
345351
SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DSAFEMALLOC")
346352
SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DSAFEMALLOC")
347353
ENDIF()

client/mysql.cc

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3212,6 +3212,26 @@ static int reconnect(void)
32123212
return 0;
32133213
}
32143214

3215+
#ifndef EMBEDDED_LIBRARY
3216+
static void status_info_cb(void *data, enum enum_mariadb_status_info type, ...)
3217+
{
3218+
va_list ap;
3219+
va_start(ap, type);
3220+
if (type == SESSION_TRACK_TYPE && va_arg(ap, int) == SESSION_TRACK_SCHEMA)
3221+
{
3222+
MARIADB_CONST_STRING *val= va_arg(ap, MARIADB_CONST_STRING *);
3223+
my_free(current_db);
3224+
if (val->length)
3225+
current_db= my_strndup(PSI_NOT_INSTRUMENTED, val->str, val->length, MYF(MY_FAE));
3226+
else
3227+
current_db= NULL;
3228+
}
3229+
va_end(ap);
3230+
}
3231+
#else
3232+
#define mysql_optionsv(A,B,C,D) do { } while(0)
3233+
#endif
3234+
32153235
static void get_current_db()
32163236
{
32173237
MYSQL_RES *res;
@@ -5025,6 +5045,8 @@ sql_real_connect(char *host,char *database,char *user,char *password,
50255045
mysql_close(&mysql);
50265046
}
50275047
mysql_init(&mysql);
5048+
if (!one_database)
5049+
mysql_optionsv(&mysql, MARIADB_OPT_STATUS_CALLBACK, status_info_cb, NULL);
50285050
if (opt_init_command)
50295051
mysql_options(&mysql, MYSQL_INIT_COMMAND, opt_init_command);
50305052
if (opt_connect_timeout)

client/mysqlbinlog.cc

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1033,9 +1033,16 @@ Exit_status process_event(PRINT_EVENT_INFO *print_event_info, Log_event *ev,
10331033
binlog, even if they have a server_id. Also, we have to read
10341034
the format_description event so that we can parse subsequent
10351035
events.
1036+
Don't skip Unknown events either since we don't know their `server_id`s.
10361037
*/
1037-
if (ev_type != ROTATE_EVENT && is_server_id_excluded(ev->server_id))
1038-
goto end;
1038+
switch (ev_type) {
1039+
case ROTATE_EVENT:
1040+
case UNKNOWN_EVENT:
1041+
break;
1042+
default:
1043+
if (is_server_id_excluded(ev->server_id))
1044+
goto end;
1045+
}
10391046
}
10401047
if ((stop_datetime_given && ev->when >= stop_datetime)
10411048
|| (pos >= stop_position_mot))
@@ -3400,7 +3407,8 @@ int main(int argc, char** argv)
34003407
}
34013408

34023409
/*
3403-
Emit a warning if we finished processing input before reaching the stop
3410+
Emit warning(s) (in Gtid_event_filter::verify_completed_state() for GTID(s))
3411+
if we finished processing input before reaching the stop
34043412
boundaries indicated by --stop-datetime or --stop-position.
34053413
*/
34063414
if (stop_datetime_given && stop_datetime > last_processed_ev.datetime)
@@ -3410,6 +3418,8 @@ int main(int argc, char** argv)
34103418
stop_position > last_processed_ev.position)
34113419
warning("Did not reach stop position %llu before end of input",
34123420
stop_position);
3421+
if (position_gtid_filter)
3422+
position_gtid_filter->verify_final_state();
34133423

34143424
/*
34153425
If enable flashback, need to print the events from the end to the

client/mysqldump.cc

Lines changed: 23 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ static DYNAMIC_STRING extended_row;
184184
static DYNAMIC_STRING dynamic_where;
185185
static MYSQL_RES *get_table_name_result= NULL;
186186
static MEM_ROOT glob_root;
187-
static MYSQL_RES *routine_res, *routine_list_res;
187+
static MYSQL_RES *routine_res, *routine_list_res, *slave_status_res= NULL;
188188

189189

190190
#include <sslopt-vars.h>
@@ -1996,6 +1996,8 @@ static void free_resources()
19961996
mysql_free_result(routine_res);
19971997
if (routine_list_res)
19981998
mysql_free_result(routine_list_res);
1999+
if (slave_status_res)
2000+
mysql_free_result(slave_status_res);
19992001
if (mysql)
20002002
{
20012003
mysql_close(mysql);
@@ -6432,17 +6434,19 @@ static int do_show_master_status(MYSQL *mysql_con, int consistent_binlog_pos,
64326434

64336435
static int do_stop_slave_sql(MYSQL *mysql_con)
64346436
{
6435-
MYSQL_RES *slave;
64366437
MYSQL_ROW row;
6438+
DBUG_ASSERT(
6439+
!slave_status_res // do_stop_slave_sql() should only be called once
6440+
);
64376441

6438-
if (mysql_query_with_error_report(mysql_con, &slave,
6442+
if (mysql_query_with_error_report(mysql_con, &slave_status_res,
64396443
multi_source ?
64406444
"SHOW ALL SLAVES STATUS" :
64416445
"SHOW SLAVE STATUS"))
64426446
return(1);
64436447

64446448
/* Loop over all slaves */
6445-
while ((row= mysql_fetch_row(slave)))
6449+
while ((row= mysql_fetch_row(slave_status_res)))
64466450
{
64476451
if (row[11 + multi_source])
64486452
{
@@ -6457,13 +6461,11 @@ static int do_stop_slave_sql(MYSQL *mysql_con)
64576461

64586462
if (mysql_query_with_error_report(mysql_con, 0, query))
64596463
{
6460-
mysql_free_result(slave);
64616464
return 1;
64626465
}
64636466
}
64646467
}
64656468
}
6466-
mysql_free_result(slave);
64676469
return(0);
64686470
}
64696471

@@ -6587,32 +6589,35 @@ static int do_show_slave_status(MYSQL *mysql_con, int have_mariadb_gtid,
65876589

65886590
static int do_start_slave_sql(MYSQL *mysql_con)
65896591
{
6590-
MYSQL_RES *slave;
65916592
MYSQL_ROW row;
65926593
int error= 0;
65936594
DBUG_ENTER("do_start_slave_sql");
65946595

6595-
/* We need to check if the slave sql is stopped in the first place */
6596-
if (mysql_query_with_error_report(mysql_con, &slave,
6597-
multi_source ?
6598-
"SHOW ALL SLAVES STATUS" :
6599-
"SHOW SLAVE STATUS"))
6600-
DBUG_RETURN(1);
6596+
/*
6597+
do_start_slave_sql() should normally be called
6598+
sometime after do_stop_slave_sql() succeeds
6599+
*/
6600+
if (!slave_status_res)
6601+
DBUG_RETURN(error);
6602+
mysql_data_seek(slave_status_res, 0);
66016603

6602-
while ((row= mysql_fetch_row(slave)))
6604+
while ((row= mysql_fetch_row(slave_status_res)))
66036605
{
66046606
DBUG_PRINT("info", ("Connection: '%s' status: '%s'",
66056607
multi_source ? row[0] : "", row[11 + multi_source]));
66066608
if (row[11 + multi_source])
66076609
{
6608-
/* if SLAVE SQL is not running, we don't start it */
6609-
if (strcmp(row[11 + multi_source], "Yes"))
6610+
/*
6611+
If SLAVE_SQL was not running but is now,
6612+
we start it anyway to warn the unexpected state change.
6613+
*/
6614+
if (strcmp(row[11 + multi_source], "No"))
66106615
{
66116616
char query[160];
66126617
if (multi_source)
6613-
sprintf(query, "START SLAVE '%.80s'", row[0]);
6618+
sprintf(query, "START SLAVE '%.80s' SQL_THREAD", row[0]);
66146619
else
6615-
strmov(query, "START SLAVE");
6620+
strmov(query, "START SLAVE SQL_THREAD");
66166621

66176622
if (mysql_query_with_error_report(mysql_con, 0, query))
66186623
{
@@ -6623,7 +6628,6 @@ static int do_start_slave_sql(MYSQL *mysql_con)
66236628
}
66246629
}
66256630
}
6626-
mysql_free_result(slave);
66276631
DBUG_RETURN(error);
66286632
}
66296633

cmake/aws_sdk.cmake

Lines changed: 30 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,27 @@ MACRO (SKIP_AWS_SDK MSG)
44
RETURN()
55
ENDMACRO()
66

7-
FUNCTION (CHECK_AWS_SDK RETVAL REASON)
7+
FUNCTION (CHECK_AWS_SDK COMPONENTS RETVAL REASON)
88
# AWS_SDK_EXTERNAL_PROJECT must be ON
99
IF(NOT AWS_SDK_EXTERNAL_PROJECT)
10-
SKIP_AWS_SDK("AWS_SDK_EXTERNAL_PROJECT is not ON")
10+
FOREACH(comp ${COMPONENTS})
11+
FIND_PACKAGE(aws-cpp-sdk-${comp} CONFIG QUIET)
12+
IF (NOT aws-cpp-sdk-${comp}_FOUND)
13+
SKIP_AWS_SDK("AWS_SDK_EXTERNAL_PROJECT is not ON and aws-cpp-sdk-${comp} not found")
14+
ENDIF()
15+
ENDFOREACH()
16+
SET(${RETVAL} ON PARENT_SCOPE)
1117
ENDIF()
1218
IF(NOT NOT_FOR_DISTRIBUTION)
1319
SKIP_AWS_SDK("AWS SDK has Apache 2.0 License which is not compatible with GPLv2. Set -DNOT_FOR_DISTRIBUTION=ON if you need it")
1420
ENDIF()
21+
IF(CMAKE_VERSION VERSION_LESS "3.15")
22+
SKIP_AWS_SDK("CMake too old")
23+
ENDIF()
1524
# Check compiler support
1625
IF(CMAKE_CXX_COMPILER_ID MATCHES "GNU")
17-
EXECUTE_PROCESS(COMMAND ${CMAKE_CXX_COMPILER} -dumpversion OUTPUT_VARIABLE GCC_VERSION)
18-
IF (GCC_VERSION VERSION_LESS 4.8)
19-
SKIP_AWS_SDK("GCC VERSION too old (${GCC_VERSION}, required is 4.8 or later")
26+
IF (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.9)
27+
SKIP_AWS_SDK("GCC VERSION too old (${GCC_VERSION}, required is 4.9 or later")
2028
ENDIF()
2129
ELSEIF (CMAKE_CXX_COMPILER_ID MATCHES "Clang")
2230
IF ((CMAKE_CXX_COMPILER_VERSION AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 3.3) OR
@@ -36,35 +44,27 @@ FUNCTION (CHECK_AWS_SDK RETVAL REASON)
3644
SKIP_AWS_SDK("OS unsupported by AWS SDK")
3745
ENDIF()
3846

39-
# Build from source, using ExternalProject_Add
40-
# AWS C++ SDK requires cmake 2.8.12
41-
IF(CMAKE_VERSION VERSION_LESS "2.8.12")
42-
SKIP_AWS_SDK("CMake is too old")
43-
ENDIF()
44-
4547
IF(UNIX)
46-
# Check librairies required for building SDK
47-
FIND_PACKAGE(CURL)
48-
SET_PACKAGE_PROPERTIES(CURL PROPERTIES TYPE REQUIRED)
49-
IF(NOT CURL_FOUND)
50-
SKIP_AWS_SDK("AWS C++ SDK requires libcurl development package")
48+
IF("${WITH_ZLIB}" STREQUAL "bundled")
49+
# Breaks FIND_PACKAGE(ZLIB)
50+
SKIP_AWS_SDK("Incompatible with WITH_ZLIB=bundled")
5151
ENDIF()
52-
FIND_PATH(UUID_INCLUDE_DIR uuid/uuid.h)
53-
IF(NOT UUID_INCLUDE_DIR)
54-
SKIP_AWS_SDK("AWS C++ SDK requires uuid development package")
55-
ENDIF()
56-
IF(NOT APPLE)
57-
FIND_LIBRARY(UUID_LIBRARIES uuid)
58-
SET_PACKAGE_PROPERTIES(UUID_LIBRARIES PROPERTIES TYPE REQUIRED)
59-
IF(NOT UUID_LIBRARIES)
60-
SKIP_AWS_SDK("AWS C++ SDK requires uuid development package")
52+
# Check libraries required for building SDK
53+
FOREACH(pkg CURL ZLIB OpenSSL)
54+
FIND_PACKAGE(${pkg})
55+
IF(NOT ${pkg}_FOUND)
56+
SKIP_AWS_SDK("AWS C++ SDK requires ${pkg}")
6157
ENDIF()
62-
FIND_PACKAGE(OpenSSL)
63-
SET_PACKAGE_PROPERTIES(OpenSSL PROPERTIES TYPE REQUIRED)
64-
IF(NOT OPENSSL_FOUND)
65-
SKIP_AWS_SDK("AWS C++ SDK requires openssl development package")
58+
SET_PACKAGE_PROPERTIES(${pkg} PROPERTIES TYPE REQUIRED)
59+
ENDFOREACH()
60+
# Also check for required libraries explicitely - they might be
61+
# missing, even if check above succeeds, e.g when using own copy
62+
# of zlib
63+
FOREACH(lib OpenSSL::Crypto ZLIB::ZLIB CURL::libcurl)
64+
IF(NOT TARGET ${lib})
65+
SKIP_AWS_SDK("AWS C++ SDK requires ${lib}")
6666
ENDIF()
67-
ENDIF()
67+
ENDFOREACH()
6868
ENDIF()
6969
SET(${RETVAL} ON PARENT_SCOPE)
7070
ENDFUNCTION()
@@ -85,14 +85,4 @@ FUNCTION(USE_AWS_SDK_LIBS)
8585
SET_PROPERTY(GLOBAL PROPERTY AWS_SDK_LIBS ${comp} APPEND)
8686
TARGET_LINK_LIBRARIES(${target} aws-cpp-sdk-${comp})
8787
ENDFOREACH()
88-
TARGET_LINK_LIBRARIES(${target} aws-cpp-sdk-core)
89-
TARGET_INCLUDE_DIRECTORIES(${target} PRIVATE ${PROJECT_BINARY_DIR}/extra/aws_sdk/aws_sdk_cpp/include)
90-
# Link OS libraries that AWS SDK depends on
91-
IF(WIN32)
92-
TARGET_LINK_LIBRARIES(${target} bcrypt winhttp wininet userenv version)
93-
ELSE()
94-
FIND_PACKAGE(CURL REQUIRED)
95-
FIND_PACKAGE(OpenSSL REQUIRED)
96-
TARGET_LINK_LIBRARIES(${target} ${OPENSSL_LIBRARIES} ${CURL_LIBRARIES} ${UUID_LIBRARIES})
97-
ENDIF()
9888
ENDFUNCTION()

cmake/build_configurations/mysql_release.cmake

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,10 @@ ELSEIF(DEB)
120120
SET(WITH_ZLIB system CACHE STRING "")
121121
SET(WITH_LIBWRAP ON)
122122
SET(HAVE_EMBEDDED_PRIVILEGE_CONTROL ON)
123-
SET(PLUGIN_AUTH_SOCKET YES CACHE STRING "")
123+
# No hurd implementation
124+
IF(NOT CMAKE_SYSTEM_PROCESSOR STREQUAL "i686-AT386")
125+
SET(PLUGIN_AUTH_SOCKET YES CACHE STRING "")
126+
ENDIF()
124127
SET(WITH_EMBEDDED_SERVER ON CACHE BOOL "")
125128
SET(WITH_PCRE system CACHE STRING "")
126129
SET(CLIENT_PLUGIN_ZSTD OFF)

cmake/install_macros.cmake

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -255,6 +255,7 @@ FUNCTION(INSTALL_RUNTIME_DEPS)
255255
GET_PROPERTY(installed_targets GLOBAL PROPERTY INSTALLED_TARGETS)
256256
# Exclude all dependencies that are shared libraries from the
257257
# same build.
258+
FILE(TO_CMAKE_PATH "$ENV{PATH}" _path_list)
258259
FOREACH(tgt ${installed_targets})
259260
SET(exclude_libs)
260261
GET_TARGET_PROPERTY(link_libraries ${tgt} LINK_LIBRARIES)
@@ -286,8 +287,9 @@ FUNCTION(INSTALL_RUNTIME_DEPS)
286287
".*system32/.*\\.dll" # Windows stuff
287288
POST_INCLUDE_REGEXES
288289
DIRECTORIES
289-
${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/bin
290-
$<$<CONFIG:Debug>:${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/debug/bin>
290+
$<$<BOOL:${VCPKG_INSTALLED_DIR}>:${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/bin
291+
$<$<AND:$<CONFIG:Debug>,$<BOOL:${VCPKG_INSTALLED_DIR}>>:${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/debug/bin>
292+
${_path_list}
291293
)
292294
ENDFOREACH()
293295
ENDFUNCTION()

cmake/os/WindowsCache.cmake

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -361,4 +361,5 @@ SET(HAVE_LINUX_UNISTD_H CACHE INTERNAL "")
361361
SET(OFF64_T CACHE INTERNAL "")
362362
SET(Z_HAVE_UNISTD_H CACHE INTERNAL "")
363363
SET(HAVE_OFF64_T CACHE FALSE INTERNAL "")
364+
SET(HAVE_AUXV_GETAUXVAL CACHE INTERNAL "")
364365
ENDIF(MSVC)

cmake/plugin.cmake

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,9 @@ MACRO(MYSQL_ADD_PLUGIN)
161161
PROPERTIES COMPILE_DEFINITIONS "EMBEDDED_LIBRARY${version_string}")
162162
ENDIF()
163163
ADD_DEPENDENCIES(${target}_embedded GenError ${ARG_DEPENDS})
164+
IF(ARG_LINK_LIBRARIES)
165+
TARGET_LINK_LIBRARIES (${target}_embedded ${ARG_LINK_LIBRARIES})
166+
ENDIF()
164167
ENDIF()
165168
ENDIF()
166169

cmake/wsrep.cmake

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,6 @@ Then restart the build.
4949
SET(WSREP_VERSION "${WSREP_API_VERSION}.${WSREP_PATCH_VERSION}"
5050
CACHE INTERNAL "WSREP version")
5151

52-
SET(WSREP_PROC_INFO ${WITH_WSREP})
53-
5452
SET(WSREP_PATCH_VERSION "wsrep_${WSREP_VERSION}")
5553
if (NOT WITH_WSREP_ALL)
5654
SET(WSREP_LIB_WITH_UNIT_TESTS OFF CACHE BOOL

0 commit comments

Comments
 (0)