Skip to content

Commit

Permalink
Merge tag 'mariadb-10.0.33' into bb-10.0-galera
Browse files Browse the repository at this point in the history
  • Loading branch information
SachinSetiya committed Nov 3, 2017
2 parents 53b4185 + c3592ca commit 3cecb1b
Show file tree
Hide file tree
Showing 558 changed files with 55,360 additions and 5,820 deletions.
6 changes: 6 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -503,6 +503,12 @@ ENDIF()

INCLUDE(CPack)

IF(WIN32 AND SIGNCODE)
# Configure post-install script for authenticode signing
CONFIGURE_FILE(${PROJECT_SOURCE_DIR}/cmake/sign.cmake.in sign.cmake @ONLY)
INSTALL(SCRIPT ${PROJECT_BINARY_DIR}/sign.cmake)
ENDIF()

IF(NON_DISTRIBUTABLE_WARNING)
MESSAGE(WARNING "
You have linked MariaDB with GPLv3 libraries! You may not distribute the resulting binary. If you do, you will put yourself into a legal problem with Free Software Foundation.")
Expand Down
5 changes: 2 additions & 3 deletions client/mysql.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1067,8 +1067,7 @@ static void fix_history(String *final_command);

static COMMANDS *find_command(char *name);
static COMMANDS *find_command(char cmd_name);
static bool add_line(String &buffer, char *line, ulong line_length,
char *in_string, bool *ml_comment, bool truncated);
static bool add_line(String &, char *, ulong, char *, bool *, bool);
static void remove_cntrl(String &buffer);
static void print_table_data(MYSQL_RES *result);
static void print_table_data_html(MYSQL_RES *result);
Expand All @@ -1080,7 +1079,7 @@ static ulong start_timer(void);
static void end_timer(ulong start_time,char *buff);
static void mysql_end_timer(ulong start_time,char *buff);
static void nice_time(double sec,char *buff,bool part_second);
extern "C" sig_handler mysql_end(int sig);
extern "C" sig_handler mysql_end(int sig) __attribute__ ((noreturn));
extern "C" sig_handler handle_sigint(int sig);
#if defined(HAVE_TERMIOS_H) && defined(GWINSZ_IN_SYS_IOCTL)
static sig_handler window_resize(int sig);
Expand Down
20 changes: 18 additions & 2 deletions cmake/bison.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -47,15 +47,31 @@ MACRO (RUN_BISON input_yy output_cc output_h)
ENDIF()
ENDIF()
IF(BISON_USABLE)
# Workaround for VS regenerating output even
# when outputs are up-to-date. At least, fix output timestamp
# after build so that files that depend on generated header are
# not rebuilt.
IF(CMAKE_GENERATOR MATCHES "Visual Studio")
FIND_PROGRAM(TOUCH_EXECUTABLE touch DOC "Path to touch executable"
PATHS "C:/Program Files/Git/usr/bin"
"C:/Program Files (x86)/Git/usr/bin")
IF(TOUCH_EXECUTABLE)
SET(VS_FIX_OUTPUT_TIMESTAMPS
COMMAND ${TOUCH_EXECUTABLE} -r ${input_yy} ${output_cc}
COMMAND ${TOUCH_EXECUTABLE} -r ${input_yy} ${output_h})
ENDIF()
ENDIF()

ADD_CUSTOM_COMMAND(
OUTPUT ${output_cc}
${output_h}
COMMAND ${BISON_EXECUTABLE} -y -p MYSQL
--output=${output_cc}
--defines=${output_h}
${input_yy}
DEPENDS ${input_yy}
)
${VS_FIX_OUTPUT_TIMESTAMPS}
DEPENDS ${input_yy}
)
ELSE()
# Bison is missing or not usable, e.g too old
IF(EXISTS ${output_cc} AND EXISTS ${output_h})
Expand Down
64 changes: 19 additions & 45 deletions cmake/install_macros.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -57,17 +57,8 @@ FUNCTION (INSTALL_DEBUG_SYMBOLS)
ENDIF()
SET(targets ${ARG_DEFAULT_ARGS})
FOREACH(target ${targets})
GET_TARGET_PROPERTY(type ${target} TYPE)
GET_TARGET_PROPERTY(location ${target} LOCATION)
STRING(REPLACE ".exe" ".pdb" pdb_location ${location})
STRING(REPLACE ".dll" ".pdb" pdb_location ${pdb_location})
STRING(REPLACE ".lib" ".pdb" pdb_location ${pdb_location})
IF(CMAKE_GENERATOR MATCHES "Visual Studio")
STRING(REPLACE
"${CMAKE_CFG_INTDIR}" "\${CMAKE_INSTALL_CONFIG_NAME}"
pdb_location ${pdb_location})
ENDIF()

GET_TARGET_PROPERTY(target_type ${target} TYPE)

set(comp "")
IF(ARG_COMPONENT STREQUAL "Server")
IF(target MATCHES "mysqld" OR type MATCHES "MODULE")
Expand All @@ -87,11 +78,9 @@ FUNCTION (INSTALL_DEBUG_SYMBOLS)
IF(NOT comp)
SET(comp Debuginfo_archive_only) # not in MSI
ENDIF()
IF(type MATCHES "STATIC")
# PDB for static libraries might be unsupported http://public.kitware.com/Bug/view.php?id=14600
SET(opt OPTIONAL)
ENDIF()
INSTALL(FILES ${pdb_location} DESTINATION ${ARG_INSTALL_LOCATION} COMPONENT ${comp} ${opt})
IF(NOT target_type MATCHES "STATIC")
INSTALL(FILES $<TARGET_PDB_FILE:${target}> DESTINATION ${ARG_INSTALL_LOCATION} COMPONENT ${comp})
ENDIF()
ENDFOREACH()
ENDIF()
ENDFUNCTION()
Expand Down Expand Up @@ -243,37 +232,22 @@ IF(WIN32)
ENDIF()
ENDIF()

MACRO(SIGN_TARGET)
MYSQL_PARSE_ARGUMENTS(ARG "COMPONENT" "" ${ARGN})
SET(target ${ARG_DEFAULT_ARGS})
IF(ARG_COMPONENT)
SET(comp COMPONENT ${ARG_COMPONENT})
ELSE()
SET(comp)
ENDIF()
GET_TARGET_PROPERTY(target_type ${target} TYPE)
IF(target_type AND NOT target_type MATCHES "STATIC")
GET_TARGET_PROPERTY(target_location ${target} LOCATION)
IF(CMAKE_GENERATOR MATCHES "Visual Studio")
STRING(REPLACE "${CMAKE_CFG_INTDIR}" "\${CMAKE_INSTALL_CONFIG_NAME}"
target_location ${target_location})
ENDIF()
INSTALL(CODE
"EXECUTE_PROCESS(COMMAND
\"${SIGNTOOL_EXECUTABLE}\" verify /pa /q \"${target_location}\"
RESULT_VARIABLE ERR)
IF(NOT \${ERR} EQUAL 0)
EXECUTE_PROCESS(COMMAND
\"${SIGNTOOL_EXECUTABLE}\" sign ${SIGNTOOL_PARAMETERS} \"${target_location}\"
RESULT_VARIABLE ERR)

FUNCTION(SIGN_TARGET target)
IF(NOT SIGNCODE)
RETURN()
ENDIF()
IF(NOT \${ERR} EQUAL 0)
MESSAGE(FATAL_ERROR \"Error signing '${target_location}'\")
GET_TARGET_PROPERTY(target_type ${target} TYPE)
IF((NOT target_type) OR (target_type MATCHES "STATIC"))
RETURN()
ENDIF()
" ${comp})
ENDIF()
ENDMACRO()

# Mark executable for signing by creating empty *.signme file
# The actual signing happens in preinstall step
# (which traverses
ADD_CUSTOM_COMMAND(TARGET ${target} POST_BUILD
COMMAND ${CMAKE_COMMAND} -E touch "$<TARGET_FILE:${target}>.signme"
)
ENDFUNCTION()

# Installs targets, also installs pdbs on Windows.
#
Expand Down
4 changes: 2 additions & 2 deletions cmake/os/Windows.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,8 @@ IF(MSVC)
ENDIF()

#TODO: update the code and remove the disabled warnings
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /wd4800 /wd4805 /wd4996")
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /wd4800 /wd4805 /wd4996 /wd4291 /wd4577 /we4099")
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /wd4800 /wd4805 /wd4996 /we4700")
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /wd4800 /wd4805 /wd4996 /wd4291 /wd4577 /we4099 /we4700")

IF(CMAKE_SIZEOF_VOID_P MATCHES 8)
# _WIN64 is defined by the compiler itself.
Expand Down
16 changes: 14 additions & 2 deletions cmake/pcre.cmake
Original file line number Diff line number Diff line change
@@ -1,11 +1,23 @@
INCLUDE (CheckCSourceRuns)

SET(WITH_PCRE "auto" CACHE STRING
"Which pcre to use (possible values are 'bundled', 'system', or 'auto')")

MACRO (CHECK_PCRE)
IF(WITH_PCRE STREQUAL "system" OR WITH_PCRE STREQUAL "auto")
CHECK_LIBRARY_EXISTS(pcre pcre_stack_guard "" HAVE_PCRE)
CHECK_LIBRARY_EXISTS(pcre pcre_stack_guard "" HAVE_PCRE_STACK_GUARD)
IF(NOT CMAKE_CROSSCOMPILING)
SET(CMAKE_REQUIRED_LIBRARIES "pcre")
CHECK_C_SOURCE_RUNS("
#include <pcre.h>
int main() {
return -pcre_exec(NULL, NULL, NULL, -999, -999, 0, NULL, 0) < 256;
}" PCRE_STACK_SIZE_OK)
SET(CMAKE_REQUIRED_LIBRARIES)
ENDIF()
ENDIF()
IF(NOT HAVE_PCRE OR WITH_PCRE STREQUAL "bundled")
IF(NOT HAVE_PCRE_STACK_GUARD OR NOT PCRE_STACK_SIZE_OK OR
WITH_PCRE STREQUAL "bundled")
IF (WITH_PCRE STREQUAL "system")
MESSAGE(FATAL_ERROR "system pcre is not found or unusable")
ENDIF()
Expand Down
2 changes: 1 addition & 1 deletion cmake/plugin.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ MACRO(MYSQL_ADD_PLUGIN)
# only server package is required to be generated.
IF(CPACK_COMPONENTS_ALL AND
NOT CPACK_COMPONENTS_ALL MATCHES ${ARG_COMPONENT} AND
NOT WITH_WSREP)
NOT WITH_WSREP AND INSTALL_SYSCONF2DIR)
IF (ARG_STORAGE_ENGINE)
SET(ver " = %{version}-%{release}")
ENDIF()
Expand Down
18 changes: 18 additions & 0 deletions cmake/sign.cmake.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
FILE(GLOB_RECURSE files "@CMAKE_BINARY_DIR@/*.signme")
MESSAGE(STATUS "signing files")
FOREACH(f ${files})
STRING(REPLACE ".signme" "" exe_location "${f}")

string (REPLACE ";" " " params "@SIGNTOOL_PARAMETERS@")
#MESSAGE("@SIGNTOOL_EXECUTABLE@" sign ${params} "${exe_location}")

EXECUTE_PROCESS(COMMAND
"@SIGNTOOL_EXECUTABLE@" sign @SIGNTOOL_PARAMETERS@ "${exe_location}"
RESULT_VARIABLE ERR)
IF(NOT ${ERR} EQUAL 0)
MESSAGE( "Error ${ERR} signing ${exe_location}")
ELSE()
FILE(REMOVE ${f})
ENDIF()

ENDFOREACH()
18 changes: 9 additions & 9 deletions debian/patches/50_mysql-test__db_test.dpatch
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@
--- old/mysql-test/mysql-test-run.pl 2009-06-16 14:24:09.000000000 +0200
+++ new/mysql-test/mysql-test-run.pl 2009-07-04 00:03:34.000000000 +0200
@@ -3578,6 +3578,11 @@ sub mysql_install_db {
mtr_appendfile_to_file("$sql_dir/mysql_system_tables_data.sql",
$bootstrap_sql_file);
mtr_appendfile_to_file("$sql_dir/mysql_system_tables_data.sql",
$bootstrap_sql_file);

+ mtr_tofile($bootstrap_sql_file, "-- Debian removed the default privileges on the 'test' database\n");
+ mtr_tofile($bootstrap_sql_file, "INSERT INTO mysql.db VALUES ('%','test','','Y','Y','Y','Y','Y','Y','N','Y','Y','Y','Y','Y','Y','Y','Y','N','N','Y','Y');\n");
+ mtr_tofile($bootstrap_sql_file, "INSERT INTO mysql.db VALUES ('%','test\\_%','','Y','Y','Y','Y','Y','Y','N','Y','Y','Y','Y','Y','Y','Y','Y','N','N','Y','Y');\n");
+
+ mtr_tofile($bootstrap_sql_file, "-- Debian removed the default privileges on the 'test' database\n");
+ mtr_tofile($bootstrap_sql_file, "INSERT INTO mysql.db VALUES ('%','test','','Y','Y','Y','Y','Y','Y','N','Y','Y','Y','Y','Y','Y','Y','Y','N','N','Y','Y');\n");
+ mtr_tofile($bootstrap_sql_file, "INSERT INTO mysql.db VALUES ('%','test\\_%','','Y','Y','Y','Y','Y','Y','N','Y','Y','Y','Y','Y','Y','Y','Y','N','N','Y','Y');\n");
+
# Add test data for timezone - this is just a subset, on a real
# system these tables will be populated either by mysql_tzinfo_to_sql
# or by downloading the timezone table package from our website
+
# Add test data for timezone - this is just a subset, on a real
# system these tables will be populated either by mysql_tzinfo_to_sql
# or by downloading the timezone table package from our website
21 changes: 13 additions & 8 deletions extra/my_print_defaults.c
Original file line number Diff line number Diff line change
Expand Up @@ -104,12 +104,16 @@ void cleanup_and_exit(int exit_code)
exit(exit_code);
}

static void usage(my_bool version)
static void version()
{
printf("%s Ver 1.6 for %s at %s\n",my_progname,SYSTEM_TYPE,
MACHINE_TYPE);
if (version)
return;
printf("%s Ver 1.6 for %s at %s\n",my_progname,SYSTEM_TYPE, MACHINE_TYPE);
}


static void usage() __attribute__ ((noreturn));
static void usage()
{
version();
puts("This software comes with ABSOLUTELY NO WARRANTY. This is free software,\nand you are welcome to modify and redistribute it under the GPL license\n");
puts("Prints all arguments that is give to some program using the default files");
printf("Usage: %s [OPTIONS] [groups]\n", my_progname);
Expand All @@ -133,12 +137,13 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
cleanup_and_exit(0);
case 'I':
case '?':
usage(0);
usage();
case 'v':
verbose++;
break;
case 'V':
usage(1);
version();
/* fall through */
case '#':
DBUG_PUSH(argument ? argument : default_dbug_option);
break;
Expand Down Expand Up @@ -186,7 +191,7 @@ int main(int argc, char **argv)
nargs+= array_elements(mysqld_groups);

if (nargs < 2)
usage(0);
usage();

load_default_groups=(char**) my_malloc(nargs*sizeof(char*), MYF(MY_WME));
if (!load_default_groups)
Expand Down
2 changes: 1 addition & 1 deletion extra/replace.c
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ register char **argv[];
break;
case 'V':
version=1;
/* fall through */
/* fall through */
case 'I':
case '?':
help=1; /* Help text written */
Expand Down
5 changes: 0 additions & 5 deletions extra/yassl/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,3 @@ SET(YASSL_SOURCES src/buffer.cpp src/cert_wrapper.cpp src/crypto_wrapper.cpp sr
ADD_CONVENIENCE_LIBRARY(yassl ${YASSL_SOURCES})
RESTRICT_SYMBOL_EXPORTS(yassl)

IF(MSVC)
INSTALL_DEBUG_TARGET(yassl DESTINATION ${INSTALL_LIBDIR}/debug)
ENDIF()


8 changes: 8 additions & 0 deletions extra/yassl/README
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,14 @@ before calling SSL_new();

*** end Note ***

yaSSL Release notes, version 2.4.4 (8/8/2017)
This release of yaSSL fixes an interop issue. A fix for detecting cipher
suites with non leading zeros is included as yaSSL only supports cipher
suites with leading zeros. Thanks for the report from Security Innovation
and Oracle.

Users interoping with other SSL stacks should update.

yaSSL Release notes, version 2.4.2 (9/22/2016)
This release of yaSSL fixes a medium security vulnerability. A fix for
potential AES side channel leaks is included that a local user monitoring
Expand Down
5 changes: 3 additions & 2 deletions extra/yassl/include/openssl/ssl.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/*
Copyright (c) 2005, 2014, Oracle and/or its affiliates.
Copyright (c) 2005, 2017, Oracle and/or its affiliates. All rights reserved.
Use is subject to license terms.
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
Expand Down Expand Up @@ -34,7 +35,7 @@
#include "rsa.h"


#define YASSL_VERSION "2.4.2"
#define YASSL_VERSION "2.4.4"


#if defined(__cplusplus)
Expand Down
6 changes: 5 additions & 1 deletion extra/yassl/src/yassl_imp.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Copyright (c) 2005, 2014, Oracle and/or its affiliates
Copyright (c) 2005, 2017, Oracle and/or its affiliates.
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
Expand Down Expand Up @@ -1578,6 +1578,10 @@ void ServerHello::Process(input_buffer& input, SSL& ssl)
ssl.SetError(badVersion_error);
return;
}
if (cipher_suite_[0] != 0x00) {
ssl.SetError(unknown_cipher);
return;
}
ssl.set_pending(cipher_suite_[1]);
ssl.set_random(random_, server_end);
if (id_len_)
Expand Down
14 changes: 9 additions & 5 deletions extra/yassl/src/yassl_int.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Copyright (c) 2005, 2014, Oracle and/or its affiliates
Copyright (c) 2005, 2017, Oracle and/or its affiliates.
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
Expand Down Expand Up @@ -1399,12 +1399,17 @@ void SSL::matchSuite(const opaque* peer, uint length)
// start with best, if a match we are good, Ciphers are at odd index
// since all SSL and TLS ciphers have 0x00 first byte
for (uint i = 1; i < secure_.get_parms().suites_size_; i += 2)
for (uint j = 1; j < length; j+= 2)
if (secure_.use_parms().suites_[i] == peer[j]) {
for (uint j = 0; (j + 1) < length; j+= 2) {
if (peer[j] != 0x00) {
continue; // only 0x00 first byte supported
}

if (secure_.use_parms().suites_[i] == peer[j + 1]) {
secure_.use_parms().suite_[0] = 0x00;
secure_.use_parms().suite_[1] = peer[j];
secure_.use_parms().suite_[1] = peer[j + 1];
return;
}
}

SetError(match_error);
}
Expand Down Expand Up @@ -2697,4 +2702,3 @@ extern "C" void yaSSL_CleanUp()
yaSSL::sessionsInstance = 0;
yaSSL::errorsInstance = 0;
}

4 changes: 0 additions & 4 deletions extra/yassl/taocrypt/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,3 @@ SET(TAOCRYPT_SOURCES src/aes.cpp src/aestables.cpp src/algebra.cpp src/arc4.cpp
ADD_CONVENIENCE_LIBRARY(taocrypt ${TAOCRYPT_SOURCES})
RESTRICT_SYMBOL_EXPORTS(taocrypt)

IF(MSVC)
INSTALL_DEBUG_TARGET(taocrypt DESTINATION ${INSTALL_LIBDIR}/debug)
ENDIF()

Loading

0 comments on commit 3cecb1b

Please sign in to comment.