Commit 5046bb4f authored by Otto Kekäläinen's avatar Otto Kekäläinen

New upstream version 10.3.14

parent 84c00abf
......@@ -193,8 +193,8 @@ storage/myisam/sp_test
storage/rocksdb/ldb
storage/rocksdb/myrocks_hotbackup
storage/rocksdb/mysql_ldb
storage/rocksdb/sst_dump
storage/rocksdb/rdb_source_revision.h
storage/rocksdb/sst_dump
storage/tokudb/PerconaFT/buildheader/db.h
storage/tokudb/PerconaFT/buildheader/make_tdb
storage/tokudb/PerconaFT/buildheader/runcat.sh
......@@ -513,3 +513,6 @@ compile_commands.json
.editorconfig
.kateconfig
*.kdev4
# Visual Studio Code workspace
.vscode/
......@@ -25,7 +25,8 @@ ENDIF()
MESSAGE(STATUS "Running cmake version ${CMAKE_VERSION}")
SET(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_SOURCE_DIR}/cmake)
SET(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH}
${CMAKE_SOURCE_DIR}/cmake ${CMAKE_SOURCE_DIR}/cmake/Internal/CPack)
# Use a default manufacturer if no manufacturer was identified.
IF(NOT DEFINED MANUFACTURER)
......@@ -213,6 +214,14 @@ IF (WITH_TSAN)
MY_CHECK_AND_SET_COMPILER_FLAG("-fsanitize=thread" DEBUG RELWITHDEBINFO)
ENDIF()
OPTION(WITH_UBSAN "Enable undefined behavior sanitizer" OFF)
IF (WITH_UBSAN)
IF(SECURITY_HARDENED)
MESSAGE(FATAL_ERROR "WITH_UBSAN and SECURITY_HARDENED are mutually exclusive")
ENDIF()
MY_CHECK_AND_SET_COMPILER_FLAG("-fsanitize=undefined" DEBUG RELWITHDEBINFO)
ENDIF()
IF(NOT WITH_TSAN)
# enable security hardening features, like most distributions do
# in our benchmarks that costs about ~1% of performance, depending on the load
......@@ -493,6 +502,8 @@ IF(UNIX)
INSTALL_DOCUMENTATION(Docs/INSTALL-BINARY Docs/README-wsrep COMPONENT Readme)
ENDIF()
INCLUDE(build_depends)
INCLUDE(CPack)
IF(WIN32 AND SIGNCODE)
......
commit: c8f9b3f915a729ec35c00e92cc534a01271aa6e6
date: 2019-02-20 08:44:08 +0100
build-date: 2019-02-20 07:59:16 +0000
short: c8f9b3f
commit: ab7b9cf9122f6eb02744082db8672a920ae6009f
date: 2019-04-01 16:58:37 +0300
build-date: 2019-04-01 14:04:05 +0000
short: ab7b9cf
branch: HEAD
MariaDB source 10.3.13
MariaDB source 10.3.14
MYSQL_VERSION_MAJOR=10
MYSQL_VERSION_MINOR=3
MYSQL_VERSION_PATCH=13
MYSQL_VERSION_PATCH=14
SERVER_MATURITY=stable
......@@ -3786,9 +3786,10 @@ print_table_data_html(MYSQL_RES *result)
MYSQL_FIELD *field;
mysql_field_seek(result,0);
(void) tee_fputs("<TABLE BORDER=1><TR>", PAGER);
(void) tee_fputs("<TABLE BORDER=1>", PAGER);
if (column_names)
{
(void) tee_fputs("<TR>", PAGER);
while((field = mysql_fetch_field(result)))
{
tee_fputs("<TH>", PAGER);
......
......@@ -318,7 +318,6 @@ int main(int argc,char *argv[])
char **commands, **save_argv, **temp_argv;
MY_INIT(argv[0]);
mysql_init(&mysql);
sf_leaking_memory=1; /* don't report memory leaks on early exits */
load_defaults_or_exit("my", load_default_groups, &argc, &argv);
save_argv = argv; /* Save for free_defaults */
......@@ -347,6 +346,7 @@ int main(int argc,char *argv[])
sf_leaking_memory=0; /* from now on we cleanup properly */
mysql_init(&mysql);
if (opt_compress)
mysql_options(&mysql,MYSQL_OPT_COMPRESS,NullS);
if (opt_connect_timeout)
......
......@@ -3229,17 +3229,24 @@ int main(int argc, char** argv)
DBUG_RETURN(retval == ERROR_STOP ? 1 : 0);
}
uint e_key_get_latest_version_func(uint) { return 1; }
uint e_key_get_func(uint, uint, uchar*, uint*) { return 1; }
uint e_ctx_size_func(uint, uint) { return 1; }
int e_ctx_init_func(void *, const uchar*, uint, const uchar*, uint,
int, uint, uint) { return 1; }
int e_ctx_update_func(void *, const uchar*, uint, uchar*, uint*) { return 1; }
int e_ctx_finish_func(void *, uchar*, uint*) { return 1; }
uint e_encrypted_length_func(uint, uint, uint) { return 1; }
uint dummy1() { return 1; }
struct encryption_service_st encryption_handler=
{
(uint(*)(uint))dummy1,
(uint(*)(uint, uint, uchar*, uint*))dummy1,
(uint(*)(uint, uint))dummy1,
(int (*)(void*, const uchar*, uint, const uchar*, uint, int, uint, uint))dummy1,
(int (*)(void*, const uchar*, uint, uchar*, uint*))dummy1,
(int (*)(void*, uchar*, uint*))dummy1,
(uint (*)(uint, uint, uint))dummy1
e_key_get_latest_version_func,
e_key_get_func,
e_ctx_size_func,
e_ctx_init_func,
e_ctx_update_func,
e_ctx_finish_func,
e_encrypted_length_func
};
/*
......
......@@ -968,7 +968,8 @@ static int handle_request_for_tables(char *tables, size_t length,
puts(query);
if (mysql_real_query(sock, query, (ulong)query_length))
{
sprintf(message, "when executing '%s%s... %s'", op, tab_view, options);
my_snprintf(message, sizeof(message), "when executing '%s%s... %s'",
op, tab_view, options);
DBerror(sock, message);
my_free(query);
DBUG_RETURN(1);
......
......@@ -193,6 +193,7 @@ static char TMPDIR[FN_REFLEN];
static char global_subst_from[200];
static char global_subst_to[200];
static char *global_subst= NULL;
static char *read_command_buf= NULL;
static MEM_ROOT require_file_root;
static const my_bool my_true= 1;
static const my_bool my_false= 0;
......@@ -1532,6 +1533,7 @@ void free_used_memory()
free_defaults(default_argv);
free_root(&require_file_root, MYF(0));
free_re();
my_free(read_command_buf);
#ifdef _WIN32
free_tmp_sh_file();
free_win_path_patterns();
......@@ -6583,7 +6585,6 @@ static inline bool is_escape_char(char c, char in_string)
*/
static char *read_command_buf= NULL;
static size_t read_command_buflen= 0;
static const size_t max_multibyte_length= 6;
......@@ -8301,6 +8302,12 @@ void run_query_stmt(struct st_connection *cn, struct st_command *command,
DBUG_ENTER("run_query_stmt");
DBUG_PRINT("query", ("'%-.60s'", query));
if (!mysql)
{
handle_no_active_connection(command, cn, ds);
DBUG_VOID_RETURN;
}
/*
Init a new stmt if it's not already one created for this connection
*/
......@@ -8838,18 +8845,56 @@ void init_re(void)
*/
const char *ps_re_str =
"^("
"[[:space:]]*REPLACE[[:space:]]|"
"[[:space:]]*INSERT[[:space:]]|"
"[[:space:]]*UPDATE[[:space:]]|"
"[[:space:]]*DELETE[[:space:]]|"
"[[:space:]]*SELECT[[:space:]]|"
"[[:space:]]*ALTER[[:space:]]+SEQUENCE[[:space:]]|"
"[[:space:]]*ALTER[[:space:]]+TABLE[[:space:]]|"
"[[:space:]]*ALTER[[:space:]]+USER[[:space:]]|"
"[[:space:]]*ANALYZE[[:space:]]|"
"[[:space:]]*ASSIGN[[:space:]]|"
//"[[:space:]]*CALL[[:space:]]|" // XXX run_query_stmt doesn't read multiple result sets
"[[:space:]]*CHANGE[[:space:]]|"
"[[:space:]]*CHECKSUM[[:space:]]|"
"[[:space:]]*COMMIT[[:space:]]|"
"[[:space:]]*COMPOUND[[:space:]]|"
"[[:space:]]*CREATE[[:space:]]+DATABASE[[:space:]]|"
"[[:space:]]*CREATE[[:space:]]+INDEX[[:space:]]|"
"[[:space:]]*CREATE[[:space:]]+ROLE[[:space:]]|"
"[[:space:]]*CREATE[[:space:]]+SEQUENCE[[:space:]]|"
"[[:space:]]*CREATE[[:space:]]+TABLE[[:space:]]|"
"[[:space:]]*CREATE[[:space:]]+USER[[:space:]]|"
"[[:space:]]*CREATE[[:space:]]+VIEW[[:space:]]|"
"[[:space:]]*DELETE[[:space:]]|"
"[[:space:]]*DO[[:space:]]|"
"[[:space:]]*DROP[[:space:]]+DATABASE[[:space:]]|"
"[[:space:]]*DROP[[:space:]]+INDEX[[:space:]]|"
"[[:space:]]*DROP[[:space:]]+ROLE[[:space:]]|"
"[[:space:]]*DROP[[:space:]]+SEQUENCE[[:space:]]|"
"[[:space:]]*DROP[[:space:]]+TABLE[[:space:]]|"
"[[:space:]]*DROP[[:space:]]+USER[[:space:]]|"
"[[:space:]]*DROP[[:space:]]+VIEW[[:space:]]|"
"[[:space:]]*FLUSH[[:space:]]|"
"[[:space:]]*GRANT[[:space:]]|"
"[[:space:]]*HANDLER[[:space:]]+.*[[:space:]]+READ[[:space:]]|"
"[[:space:]]*INSERT[[:space:]]|"
"[[:space:]]*INSTALL[[:space:]]+|"
"[[:space:]]*KILL[[:space:]]|"
"[[:space:]]*OPTIMIZE[[:space:]]|"
"[[:space:]]*PRELOAD[[:space:]]|"
"[[:space:]]*RENAME[[:space:]]+TABLE[[:space:]]|"
"[[:space:]]*RENAME[[:space:]]+USER[[:space:]]|"
"[[:space:]]*REPAIR[[:space:]]|"
"[[:space:]]*REPLACE[[:space:]]|"
"[[:space:]]*RESET[[:space:]]|"
"[[:space:]]*REVOKE[[:space:]]|"
"[[:space:]]*ROLLBACK[[:space:]]|"
"[[:space:]]*SELECT[[:space:]]|"
"[[:space:]]*SET[[:space:]]+OPTION[[:space:]]|"
"[[:space:]]*DELETE[[:space:]]+MULTI[[:space:]]|"
"[[:space:]]*UPDATE[[:space:]]+MULTI[[:space:]]|"
"[[:space:]]*INSERT[[:space:]]+SELECT[[:space:]])";
"[[:space:]]*SHOW[[:space:]]|"
"[[:space:]]*SHUTDOWN[[:space:]]|"
"[[:space:]]*SLAVE[[:space:]]|"
"[[:space:]]*TRUNCATE[[:space:]]|"
"[[:space:]]*UNINSTALL[[:space:]]+|"
"[[:space:]]*UPDATE[[:space:]]"
")";
/*
Filter for queries that can be run using the
......
......@@ -50,7 +50,11 @@ endif()
# load the original CPackRPM.cmake
set(orig_CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH})
unset(CMAKE_MODULE_PATH)
include(CPackRPM)
if (CMAKE_VERSION VERSION_GREATER "3.12.99")
include(Internal/CPack/CPackRPM)
else()
include(CPackRPM)
endif()
set(CMAKE_MODULE_PATH ${orig_CMAKE_MODULE_PATH})
restore(LICENSE)
......
......@@ -87,6 +87,7 @@ IF(FEATURE_SET)
ENDIF()
SET(WITH_INNODB_SNAPPY OFF CACHE STRING "")
SET(WITH_NUMA 0 CACHE BOOL "")
IF(WIN32)
SET(INSTALL_MYSQLTESTDIR "" CACHE STRING "")
SET(INSTALL_SQLBENCHDIR "" CACHE STRING "")
......@@ -94,20 +95,17 @@ IF(WIN32)
ELSEIF(RPM)
SET(WITH_SSL system CACHE STRING "")
SET(WITH_ZLIB system CACHE STRING "")
SET(CHECKMODULE /usr/bin/checkmodule CACHE STRING "")
SET(SEMODULE_PACKAGE /usr/bin/semodule_package CACHE STRING "")
SET(WITH_LIBARCHIVE ON CACHE STRING "")
SET(CHECKMODULE /usr/bin/checkmodule CACHE FILEPATH "")
SET(SEMODULE_PACKAGE /usr/bin/semodule_package CACHE FILEPATH "")
ELSEIF(DEB)
SET(WITH_SSL system CACHE STRING "")
SET(WITH_ZLIB system CACHE STRING "")
SET(WITH_LIBWRAP ON)
SET(HAVE_EMBEDDED_PRIVILEGE_CONTROL ON)
SET(WITH_LIBARCHIVE ON CACHE STRING "")
ELSE()
SET(WITH_SSL bundled CACHE STRING "")
SET(WITH_ZLIB bundled CACHE STRING "")
SET(WITH_JEMALLOC static CACHE STRING "")
SET(WITH_LIBARCHIVE STATIC CACHE STRING "")
ENDIF()
IF(NOT COMPILATION_COMMENT)
......
IF(RPM)
MACRO(FIND_DEP V)
SET(out ${V}_DEP)
IF (NOT DEFINED ${out})
IF(EXISTS ${${V}} AND NOT IS_DIRECTORY ${${V}})
EXECUTE_PROCESS(COMMAND ${ARGN} RESULT_VARIABLE res OUTPUT_VARIABLE O OUTPUT_STRIP_TRAILING_WHITESPACE)
ELSE()
SET(res 1)
ENDIF()
IF (res)
SET(O)
ELSE()
MESSAGE(STATUS "Need ${O} for ${${V}}")
ENDIF()
SET(${out} ${O} CACHE INTERNAL "Package that contains ${${V}}" FORCE)
ENDIF()
ENDMACRO()
GET_CMAKE_PROPERTY(ALL_VARS CACHE_VARIABLES)
FOREACH (V ${ALL_VARS})
GET_PROPERTY(H CACHE ${V} PROPERTY HELPSTRING)
IF (H MATCHES "^Have library [^/]" AND ${V})
STRING(REGEX REPLACE "^Have library " "" L ${H})
SET(V ${L}_LIBRARY)
FIND_LIBRARY(${V} ${L})
ENDIF()
GET_PROPERTY(T CACHE ${V} PROPERTY TYPE)
IF ((T STREQUAL FILEPATH OR V MATCHES "^CMAKE_COMMAND$") AND ${V} MATCHES "^/")
IF (RPM)
FIND_DEP(${V} rpm -q --qf "%{NAME}" -f ${${V}})
ELSE() # must be DEB
MESSAGE(FATAL_ERROR "Not implemented")
ENDIF ()
SET(BUILD_DEPS ${BUILD_DEPS} ${${V}_DEP})
ENDIF()
ENDFOREACH()
LIST(REMOVE_DUPLICATES BUILD_DEPS)
STRING(REPLACE ";" " " CPACK_RPM_BUILDREQUIRES "${BUILD_DEPS}")
ENDIF(RPM)
......@@ -83,6 +83,12 @@ SET(CPACK_RPM_SPEC_MORE_DEFINE "
%define _sysconfdir ${INSTALL_SYSCONFDIR}
%define restart_flag_dir %{_localstatedir}/lib/rpm-state/mariadb
%define restart_flag %{restart_flag_dir}/need-restart
%{?filter_setup:
%filter_from_provides /perl(\\\\(mtr\\\\|My::\\\\)/d
%filter_from_requires /\\\\(lib\\\\(ft\\\\|lzma\\\\|tokuportability\\\\)\\\\)\\\\|\\\\(perl(\\\\(.*mtr\\\\|My::\\\\|.*HandlerSocket\\\\|Mysql\\\\)\\\\)/d
%filter_setup
}
")
# this creative hack is described here: http://www.cmake.org/pipermail/cmake/2012-January/048416.html
......@@ -202,7 +208,7 @@ ALTERNATIVE_NAME("server" "mysql-server")
ALTERNATIVE_NAME("test" "mysql-test")
# Argh! Different distributions call packages differently, to be a drop-in
# replacement we have to fake distribution-specificic dependencies
# replacement we have to fake distribution-specific dependencies
IF(RPM MATCHES "(rhel|centos)6")
ALTERNATIVE_NAME("client" "mysql")
......@@ -218,36 +224,6 @@ ELSEIF(RPM MATCHES "(rhel|centos)8")
SET(PYTHON_SHEBANG "/usr/bin/python3")
ENDIF()
# workaround for lots of perl dependencies added by rpmbuild
SETA(CPACK_RPM_test_PACKAGE_PROVIDES
"perl(lib::mtr_gcov.pl)"
"perl(lib::mtr_gprof.pl)"
"perl(lib::mtr_io.pl)"
"perl(lib::mtr_misc.pl)"
"perl(lib::mtr_process.pl)"
"perl(lib::v1/mtr_cases.pl)"
"perl(lib::v1/mtr_gcov.pl)"
"perl(lib::v1/mtr_gprof.pl)"
"perl(lib::v1/mtr_im.pl)"
"perl(lib::v1/mtr_io.pl)"
"perl(lib::v1/mtr_match.pl)"
"perl(lib::v1/mtr_misc.pl)"
"perl(lib::v1/mtr_process.pl)"
"perl(lib::v1/mtr_report.pl)"
"perl(lib::v1/mtr_stress.pl)"
"perl(lib::v1/mtr_timer.pl)"
"perl(lib::v1/mtr_unique.pl)"
"perl(mtr_cases)"
"perl(mtr_io.pl)"
"perl(mtr_match)"
"perl(mtr_misc.pl)"
"perl(mtr_gcov.pl)"
"perl(mtr_gprof.pl)"
"perl(mtr_process.pl)"
"perl(mtr_report)"
"perl(mtr_results)"
"perl(mtr_unique)")
# If we want to build build MariaDB-shared-compat,
# extract compat libraries from MariaDB-shared-5.3 rpm
FILE(GLOB compat53 RELATIVE ${CMAKE_SOURCE_DIR}
......@@ -294,4 +270,24 @@ IF(compat53 AND compat101)
ENDIF()
ENDIF()
################
IF(CMAKE_VERSION VERSION_GREATER "3.9.99")
SET(CPACK_SOURCE_GENERATOR "RPM")
SETA(CPACK_RPM_SOURCE_PKG_BUILD_PARAMS
"-DBUILD_CONFIG=mysql_release"
"-DRPM=${RPM}"
"-DCPACK_RPM_BUILD_SOURCE_DIRS_PREFIX=/usr/src/debug/${CPACK_RPM_PACKAGE_NAME}-${VERSION}"
)
MACRO(ADDIF var)
IF(DEFINED ${var})
SETA(CPACK_RPM_SOURCE_PKG_BUILD_PARAMS "-D${var}=${${var}}")
ENDIF()
ENDMACRO()
ADDIF(BUILD_CONFIG)
ADDIF(WITH_SSL)
ENDIF()
ENDIF(RPM)
......@@ -15,18 +15,19 @@
SET(CPACK_SOURCE_IGNORE_FILES
\\\\.git/
\\\\.gitignore
CMakeCache\\\\.txt
cmake_dist\\\\.cmake
CPackSourceConfig\\\\.cmake
CPackConfig.cmake
/cmake_install\\\\.cmake
/CTestTestfile\\\\.cmake
\\\\.gitignore$
\\\\.gitattributes$
CMakeCache\\\\.txt$
cmake_dist\\\\.cmake$
CPackSourceConfig\\\\.cmake$
CPackConfig.cmake$
/cmake_install\\\\.cmake$
/CTestTestfile\\\\.cmake$
/CMakeFiles/
/version_resources/
/_CPack_Packages/
$\\\\.gz
$\\\\.zip
\\\\.gz$
\\\\.zip$
/CMakeFiles/
/version_resources/
/_CPack_Packages/
......@@ -49,5 +50,6 @@ include/config\\\\.h$
include/my_config\\\\.h$
/autom4te\\\\.cache/
errmsg\\\\.sys$
\\\\.rpm$
#
)
......@@ -33,10 +33,15 @@ SET(MY_WARNING_FLAGS
-Wnon-virtual-dtor
-Wvla
-Wwrite-strings
-Werror
)
IF(MYSQL_MAINTAINER_MODE MATCHES "ON")
SET(WHERE)
IF(CMAKE_COMPILER_IS_GNUCC AND CMAKE_C_COMPILER_VERSION VERSION_LESS "6.0.0")
SET(MY_WARNING_FLAGS ${MY_WARNING_FLAGS} -Wno-error=maybe-uninitialized)
ENDIF()
IF(MYSQL_MAINTAINER_MODE MATCHES "OFF")
RETURN()
ELSEIF(MYSQL_MAINTAINER_MODE MATCHES "AUTO")
SET(WHERE DEBUG)
ENDIF()
......
......@@ -37,3 +37,8 @@ SET(CLIENT_PLUGIN_PVIO_SOCKET STATIC)
MESSAGE("== Configuring MariaDB Connector/C")
ADD_SUBDIRECTORY(libmariadb)
#remove after merging libmariadb > v3.0.9
IF(TARGET caching_sha2_password AND CMAKE_C_FLAGS_DEBUG MATCHES "-Werror")
SET_PROPERTY(TARGET caching_sha2_password APPEND_STRING PROPERTY COMPILE_FLAGS -Wno-unused-function)
ENDIF()
......@@ -34,8 +34,8 @@ ENDFOREACH()
# Ensure we have clean build for shared libraries
# without unresolved symbols
# Not supported with AddressSanitizer and ThreadSanitizer
IF(NOT WITH_ASAN AND NOT WITH_TSAN)
# Not supported with the clang sanitizers
IF(NOT WITH_ASAN AND NOT WITH_TSAN AND NOT WITH_UBSAN)
SET(LINK_FLAG_NO_UNDEFINED "-Wl,--no-undefined")
ENDIF()
......
# Copyright (c) 2009, 2018, Oracle and/or its affiliates.
# Copyright (c) 2011, 2018, MariaDB Corporation
# Copyright (c) 2011, 2019, MariaDB Corporation
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
......@@ -209,7 +209,7 @@ MACRO(MYSQL_ADD_PLUGIN)
ELSEIF(NOT CMAKE_SYSTEM_NAME STREQUAL "Linux")