Skip to content

Commit

Permalink
Merge bb-10.2-ext into 10.3
Browse files Browse the repository at this point in the history
  • Loading branch information
dr-m committed Feb 15, 2018
2 parents b782971 + dc09f8f commit b006d2e
Show file tree
Hide file tree
Showing 583 changed files with 17,030 additions and 5,583 deletions.
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,9 @@ ENDIF()
SET(CMAKE_BUILD_TYPE "RelWithDebInfo" CACHE STRING
"Choose the type of build, options are: None(CMAKE_CXX_FLAGS or CMAKE_C_FLAGS used) Debug Release RelWithDebInfo MinSizeRel")

# MAX_INDEXES - Set the maximum number of indexes per table, default 64U
# MAX_INDEXES - Set the maximum number of indexes per table, default 64
IF (NOT MAX_INDEXES)
SET(MAX_INDEXES 64U)
SET(MAX_INDEXES 64)
ENDIF(NOT MAX_INDEXES)

IF (${MAX_INDEXES} GREATER 128)
Expand Down
3 changes: 2 additions & 1 deletion CREDITS
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@ organization registered in the USA.

The current main sponsors of the MariaDB Foundation are:

Alibaba Cloud https://intl.aliyun.com (2017)
Alibaba Cloud https://www.alibabacloud.com/ (2017)
Booking.com https://www.booking.com (2013)
Microsoft https://microsoft.com/ (2017)
Tencent Cloud https://cloud.tencent.com (2017)
Development Bank of Singapore https://dbs.com (2016)
IBM https://www.ibm.com (2017)
Expand Down
24 changes: 14 additions & 10 deletions appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,21 @@
version: 10.2-{build}
version: build-{build}~branch-{branch}

before_build:
- md %APPVEYOR_BUILD_FOLDER%\win_build
- cd %APPVEYOR_BUILD_FOLDER%\win_build
- cmake .. -G "Visual Studio 15 2017" -DBISON_EXECUTABLE=C:\cygwin\bin\bison
- dir
- md %APPVEYOR_BUILD_FOLDER%\win_build
- cd %APPVEYOR_BUILD_FOLDER%\win_build
- cmake .. -G "Visual Studio 15 2017 Win64" -DWITH_UNIT_TESTS=0 -DBISON_EXECUTABLE=C:\cygwin\bin\bison

build:
project: win_build\MySQL.sln
parallel: true
verbosity: minimal
configuration:
- Debug
test:

configuration: RelWithDebInfo
platform: x64

test_script:
- cd %APPVEYOR_BUILD_FOLDER%\win_build\mysql-test
- perl mysql-test-run.pl --force --max-test-fail=20 --parallel=6 --testcase-timeout=4 --skip-test-list=unstable-tests --suite=main,innodb,plugins,mariabackup
- set PATH=%PATH%;C:\Program Files (x86)\Windows Kits\10\Debuggers\x64
- cd %APPVEYOR_BUILD_FOLDER%\win_build\mysql-test
- perl mysql-test-run.pl --force --max-test-fail=10 --parallel=auto --testcase-timeout=10 --skip-test-list=unstable-tests --suite=main,innodb,plugins,mariabackup

image: Visual Studio 2017
12 changes: 7 additions & 5 deletions client/mysql.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1138,6 +1138,7 @@ int main(int argc,char *argv[])
current_prompt = my_strdup(default_prompt,MYF(MY_WME));
prompt_counter=0;
aborted= 0;
sf_leaking_memory= 1; /* no memory leak reports yet */

outfile[0]=0; // no (default) outfile
strmov(pager, "stdout"); // the default, if --pager wasn't given
Expand Down Expand Up @@ -1203,6 +1204,7 @@ int main(int argc,char *argv[])
my_end(0);
exit(1);
}
sf_leaking_memory= 0;
glob_buffer.realloc(512);
completion_hash_init(&ht, 128);
init_alloc_root(&hash_mem_root, "hash", 16384, 0, MYF(0));
Expand Down Expand Up @@ -1797,10 +1799,7 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
#ifndef EMBEDDED_LIBRARY
if ((opt_protocol= find_type_with_warning(argument, &sql_protocol_typelib,
opt->name)) <= 0)
{
sf_leaking_memory= 1; /* no memory leak reports here */
exit(1);
}
#endif
break;
case OPT_SERVER_ARG:
Expand Down Expand Up @@ -4595,8 +4594,11 @@ static char *get_arg(char *line, get_arg_mode mode)
}
for (start=ptr ; *ptr; ptr++)
{
if ((*ptr == '\\' && ptr[1]) || // escaped character
(!short_cmd && qtype && *ptr == qtype && ptr[1] == qtype)) // quote
/* if short_cmd use historical rules (only backslash) otherwise SQL rules */
if (short_cmd
? (*ptr == '\\' && ptr[1]) // escaped character
: (*ptr == '\\' && ptr[1] && qtype != '`') || // escaped character
(qtype && *ptr == qtype && ptr[1] == qtype)) // quote
{
// Remove (or skip) the backslash (or a second quote)
if (mode != CHECK)
Expand Down
4 changes: 0 additions & 4 deletions client/mysqltest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1567,7 +1567,6 @@ static void cleanup_and_exit(int exit_code)
}
}

sf_leaking_memory= 0; /* all memory should be freed by now */
exit(exit_code);
}

Expand Down Expand Up @@ -7323,10 +7322,7 @@ get_one_option(int optid, const struct my_option *opt, char *argument)
#ifndef EMBEDDED_LIBRARY
if ((opt_protocol= find_type_with_warning(argument, &sql_protocol_typelib,
opt->name)) <= 0)
{
sf_leaking_memory= 1; /* no memory leak reports here */
exit(1);
}
#endif
break;
case '?':
Expand Down
1 change: 1 addition & 0 deletions cmake/build_configurations/mysql_release.cmake
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Copyright (c) 2010, 2011, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2011, 2018, 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
Expand Down
14 changes: 7 additions & 7 deletions cmake/check_compiler_flag.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -32,25 +32,25 @@ MACRO (MY_CHECK_CXX_COMPILER_FLAG flag)
SET(CMAKE_REQUIRED_FLAGS "${SAVE_CMAKE_REQUIRED_FLAGS}")
ENDMACRO()

FUNCTION(MY_CHECK_AND_SET_COMPILER_FLAG flag)
FUNCTION(MY_CHECK_AND_SET_COMPILER_FLAG flag_to_set)
# At the moment this is gcc-only.
# Let's avoid expensive compiler tests on Windows:
IF(WIN32)
RETURN()
ENDIF()
MY_CHECK_C_COMPILER_FLAG(${flag})
MY_CHECK_CXX_COMPILER_FLAG(${flag})
STRING(REGEX REPLACE "[-,= +]" "_" result "${flag}")
STRING(REGEX REPLACE "^-Wno-" "-W" flag_to_check ${flag_to_set})
MY_CHECK_C_COMPILER_FLAG(${flag_to_check})
MY_CHECK_CXX_COMPILER_FLAG(${flag_to_check})
STRING(REGEX REPLACE "[-,= +]" "_" result "${flag_to_check}")
FOREACH(lang C CXX)
IF (have_${lang}_${result})
IF(ARGN)
FOREACH(type ${ARGN})
SET(CMAKE_${lang}_FLAGS_${type} "${CMAKE_${lang}_FLAGS_${type}} ${flag}" PARENT_SCOPE)
SET(CMAKE_${lang}_FLAGS_${type} "${CMAKE_${lang}_FLAGS_${type}} ${flag_to_set}" PARENT_SCOPE)
ENDFOREACH()
ELSE()
SET(CMAKE_${lang}_FLAGS "${CMAKE_${lang}_FLAGS} ${flag}" PARENT_SCOPE)
SET(CMAKE_${lang}_FLAGS "${CMAKE_${lang}_FLAGS} ${flag_to_set}" PARENT_SCOPE)
ENDIF()
ENDIF()
ENDFOREACH()
ENDFUNCTION()

65 changes: 22 additions & 43 deletions cmake/maintainer.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -14,54 +14,33 @@
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA

# Common warning flags for GCC, G++, Clang and Clang++
SET(MY_WARNING_FLAGS "-Wall -Wextra -Wformat-security -Wno-init-self")
MY_CHECK_C_COMPILER_FLAG("-Wvla") # Requires GCC 4.3+ or Clang
IF(have_C__Wvla)
SET(MY_WARNING_FLAGS "${MY_WARNING_FLAGS} -Wvla")
ENDIF()

MY_CHECK_C_COMPILER_FLAG("-Wno-format-truncation")
IF(HAVE_C__Wno_format_truncation)
SET(MY_WARNING_FLAGS "${MY_WARNING_FLAGS} -Wno-format-truncation")
ENDIF()

# Common warning flags for GCC and Clang
SET(MY_C_WARNING_FLAGS
"${MY_WARNING_FLAGS} -Wwrite-strings -Wdeclaration-after-statement")

# Common warning flags for G++ and Clang++
SET(MY_CXX_WARNING_FLAGS
"${MY_WARNING_FLAGS} -Woverloaded-virtual -Wno-unused-parameter")

# Extra warning flags for Clang++
IF(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
SET(MY_CXX_WARNING_FLAGS
"${MY_CXX_WARNING_FLAGS} -Wno-null-conversion -Wno-unused-private-field")
ENDIF()

# Turn on Werror (warning => error) when using maintainer mode.
IF(MYSQL_MAINTAINER_MODE MATCHES "ERR")
SET(MY_C_WARNING_FLAGS "${MY_C_WARNING_FLAGS} -DFORCE_INIT_OF_VARS -Werror")
SET(MY_CXX_WARNING_FLAGS "${MY_CXX_WARNING_FLAGS} -DFORCE_INIT_OF_VARS -Werror")
ENDIF()

# Set warning flags for GCC/Clang
IF(CMAKE_C_COMPILER_ID MATCHES "GNU|Clang")
SET(MY_MAINTAINER_C_WARNINGS "${MY_C_WARNING_FLAGS}")
ENDIF()
# Set warning flags for G++/Clang++
IF(CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang")
SET(MY_MAINTAINER_CXX_WARNINGS "${MY_CXX_WARNING_FLAGS} -Wnon-virtual-dtor")
ENDIF()
SET(MY_WARNING_FLAGS
-Wall
-Wdeclaration-after-statement
-Wextra
-Wformat-security
-Wno-format-truncation
-Wno-init-self
-Wno-nonnull-compare
-Wno-null-conversion
-Wno-unused-parameter
-Wno-unused-private-field
-Woverloaded-virtual
-Wnon-virtual-dtor
-Wvla
-Wwrite-strings
)

IF(MYSQL_MAINTAINER_MODE MATCHES "ON")
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${MY_MAINTAINER_C_WARNINGS}")
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${MY_MAINTAINER_CXX_WARNINGS}")
SET(WHERE)
ELSEIF(MYSQL_MAINTAINER_MODE MATCHES "AUTO")
SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} ${MY_MAINTAINER_C_WARNINGS}")
SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} ${MY_MAINTAINER_CXX_WARNINGS}")
SET(WHERE DEBUG)
ENDIF()

FOREACH(F ${MY_WARNING_FLAGS})
MY_CHECK_AND_SET_COMPILER_FLAG(${F} ${WHERE})
ENDFOREACH()

IF(CMAKE_C_COMPILER_ID MATCHES "GNU")
STRING(REPLACE " -E " " -E -dDI " CMAKE_C_CREATE_PREPROCESSED_SOURCE ${CMAKE_C_CREATE_PREPROCESSED_SOURCE})
ENDIF()
Expand Down
1 change: 1 addition & 0 deletions config.h.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@
#cmakedefine HAVE_CLOCK_GETTIME 1
#cmakedefine HAVE_CRYPT 1
#cmakedefine HAVE_CUSERID 1
#cmakedefine HAVE_DLADDR 1
#cmakedefine HAVE_DLERROR 1
#cmakedefine HAVE_DLOPEN 1
#cmakedefine HAVE_FCHMOD 1
Expand Down
12 changes: 11 additions & 1 deletion configure.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -338,6 +338,7 @@ CHECK_FUNCTION_EXISTS (cuserid HAVE_CUSERID)
CHECK_FUNCTION_EXISTS (ftruncate HAVE_FTRUNCATE)
CHECK_FUNCTION_EXISTS (compress HAVE_COMPRESS)
CHECK_FUNCTION_EXISTS (crypt HAVE_CRYPT)
CHECK_FUNCTION_EXISTS (dladdr HAVE_DLADDR)
CHECK_FUNCTION_EXISTS (dlerror HAVE_DLERROR)
CHECK_FUNCTION_EXISTS (dlopen HAVE_DLOPEN)
CHECK_FUNCTION_EXISTS (fchmod HAVE_FCHMOD)
Expand Down Expand Up @@ -388,7 +389,6 @@ CHECK_FUNCTION_EXISTS (pthread_rwlock_rdlock HAVE_PTHREAD_RWLOCK_RDLOCK)
CHECK_FUNCTION_EXISTS (pthread_sigmask HAVE_PTHREAD_SIGMASK)
CHECK_FUNCTION_EXISTS (pthread_yield_np HAVE_PTHREAD_YIELD_NP)
CHECK_FUNCTION_EXISTS (putenv HAVE_PUTENV)
CHECK_FUNCTION_EXISTS (readdir_r HAVE_READDIR_R)
CHECK_FUNCTION_EXISTS (readlink HAVE_READLINK)
CHECK_FUNCTION_EXISTS (realpath HAVE_REALPATH)
CHECK_FUNCTION_EXISTS (rename HAVE_RENAME)
Expand Down Expand Up @@ -425,6 +425,16 @@ IF(HAVE_SYS_EVENT_H)
CHECK_FUNCTION_EXISTS (kqueue HAVE_KQUEUE)
ENDIF()

# readdir_r might exist, but be marked deprecated
SET(CMAKE_REQUIRED_FLAGS -Werror)
CHECK_CXX_SOURCE_COMPILES(
"#include <dirent.h>
int main() {
readdir_r(0,0,0);
return 0;
}" HAVE_READDIR_R)
SET(CMAKE_REQUIRED_FLAGS)

#--------------------------------------------------------------------
# Support for WL#2373 (Use cycle counter for timing)
#--------------------------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion debian/additions/debian-start.inc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ function check_root_accounts() {

logger -p daemon.info -i -t$0 "Checking for insecure root accounts."

ret=$( echo "SELECT count(*) FROM mysql.user WHERE user='root' and password='';" | $MYSQL --skip-column-names )
ret=$( echo "SELECT count(*) FROM mysql.user WHERE user='root' and password='' and plugin in ('', 'mysql_native_password', 'mysql_old_password');" | $MYSQL --skip-column-names )
if [ "$ret" -ne "0" ]; then
logger -p daemon.warn -i -t$0 "WARNING: mysql.user contains $ret root accounts without password!"
fi
Expand Down
7 changes: 5 additions & 2 deletions debian/autobake-deb.sh
Original file line number Diff line number Diff line change
Expand Up @@ -75,12 +75,15 @@ fi

# Convert gcc version to numberical value. Format is Mmmpp where M is Major
# version, mm is minor version and p is patch.
GCCVERSION=$(gcc -dumpversion | sed -e 's/\.\([0-9][0-9]\)/\1/g' -e 's/\.\([0-9]\)/0\1/g' -e 's/^[0-9]\{3,4\}$/&00/')
# -dumpfullversion & -dumpversion to make it uniform across old and new (>=7)
GCCVERSION=$(gcc -dumpfullversion -dumpversion | sed -e 's/\.\([0-9][0-9]\)/\1/g' \
-e 's/\.\([0-9]\)/0\1/g' \
-e 's/^[0-9]\{3,4\}$/&00/')
# Don't build rocksdb package if gcc version is less than 4.8 or we are running on
# x86 32 bit.
if [[ $GCCVERSION -lt 40800 ]] || [[ $(arch) =~ i[346]86 ]] || [[ $TRAVIS ]]
then
sed '/Package: mariadb-plugin-rocksdb/,+13d' -i debian/control
sed '/Package: mariadb-plugin-rocksdb/,+14d' -i debian/control
fi

# AWS SDK requires c++11 -capable compiler
Expand Down
1 change: 1 addition & 0 deletions debian/control
Original file line number Diff line number Diff line change
Expand Up @@ -542,6 +542,7 @@ Breaks: mariadb-rocksdb-engine-10.2,
mariadb-rocksdb-engine-10.3
Replaces: mariadb-rocksdb-engine-10.2,
mariadb-rocksdb-engine-10.3
Recommends: python-mysqldb
Description: RocksDB storage engine for MariaDB
The RocksDB storage engine is a high performance storage engine, aimed
at maximising storage efficiency while maintaining InnoDB-like performance.
Expand Down
1 change: 1 addition & 0 deletions debian/mariadb-plugin-rocksdb.install
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
etc/mysql/conf.d/rocksdb.cnf etc/mysql/mariadb.conf.d
usr/bin/mysql_ldb
usr/bin/myrocks_hotbackup
usr/bin/sst_dump
usr/lib/mysql/plugin/ha_rocksdb.so
38 changes: 18 additions & 20 deletions extra/mariabackup/xtrabackup.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1265,10 +1265,10 @@ static int prepare_export()


static const char *xb_client_default_groups[]=
{ "xtrabackup", "client", 0, 0, 0 };
{ "xtrabackup", "mariabackup", "client", 0, 0, 0 };

static const char *xb_server_default_groups[]=
{ "xtrabackup", "mysqld", 0, 0, 0 };
{ "xtrabackup", "mariabackup", "mysqld", 0, 0, 0 };

static void print_version(void)
{
Expand All @@ -1295,7 +1295,7 @@ GNU General Public License for more details.\n\
\n\
You can download full text of the license on http://www.gnu.org/licenses/gpl-2.0.txt\n");

printf("Usage: [%s [--defaults-file=#] --backup | %s [--defaults-file=#] --prepare] [OPTIONS]\n",my_progname,my_progname);
printf("Usage: %s [--defaults-file=#] [--backup | --prepare | --copy-back | --move-back] [OPTIONS]\n",my_progname);
print_defaults("my", xb_server_default_groups);
my_print_help(xb_client_options);
my_print_help(xb_server_options);
Expand Down Expand Up @@ -2909,19 +2909,7 @@ xb_load_tablespaces()
&flush_lsn);

if (err != DB_SUCCESS) {
msg("mariabackup: Could not open or create data files.\n"
"mariabackup: If you tried to add new data files, and it "
"failed here,\n"
"mariabackup: you should now edit innodb_data_file_path in "
"my.cnf back\n"
"mariabackup: to what it was, and remove the new ibdata "
"files InnoDB created\n"
"mariabackup: in this failed attempt. InnoDB only wrote "
"those files full of\n"
"mariabackup: zeros, but did not yet use them in any way. "
"But be careful: do not\n"
"mariabackup: remove old data files which contain your "
"precious data!\n");
msg("mariabackup: Could not open data files.\n");
return(err);
}

Expand Down Expand Up @@ -3860,7 +3848,7 @@ xtrabackup_backup_func()
err = xb_load_tablespaces();
if (err != DB_SUCCESS) {
msg("mariabackup: error: xb_load_tablespaces() failed with"
"error code %u\n", err);
" error code %u\n", err);
goto fail;
}

Expand Down Expand Up @@ -4971,9 +4959,19 @@ xb_init()
return(false);
}

if (opt_rsync && xtrabackup_stream_fmt) {
msg("Error: --rsync doesn't work with --stream\n");
return(false);
if (xtrabackup_backup && opt_rsync)
{
if (xtrabackup_stream_fmt)
{
msg("Error: --rsync doesn't work with --stream\n");
return(false);
}
bool have_rsync = IF_WIN(false, (system("rsync --version > /dev/null 2>&1") == 0));
if (!have_rsync)
{
msg("Error: rsync executable not found, cannot run backup with --rsync\n");
return false;
}
}

n_mixed_options = 0;
Expand Down
3 changes: 3 additions & 0 deletions include/ma_dyncol.h
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,9 @@ typedef struct st_mysql_lex_string LEX_STRING;
#define DYNCOL_UTF (&my_charset_utf8_general_ci)
#endif

/* escape json strings */
#define DYNCOL_JSON_ESC ((char)1)

enum enum_dyncol_func_result
{
ER_DYNCOL_OK= 0,
Expand Down
Loading

0 comments on commit b006d2e

Please sign in to comment.