Skip to content

Commit

Permalink
Merge 10.2 into 10.3
Browse files Browse the repository at this point in the history
main.derived_cond_pushdown: Move all 10.3 tests to the end,
trim trailing white space, and add an "End of 10.3 tests" marker.
Add --sorted_result to tests where the ordering is not deterministic.

main.win_percentile: Add --sorted_result to tests where the
ordering is no longer deterministic.
  • Loading branch information
dr-m committed Nov 6, 2018
2 parents e058a25 + bdfe278 commit df563e0
Show file tree
Hide file tree
Showing 375 changed files with 27,579 additions and 14,574 deletions.
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -261,6 +261,7 @@ storage/mroonga/vendor/groonga/src/groonga-benchmark
storage/mroonga/vendor/groonga/src/suggest/groonga-suggest-create-dataset
storage/mroonga/mysql-test/mroonga/storage/r/information_schema_plugins.result
storage/mroonga/mysql-test/mroonga/storage/r/variable_version.result
zlib/zconf.h
xxx/*
yyy/*
zzz/*
Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
@@ -1,5 +1,5 @@
# Copyright (c) 2006, 2017, Oracle and/or its affiliates.
# Copyright (c) 2008, 2017, MariaDB
# Copyright (c) 2008, 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
10 changes: 7 additions & 3 deletions README.md
Expand Up @@ -64,10 +64,14 @@ and COPYING.thirdparty files.
Bug Reports:
------------

Bug and/or error reports regarding MariaDB should be submitted at
https://mariadb.org/jira
Bug and/or error reports regarding MariaDB should be submitted at:
https://jira.mariadb.org

Bugs in the MySQL code can also be submitted at https://bugs.mysql.com
For reporting security vulnerabilities see:
https://mariadb.org/about/security-policy/

Bugs in the MySQL code can also be submitted at:
https://bugs.mysql.com

The code for MariaDB, including all revision history, can be found at:
https://github.com/MariaDB/server
Expand Down
1 change: 1 addition & 0 deletions client/CMakeLists.txt
@@ -1,4 +1,5 @@
# Copyright (c) 2006, 2015, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2008, 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
6 changes: 3 additions & 3 deletions client/mysql.cc
@@ -1,6 +1,6 @@
/*
Copyright (c) 2000, 2014, Oracle and/or its affiliates.
Copyright (c) 2009, 2017, MariaDB
Copyright (c) 2000, 2018, Oracle and/or its affiliates.
Copyright (c) 2009, 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 Expand Up @@ -1493,7 +1493,7 @@ static struct my_option my_long_options[] =
{"batch", 'B',
"Don't use history file. Disable interactive behavior. (Enables --silent.)",
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
{"binary-as-hex", 'b', "Print binary data as hex", &opt_binhex, &opt_binhex,
{"binary-as-hex", 0, "Print binary data as hex", &opt_binhex, &opt_binhex,
0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
{"character-sets-dir", OPT_CHARSETS_DIR,
"Directory for character set files.", &charsets_dir,
Expand Down
3 changes: 3 additions & 0 deletions cmake/cpack_rpm.cmake
Expand Up @@ -99,12 +99,15 @@ SET(ignored
"%ignore /etc"
"%ignore /etc/init.d"
"%ignore /etc/logrotate.d"
"%ignore /etc/systemd"
"%ignore /etc/systemd/system"
"%ignore ${CMAKE_INSTALL_PREFIX}"
"%ignore ${CMAKE_INSTALL_PREFIX}/bin"
"%ignore ${CMAKE_INSTALL_PREFIX}/include"
"%ignore ${CMAKE_INSTALL_PREFIX}/lib"
"%ignore ${CMAKE_INSTALL_PREFIX}/lib/systemd"
"%ignore ${CMAKE_INSTALL_PREFIX}/lib/systemd/system"
"%ignore ${CMAKE_INSTALL_PREFIX}/lib/tmpfiles.d"
"%ignore ${CMAKE_INSTALL_PREFIX}/lib64"
"%ignore ${CMAKE_INSTALL_PREFIX}/sbin"
"%ignore ${CMAKE_INSTALL_PREFIX}/share"
Expand Down
12 changes: 8 additions & 4 deletions cmake/libutils.cmake
Expand Up @@ -136,6 +136,10 @@ MACRO(MERGE_STATIC_LIBS TARGET OUTPUT_NAME LIBS_TO_MERGE)
SET(SOURCE_FILE ${CMAKE_CURRENT_BINARY_DIR}/${TARGET}_depends.c)
ADD_LIBRARY(${TARGET} STATIC ${SOURCE_FILE})
SET_TARGET_PROPERTIES(${TARGET} PROPERTIES OUTPUT_NAME ${OUTPUT_NAME})
IF(NOT _SKIP_PIC)
SET_TARGET_PROPERTIES(${TARGET} PROPERTIES COMPILE_FLAGS
"${CMAKE_SHARED_LIBRARY_C_FLAGS}")
ENDIF()

SET(OSLIBS)
FOREACH(LIB ${LIBS_TO_MERGE})
Expand Down Expand Up @@ -239,11 +243,11 @@ MACRO(MERGE_LIBRARIES)
# check for non-PIC libraries
IF(NOT _SKIP_PIC)
FOREACH(LIB ${LIBS})
GET_TARGET_PROPERTY(${LIB} TYPE LIBTYPE)
IF(LIBTYPE STREQUAL "STATIC_LIBRARY")
GET_TARGET_PROPERTY(LIB COMPILE_FLAGS LIB_COMPILE_FLAGS)
GET_TARGET_PROPERTY(LTYPE ${LIB} TYPE)
IF(LTYPE STREQUAL "STATIC_LIBRARY")
GET_TARGET_PROPERTY(LIB_COMPILE_FLAGS ${LIB} COMPILE_FLAGS)
STRING(REPLACE "${CMAKE_SHARED_LIBRARY_C_FLAGS}"
"<PIC_FLAG>" LIB_COMPILE_FLAGS ${LIB_COMPILE_FLAG})
"<PIC_FLAG>" LIB_COMPILE_FLAGS "${LIB_COMPILE_FLAGS}")
IF(NOT LIB_COMPILE_FLAGS MATCHES "<PIC_FLAG>")
MESSAGE(FATAL_ERROR
"Attempted to link non-PIC static library ${LIB} to shared library ${TARGET}\n"
Expand Down
5 changes: 2 additions & 3 deletions cmake/os/Windows.cmake
Expand Up @@ -205,9 +205,8 @@ IF(MSVC)
ENDIF()

# Always link with socket library
LINK_LIBRARIES(ws2_32)
# ..also for tests
SET(CMAKE_REQUIRED_LIBRARIES ws2_32)
STRING(APPEND CMAKE_C_STANDARD_LIBRARIES " ws2_32.lib")
STRING(APPEND CMAKE_CXX_STANDARD_LIBRARIES " ws2_32.lib")

# System checks
SET(SIGNAL_WITH_VIO_CLOSE 1) # Something that runtime team needs
Expand Down
3 changes: 2 additions & 1 deletion cmake/plugin.cmake
@@ -1,4 +1,5 @@
# Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2009, 2018, Oracle and/or its affiliates.
# 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
4 changes: 2 additions & 2 deletions cmake/ssl.cmake
Expand Up @@ -159,12 +159,12 @@ MACRO (MYSQL_CHECK_SSL)
SET(CMAKE_REQUIRED_LIBRARIES)
ELSE()
IF(WITH_SSL STREQUAL "system")
MESSAGE(SEND_ERROR "Cannot find appropriate system libraries for SSL. Use WITH_SSL=bundled to enable SSL support")
MESSAGE(FATAL_ERROR "Cannot find appropriate system libraries for SSL. Use WITH_SSL=bundled to enable SSL support")
ENDIF()
MYSQL_USE_BUNDLED_SSL()
ENDIF()
ELSE()
MESSAGE(SEND_ERROR
MESSAGE(FATAL_ERROR
"Wrong option for WITH_SSL. Valid values are: ${WITH_SSL_DOC}")
ENDIF()
ENDMACRO()
Expand Down
18 changes: 5 additions & 13 deletions cmake/zlib.cmake
@@ -1,4 +1,4 @@
# Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2009, 2018, Oracle and/or its affiliates. All rights reserved.
#
# 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 All @@ -14,15 +14,12 @@
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA

MACRO (MYSQL_USE_BUNDLED_ZLIB)
SET(ZLIB_LIBRARY zlib)
SET(ZLIB_INCLUDE_DIR ${CMAKE_SOURCE_DIR}/zlib)
SET(ZLIB_INCLUDE_DIR ${CMAKE_SOURCE_DIR}/zlib ${CMAKE_BINARY_DIR}/zlib)
SET(BUILD_BUNDLED_ZLIB 1)
SET(ZLIB_LIBRARY zlib CACHE INTERNAL "Bundled zlib library")
SET(ZLIB_FOUND TRUE)
SET(WITH_ZLIB "bundled" CACHE STRING "Use bundled zlib")
ADD_SUBDIRECTORY(zlib)
GET_TARGET_PROPERTY(src zlib SOURCES)
FOREACH(file ${src})
SET(ZLIB_SOURCES ${ZLIB_SOURCES} ${CMAKE_SOURCE_DIR}/zlib/${file})
ENDFOREACH()
ENDMACRO()

# MYSQL_CHECK_ZLIB_WITH_COMPRESS
Expand All @@ -37,15 +34,10 @@ ENDMACRO()

MACRO (MYSQL_CHECK_ZLIB_WITH_COMPRESS)

IF(CMAKE_SYSTEM_NAME STREQUAL "OS400" OR
CMAKE_SYSTEM_NAME STREQUAL "AIX" OR
CMAKE_SYSTEM_NAME STREQUAL "Windows")
# Use bundled zlib on some platforms by default (system one is too
# old or not existent)
# For NDBCLUSTER: Use bundled zlib by default
IF (NOT WITH_ZLIB)
SET(WITH_ZLIB "bundled" CACHE STRING "By default use bundled zlib on this platform")
ENDIF()
ENDIF()

IF(WITH_ZLIB STREQUAL "bundled")
MYSQL_USE_BUNDLED_ZLIB()
Expand Down
11 changes: 7 additions & 4 deletions configure.cmake
Expand Up @@ -986,11 +986,14 @@ CHECK_STRUCT_HAS_MEMBER("struct sockaddr_in6" sin6_len

SET(CMAKE_EXTRA_INCLUDE_FILES)

CHECK_INCLUDE_FILE(ucontext.h HAVE_UCONTEXT_H)
IF(NOT HAVE_UCONTEXT_H)
CHECK_INCLUDE_FILE(sys/ucontext.h HAVE_UCONTEXT_H)
CHECK_STRUCT_HAS_MEMBER("struct dirent" d_ino "dirent.h" STRUCT_DIRENT_HAS_D_INO)
CHECK_STRUCT_HAS_MEMBER("struct dirent" d_namlen "dirent.h" STRUCT_DIRENT_HAS_D_NAMLEN)
SET(SPRINTF_RETURNS_INT 1)
CHECK_INCLUDE_FILE(ucontext.h HAVE_FILE_UCONTEXT_H)
IF(NOT HAVE_FILE_UCONTEXT_H)
CHECK_INCLUDE_FILE(sys/ucontext.h HAVE_FILE_UCONTEXT_H)
ENDIF()
IF(HAVE_UCONTEXT_H)
IF(HAVE_FILE_UCONTEXT_H)
CHECK_FUNCTION_EXISTS(makecontext HAVE_UCONTEXT_H)
ENDIF()

Expand Down
1 change: 1 addition & 0 deletions debian/rules
@@ -1,6 +1,7 @@
#!/usr/bin/make -f

export DH_VERBOSE=1
export DEB_BUILD_HARDENING=1

# enable Debian Hardening
# see: https://wiki.debian.org/Hardening
Expand Down
4 changes: 2 additions & 2 deletions extra/mariabackup/backup_copy.cc
Expand Up @@ -35,8 +35,8 @@ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with
this program; if not, write to the Free Software Foundation, Inc., 59 Temple
Place, Suite 330, Boston, MA 02111-1307 USA
this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin St, Fifth Floor, Boston, MA 02111-1301 USA
*******************************************************/

Expand Down
63 changes: 32 additions & 31 deletions extra/mariabackup/backup_mysql.cc
Expand Up @@ -34,8 +34,8 @@ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with
this program; if not, write to the Free Software Foundation, Inc., 59 Temple
Place, Suite 330, Boston, MA 02111-1307 USA
this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin St, Fifth Floor, Boston, MA 02111-1301 USA
*******************************************************/
#define MYSQL_CLIENT
Expand Down Expand Up @@ -1759,62 +1759,63 @@ backup_cleanup()
}


static pthread_mutex_t mdl_lock_con_mutex;
static MYSQL *mdl_con = NULL;

std::map<ulint, std::string> spaceid_to_tablename;

void
mdl_lock_init()
{
pthread_mutex_init(&mdl_lock_con_mutex, NULL);
mdl_con = xb_mysql_connect();
if (mdl_con)
if (!mdl_con)
{
xb_mysql_query(mdl_con, "BEGIN", false, true);
msg("FATAL: cannot create connection for MDL locks");
exit(1);
}
const char *query =
"SELECT NAME, SPACE FROM INFORMATION_SCHEMA.INNODB_SYS_TABLES WHERE NAME LIKE '%%/%%'";

MYSQL_RES *mysql_result = xb_mysql_query(mdl_con, query, true, true);
while (MYSQL_ROW row = mysql_fetch_row(mysql_result)) {
int err;
ulint id = (ulint)my_strtoll10(row[1], 0, &err);
spaceid_to_tablename[id] = ut_get_name(0, row[0]);
}
mysql_free_result(mysql_result);

xb_mysql_query(mdl_con, "BEGIN", false, true);
}

void
mdl_lock_table(ulint space_id)
{
std::ostringstream oss;
oss << "SELECT NAME "
"FROM INFORMATION_SCHEMA.INNODB_SYS_TABLES "
"WHERE SPACE = " << space_id << " AND NAME LIKE '%%/%%'";
if (space_id == 0)
return;

pthread_mutex_lock(&mdl_lock_con_mutex);
std::string full_table_name = spaceid_to_tablename[space_id];

MYSQL_RES *mysql_result = xb_mysql_query(mdl_con, oss.str().c_str(), true, true);
DBUG_EXECUTE_IF("rename_during_mdl_lock_table",
if (full_table_name == "`test`.`t1`")
xb_mysql_query(mysql_connection, "RENAME TABLE test.t1 to test.t2", false, true);
);

while (MYSQL_ROW row = mysql_fetch_row(mysql_result)) {

DBUG_EXECUTE_IF("rename_during_mdl_lock_table",
if (strcmp(row[0], "test/t1") == 0)
xb_mysql_query(mysql_connection, "RENAME TABLE test.t1 to test.t2", false, true
););

std::string full_table_name = ut_get_name(0,row[0]);
std::ostringstream lock_query;
lock_query << "SELECT 1 FROM " << full_table_name << " LIMIT 0";
msg_ts("Locking MDL for %s\n", full_table_name.c_str());
if (mysql_query(mdl_con, lock_query.str().c_str())) {
std::ostringstream lock_query;
lock_query << "SELECT 1 FROM " << full_table_name << " LIMIT 0";
msg_ts("Locking MDL for %s\n", full_table_name.c_str());
if (mysql_query(mdl_con, lock_query.str().c_str())) {
msg_ts("Warning : locking MDL failed for space id %zu, name %s\n", space_id, full_table_name.c_str());
} else {
} else {
MYSQL_RES *r = mysql_store_result(mdl_con);
mysql_free_result(r);
}
}

pthread_mutex_unlock(&mdl_lock_con_mutex);
mysql_free_result(mysql_result);
}


void
mdl_unlock_all()
{
msg_ts("Unlocking MDL for all tables\n");
xb_mysql_query(mdl_con, "COMMIT", false, true);
mysql_close(mdl_con);
pthread_mutex_destroy(&mdl_lock_con_mutex);
spaceid_to_tablename.clear();
}

2 changes: 1 addition & 1 deletion extra/mariabackup/crc/crc-intel-pclmul.c
Expand Up @@ -35,7 +35,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*
* You should have received a copy of the GNU Lesser General Public
* License along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*
*/

Expand Down
4 changes: 2 additions & 2 deletions extra/mariabackup/innobackupex.cc
Expand Up @@ -34,8 +34,8 @@ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with
this program; if not, write to the Free Software Foundation, Inc., 59 Temple
Place, Suite 330, Boston, MA 02111-1307 USA
this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*******************************************************/

Expand Down
4 changes: 2 additions & 2 deletions extra/mariabackup/xtrabackup.cc
Expand Up @@ -36,8 +36,8 @@ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with
this program; if not, write to the Free Software Foundation, Inc., 59 Temple
Place, Suite 330, Boston, MA 02111-1307 USA
this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*******************************************************/

Expand Down
2 changes: 1 addition & 1 deletion include/big_endian.h
Expand Up @@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02111-1307 USA */
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02111-1301 USA */

/*
Data in big-endian format.
Expand Down
2 changes: 1 addition & 1 deletion include/byte_order_generic.h
Expand Up @@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02111-1307 USA */
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02111-1301 USA */

/*
Endianness-independent definitions for architectures other
Expand Down
2 changes: 1 addition & 1 deletion include/byte_order_generic_x86.h
Expand Up @@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02111-1307 USA */
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02111-1301 USA */

/*
Optimized function-like macros for the x86 architecture (_WIN32 included).
Expand Down
2 changes: 1 addition & 1 deletion include/byte_order_generic_x86_64.h
Expand Up @@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02111-1307 USA */
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02111-1301 USA */

/*
Optimized function-like macros for the x86 architecture (_WIN32 included).
Expand Down
2 changes: 1 addition & 1 deletion include/little_endian.h
Expand Up @@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02111-1307 USA */
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02111-1301 USA */

/*
Data in little-endian format.
Expand Down

0 comments on commit df563e0

Please sign in to comment.