merged mysql-5.5->mysql-5.5-security
This commit is contained in:
commit
455c676792
@ -3129,3 +3129,7 @@ libmysqld/examples/mysql_embedded
|
||||
sql/.empty
|
||||
mysys/thr_lock
|
||||
VERSION.dep
|
||||
info_macros.cmake
|
||||
Docs/INFO_BIN
|
||||
Docs/INFO_SRC
|
||||
Testing
|
||||
|
@ -1,6 +1,6 @@
|
||||
#!/bin/sh
|
||||
|
||||
# Copyright (C) 2000, 2007 MySQL AB
|
||||
# Copyright (c) 2000, 2011, 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 Library General Public
|
||||
@ -250,7 +250,7 @@ gcov_compile_flags="$gcov_compile_flags -DMYSQL_SERVER_SUFFIX=-gcov -DHAVE_gcov"
|
||||
|
||||
gcov_link_flags="-fprofile-arcs -ftest-coverage"
|
||||
|
||||
gcov_configs="--disable-shared"
|
||||
gcov_configs="--with-gcov"
|
||||
|
||||
# gprof
|
||||
|
||||
|
@ -293,7 +293,8 @@ extended_usage()
|
||||
version string suffix: [none]
|
||||
|
||||
All packages except Classic include support for user-defined
|
||||
partitioning.
|
||||
partitioning. All packages include support for Performance
|
||||
Schema.
|
||||
|
||||
If --with-debug is used, an additional "-debug" is appended to the
|
||||
version string.
|
||||
|
@ -172,6 +172,13 @@ IF(ENABLE_DEBUG_SYNC)
|
||||
SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DENABLED_DEBUG_SYNC")
|
||||
ENDIF()
|
||||
|
||||
OPTION(ENABLE_GCOV "Enable gcov (debug, Linux builds only)" OFF)
|
||||
IF (ENABLE_GCOV AND NOT WIN32 AND NOT APPLE)
|
||||
SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -fprofile-arcs -ftest-coverage")
|
||||
SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -fprofile-arcs -ftest-coverage")
|
||||
SET(CMAKE_EXE_LINKER_FLAGS_DEBUG "${CMAKE_EXE_LINKER_FLAGS_DEBUG} -fprofile-arcs -ftest-coverage -lgcov")
|
||||
ENDIF()
|
||||
|
||||
OPTION(ENABLED_LOCAL_INFILE
|
||||
"If we should should enable LOAD DATA LOCAL by default" ${IF_WIN})
|
||||
MARK_AS_ADVANCED(ENABLED_LOCAL_INFILE)
|
||||
|
@ -1564,11 +1564,11 @@ static struct my_option my_long_options[] =
|
||||
&show_warnings, &show_warnings, 0, GET_BOOL, NO_ARG,
|
||||
0, 0, 0, 0, 0, 0},
|
||||
{"plugin_dir", OPT_PLUGIN_DIR, "Directory for client-side plugins.",
|
||||
(uchar**) &opt_plugin_dir, (uchar**) &opt_plugin_dir, 0,
|
||||
&opt_plugin_dir, &opt_plugin_dir, 0,
|
||||
GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"default_auth", OPT_DEFAULT_AUTH,
|
||||
"Default authentication client-side plugin to use.",
|
||||
(uchar**) &opt_default_auth, (uchar**) &opt_default_auth, 0,
|
||||
&opt_default_auth, &opt_default_auth, 0,
|
||||
GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{ 0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}
|
||||
};
|
||||
|
@ -92,7 +92,7 @@ static struct my_option my_long_options[]=
|
||||
0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"default_auth", OPT_DEFAULT_AUTH,
|
||||
"Default authentication client-side plugin to use.",
|
||||
(uchar**) &opt_default_auth, (uchar**) &opt_default_auth, 0,
|
||||
&opt_default_auth, &opt_default_auth, 0,
|
||||
GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"force", 'f', "Force execution of mysqlcheck even if mysql_upgrade "
|
||||
"has already been executed for the current version of MySQL.",
|
||||
@ -109,7 +109,7 @@ static struct my_option my_long_options[]=
|
||||
GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
|
||||
#endif
|
||||
{"plugin_dir", OPT_PLUGIN_DIR, "Directory for client-side plugins.",
|
||||
(uchar**) &opt_plugin_dir, (uchar**) &opt_plugin_dir, 0,
|
||||
&opt_plugin_dir, &opt_plugin_dir, 0,
|
||||
GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"port", 'P', "Port number to use for connection or 0 for default to, in "
|
||||
"order of preference, my.cnf, $MYSQL_TCP_PORT, "
|
||||
|
@ -206,11 +206,11 @@ static struct my_option my_long_options[] =
|
||||
&opt_shutdown_timeout, 0, GET_ULONG, REQUIRED_ARG,
|
||||
SHUTDOWN_DEF_TIMEOUT, 0, 3600*12, 0, 1, 0},
|
||||
{"plugin_dir", OPT_PLUGIN_DIR, "Directory for client-side plugins.",
|
||||
(uchar**) &opt_plugin_dir, (uchar**) &opt_plugin_dir, 0,
|
||||
&opt_plugin_dir, &opt_plugin_dir, 0,
|
||||
GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"default_auth", OPT_DEFAULT_AUTH,
|
||||
"Default authentication client-side plugin to use.",
|
||||
(uchar**) &opt_default_auth, (uchar**) &opt_default_auth, 0,
|
||||
&opt_default_auth, &opt_default_auth, 0,
|
||||
GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{ 0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}
|
||||
};
|
||||
|
@ -1052,7 +1052,7 @@ static struct my_option my_long_options[] =
|
||||
0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"default_auth", OPT_DEFAULT_AUTH,
|
||||
"Default authentication client-side plugin to use.",
|
||||
(uchar**) &opt_default_auth, (uchar**) &opt_default_auth, 0,
|
||||
&opt_default_auth, &opt_default_auth, 0,
|
||||
GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"disable-log-bin", 'D', "Disable binary log. This is useful, if you "
|
||||
"enabled --to-last-log and are sending the output to the same MySQL server. "
|
||||
@ -1080,7 +1080,7 @@ static struct my_option my_long_options[] =
|
||||
{"password", 'p', "Password to connect to remote server.",
|
||||
0, 0, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"plugin_dir", OPT_PLUGIN_DIR, "Directory for client-side plugins.",
|
||||
(uchar**) &opt_plugin_dir, (uchar**) &opt_plugin_dir, 0,
|
||||
&opt_plugin_dir, &opt_plugin_dir, 0,
|
||||
GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"port", 'P', "Port number to use for connection or 0 for default to, in "
|
||||
"order of preference, my.cnf, $MYSQL_TCP_PORT, "
|
||||
|
@ -102,7 +102,7 @@ static struct my_option my_long_options[] =
|
||||
&default_charset, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"default_auth", OPT_DEFAULT_AUTH,
|
||||
"Default authentication client-side plugin to use.",
|
||||
(uchar**) &opt_default_auth, (uchar**) &opt_default_auth, 0,
|
||||
&opt_default_auth, &opt_default_auth, 0,
|
||||
GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"fast",'F', "Check only tables that haven't been closed properly.",
|
||||
&opt_fast, &opt_fast, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0,
|
||||
@ -142,7 +142,7 @@ static struct my_option my_long_options[] =
|
||||
NO_ARG, 0, 0, 0, 0, 0, 0},
|
||||
#endif
|
||||
{"plugin_dir", OPT_PLUGIN_DIR, "Directory for client-side plugins.",
|
||||
(uchar**) &opt_plugin_dir, (uchar**) &opt_plugin_dir, 0,
|
||||
&opt_plugin_dir, &opt_plugin_dir, 0,
|
||||
GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"port", 'P', "Port number to use for connection or 0 for default to, in "
|
||||
"order of preference, my.cnf, $MYSQL_TCP_PORT, "
|
||||
|
@ -501,11 +501,11 @@ static struct my_option my_long_options[] =
|
||||
{"xml", 'X', "Dump a database as well formed XML.", 0, 0, 0, GET_NO_ARG,
|
||||
NO_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"plugin_dir", OPT_PLUGIN_DIR, "Directory for client-side plugins.",
|
||||
(uchar**) &opt_plugin_dir, (uchar**) &opt_plugin_dir, 0,
|
||||
&opt_plugin_dir, &opt_plugin_dir, 0,
|
||||
GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"default_auth", OPT_DEFAULT_AUTH,
|
||||
"Default authentication client-side plugin to use.",
|
||||
(uchar**) &opt_default_auth, (uchar**) &opt_default_auth, 0,
|
||||
&opt_default_auth, &opt_default_auth, 0,
|
||||
GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}
|
||||
};
|
||||
|
@ -93,7 +93,7 @@ static struct my_option my_long_options[] =
|
||||
0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"default_auth", OPT_DEFAULT_AUTH,
|
||||
"Default authentication client-side plugin to use.",
|
||||
(uchar**) &opt_default_auth, (uchar**) &opt_default_auth, 0,
|
||||
&opt_default_auth, &opt_default_auth, 0,
|
||||
GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"delete", 'd', "First delete all rows from table.", &opt_delete,
|
||||
&opt_delete, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
|
||||
@ -145,7 +145,7 @@ static struct my_option my_long_options[] =
|
||||
NO_ARG, 0, 0, 0, 0, 0, 0},
|
||||
#endif
|
||||
{"plugin_dir", OPT_PLUGIN_DIR, "Directory for client-side plugins.",
|
||||
(uchar**) &opt_plugin_dir, (uchar**) &opt_plugin_dir, 0,
|
||||
&opt_plugin_dir, &opt_plugin_dir, 0,
|
||||
GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"port", 'P', "Port number to use for connection or 0 for default to, in "
|
||||
"order of preference, my.cnf, $MYSQL_TCP_PORT, "
|
||||
|
@ -191,7 +191,7 @@ static struct my_option my_long_options[] =
|
||||
0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"default_auth", OPT_DEFAULT_AUTH,
|
||||
"Default authentication client-side plugin to use.",
|
||||
(uchar**) &opt_default_auth, (uchar**) &opt_default_auth, 0,
|
||||
&opt_default_auth, &opt_default_auth, 0,
|
||||
GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"help", '?', "Display this help and exit.", 0, 0, 0, GET_NO_ARG, NO_ARG,
|
||||
0, 0, 0, 0, 0, 0},
|
||||
@ -207,7 +207,7 @@ static struct my_option my_long_options[] =
|
||||
"solicited on the tty.",
|
||||
0, 0, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"plugin_dir", OPT_PLUGIN_DIR, "Directory for client-side plugins.",
|
||||
(uchar**) &opt_plugin_dir, (uchar**) &opt_plugin_dir, 0,
|
||||
&opt_plugin_dir, &opt_plugin_dir, 0,
|
||||
GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"port", 'P', "Port number to use for connection or 0 for default to, in "
|
||||
"order of preference, my.cnf, $MYSQL_TCP_PORT, "
|
||||
|
@ -590,7 +590,7 @@ static struct my_option my_long_options[] =
|
||||
&debug_info_flag, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"default_auth", OPT_DEFAULT_AUTH,
|
||||
"Default authentication client-side plugin to use.",
|
||||
(uchar**) &opt_default_auth, (uchar**) &opt_default_auth, 0,
|
||||
&opt_default_auth, &opt_default_auth, 0,
|
||||
GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"delimiter", 'F',
|
||||
"Delimiter to use in SQL statements supplied in file or command line.",
|
||||
@ -634,7 +634,7 @@ static struct my_option my_long_options[] =
|
||||
NO_ARG, 0, 0, 0, 0, 0, 0},
|
||||
#endif
|
||||
{"plugin_dir", OPT_PLUGIN_DIR, "Directory for client-side plugins.",
|
||||
(uchar**) &opt_plugin_dir, (uchar**) &opt_plugin_dir, 0,
|
||||
&opt_plugin_dir, &opt_plugin_dir, 0,
|
||||
GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"port", 'P', "Port number to use for connection.", &opt_mysql_port,
|
||||
&opt_mysql_port, 0, GET_UINT, REQUIRED_ARG, MYSQL_PORT, 0, 0, 0, 0,
|
||||
|
@ -6423,7 +6423,7 @@ static struct my_option my_long_options[] =
|
||||
&opt_connect_timeout, &opt_connect_timeout, 0, GET_UINT, REQUIRED_ARG,
|
||||
120, 0, 3600 * 12, 0, 0, 0},
|
||||
{"plugin_dir", OPT_PLUGIN_DIR, "Directory for client-side plugins.",
|
||||
(uchar**) &opt_plugin_dir, (uchar**) &opt_plugin_dir, 0,
|
||||
&opt_plugin_dir, &opt_plugin_dir, 0,
|
||||
GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{ 0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}
|
||||
};
|
||||
|
@ -190,6 +190,11 @@ foreach my $option (@ARGV)
|
||||
$cmakeargs = $cmakeargs." \"-DWITH_COMMENT=".substr($option,13)."\"";
|
||||
next;
|
||||
}
|
||||
if ($option =~ /with-gcov/)
|
||||
{
|
||||
$cmakeargs = $cmakeargs." -DENABLE_GCOV=ON";
|
||||
next;
|
||||
}
|
||||
|
||||
$option = uc($option);
|
||||
$option =~ s/-/_/g;
|
||||
|
@ -98,6 +98,13 @@ IF(UNIX)
|
||||
MARK_AS_ADVANCED(SYSCONFDIR)
|
||||
ENDIF()
|
||||
|
||||
#
|
||||
# plugin_tests's value should not be used by imported plugins,
|
||||
# just use if(INSTALL_PLUGINTESTDIR).
|
||||
# The plugin must set its own install path for tests
|
||||
#
|
||||
FILE(GLOB plugin_tests ${CMAKE_SOURCE_DIR}/plugin/*/tests)
|
||||
|
||||
#
|
||||
# STANDALONE layout
|
||||
#
|
||||
@ -122,6 +129,7 @@ SET(INSTALL_SQLBENCHDIR_STANDALONE ".")
|
||||
SET(INSTALL_SUPPORTFILESDIR_STANDALONE "support-files")
|
||||
#
|
||||
SET(INSTALL_MYSQLDATADIR_STANDALONE "data")
|
||||
SET(INSTALL_PLUGINTESTDIR_STANDALONE ${plugin_tests})
|
||||
|
||||
#
|
||||
# RPM layout
|
||||
@ -152,6 +160,7 @@ SET(INSTALL_SQLBENCHDIR_RPM "")
|
||||
SET(INSTALL_SUPPORTFILESDIR_RPM "share/mysql")
|
||||
#
|
||||
SET(INSTALL_MYSQLDATADIR_RPM "/var/lib/mysql")
|
||||
SET(INSTALL_PLUGINTESTDIR_RPM ${plugin_tests})
|
||||
|
||||
#
|
||||
# DEB layout
|
||||
@ -177,6 +186,7 @@ SET(INSTALL_SQLBENCHDIR_DEB ".")
|
||||
SET(INSTALL_SUPPORTFILESDIR_DEB "support-files")
|
||||
#
|
||||
SET(INSTALL_MYSQLDATADIR_DEB "data")
|
||||
SET(INSTALL_PLUGINTESTDIR_DEB ${plugin_tests})
|
||||
|
||||
#
|
||||
# SVR4 layout
|
||||
@ -202,6 +212,7 @@ SET(INSTALL_SQLBENCHDIR_SVR4 ".")
|
||||
SET(INSTALL_SUPPORTFILESDIR_SVR4 "support-files")
|
||||
#
|
||||
SET(INSTALL_MYSQLDATADIR_SVR4 "/var/lib/mysql")
|
||||
SET(INSTALL_PLUGINTESTDIR_SVR4 ${plugin_tests})
|
||||
|
||||
|
||||
# Clear cached variables if install layout was changed
|
||||
@ -216,7 +227,7 @@ SET(OLD_INSTALL_LAYOUT ${INSTALL_LAYOUT} CACHE INTERNAL "")
|
||||
# will be defined as ${INSTALL_BINDIR_STANDALONE} by default if STANDALONE
|
||||
# layout is chosen)
|
||||
FOREACH(var BIN SBIN LIB MYSQLSHARE SHARE PLUGIN INCLUDE SCRIPT DOC MAN
|
||||
INFO MYSQLTEST SQLBENCH DOCREADME SUPPORTFILES MYSQLDATA)
|
||||
INFO MYSQLTEST SQLBENCH DOCREADME SUPPORTFILES MYSQLDATA PLUGINTEST)
|
||||
SET(INSTALL_${var}DIR ${INSTALL_${var}DIR_${INSTALL_LAYOUT}}
|
||||
CACHE STRING "${var} installation directory" ${FORCE})
|
||||
MARK_AS_ADVANCED(INSTALL_${var}DIR)
|
||||
|
@ -341,6 +341,7 @@ SET(SIGNAL_RETURN_TYPE_IS_VOID 1 CACHE INTERNAL "")
|
||||
SET(C_HAS_inline CACHE INTERNAL "")
|
||||
SET(C_HAS___inline 1 CACHE INTERNAL "")
|
||||
SET(FIONREAD_IN_SYS_IOCTL CACHE INTERNAL "")
|
||||
SET(FIONREAD_IN_SYS_FILIO CACHE INTERNAL "")
|
||||
SET(GWINSZ_IN_SYS_IOCTL CACHE INTERNAL "")
|
||||
SET(HAVE_CXXABI_H CACHE INTERNAL "")
|
||||
SET(HAVE_NDIR_H CACHE INTERNAL "")
|
||||
|
@ -1,4 +1,4 @@
|
||||
# Copyright (C) 2009 Sun Microsystems, Inc
|
||||
# Copyright (c) 2009, 2011, 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
|
||||
@ -27,6 +27,23 @@ INCLUDE(${MYSQL_CMAKE_SCRIPT_DIR}/cmake_parse_arguments.cmake)
|
||||
# [LINK_LIBRARIES lib1...libN]
|
||||
# [DEPENDENCIES target1...targetN]
|
||||
|
||||
# Append collections files for the plugin to the common files
|
||||
# Make sure we don't copy twice if running cmake again
|
||||
|
||||
MACRO(PLUGIN_APPEND_COLLECTIONS plugin)
|
||||
SET(fcopied "${CMAKE_CURRENT_SOURCE_DIR}/tests/collections/FilesCopied")
|
||||
IF(EXISTS ${fcopied})
|
||||
RETURN()
|
||||
ENDIF()
|
||||
FILE(GLOB collections ${CMAKE_CURRENT_SOURCE_DIR}/tests/collections/*)
|
||||
FOREACH(cfile ${collections})
|
||||
FILE(READ ${cfile} contents)
|
||||
GET_FILENAME_COMPONENT(fname ${cfile} NAME)
|
||||
FILE(APPEND ${CMAKE_SOURCE_DIR}/mysql-test/collections/${fname} "${contents}")
|
||||
FILE(APPEND ${fcopied} "${fname}\n")
|
||||
ENDFOREACH()
|
||||
ENDMACRO()
|
||||
|
||||
MACRO(MYSQL_ADD_PLUGIN)
|
||||
MYSQL_PARSE_ARGUMENTS(ARG
|
||||
"LINK_LIBRARIES;DEPENDENCIES;MODULE_OUTPUT_NAME;STATIC_OUTPUT_NAME"
|
||||
@ -180,6 +197,10 @@ MACRO(MYSQL_ADD_PLUGIN)
|
||||
# Install dynamic library
|
||||
MYSQL_INSTALL_TARGETS(${target} DESTINATION ${INSTALL_PLUGINDIR} COMPONENT Server)
|
||||
INSTALL_DEBUG_TARGET(${target} DESTINATION ${INSTALL_PLUGINDIR}/debug)
|
||||
# For internal testing in PB2, append collections files
|
||||
IF(DEFINED ENV{PB2WORKDIR})
|
||||
PLUGIN_APPEND_COLLECTIONS(${plugin})
|
||||
ENDIF()
|
||||
ELSE()
|
||||
IF(WITHOUT_${plugin})
|
||||
# Update cache variable
|
||||
|
@ -345,6 +345,7 @@ CHECK_FUNCTION_EXISTS (fconvert HAVE_FCONVERT)
|
||||
CHECK_FUNCTION_EXISTS (fdatasync HAVE_FDATASYNC)
|
||||
CHECK_SYMBOL_EXISTS(fdatasync "unistd.h" HAVE_DECL_FDATASYNC)
|
||||
CHECK_FUNCTION_EXISTS (fesetround HAVE_FESETROUND)
|
||||
CHECK_FUNCTION_EXISTS (fedisableexcept HAVE_FEDISABLEEXCEPT)
|
||||
CHECK_FUNCTION_EXISTS (fpsetmask HAVE_FPSETMASK)
|
||||
CHECK_FUNCTION_EXISTS (fseeko HAVE_FSEEKO)
|
||||
CHECK_FUNCTION_EXISTS (fsync HAVE_FSYNC)
|
||||
|
@ -446,7 +446,8 @@ enum ha_base_keytype {
|
||||
#define HA_ERR_FILE_TOO_SHORT 175 /* File too short */
|
||||
#define HA_ERR_WRONG_CRC 176 /* Wrong CRC on page */
|
||||
#define HA_ERR_TOO_MANY_CONCURRENT_TRXS 177 /*Too many active concurrent transactions */
|
||||
#define HA_ERR_LAST 177 /* Copy of last error nr */
|
||||
#define HA_ERR_INDEX_COL_TOO_LONG 178 /* Index column length exceeds limit */
|
||||
#define HA_ERR_LAST 178 /* Copy of last error nr */
|
||||
|
||||
/* Number of different errors */
|
||||
#define HA_ERR_ERRORS (HA_ERR_LAST - HA_ERR_FIRST + 1)
|
||||
|
@ -140,6 +140,14 @@ struct my_aligned_storage
|
||||
|
||||
#endif /* __cplusplus */
|
||||
|
||||
# ifndef MY_ALIGNED
|
||||
/*
|
||||
Make sure MY_ALIGNED can be used also on platforms where we don't
|
||||
have a way of aligning data structures.
|
||||
*/
|
||||
#define MY_ALIGNED(size)
|
||||
#endif
|
||||
|
||||
#include <my_attribute.h>
|
||||
|
||||
#endif /* MY_COMPILER_INCLUDED */
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* Copyright (C) 2002-2004 MySQL AB
|
||||
/* Copyright (c) 2002, 2011, 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
|
||||
@ -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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
|
||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
|
||||
|
||||
#ifndef _my_getopt_h
|
||||
#define _my_getopt_h
|
||||
@ -86,7 +86,9 @@ struct my_option
|
||||
|
||||
|
||||
typedef my_bool (*my_get_one_option)(int, const struct my_option *, char *);
|
||||
typedef void (*my_error_reporter)(enum loglevel level, const char *format, ...);
|
||||
typedef void (*my_error_reporter)(enum loglevel level, const char *format, ...)
|
||||
ATTRIBUTE_FORMAT_FPTR(printf, 2, 3);
|
||||
|
||||
/**
|
||||
Used to retrieve a reference to the object (variable) that holds the value
|
||||
for the given option. For example, if var_type is GET_UINT, the function
|
||||
|
@ -627,6 +627,8 @@ extern FILE *my_freopen(const char *path, const char *mode, FILE *stream);
|
||||
extern int my_fclose(FILE *fd,myf MyFlags);
|
||||
extern File my_fileno(FILE *fd);
|
||||
extern int my_chsize(File fd,my_off_t newlength, int filler, myf MyFlags);
|
||||
extern void thr_set_sync_wait_callback(void (*before_sync)(void),
|
||||
void (*after_sync)(void));
|
||||
extern int my_sync(File fd, myf my_flags);
|
||||
extern int my_sync_dir(const char *dir_name, myf my_flags);
|
||||
extern int my_sync_dir_by_file(const char *file_name, myf my_flags);
|
||||
|
@ -24,16 +24,7 @@
|
||||
|
||||
#define MYSQL_AUDIT_CLASS_MASK_SIZE 1
|
||||
|
||||
#define MYSQL_AUDIT_INTERFACE_VERSION 0x0200
|
||||
|
||||
/*
|
||||
The first word in every event class struct indicates the specific
|
||||
class of the event.
|
||||
*/
|
||||
struct mysql_event
|
||||
{
|
||||
unsigned int event_class;
|
||||
};
|
||||
#define MYSQL_AUDIT_INTERFACE_VERSION 0x0300
|
||||
|
||||
|
||||
/*************************************************************************
|
||||
@ -55,7 +46,6 @@ struct mysql_event
|
||||
|
||||
struct mysql_event_general
|
||||
{
|
||||
unsigned int event_class;
|
||||
unsigned int event_subclass;
|
||||
int general_error_code;
|
||||
unsigned long general_thread_id;
|
||||
@ -87,7 +77,6 @@ struct mysql_event_general
|
||||
|
||||
struct mysql_event_connection
|
||||
{
|
||||
unsigned int event_class;
|
||||
unsigned int event_subclass;
|
||||
int status;
|
||||
unsigned long thread_id;
|
||||
@ -118,9 +107,9 @@ struct mysql_event_connection
|
||||
waiting for the next query from the client.
|
||||
|
||||
event_notify() is invoked whenever an event occurs which is of any
|
||||
class for which the plugin has interest. The first word of the
|
||||
mysql_event argument indicates the specific event class and the
|
||||
remainder of the structure is as required for that class.
|
||||
class for which the plugin has interest. The second argument
|
||||
indicates the specific event class and the third argument is data
|
||||
as required for that class.
|
||||
|
||||
class_mask is an array of bits used to indicate what event classes
|
||||
that this plugin wants to receive.
|
||||
@ -130,7 +119,7 @@ struct st_mysql_audit
|
||||
{
|
||||
int interface_version;
|
||||
void (*release_thd)(MYSQL_THD);
|
||||
void (*event_notify)(MYSQL_THD, const struct mysql_event *);
|
||||
void (*event_notify)(MYSQL_THD, unsigned int, const void *);
|
||||
unsigned long class_mask[MYSQL_AUDIT_CLASS_MASK_SIZE];
|
||||
};
|
||||
|
||||
|
@ -33,16 +33,23 @@ MYSQL_LEX_STRING *thd_make_lex_string(void* thd, MYSQL_LEX_STRING *lex_str,
|
||||
int allocate_lex_string);
|
||||
#include <mysql/service_thd_wait.h>
|
||||
typedef enum _thd_wait_type_e {
|
||||
THD_WAIT_MUTEX= 1,
|
||||
THD_WAIT_SLEEP= 1,
|
||||
THD_WAIT_DISKIO= 2,
|
||||
THD_WAIT_ROW_TABLE_LOCK= 3,
|
||||
THD_WAIT_GLOBAL_LOCK= 4
|
||||
THD_WAIT_ROW_LOCK= 3,
|
||||
THD_WAIT_GLOBAL_LOCK= 4,
|
||||
THD_WAIT_META_DATA_LOCK= 5,
|
||||
THD_WAIT_TABLE_LOCK= 6,
|
||||
THD_WAIT_USER_LOCK= 7,
|
||||
THD_WAIT_BINLOG= 8,
|
||||
THD_WAIT_GROUP_COMMIT= 9,
|
||||
THD_WAIT_SYNC= 10,
|
||||
THD_WAIT_LAST= 11
|
||||
} thd_wait_type;
|
||||
extern struct thd_wait_service_st {
|
||||
void (*thd_wait_begin_func)(void*, thd_wait_type);
|
||||
void (*thd_wait_begin_func)(void*, int);
|
||||
void (*thd_wait_end_func)(void*);
|
||||
} *thd_wait_service;
|
||||
void thd_wait_begin(void* thd, thd_wait_type wait_type);
|
||||
void thd_wait_begin(void* thd, int wait_type);
|
||||
void thd_wait_end(void* thd);
|
||||
#include <mysql/service_thread_scheduler.h>
|
||||
struct scheduler_functions;
|
||||
@ -188,13 +195,8 @@ void mysql_query_cache_invalidate4(void* thd,
|
||||
void *thd_get_ha_data(const void* thd, const struct handlerton *hton);
|
||||
void thd_set_ha_data(void* thd, const struct handlerton *hton,
|
||||
const void *ha_data);
|
||||
struct mysql_event
|
||||
{
|
||||
unsigned int event_class;
|
||||
};
|
||||
struct mysql_event_general
|
||||
{
|
||||
unsigned int event_class;
|
||||
unsigned int event_subclass;
|
||||
int general_error_code;
|
||||
unsigned long general_thread_id;
|
||||
@ -210,7 +212,6 @@ struct mysql_event_general
|
||||
};
|
||||
struct mysql_event_connection
|
||||
{
|
||||
unsigned int event_class;
|
||||
unsigned int event_subclass;
|
||||
int status;
|
||||
unsigned long thread_id;
|
||||
@ -233,6 +234,6 @@ struct st_mysql_audit
|
||||
{
|
||||
int interface_version;
|
||||
void (*release_thd)(void*);
|
||||
void (*event_notify)(void*, const struct mysql_event *);
|
||||
void (*event_notify)(void*, unsigned int, const void *);
|
||||
unsigned long class_mask[1];
|
||||
};
|
||||
|
@ -33,16 +33,23 @@ MYSQL_LEX_STRING *thd_make_lex_string(void* thd, MYSQL_LEX_STRING *lex_str,
|
||||
int allocate_lex_string);
|
||||
#include <mysql/service_thd_wait.h>
|
||||
typedef enum _thd_wait_type_e {
|
||||
THD_WAIT_MUTEX= 1,
|
||||
THD_WAIT_SLEEP= 1,
|
||||
THD_WAIT_DISKIO= 2,
|
||||
THD_WAIT_ROW_TABLE_LOCK= 3,
|
||||
THD_WAIT_GLOBAL_LOCK= 4
|
||||
THD_WAIT_ROW_LOCK= 3,
|
||||
THD_WAIT_GLOBAL_LOCK= 4,
|
||||
THD_WAIT_META_DATA_LOCK= 5,
|
||||
THD_WAIT_TABLE_LOCK= 6,
|
||||
THD_WAIT_USER_LOCK= 7,
|
||||
THD_WAIT_BINLOG= 8,
|
||||
THD_WAIT_GROUP_COMMIT= 9,
|
||||
THD_WAIT_SYNC= 10,
|
||||
THD_WAIT_LAST= 11
|
||||
} thd_wait_type;
|
||||
extern struct thd_wait_service_st {
|
||||
void (*thd_wait_begin_func)(void*, thd_wait_type);
|
||||
void (*thd_wait_begin_func)(void*, int);
|
||||
void (*thd_wait_end_func)(void*);
|
||||
} *thd_wait_service;
|
||||
void thd_wait_begin(void* thd, thd_wait_type wait_type);
|
||||
void thd_wait_begin(void* thd, int wait_type);
|
||||
void thd_wait_end(void* thd);
|
||||
#include <mysql/service_thread_scheduler.h>
|
||||
struct scheduler_functions;
|
||||
|
@ -33,16 +33,23 @@ MYSQL_LEX_STRING *thd_make_lex_string(void* thd, MYSQL_LEX_STRING *lex_str,
|
||||
int allocate_lex_string);
|
||||
#include <mysql/service_thd_wait.h>
|
||||
typedef enum _thd_wait_type_e {
|
||||
THD_WAIT_MUTEX= 1,
|
||||
THD_WAIT_SLEEP= 1,
|
||||
THD_WAIT_DISKIO= 2,
|
||||
THD_WAIT_ROW_TABLE_LOCK= 3,
|
||||
THD_WAIT_GLOBAL_LOCK= 4
|
||||
THD_WAIT_ROW_LOCK= 3,
|
||||
THD_WAIT_GLOBAL_LOCK= 4,
|
||||
THD_WAIT_META_DATA_LOCK= 5,
|
||||
THD_WAIT_TABLE_LOCK= 6,
|
||||
THD_WAIT_USER_LOCK= 7,
|
||||
THD_WAIT_BINLOG= 8,
|
||||
THD_WAIT_GROUP_COMMIT= 9,
|
||||
THD_WAIT_SYNC= 10,
|
||||
THD_WAIT_LAST= 11
|
||||
} thd_wait_type;
|
||||
extern struct thd_wait_service_st {
|
||||
void (*thd_wait_begin_func)(void*, thd_wait_type);
|
||||
void (*thd_wait_begin_func)(void*, int);
|
||||
void (*thd_wait_end_func)(void*);
|
||||
} *thd_wait_service;
|
||||
void thd_wait_begin(void* thd, thd_wait_type wait_type);
|
||||
void thd_wait_begin(void* thd, int wait_type);
|
||||
void thd_wait_end(void* thd);
|
||||
#include <mysql/service_thread_scheduler.h>
|
||||
struct scheduler_functions;
|
||||
|
@ -50,15 +50,35 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/*
|
||||
One should only report wait events that could potentially block for a
|
||||
long time. A mutex wait is too short of an event to report. The reason
|
||||
is that an event which is reported leads to a new thread starts
|
||||
executing a query and this has a negative impact of usage of CPU caches
|
||||
and thus the expected gain of starting a new thread must be higher than
|
||||
the expected cost of lost performance due to starting a new thread.
|
||||
|
||||
Good examples of events that should be reported are waiting for row locks
|
||||
that could easily be for many milliseconds or even seconds and the same
|
||||
holds true for global read locks, table locks and other meta data locks.
|
||||
Another event of interest is going to sleep for an extended time.
|
||||
*/
|
||||
typedef enum _thd_wait_type_e {
|
||||
THD_WAIT_MUTEX= 1,
|
||||
THD_WAIT_SLEEP= 1,
|
||||
THD_WAIT_DISKIO= 2,
|
||||
THD_WAIT_ROW_TABLE_LOCK= 3,
|
||||
THD_WAIT_GLOBAL_LOCK= 4
|
||||
THD_WAIT_ROW_LOCK= 3,
|
||||
THD_WAIT_GLOBAL_LOCK= 4,
|
||||
THD_WAIT_META_DATA_LOCK= 5,
|
||||
THD_WAIT_TABLE_LOCK= 6,
|
||||
THD_WAIT_USER_LOCK= 7,
|
||||
THD_WAIT_BINLOG= 8,
|
||||
THD_WAIT_GROUP_COMMIT= 9,
|
||||
THD_WAIT_SYNC= 10,
|
||||
THD_WAIT_LAST= 11
|
||||
} thd_wait_type;
|
||||
|
||||
extern struct thd_wait_service_st {
|
||||
void (*thd_wait_begin_func)(MYSQL_THD, thd_wait_type);
|
||||
void (*thd_wait_begin_func)(MYSQL_THD, int);
|
||||
void (*thd_wait_end_func)(MYSQL_THD);
|
||||
} *thd_wait_service;
|
||||
|
||||
@ -70,7 +90,7 @@ extern struct thd_wait_service_st {
|
||||
|
||||
#else
|
||||
|
||||
void thd_wait_begin(MYSQL_THD thd, thd_wait_type wait_type);
|
||||
void thd_wait_begin(MYSQL_THD thd, int wait_type);
|
||||
void thd_wait_end(MYSQL_THD thd);
|
||||
|
||||
#endif
|
||||
|
121
include/mysql/thread_pool_priv.h
Normal file
121
include/mysql/thread_pool_priv.h
Normal file
@ -0,0 +1,121 @@
|
||||
/*
|
||||
Copyright (C) 2010, 2011 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
|
||||
the Free Software Foundation; version 2 of the License.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT 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
|
||||
*/
|
||||
|
||||
#ifndef THREAD_POOL_PRIV_INCLUDED
|
||||
#define THREAD_POOL_PRIV_INCLUDED
|
||||
|
||||
/*
|
||||
The thread pool requires access to some MySQL server error codes, this is
|
||||
accessed from mysqld_error.h.
|
||||
We need access to the struct that defines the thread pool plugin interface
|
||||
which is accessed through scheduler.h.
|
||||
All accesses to THD variables and functions are defined in this header file.
|
||||
A thread pool can also use DEBUG_SYNC and must thus include
|
||||
debug_sync.h
|
||||
To handle definitions of Information Schema plugins it is also required
|
||||
to include sql_profile.h and table.h.
|
||||
*/
|
||||
#include <mysqld_error.h> /* To get ER_ERROR_ON_READ */
|
||||
#define MYSQL_SERVER 1
|
||||
#include <scheduler.h>
|
||||
#include <debug_sync.h>
|
||||
#include <sql_profile.h>
|
||||
#include <table.h>
|
||||
|
||||
/* Needed to get access to scheduler variables */
|
||||
void* thd_get_scheduler_data(THD *thd);
|
||||
void thd_set_scheduler_data(THD *thd, void *data);
|
||||
PSI_thread* thd_get_psi(THD *thd);
|
||||
void thd_set_psi(THD *thd, PSI_thread *psi);
|
||||
|
||||
/* Interface to THD variables and functions */
|
||||
void thd_set_killed(THD *thd);
|
||||
void thd_clear_errors(THD *thd);
|
||||
void thd_set_thread_stack(THD *thd, char *stack_start);
|
||||
void thd_lock_thread_count(THD *thd);
|
||||
void thd_unlock_thread_count(THD *thd);
|
||||
void thd_close_connection(THD *thd);
|
||||
THD *thd_get_current_thd();
|
||||
void thd_new_connection_setup(THD *thd, char *stack_start);
|
||||
void thd_lock_data(THD *thd);
|
||||
void thd_unlock_data(THD *thd);
|
||||
bool thd_is_transaction_active(THD *thd);
|
||||
int thd_connection_has_data(THD *thd);
|
||||
void thd_set_net_read_write(THD *thd, uint val);
|
||||
void thd_set_mysys_var(THD *thd, st_my_thread_var *mysys_var);
|
||||
my_socket thd_get_fd(THD *thd);
|
||||
|
||||
/* Print to the MySQL error log */
|
||||
void sql_print_error(const char *format, ...);
|
||||
|
||||
/* Store a table record */
|
||||
bool schema_table_store_record(THD *thd, TABLE *table);
|
||||
|
||||
/*
|
||||
The thread pool must be able to execute statements using the connection
|
||||
state in THD object. This is the main objective of the thread pool to
|
||||
schedule the start of these commands.
|
||||
*/
|
||||
bool do_command(THD *thd);
|
||||
|
||||
/*
|
||||
The thread pool requires an interface to the connection logic in the
|
||||
MySQL Server since the thread pool will maintain the event logic on
|
||||
the TCP connection of the MySQL Server. Thus new connections, dropped
|
||||
connections will be discovered by the thread pool and it needs to
|
||||
ensure that the proper MySQL Server logic attached to these events is
|
||||
executed.
|
||||
*/
|
||||
/* Initialise a new connection handler thread */
|
||||
bool init_new_connection_handler_thread();
|
||||
/* Set up connection thread before use as execution thread */
|
||||
bool setup_connection_thread_globals(THD *thd);
|
||||
/* Prepare connection as part of connection set-up */
|
||||
bool thd_prepare_connection(THD *thd);
|
||||
/* Release auditing before executing statement */
|
||||
void mysql_audit_release(THD *thd);
|
||||
/* Check if connection is still alive */
|
||||
bool thd_is_connection_alive(THD *thd);
|
||||
/* Close connection with possible error code */
|
||||
void close_connection(THD *thd, uint errcode);
|
||||
/* End the connection before closing it */
|
||||
void end_connection(THD *thd);
|
||||
/* Cleanup the THD object */
|
||||
void thd_cleanup(THD *thd);
|
||||
/* Decrement connection counter */
|
||||
void dec_connection_count();
|
||||
/* Destroy THD object */
|
||||
void delete_thd(THD *thd);
|
||||
|
||||
/*
|
||||
thread_created is maintained by thread pool when activated since
|
||||
user threads are created by the thread pool (and also special
|
||||
threads to maintain the thread pool). This is done through
|
||||
inc_thread_created.
|
||||
|
||||
max_connections is needed to calculate the maximum number of threads
|
||||
that is allowed to be started by the thread pool. The method
|
||||
get_max_connections() gets reference to this variable.
|
||||
|
||||
connection_attrib is the thread attributes for connection threads,
|
||||
the method get_connection_attrib provides a reference to these
|
||||
attributes.
|
||||
*/
|
||||
void inc_thread_created(void);
|
||||
ulong get_max_connections(void);
|
||||
pthread_attr_t *get_connection_attrib(void);
|
||||
#endif
|
@ -134,13 +134,13 @@ struct st_VioSSLFd
|
||||
SSL_CTX *ssl_context;
|
||||
};
|
||||
|
||||
int sslaccept(struct st_VioSSLFd*, Vio *, long timeout);
|
||||
int sslconnect(struct st_VioSSLFd*, Vio *, long timeout);
|
||||
int sslaccept(struct st_VioSSLFd*, Vio *, long timeout, unsigned long *errptr);
|
||||
int sslconnect(struct st_VioSSLFd*, Vio *, long timeout, unsigned long *errptr);
|
||||
|
||||
struct st_VioSSLFd
|
||||
*new_VioSSLConnectorFd(const char *key_file, const char *cert_file,
|
||||
const char *ca_file, const char *ca_path,
|
||||
const char *cipher);
|
||||
const char *cipher, enum enum_ssl_init_error* error);
|
||||
struct st_VioSSLFd
|
||||
*new_VioSSLAcceptorFd(const char *key_file, const char *cert_file,
|
||||
const char *ca_file,const char *ca_path,
|
||||
|
@ -20,6 +20,16 @@
|
||||
|
||||
#include "common.h"
|
||||
|
||||
/*
|
||||
The following MS C++ specific pragma embeds a comment in the resulting
|
||||
object file. A "lib" comment tells the linker to use the specified
|
||||
library, thus the dependency is handled automagically.
|
||||
*/
|
||||
|
||||
#ifdef _MSC_VER
|
||||
#pragma comment(lib, "Secur32")
|
||||
#endif
|
||||
|
||||
static int win_auth_client_plugin_init(char*, size_t, int, va_list)
|
||||
{
|
||||
return 0;
|
||||
|
@ -51,7 +51,7 @@ const char *client_errors[]=
|
||||
"Error on SHOW SLAVE HOSTS:",
|
||||
"Error connecting to slave:",
|
||||
"Error connecting to master:",
|
||||
"SSL connection error",
|
||||
"SSL connection error: %-.100s",
|
||||
"Malformed packet",
|
||||
"This client library is licensed only for use with MySQL servers having '%s' license",
|
||||
"Invalid use of null pointer",
|
||||
|
@ -50,6 +50,23 @@ extern "C" void unireg_clear(int exit_code)
|
||||
DBUG_VOID_RETURN;
|
||||
}
|
||||
|
||||
/*
|
||||
Wrapper error handler for embedded server to call client/server error
|
||||
handler based on whether thread is in client/server context
|
||||
*/
|
||||
|
||||
static void embedded_error_handler(uint error, const char *str, myf MyFlags)
|
||||
{
|
||||
DBUG_ENTER("embedded_error_handler");
|
||||
|
||||
/*
|
||||
If current_thd is NULL, it means restore_global has been called and
|
||||
thread is in client context, then call client error handler else call
|
||||
server error handler.
|
||||
*/
|
||||
DBUG_RETURN(current_thd ? my_message_sql(error, str, MyFlags):
|
||||
my_message_stderr(error, str, MyFlags));
|
||||
}
|
||||
|
||||
/*
|
||||
Reads error information from the MYSQL_DATA and puts
|
||||
@ -106,7 +123,8 @@ emb_advanced_command(MYSQL *mysql, enum enum_server_command command,
|
||||
if (mysql->status != MYSQL_STATUS_READY)
|
||||
{
|
||||
set_mysql_error(mysql, CR_COMMANDS_OUT_OF_SYNC, unknown_sqlstate);
|
||||
return 1;
|
||||
result= 1;
|
||||
goto end;
|
||||
}
|
||||
|
||||
/* Clear result variables */
|
||||
@ -147,6 +165,9 @@ emb_advanced_command(MYSQL *mysql, enum enum_server_command command,
|
||||
#if defined(ENABLED_PROFILING)
|
||||
thd->profiling.finish_current_query();
|
||||
#endif
|
||||
|
||||
end:
|
||||
thd->restore_globals();
|
||||
return result;
|
||||
}
|
||||
|
||||
@ -545,7 +566,10 @@ int init_embedded_server(int argc, char **argv, char **groups)
|
||||
return 1;
|
||||
}
|
||||
|
||||
error_handler_hook = my_message_sql;
|
||||
/*
|
||||
set error_handler_hook to embedded_error_handler wrapper.
|
||||
*/
|
||||
error_handler_hook= embedded_error_handler;
|
||||
|
||||
acl_error= 0;
|
||||
#ifndef NO_EMBEDDED_ACCESS_CHECKS
|
||||
|
@ -2,33 +2,27 @@
|
||||
# in alphabetical order. This also helps with merge conflict resolution.
|
||||
|
||||
binlog.binlog_multi_engine # joro : NDB tests marked as experimental as agreed with bochklin
|
||||
binlog.binlog_bug23533 # skozlov: BUG#12371924
|
||||
|
||||
funcs_1.charset_collation_1 # depends on compile-time decisions
|
||||
|
||||
main.func_math @freebsd # Bug#43020 2010-05-04 alik main.func_math fails on FreeBSD in PB2
|
||||
main.gis-rtree @freebsd # Bug#38965 2010-05-04 alik test cases gis-rtree, type_float, type_newdecimal fail in embedded server
|
||||
main.lock_multi_bug38499 # Bug#47448 2009-09-19 alik main.lock_multi_bug38499 times out sporadically
|
||||
main.outfile_loaddata @solaris # Bug#46895 2010-01-20 alik Test "outfile_loaddata" fails (reproducible)
|
||||
main.signal_demo3 @solaris # Bug#47791 2010-01-20 alik Several test cases fail on Solaris with error Thread stack overrun
|
||||
main.sp @solaris # Bug#47791 2010-01-20 alik Several test cases fail on Solaris with error Thread stack overrun
|
||||
main.type_float @freebsd # Bug#38965 2010-05-04 alik test cases gis-rtree, type_float, type_newdecimal fail in embedded server
|
||||
main.wait_timeout @solaris # Bug#51244 2010-04-26 alik wait_timeout fails on OpenSolaris
|
||||
main.func_math @freebsd # Bug#11751977 2010-05-04 alik main.func_math fails on FreeBSD in PB2
|
||||
main.lock_multi_bug38499 # Bug#11755645 2009-09-19 alik main.lock_multi_bug38499 times out sporadically
|
||||
main.outfile_loaddata @solaris # Bug#11755168 2010-01-20 alik Test "outfile_loaddata" fails (reproducible)
|
||||
main.signal_demo3 @solaris # Bug#11755949 2010-01-20 alik Several test cases fail on Solaris with error Thread stack overrun
|
||||
main.sp @solaris # Bug#11755949 2010-01-20 alik Several test cases fail on Solaris with error Thread stack overrun
|
||||
main.wait_timeout @solaris # Bug#11758972 2010-04-26 alik wait_timeout fails on OpenSolaris
|
||||
|
||||
rpl.rpl_innodb_bug28430 # Bug#11754425
|
||||
rpl.rpl_bug37426 # WL#5867: skozlov: test case moved from unused bugs suite
|
||||
rpl.rpl_heartbeat_basic # BUG#12403008 2011-04-27 sven fails sporadically
|
||||
rpl.rpl_innodb_bug28430 # Bug#46029
|
||||
rpl.rpl_show_slave_hosts # BUG#12416700 2011-05-02 sven fails sporadically
|
||||
|
||||
sys_vars.max_sp_recursion_depth_func @solaris # Bug#47791 2010-01-20 alik Several test cases fail on Solaris with error Thread stack overrun
|
||||
sys_vars.plugin_dir_basic # Bug#52223 2010-11-24 alik Test "plugin_dir_basic" does not support RPM build (test) directory structure
|
||||
sys_vars.wait_timeout_func # Bug#41255 2010-04-26 alik wait_timeout_func fails
|
||||
sys_vars.max_sp_recursion_depth_func @solaris # Bug#11755949 2010-01-20 alik Several test cases fail on Solaris with error Thread stack overrun
|
||||
sys_vars.wait_timeout_func # Bug#11750645 2010-04-26 alik wait_timeout_func fails
|
||||
|
||||
# BUG #59055 : All ndb tests should be removed from the repository
|
||||
# Leaving the sys_vars tests for now. sys_vars.all_vars.test fails on removing ndb tests
|
||||
sys_vars.ndb_log_update_as_write_basic
|
||||
sys_vars.have_ndbcluster_basic
|
||||
sys_vars.ndb_log_updated_only_basic
|
||||
|
||||
main.gis-rtree # svoj: due to BUG#38965
|
||||
main.type_float # svoj: due to BUG#38965
|
||||
main.type_newdecimal # svoj: due to BUG#38965
|
||||
sys_vars.rpl_init_slave_func # Bug#12535301 2011-05-09 andrei sys_vars.rpl_init_slave_func mismatches in daily-5.5
|
||||
|
@ -11,18 +11,28 @@
|
||||
# on the slave)
|
||||
# $can_convert True if conversion shall work, false if it
|
||||
# shall generate an error
|
||||
# $engine_type The storage engine to be used for storing table
|
||||
# on both master and slave
|
||||
|
||||
if (!$engine_type)
|
||||
{
|
||||
# Use the default storage engine
|
||||
let $engine_type=`SELECT @@storage_engine`;
|
||||
}
|
||||
|
||||
connection master;
|
||||
disable_warnings;
|
||||
DROP TABLE IF EXISTS t1;
|
||||
enable_warnings;
|
||||
eval CREATE TABLE t1 (a $source_type);
|
||||
eval CREATE TABLE t1(
|
||||
pk INT NOT NULL PRIMARY KEY,
|
||||
a $source_type
|
||||
) ENGINE=$engine_type;
|
||||
sync_slave_with_master;
|
||||
eval ALTER TABLE t1 MODIFY a $target_type;
|
||||
|
||||
connection master;
|
||||
eval INSERT INTO t1 VALUES($source_value);
|
||||
eval INSERT INTO t1 VALUES(1, $source_value);
|
||||
if ($can_convert) {
|
||||
sync_slave_with_master;
|
||||
eval SELECT a = $target_value into @compare FROM t1;
|
||||
|
@ -1,5 +1,10 @@
|
||||
disable_query_log;
|
||||
if (`select plugin_library IS NULL from information_schema.plugins where plugin_name LIKE '%archive%'`)
|
||||
{
|
||||
--skip archive plugin not available
|
||||
}
|
||||
|
||||
if (`SELECT @@plugin_dir != '$ARCHIVE_PLUGIN_DIR'`) {
|
||||
--skip Archive plugin requires that --plugin-dir is set to the archive plugin dir (either the .opt file does not contain \$ARCHIVE_PLUGIN_OPT or another plugin is in use)
|
||||
}
|
||||
enable_query_log;
|
@ -1,5 +1,11 @@
|
||||
disable_query_log;
|
||||
if (`select plugin_library IS NULL from information_schema.plugins where plugin_name LIKE '%blackhole%'`)
|
||||
{
|
||||
--skip blackhole plugin not available;
|
||||
}
|
||||
|
||||
if (`SELECT @@plugin_dir != '$BLACKHOLE_PLUGIN_DIR'`) {
|
||||
--skip Blackhole plugin requires that --plugin-dir is set to the blackhole plugin dir (either the .opt file does not contain \$BLACKHOLE_PLUGIN_OPT or another plugin is in use)
|
||||
}
|
||||
enable_query_log;
|
||||
|
||||
|
5
mysql-test/include/not_threadpool.inc
Normal file
5
mysql-test/include/not_threadpool.inc
Normal file
@ -0,0 +1,5 @@
|
||||
if (`SELECT count(*) FROM information_schema.GLOBAL_VARIABLES WHERE
|
||||
VARIABLE_NAME = 'THREAD_HANDLING' AND
|
||||
VARIABLE_VALUE = 'loaded-dynamically'`){
|
||||
skip Test requires: 'not_threadpool';
|
||||
}
|
@ -31,6 +31,21 @@
|
||||
# Created: 2009-02-18 mleich
|
||||
#
|
||||
|
||||
if (!$condition)
|
||||
{
|
||||
--die ERROR IN TEST: the "condition" variable must be set
|
||||
}
|
||||
|
||||
if (!$field)
|
||||
{
|
||||
--die ERROR IN TEST: the "field" variable must be set
|
||||
}
|
||||
|
||||
if (!$show_statement)
|
||||
{
|
||||
--die ERROR IN TEST: the "show_statement" variable must be set
|
||||
}
|
||||
|
||||
let $max_run_time= 30;
|
||||
if ($wait_timeout)
|
||||
{
|
||||
|
@ -1,5 +1,5 @@
|
||||
# -*- cperl -*-
|
||||
# Copyright (C) 2008 MySQL AB, 2009 Sun Microsystems, Inc.
|
||||
# Copyright (c) 2008, 2011, 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
|
||||
@ -21,6 +21,7 @@ use Carp;
|
||||
use My::Platform;
|
||||
|
||||
use File::Temp qw/ tempfile tempdir /;
|
||||
use mtr_results;
|
||||
|
||||
my $hint_mysqld; # Last resort guess for executable path
|
||||
|
||||
@ -80,7 +81,7 @@ sub _gdb {
|
||||
return if $? >> 8;
|
||||
return unless $gdb_output;
|
||||
|
||||
print <<EOF, $gdb_output, "\n";
|
||||
resfile_print <<EOF, $gdb_output, "\n";
|
||||
Output from gdb follows. The first stack trace is from the failing thread.
|
||||
The following stack traces are from all threads (so the failing one is
|
||||
duplicated).
|
||||
@ -124,7 +125,7 @@ sub _dbx {
|
||||
return if $? >> 8;
|
||||
return unless $dbx_output;
|
||||
|
||||
print <<EOF, $dbx_output, "\n";
|
||||
resfile_print <<EOF . $dbx_output . "\n";
|
||||
Output from dbx follows. Stack trace is printed for all threads in order,
|
||||
above this you should see info about which thread was the failing one.
|
||||
----------------------------
|
||||
@ -244,7 +245,7 @@ sub _cdb {
|
||||
$cdb_output=~ s/^Child\-SP RetAddr Call Site//gm;
|
||||
$cdb_output=~ s/\+0x([0-9a-fA-F]+)//gm;
|
||||
|
||||
print <<EOF, $cdb_output, "\n";
|
||||
resfile_print <<EOF, $cdb_output, "\n";
|
||||
Output from cdb follows. Faulting thread is printed twice,with and without function parameters
|
||||
Search for STACK_TEXT to see the stack trace of
|
||||
the faulting thread. Callstacks of other threads are printed after it.
|
||||
|
@ -1,6 +1,6 @@
|
||||
# -*- cperl -*-
|
||||
# Copyright (C) 2008 MySQL AB
|
||||
#
|
||||
# Copyright (c) 2008, 2011, 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
|
||||
# the Free Software Foundation; version 2 of the License.
|
||||
@ -23,6 +23,7 @@ package My::Test;
|
||||
use strict;
|
||||
use warnings;
|
||||
use Carp;
|
||||
use mtr_results;
|
||||
|
||||
|
||||
sub new {
|
||||
@ -66,9 +67,26 @@ sub is_failed {
|
||||
}
|
||||
|
||||
|
||||
my %result_names= (
|
||||
'MTR_RES_PASSED' => 'pass',
|
||||
'MTR_RES_FAILED' => 'fail',
|
||||
'MTR_RES_SKIPPED' => 'skipped',
|
||||
);
|
||||
|
||||
sub write_test {
|
||||
my ($test, $sock, $header)= @_;
|
||||
|
||||
if ($::opt_resfile && defined $test->{'result'}) {
|
||||
resfile_test_info("result", $result_names{$test->{'result'}});
|
||||
if ($test->{'timeout'}) {
|
||||
resfile_test_info("comment", "Timeout");
|
||||
} elsif (defined $test->{'comment'}) {
|
||||
resfile_test_info("comment", $test->{'comment'});
|
||||
}
|
||||
resfile_test_info("result", "warning") if defined $test->{'check'};
|
||||
resfile_to_test($test);
|
||||
}
|
||||
|
||||
# Give the test a unique key before serializing it
|
||||
$test->{key}= "$test" unless defined $test->{key};
|
||||
|
||||
@ -113,6 +131,7 @@ sub read_test {
|
||||
$test->{$key}= _decode($value);
|
||||
}
|
||||
}
|
||||
resfile_from_test($test) if $::opt_resfile;
|
||||
return $test;
|
||||
}
|
||||
|
||||
|
@ -287,9 +287,11 @@ sub collect_one_suite($)
|
||||
"mysql-test/suite",
|
||||
"mysql-test",
|
||||
# Look in storage engine specific suite dirs
|
||||
"storage/*/mysql-test-suites"
|
||||
"storage/*/mtr",
|
||||
# Look in plugin specific suite dir
|
||||
"plugin/$suite/tests",
|
||||
],
|
||||
[$suite]);
|
||||
[$suite, "mtr"]);
|
||||
}
|
||||
mtr_verbose("suitedir: $suitedir");
|
||||
}
|
||||
|
@ -31,6 +31,7 @@ sub mtr_script_exists(@);
|
||||
sub mtr_file_exists(@);
|
||||
sub mtr_exe_exists(@);
|
||||
sub mtr_exe_maybe_exists(@);
|
||||
sub mtr_compress_file($);
|
||||
sub mtr_milli_sleep($);
|
||||
sub start_timer($);
|
||||
sub has_expired($);
|
||||
@ -199,6 +200,40 @@ sub mtr_exe_exists (@) {
|
||||
}
|
||||
}
|
||||
|
||||
#
|
||||
# Try to compress file using tools that might be available.
|
||||
# If zip/gzip is not available, just silently ignore.
|
||||
#
|
||||
|
||||
sub mtr_compress_file ($) {
|
||||
my ($filename)= @_;
|
||||
|
||||
mtr_error ("File to compress not found: $filename") unless -f $filename;
|
||||
|
||||
my $did_compress= 0;
|
||||
|
||||
if (IS_WINDOWS)
|
||||
{
|
||||
# Capture stderr
|
||||
my $ziperr= `zip $filename.zip $filename 2>&1`;
|
||||
if ($?) {
|
||||
print "$ziperr\n" if $ziperr !~ /recognized as an internal or external/;
|
||||
} else {
|
||||
unlink($filename);
|
||||
$did_compress=1;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
my $gzres= system("gzip $filename");
|
||||
$did_compress= ! $gzres;
|
||||
if ($gzres && $gzres != -1) {
|
||||
mtr_error ("Error: have gzip but it fails to compress core file");
|
||||
}
|
||||
}
|
||||
mtr_print("Compressed file $filename") if $did_compress;
|
||||
}
|
||||
|
||||
|
||||
sub mtr_milli_sleep ($) {
|
||||
die "usage: mtr_milli_sleep(milliseconds)" unless @_ == 1;
|
||||
|
@ -34,6 +34,7 @@ use My::Platform;
|
||||
use POSIX qw[ _exit ];
|
||||
use IO::Handle qw[ flush ];
|
||||
require "mtr_io.pl";
|
||||
use mtr_results;
|
||||
|
||||
my $tot_real_time= 0;
|
||||
|
||||
@ -96,6 +97,7 @@ sub mtr_report_test_passed ($) {
|
||||
{
|
||||
$timer_str= mtr_fromfile("$::opt_vardir/log/timer");
|
||||
$tinfo->{timer}= $timer_str;
|
||||
resfile_test_info('duration', $timer_str) if $::opt_resfile;
|
||||
}
|
||||
|
||||
# Big warning if status already set
|
||||
@ -301,6 +303,7 @@ sub mtr_report_stats ($$;$) {
|
||||
time - $BASETIME, "seconds executing testcases");
|
||||
}
|
||||
|
||||
resfile_global("duration", time - $BASETIME) if $::opt_resfile;
|
||||
|
||||
my $warnlog= "$::opt_vardir/log/warnings";
|
||||
if ( -f $warnlog )
|
||||
|
167
mysql-test/lib/mtr_results.pm
Normal file
167
mysql-test/lib/mtr_results.pm
Normal file
@ -0,0 +1,167 @@
|
||||
# -*- cperl -*-
|
||||
# Copyright (c) 2011, 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
|
||||
# the Free Software Foundation; version 2 of the License.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
package mtr_results;
|
||||
use strict;
|
||||
use IO::Handle qw[ flush ];
|
||||
|
||||
use base qw(Exporter);
|
||||
our @EXPORT= qw(resfile_init resfile_global resfile_new_test resfile_test_info
|
||||
resfile_output resfile_output_file resfile_print
|
||||
resfile_print_test resfile_to_test resfile_from_test );
|
||||
|
||||
my %curr_result; # Result for current test
|
||||
my $curr_output; # Output for current test
|
||||
my $do_resfile;
|
||||
|
||||
END {
|
||||
close RESF if $do_resfile;
|
||||
}
|
||||
|
||||
sub resfile_init($)
|
||||
{
|
||||
my $fname= shift;
|
||||
open (RESF, " > $fname") or die ("Could not open result file $fname");
|
||||
%curr_result= ();
|
||||
$curr_output= "";
|
||||
$do_resfile= 1;
|
||||
}
|
||||
|
||||
# Strings need to be quoted if they start with white space or ",
|
||||
# or if they contain newlines. Pass a reference to the string.
|
||||
# If the string is quoted, " must be escaped, thus \ also must be escaped
|
||||
|
||||
sub quote_value($)
|
||||
{
|
||||
my $stref= shift;
|
||||
|
||||
for ($$stref) {
|
||||
return unless /^[\s"]/ or /\n/;
|
||||
s/\\/\\\\/g;
|
||||
s/"/\\"/g;
|
||||
$_= '"' . $_ . '"';
|
||||
}
|
||||
}
|
||||
|
||||
# Output global variable setting to result file.
|
||||
|
||||
sub resfile_global($$)
|
||||
{
|
||||
return unless $do_resfile;
|
||||
my ($tag, $val) = @_;
|
||||
$val= join (' ', @$val) if ref($val) eq 'ARRAY';
|
||||
quote_value(\$val);
|
||||
print RESF "$tag : $val\n";
|
||||
}
|
||||
|
||||
# Prepare to add results for new test
|
||||
|
||||
sub resfile_new_test()
|
||||
{
|
||||
%curr_result= ();
|
||||
$curr_output= "";
|
||||
}
|
||||
|
||||
# Add (or change) one variable setting for current test
|
||||
|
||||
sub resfile_test_info($$)
|
||||
{
|
||||
my ($tag, $val) = @_;
|
||||
return unless $do_resfile;
|
||||
quote_value(\$val);
|
||||
$curr_result{$tag} = $val;
|
||||
}
|
||||
|
||||
# Add to output value for current test.
|
||||
# Will be quoted if necessary, truncated if length over 5000.
|
||||
|
||||
sub resfile_output($)
|
||||
{
|
||||
return unless $do_resfile;
|
||||
|
||||
for (shift) {
|
||||
my $len= length;
|
||||
if ($len > 5000) {
|
||||
my $trlen= $len - 5000;
|
||||
$_= substr($_, 0, 5000) . "\n[TRUNCATED $trlen chars removed]\n";
|
||||
}
|
||||
s/\\/\\\\/g;
|
||||
s/"/\\"/g;
|
||||
$curr_output .= $_;
|
||||
}
|
||||
}
|
||||
|
||||
# Add to output, read from named file
|
||||
|
||||
sub resfile_output_file($)
|
||||
{
|
||||
resfile_output(::mtr_grab_file(shift)) if $do_resfile;
|
||||
}
|
||||
|
||||
# Print text, and also append to current output if we're collecting results
|
||||
|
||||
sub resfile_print($)
|
||||
{
|
||||
my $txt= shift;
|
||||
print($txt);
|
||||
resfile_output($txt) if $do_resfile;
|
||||
}
|
||||
|
||||
# Print results for current test, then reset
|
||||
# (So calling a second time without having generated new results
|
||||
# will have no effect)
|
||||
|
||||
sub resfile_print_test()
|
||||
{
|
||||
return unless %curr_result;
|
||||
|
||||
print RESF "{\n";
|
||||
while (my ($t, $v) = each %curr_result) {
|
||||
print RESF "$t : $v\n";
|
||||
}
|
||||
if ($curr_output) {
|
||||
chomp($curr_output);
|
||||
print RESF " output : " . $curr_output . "\"\n";
|
||||
}
|
||||
print RESF "}\n";
|
||||
IO::Handle::flush(\*RESF);
|
||||
resfile_new_test();
|
||||
}
|
||||
|
||||
# Add current test results to test object (to send from worker)
|
||||
|
||||
sub resfile_to_test($)
|
||||
{
|
||||
return unless $do_resfile;
|
||||
my $tinfo= shift;
|
||||
my @res_array= %curr_result;
|
||||
$tinfo->{'resfile'}= \@res_array;
|
||||
$tinfo->{'output'}= $curr_output if $curr_output;
|
||||
}
|
||||
|
||||
# Get test results (from worker) from test object
|
||||
|
||||
sub resfile_from_test($)
|
||||
{
|
||||
return unless $do_resfile;
|
||||
my $tinfo= shift;
|
||||
my $res_array= $tinfo->{'resfile'};
|
||||
return unless $res_array;
|
||||
%curr_result= @$res_array;
|
||||
$curr_output= $tinfo->{'output'} if defined $tinfo->{'output'};
|
||||
}
|
||||
|
||||
1;
|
@ -96,6 +96,7 @@ use mtr_cases;
|
||||
use mtr_report;
|
||||
use mtr_match;
|
||||
use mtr_unique;
|
||||
use mtr_results;
|
||||
use IO::Socket::INET;
|
||||
use IO::Select;
|
||||
|
||||
@ -245,6 +246,8 @@ my $build_thread= 0;
|
||||
my $opt_record;
|
||||
my $opt_report_features;
|
||||
|
||||
our $opt_resfile= $ENV{'MTR_RESULT_FILE'} || 0;
|
||||
|
||||
my $opt_skip_core;
|
||||
|
||||
our $opt_check_testcases= 1;
|
||||
@ -260,7 +263,6 @@ my $opt_shutdown_timeout= $ENV{MTR_SHUTDOWN_TIMEOUT} || 10; # seconds
|
||||
my $opt_start_timeout = $ENV{MTR_START_TIMEOUT} || 180; # seconds
|
||||
|
||||
sub suite_timeout { return $opt_suite_timeout * 60; };
|
||||
sub check_timeout { return $opt_testcase_timeout * 6; };
|
||||
|
||||
my $opt_wait_all;
|
||||
my $opt_user_args;
|
||||
@ -296,6 +298,8 @@ sub testcase_timeout ($) {
|
||||
return $opt_testcase_timeout * 60;
|
||||
}
|
||||
|
||||
sub check_timeout ($) { return testcase_timeout($_[0]) / 10; }
|
||||
|
||||
our $opt_warnings= 1;
|
||||
|
||||
our $opt_include_ndbcluster= 0;
|
||||
@ -322,6 +326,14 @@ my $opt_parallel= $ENV{MTR_PARALLEL} || 1;
|
||||
select(STDOUT);
|
||||
$| = 1; # Automatically flush STDOUT
|
||||
|
||||
# Used by --result-file for for formatting times
|
||||
|
||||
sub isotime($) {
|
||||
my ($sec,$min,$hr,$day,$mon,$yr)= gmtime($_[0]);
|
||||
return sprintf "%d-%02d-%02dT%02d:%02d:%02dZ",
|
||||
$yr+1900, $mon+1, $day, $hr, $min, $sec;
|
||||
}
|
||||
|
||||
main();
|
||||
|
||||
|
||||
@ -426,11 +438,21 @@ sub main {
|
||||
my $server_port = $server->sockport();
|
||||
mtr_report("Using server port $server_port");
|
||||
|
||||
if ($opt_resfile) {
|
||||
resfile_init("$opt_vardir/mtr-results.txt");
|
||||
print_global_resfile();
|
||||
}
|
||||
|
||||
# --------------------------------------------------------------------------
|
||||
# Read definitions from include/plugin.defs
|
||||
#
|
||||
read_plugin_defs("include/plugin.defs");
|
||||
|
||||
# Also read from any plugin local plugin.defs
|
||||
for (glob "$basedir/plugin/*/tests/mtr/plugin.defs") {
|
||||
read_plugin_defs($_);
|
||||
}
|
||||
|
||||
# Simplify reference to semisync plugins
|
||||
$ENV{'SEMISYNC_PLUGIN_OPT'}= $ENV{'SEMISYNC_MASTER_PLUGIN_OPT'};
|
||||
|
||||
@ -641,6 +663,8 @@ sub run_test_server ($$$) {
|
||||
mtr_report(" - deleting it, already saved",
|
||||
"$opt_max_save_core");
|
||||
unlink("$core_file");
|
||||
} else {
|
||||
mtr_compress_file($core_file) unless @opt_cases;
|
||||
}
|
||||
++$num_saved_cores;
|
||||
}
|
||||
@ -649,6 +673,7 @@ sub run_test_server ($$$) {
|
||||
$savedir);
|
||||
}
|
||||
}
|
||||
resfile_print_test();
|
||||
$num_saved_datadir++;
|
||||
$num_failed_test++ unless ($result->{retries} ||
|
||||
$result->{exp_fail});
|
||||
@ -671,6 +696,7 @@ sub run_test_server ($$$) {
|
||||
}
|
||||
}
|
||||
|
||||
resfile_print_test();
|
||||
# Retry test run after test failure
|
||||
my $retries= $result->{retries} || 2;
|
||||
my $test_has_failed= $result->{failures} || 0;
|
||||
@ -958,6 +984,49 @@ sub set_vardir {
|
||||
}
|
||||
|
||||
|
||||
sub print_global_resfile {
|
||||
resfile_global("start_time", isotime $^T);
|
||||
resfile_global("user_id", $<);
|
||||
resfile_global("embedded-server", $opt_embedded_server ? 1 : 0);
|
||||
resfile_global("ps-protocol", $opt_ps_protocol ? 1 : 0);
|
||||
resfile_global("sp-protocol", $opt_sp_protocol ? 1 : 0);
|
||||
resfile_global("view-protocol", $opt_view_protocol ? 1 : 0);
|
||||
resfile_global("cursor-protocol", $opt_cursor_protocol ? 1 : 0);
|
||||
resfile_global("ssl", $opt_ssl ? 1 : 0);
|
||||
resfile_global("compress", $opt_compress ? 1 : 0);
|
||||
resfile_global("parallel", $opt_parallel);
|
||||
resfile_global("check-testcases", $opt_check_testcases ? 1 : 0);
|
||||
resfile_global("mysqld", \@opt_extra_mysqld_opt);
|
||||
resfile_global("debug", $opt_debug ? 1 : 0);
|
||||
resfile_global("gcov", $opt_gcov ? 1 : 0);
|
||||
resfile_global("gprof", $opt_gprof ? 1 : 0);
|
||||
resfile_global("valgrind", $opt_valgrind ? 1 : 0);
|
||||
resfile_global("callgrind", $opt_callgrind ? 1 : 0);
|
||||
resfile_global("mem", $opt_mem ? 1 : 0);
|
||||
resfile_global("tmpdir", $opt_tmpdir);
|
||||
resfile_global("vardir", $opt_vardir);
|
||||
resfile_global("fast", $opt_fast ? 1 : 0);
|
||||
resfile_global("force-restart", $opt_force_restart ? 1 : 0);
|
||||
resfile_global("reorder", $opt_reorder ? 1 : 0);
|
||||
resfile_global("sleep", $opt_sleep);
|
||||
resfile_global("repeat", $opt_repeat);
|
||||
resfile_global("user", $opt_user);
|
||||
resfile_global("testcase-timeout", $opt_testcase_timeout);
|
||||
resfile_global("suite-timeout", $opt_suite_timeout);
|
||||
resfile_global("shutdown-timeout", $opt_shutdown_timeout ? 1 : 0);
|
||||
resfile_global("warnings", $opt_warnings ? 1 : 0);
|
||||
resfile_global("max-connections", $opt_max_connections);
|
||||
# resfile_global("default-myisam", $opt_default_myisam ? 1 : 0);
|
||||
resfile_global("product", "MySQL");
|
||||
# Somewhat hacky code to convert numeric version back to dot notation
|
||||
my $v1= int($mysql_version_id / 10000);
|
||||
my $v2= int(($mysql_version_id % 10000)/100);
|
||||
my $v3= $mysql_version_id % 100;
|
||||
resfile_global("version", "$v1.$v2.$v3");
|
||||
}
|
||||
|
||||
|
||||
|
||||
sub command_line_setup {
|
||||
my $opt_comment;
|
||||
my $opt_usage;
|
||||
@ -1100,6 +1169,7 @@ sub command_line_setup {
|
||||
'max-connections=i' => \$opt_max_connections,
|
||||
'default-myisam!' => \&collect_option,
|
||||
'report-times' => \$opt_report_times,
|
||||
'result-file' => \$opt_resfile,
|
||||
'unit-tests!' => \$opt_ctest,
|
||||
|
||||
'help|h' => \$opt_usage,
|
||||
@ -3351,7 +3421,7 @@ sub check_testcase($$)
|
||||
# Return immediately if no check proceess was started
|
||||
return 0 unless ( keys %started );
|
||||
|
||||
my $timeout= start_timer(check_timeout());
|
||||
my $timeout= start_timer(check_timeout($tinfo));
|
||||
|
||||
while (1){
|
||||
my $result;
|
||||
@ -3423,7 +3493,7 @@ test case was executed:\n";
|
||||
}
|
||||
elsif ( $proc->{timeout} ) {
|
||||
$tinfo->{comment}.= "Timeout for 'check-testcase' expired after "
|
||||
.check_timeout()." seconds";
|
||||
.check_timeout($tinfo)." seconds";
|
||||
$result= 4;
|
||||
}
|
||||
else {
|
||||
@ -3513,7 +3583,7 @@ sub run_on_all($$)
|
||||
# Return immediately if no check proceess was started
|
||||
return 0 unless ( keys %started );
|
||||
|
||||
my $timeout= start_timer(check_timeout());
|
||||
my $timeout= start_timer(check_timeout($tinfo));
|
||||
|
||||
while (1){
|
||||
my $result;
|
||||
@ -3544,7 +3614,7 @@ sub run_on_all($$)
|
||||
}
|
||||
elsif ($proc->{timeout}) {
|
||||
$tinfo->{comment}.= "Timeout for '$run' expired after "
|
||||
.check_timeout()." seconds";
|
||||
.check_timeout($tinfo)." seconds";
|
||||
}
|
||||
else {
|
||||
# Unknown process returned, most likley a crash, abort everything
|
||||
@ -3650,6 +3720,18 @@ sub timezone {
|
||||
# Storage for changed environment variables
|
||||
my %old_env;
|
||||
|
||||
sub resfile_report_test ($) {
|
||||
my $tinfo= shift;
|
||||
|
||||
resfile_new_test();
|
||||
|
||||
resfile_test_info("name", $tinfo->{name});
|
||||
resfile_test_info("variation", $tinfo->{combination})
|
||||
if $tinfo->{combination};
|
||||
resfile_test_info("start_time", isotime time);
|
||||
}
|
||||
|
||||
|
||||
#
|
||||
# Run a single test case
|
||||
#
|
||||
@ -3662,6 +3744,7 @@ sub run_testcase ($) {
|
||||
my $tinfo= shift;
|
||||
|
||||
mtr_verbose("Running test:", $tinfo->{name});
|
||||
resfile_report_test($tinfo) if $opt_resfile;
|
||||
|
||||
# Allow only alpanumerics pluss _ - + . in combination names,
|
||||
# or anything beginning with -- (the latter comes from --combination)
|
||||
@ -3867,6 +3950,7 @@ sub run_testcase ($) {
|
||||
# Test case suceeded, but it has produced unexpected
|
||||
# warnings, continue in $res == 1
|
||||
$res= 1;
|
||||
resfile_output($tinfo->{'warnings'}) if $opt_resfile;
|
||||
}
|
||||
|
||||
if ( $res == 0 )
|
||||
@ -3883,6 +3967,7 @@ sub run_testcase ($) {
|
||||
# Test case had sideeffects, not fatal error, just continue
|
||||
stop_all_servers($opt_shutdown_timeout);
|
||||
mtr_report("Resuming tests...\n");
|
||||
resfile_output($tinfo->{'check'}) if $opt_resfile;
|
||||
}
|
||||
else {
|
||||
# Test case check failed fatally, probably a server crashed
|
||||
@ -3944,6 +4029,9 @@ sub run_testcase ($) {
|
||||
# Save info from this testcase run to mysqltest.log
|
||||
if( -f $path_current_testlog)
|
||||
{
|
||||
if ($opt_resfile && $res && $res != 62) {
|
||||
resfile_output_file($path_current_testlog);
|
||||
}
|
||||
mtr_appendfile_to_file($path_current_testlog, $path_testlog);
|
||||
unlink($path_current_testlog);
|
||||
}
|
||||
@ -4251,7 +4339,7 @@ sub check_warnings ($) {
|
||||
# Return immediately if no check proceess was started
|
||||
return 0 unless ( keys %started );
|
||||
|
||||
my $timeout= start_timer(check_timeout());
|
||||
my $timeout= start_timer(check_timeout($tinfo));
|
||||
|
||||
while (1){
|
||||
my $result= 0;
|
||||
@ -4303,7 +4391,7 @@ sub check_warnings ($) {
|
||||
}
|
||||
elsif ( $proc->{timeout} ) {
|
||||
$tinfo->{comment}.= "Timeout for 'check warnings' expired after "
|
||||
.check_timeout()." seconds";
|
||||
.check_timeout($tinfo)." seconds";
|
||||
$result= 4;
|
||||
}
|
||||
else {
|
||||
|
12
mysql-test/r/archive_debug.result
Normal file
12
mysql-test/r/archive_debug.result
Normal file
@ -0,0 +1,12 @@
|
||||
#
|
||||
# BUG#12402794 - 60976: CRASH, VALGRIND WARNING AND MEMORY LEAK
|
||||
# WITH PARTITIONED ARCHIVE TABLES
|
||||
#
|
||||
CREATE TABLE t1(a INT) ENGINE=ARCHIVE;
|
||||
INSERT INTO t1 VALUES(1);
|
||||
SET SESSION debug='d,simulate_archive_open_failure';
|
||||
CHECK TABLE t1;
|
||||
Table Op Msg_type Msg_text
|
||||
test.t1 check error Corrupt
|
||||
SET SESSION debug=DEFAULT;
|
||||
DROP TABLE t1;
|
@ -2046,7 +2046,7 @@ create table t2 as select concat(a) from t1;
|
||||
show create table t2;
|
||||
Table Create Table
|
||||
t2 CREATE TABLE `t2` (
|
||||
`concat(a)` varbinary(2) DEFAULT NULL
|
||||
`concat(a)` varbinary(4) DEFAULT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
||||
drop table t1, t2;
|
||||
create table t1 (a year);
|
||||
@ -2355,7 +2355,7 @@ insert into t1 values (1);
|
||||
create view v1(a) as select concat(a) from t1;
|
||||
show columns from v1;
|
||||
Field Type Null Key Default Extra
|
||||
a varbinary(2) YES NULL
|
||||
a varbinary(4) YES NULL
|
||||
select hex(a) from v1;
|
||||
hex(a)
|
||||
3031
|
||||
|
@ -2438,7 +2438,7 @@ create table t2 as select concat(a) from t1;
|
||||
show create table t2;
|
||||
Table Create Table
|
||||
t2 CREATE TABLE `t2` (
|
||||
`concat(a)` varchar(2) CHARACTER SET cp1251 DEFAULT NULL
|
||||
`concat(a)` varchar(4) CHARACTER SET cp1251 DEFAULT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
||||
drop table t1, t2;
|
||||
create table t1 (a year);
|
||||
@ -2747,7 +2747,7 @@ insert into t1 values (1);
|
||||
create view v1(a) as select concat(a) from t1;
|
||||
show columns from v1;
|
||||
Field Type Null Key Default Extra
|
||||
a varchar(2) YES NULL
|
||||
a varchar(4) YES NULL
|
||||
select hex(a) from v1;
|
||||
hex(a)
|
||||
3031
|
||||
|
@ -2465,7 +2465,7 @@ create table t2 as select concat(a) from t1;
|
||||
show create table t2;
|
||||
Table Create Table
|
||||
t2 CREATE TABLE `t2` (
|
||||
`concat(a)` varchar(2) DEFAULT NULL
|
||||
`concat(a)` varchar(4) DEFAULT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
||||
drop table t1, t2;
|
||||
create table t1 (a year);
|
||||
@ -2774,7 +2774,7 @@ insert into t1 values (1);
|
||||
create view v1(a) as select concat(a) from t1;
|
||||
show columns from v1;
|
||||
Field Type Null Key Default Extra
|
||||
a varchar(2) YES NULL
|
||||
a varchar(4) YES NULL
|
||||
select hex(a) from v1;
|
||||
hex(a)
|
||||
3031
|
||||
|
@ -3299,7 +3299,7 @@ create table t2 as select concat(a) from t1;
|
||||
show create table t2;
|
||||
Table Create Table
|
||||
t2 CREATE TABLE `t2` (
|
||||
`concat(a)` varchar(2) CHARACTER SET ucs2 DEFAULT NULL
|
||||
`concat(a)` varchar(4) CHARACTER SET ucs2 DEFAULT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
||||
drop table t1, t2;
|
||||
create table t1 (a year);
|
||||
@ -3608,7 +3608,7 @@ insert into t1 values (1);
|
||||
create view v1(a) as select concat(a) from t1;
|
||||
show columns from v1;
|
||||
Field Type Null Key Default Extra
|
||||
a varchar(2) YES NULL
|
||||
a varchar(4) YES NULL
|
||||
select hex(a) from v1;
|
||||
hex(a)
|
||||
00300031
|
||||
|
@ -4177,7 +4177,7 @@ create table t2 as select concat(a) from t1;
|
||||
show create table t2;
|
||||
Table Create Table
|
||||
t2 CREATE TABLE `t2` (
|
||||
`concat(a)` varchar(2) CHARACTER SET utf8 DEFAULT NULL
|
||||
`concat(a)` varchar(4) CHARACTER SET utf8 DEFAULT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
||||
drop table t1, t2;
|
||||
create table t1 (a year);
|
||||
@ -4486,7 +4486,7 @@ insert into t1 values (1);
|
||||
create view v1(a) as select concat(a) from t1;
|
||||
show columns from v1;
|
||||
Field Type Null Key Default Extra
|
||||
a varchar(2) YES NULL
|
||||
a varchar(4) YES NULL
|
||||
select hex(a) from v1;
|
||||
hex(a)
|
||||
3031
|
||||
|
@ -794,3 +794,14 @@ DROP TABLE t1;
|
||||
SET @@sort_buffer_size = @old_sort_buffer_size;
|
||||
SET @@max_heap_table_size = @old_max_heap_table_size;
|
||||
End of 5.1 tests
|
||||
#
|
||||
# Bug #11744875: 4082: integer lengths cause truncation with distinct concat and innodb
|
||||
#
|
||||
CREATE TABLE t1 (a INT(1), b INT(1));
|
||||
INSERT INTO t1 VALUES (1111, 2222), (3333, 4444);
|
||||
SELECT DISTINCT CONCAT(a,b) AS c FROM t1 ORDER BY 1;
|
||||
c
|
||||
11112222
|
||||
33334444
|
||||
DROP TABLE t1;
|
||||
End of 5.5 tests
|
||||
|
@ -535,6 +535,7 @@ DROP EVENT e3;
|
||||
DROP EVENT e2;
|
||||
DROP EVENT e1;
|
||||
SET TIME_ZONE=@save_time_zone;
|
||||
SET TIMESTAMP=DEFAULT;
|
||||
drop event if exists new_event;
|
||||
CREATE EVENT new_event ON SCHEDULE EVERY 0 SECOND DO SELECT 1;
|
||||
ERROR HY000: INTERVAL is either not positive or too big
|
||||
@ -756,6 +757,45 @@ SHOW EVENTS;
|
||||
Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator character_set_client collation_connection Database Collation
|
||||
DROP DATABASE event_test1;
|
||||
DROP DATABASE event_test12;
|
||||
#
|
||||
# Bug#12546938 (formerly known as bug#61005):
|
||||
# CREATE IF NOT EXIST EVENT WILL CREATE MULTIPLE RUNNING EVENTS
|
||||
#
|
||||
USE events_test;
|
||||
SET GLOBAL event_scheduler = ON;
|
||||
DROP TABLE IF EXISTS table_bug12546938;
|
||||
DROP EVENT IF EXISTS event_Bug12546938;
|
||||
CREATE TABLE table_bug12546938 (i INT);
|
||||
# Create an event which will be executed with a small delay
|
||||
# and won't be automatically dropped after that.
|
||||
CREATE EVENT event_Bug12546938
|
||||
ON SCHEDULE AT CURRENT_TIMESTAMP + INTERVAL 1 SECOND ON COMPLETION PRESERVE
|
||||
ENABLE DO
|
||||
BEGIN
|
||||
INSERT INTO table_bug12546938 VALUES(1);
|
||||
END
|
||||
|
|
||||
# Now try to create the same event using CREATE EVENT IF NOT EXISTS.
|
||||
# A warning should be emitted. A new event should not be created nor
|
||||
# the old event should be re-executed.
|
||||
CREATE EVENT IF NOT EXISTS event_bug12546938
|
||||
ON SCHEDULE AT CURRENT_TIMESTAMP + INTERVAL 1 SECOND ON COMPLETION PRESERVE
|
||||
ENABLE DO
|
||||
BEGIN
|
||||
INSERT INTO table_bug12546938 VALUES (1);
|
||||
END
|
||||
|
|
||||
Warnings:
|
||||
Note 1537 Event 'event_bug12546938' already exists
|
||||
# Wait until at least one instance of event is executed.
|
||||
# Check that only one instance of our event was executed.
|
||||
SELECT COUNT(*) FROM table_bug12546938;
|
||||
COUNT(*)
|
||||
1
|
||||
# Clean-up.
|
||||
DROP EVENT IF EXISTS event_Bug12546938;
|
||||
DROP TABLE table_bug12546938;
|
||||
SET GLOBAL EVENT_SCHEDULER = OFF;
|
||||
DROP DATABASE events_test;
|
||||
SET GLOBAL event_scheduler= 'ON';
|
||||
SET @@global.concurrent_insert= @concurrent_insert;
|
||||
|
@ -543,6 +543,12 @@ ROUND(LEAST(15, -4939092, 0.2704), STDDEV('a'))
|
||||
-4939092.0000
|
||||
Warnings:
|
||||
Warning 1292 Truncated incorrect DOUBLE value: 'a'
|
||||
#
|
||||
# Bug#12392636 ASSERTION FAILED: SCALE >= 0 && PRECISION > 0 && SCALE <= PRECISION
|
||||
#
|
||||
SELECT SUM(DISTINCT (TRUNCATE((.1), NULL)));
|
||||
SUM(DISTINCT (TRUNCATE((.1), NULL)))
|
||||
NULL
|
||||
End of 5.1 tests
|
||||
#
|
||||
# Bug #8433: Overflow must be an error
|
||||
|
@ -1389,6 +1389,15 @@ NULL
|
||||
SELECT DATE_FORMAT('0000-00-11', '%w');
|
||||
DATE_FORMAT('0000-00-11', '%w')
|
||||
NULL
|
||||
#
|
||||
# Bug#12403504 AFTER FIX FOR #11889186 : ASSERTION FAILED: DELSUM+(INT) Y/4-TEMP > 0
|
||||
#
|
||||
SELECT MAKEDATE(11111111,1);
|
||||
MAKEDATE(11111111,1)
|
||||
NULL
|
||||
SELECT WEEK(DATE_ADD(FROM_DAYS(1),INTERVAL 1 MONTH), 1);
|
||||
WEEK(DATE_ADD(FROM_DAYS(1),INTERVAL 1 MONTH), 1)
|
||||
NULL
|
||||
End of 5.1 tests
|
||||
#
|
||||
# Bug#57039: constant subtime expression returns incorrect result.
|
||||
|
366
mysql-test/r/implicit_char_to_num_conversion.result
Normal file
366
mysql-test/r/implicit_char_to_num_conversion.result
Normal file
@ -0,0 +1,366 @@
|
||||
DROP TABLE IF EXISTS t5;
|
||||
CREATE TABLE t5(c1 BIT(2) PRIMARY KEY) ENGINE = <default_engine>;
|
||||
INSERT INTO t5 VALUES (0), (1), (2);
|
||||
SELECT HEX(c1) FROM t5 ORDER BY c1;
|
||||
HEX(c1)
|
||||
0
|
||||
1
|
||||
2
|
||||
SELECT HEX(c1) FROM t5 WHERE c1 = b'1' ORDER BY c1;
|
||||
HEX(c1)
|
||||
1
|
||||
SELECT HEX(c1) FROM t5 WHERE c1 <=> b'1' ORDER BY c1;
|
||||
HEX(c1)
|
||||
1
|
||||
SELECT HEX(c1) FROM t5 WHERE c1 != b'1' ORDER BY c1;
|
||||
HEX(c1)
|
||||
0
|
||||
2
|
||||
SELECT HEX(c1) FROM t5 WHERE c1 >= '1' ORDER BY c1;
|
||||
HEX(c1)
|
||||
1
|
||||
2
|
||||
SELECT HEX(c1) FROM t5 WHERE c1 <= '1' ORDER BY c1;
|
||||
HEX(c1)
|
||||
0
|
||||
1
|
||||
SELECT HEX(c1) FROM t5 WHERE c1 < '1' ORDER BY c1;
|
||||
HEX(c1)
|
||||
0
|
||||
SELECT HEX(c1) FROM t5 WHERE c1 > '0' ORDER BY c1;
|
||||
HEX(c1)
|
||||
1
|
||||
2
|
||||
DROP TABLE t5;
|
||||
CREATE TABLE t5(c1 FLOAT(5,2) PRIMARY KEY) ENGINE = <default_engine>;
|
||||
INSERT INTO t5 VALUES (95.95), (-10.10), (1), (0);
|
||||
SELECT c1 FROM t5 ORDER BY c1;
|
||||
c1
|
||||
-10.10
|
||||
0.00
|
||||
1.00
|
||||
95.95
|
||||
SELECT c1 FROM t5 WHERE c1 >= '95' ORDER BY c1;
|
||||
c1
|
||||
95.95
|
||||
SELECT c1 FROM t5 WHERE c1 <= '10.10' ORDER BY c1;
|
||||
c1
|
||||
-10.10
|
||||
0.00
|
||||
1.00
|
||||
SELECT c1 FROM t5 WHERE c1 != '1' ORDER BY c1;
|
||||
c1
|
||||
-10.10
|
||||
0.00
|
||||
95.95
|
||||
SELECT c1 FROM t5 WHERE c1 < '1' ORDER BY c1;
|
||||
c1
|
||||
-10.10
|
||||
0.00
|
||||
SELECT c1 FROM t5 WHERE c1 > '0' ORDER BY c1;
|
||||
c1
|
||||
1.00
|
||||
95.95
|
||||
DROP TABLE t5;
|
||||
CREATE TABLE t5(c1 TINYINT PRIMARY KEY) ENGINE = <default_engine>;
|
||||
INSERT INTO t5 VALUES (95), (10),(11),(-8);
|
||||
SELECT c1 FROM t5 ORDER BY c1;
|
||||
c1
|
||||
-8
|
||||
10
|
||||
11
|
||||
95
|
||||
SELECT c1 FROM t5 WHERE c1 = '10' ORDER BY c1;
|
||||
c1
|
||||
10
|
||||
SELECT c1 FROM t5 WHERE c1 <=> '10' ORDER BY c1;
|
||||
c1
|
||||
10
|
||||
SELECT c1 FROM t5 WHERE c1 >= '95' ORDER BY c1;
|
||||
c1
|
||||
95
|
||||
SELECT c1 FROM t5 WHERE c1 <= '11' ORDER BY c1;
|
||||
c1
|
||||
-8
|
||||
10
|
||||
11
|
||||
SELECT c1 FROM t5 WHERE c1 != '-8' ORDER BY c1;
|
||||
c1
|
||||
10
|
||||
11
|
||||
95
|
||||
SELECT c1 FROM t5 WHERE c1 < '11' ORDER BY c1;
|
||||
c1
|
||||
-8
|
||||
10
|
||||
SELECT c1 FROM t5 WHERE c1 > '10' ORDER BY c1;
|
||||
c1
|
||||
11
|
||||
95
|
||||
DROP TABLE t5;
|
||||
CREATE TABLE t5(c1 SMALLINT PRIMARY KEY) ENGINE = <default_engine>;
|
||||
INSERT INTO t5 VALUES (395), (-200), (100), (111);
|
||||
SELECT c1 FROM t5 ORDER BY c1;
|
||||
c1
|
||||
-200
|
||||
100
|
||||
111
|
||||
395
|
||||
SELECT c1 FROM t5 WHERE c1 = '100' ORDER BY c1;
|
||||
c1
|
||||
100
|
||||
SELECT c1 FROM t5 WHERE c1 <=> '100' ORDER BY c1;
|
||||
c1
|
||||
100
|
||||
SELECT c1 FROM t5 WHERE c1 >= '395' ORDER BY c1;
|
||||
c1
|
||||
395
|
||||
SELECT c1 FROM t5 WHERE c1 <= '-200' ORDER BY c1;
|
||||
c1
|
||||
-200
|
||||
SELECT c1 FROM t5 WHERE c1 != '100' ORDER BY c1;
|
||||
c1
|
||||
-200
|
||||
111
|
||||
395
|
||||
SELECT c1 FROM t5 WHERE c1 < '111' ORDER BY c1;
|
||||
c1
|
||||
-200
|
||||
100
|
||||
SELECT c1 FROM t5 WHERE c1 > '111' ORDER BY c1;
|
||||
c1
|
||||
395
|
||||
DROP TABLE t5;
|
||||
CREATE TABLE t5(c1 MEDIUMINT PRIMARY KEY) ENGINE = <default_engine>;
|
||||
INSERT INTO t5 VALUES (-8388607), (311),(215),(88608);
|
||||
SELECT c1 FROM t5 ORDER BY c1;
|
||||
c1
|
||||
-8388607
|
||||
215
|
||||
311
|
||||
88608
|
||||
SELECT c1 FROM t5 WHERE c1 = '311' ORDER BY c1;
|
||||
c1
|
||||
311
|
||||
SELECT c1 FROM t5 WHERE c1 <=> '311' ORDER BY c1;
|
||||
c1
|
||||
311
|
||||
SELECT c1 FROM t5 WHERE c1 >= '215' ORDER BY c1;
|
||||
c1
|
||||
215
|
||||
311
|
||||
88608
|
||||
SELECT c1 FROM t5 WHERE c1 <= '88608' ORDER BY c1;
|
||||
c1
|
||||
-8388607
|
||||
215
|
||||
311
|
||||
88608
|
||||
SELECT c1 FROM t5 WHERE c1 != '-8388607' ORDER BY c1;
|
||||
c1
|
||||
215
|
||||
311
|
||||
88608
|
||||
SELECT c1 FROM t5 WHERE c1 < '215' ORDER BY c1;
|
||||
c1
|
||||
-8388607
|
||||
SELECT c1 FROM t5 WHERE c1 > '215' ORDER BY c1;
|
||||
c1
|
||||
311
|
||||
88608
|
||||
DROP TABLE t5;
|
||||
CREATE TABLE t5(c1 INT PRIMARY KEY) ENGINE = <default_engine>;
|
||||
INSERT INTO t5 VALUES (-2147483647), (1011),(15),(9388607);
|
||||
SELECT c1 FROM t5 ORDER BY c1;
|
||||
c1
|
||||
-2147483647
|
||||
15
|
||||
1011
|
||||
9388607
|
||||
SELECT c1 FROM t5 WHERE c1 = '9388607' ORDER BY c1;
|
||||
c1
|
||||
9388607
|
||||
SELECT c1 FROM t5 WHERE c1 <=> '9388607' ORDER BY c1;
|
||||
c1
|
||||
9388607
|
||||
SELECT c1 FROM t5 WHERE c1 >= '15' ORDER BY c1;
|
||||
c1
|
||||
15
|
||||
1011
|
||||
9388607
|
||||
SELECT c1 FROM t5 WHERE c1 <= '1011' ORDER BY c1;
|
||||
c1
|
||||
-2147483647
|
||||
15
|
||||
1011
|
||||
SELECT c1 FROM t5 WHERE c1 != '-2147483647' ORDER BY c1;
|
||||
c1
|
||||
15
|
||||
1011
|
||||
9388607
|
||||
SELECT c1 FROM t5 WHERE c1 < '15' ORDER BY c1;
|
||||
c1
|
||||
-2147483647
|
||||
SELECT c1 FROM t5 WHERE c1 > '15' ORDER BY c1;
|
||||
c1
|
||||
1011
|
||||
9388607
|
||||
DROP TABLE t5;
|
||||
CREATE TABLE t5(c1 BIGINT PRIMARY KEY) ENGINE = <default_engine>;
|
||||
INSERT INTO t5 VALUES (-9223372036854775807), (12011),(500),(3372036854775808);
|
||||
SELECT c1 FROM t5 ORDER BY c1;
|
||||
c1
|
||||
-9223372036854775807
|
||||
500
|
||||
12011
|
||||
3372036854775808
|
||||
SELECT c1 FROM t5 WHERE c1 = '-9223372036854775807' ORDER BY c1;
|
||||
c1
|
||||
-9223372036854775807
|
||||
SELECT c1 FROM t5 WHERE c1 <=> '-9223372036854775807' ORDER BY c1;
|
||||
c1
|
||||
-9223372036854775807
|
||||
SELECT c1 FROM t5 WHERE c1 >= '12011' ORDER BY c1;
|
||||
c1
|
||||
12011
|
||||
3372036854775808
|
||||
SELECT c1 FROM t5 WHERE c1 <= '500' ORDER BY c1;
|
||||
c1
|
||||
-9223372036854775807
|
||||
500
|
||||
SELECT c1 FROM t5 WHERE c1 != '3372036854775808' ORDER BY c1;
|
||||
c1
|
||||
-9223372036854775807
|
||||
500
|
||||
12011
|
||||
SELECT c1 FROM t5 WHERE c1 < '12011' ORDER BY c1;
|
||||
c1
|
||||
-9223372036854775807
|
||||
500
|
||||
SELECT c1 FROM t5 WHERE c1 > '12011' ORDER BY c1;
|
||||
c1
|
||||
3372036854775808
|
||||
DROP TABLE t5;
|
||||
CREATE TABLE t5(c1 DOUBLE(5,2) PRIMARY KEY) ENGINE = <default_engine>;
|
||||
INSERT INTO t5 VALUES (95.95), (11.11),(5),(-908.92);
|
||||
SELECT c1 FROM t5 ORDER BY c1;
|
||||
c1
|
||||
-908.92
|
||||
5.00
|
||||
11.11
|
||||
95.95
|
||||
SELECT c1 FROM t5 WHERE c1 = '11.11' ORDER BY c1;
|
||||
c1
|
||||
11.11
|
||||
SELECT c1 FROM t5 WHERE c1 <=> '11.11' ORDER BY c1;
|
||||
c1
|
||||
11.11
|
||||
SELECT c1 FROM t5 WHERE c1 >= '5' ORDER BY c1;
|
||||
c1
|
||||
5.00
|
||||
11.11
|
||||
95.95
|
||||
SELECT c1 FROM t5 WHERE c1 <= '95.95' ORDER BY c1;
|
||||
c1
|
||||
-908.92
|
||||
5.00
|
||||
11.11
|
||||
95.95
|
||||
SELECT c1 FROM t5 WHERE c1 != '-908.92' ORDER BY c1;
|
||||
c1
|
||||
5.00
|
||||
11.11
|
||||
95.95
|
||||
SELECT c1 FROM t5 WHERE c1 < '95.95' ORDER BY c1;
|
||||
c1
|
||||
-908.92
|
||||
5.00
|
||||
11.11
|
||||
SELECT c1 FROM t5 WHERE c1 > '-908.92' ORDER BY c1;
|
||||
c1
|
||||
5.00
|
||||
11.11
|
||||
95.95
|
||||
DROP TABLE t5;
|
||||
CREATE TABLE t5(c1 NUMERIC(5,2) PRIMARY KEY) ENGINE = <default_engine>;
|
||||
INSERT INTO t5 VALUES (95.95), (11.11),(5),(-908.92);
|
||||
SELECT c1 FROM t5 ORDER BY c1;
|
||||
c1
|
||||
-908.92
|
||||
5.00
|
||||
11.11
|
||||
95.95
|
||||
SELECT c1 FROM t5 WHERE c1 = '11.11' ORDER BY c1;
|
||||
c1
|
||||
11.11
|
||||
SELECT c1 FROM t5 WHERE c1 <=> '11.11' ORDER BY c1;
|
||||
c1
|
||||
11.11
|
||||
SELECT c1 FROM t5 WHERE c1 >= '5' ORDER BY c1;
|
||||
c1
|
||||
5.00
|
||||
11.11
|
||||
95.95
|
||||
SELECT c1 FROM t5 WHERE c1 <= '95.95' ORDER BY c1;
|
||||
c1
|
||||
-908.92
|
||||
5.00
|
||||
11.11
|
||||
95.95
|
||||
SELECT c1 FROM t5 WHERE c1 != '-908.92' ORDER BY c1;
|
||||
c1
|
||||
5.00
|
||||
11.11
|
||||
95.95
|
||||
SELECT c1 FROM t5 WHERE c1 < '95.95' ORDER BY c1;
|
||||
c1
|
||||
-908.92
|
||||
5.00
|
||||
11.11
|
||||
SELECT c1 FROM t5 WHERE c1 > '-908.92' ORDER BY c1;
|
||||
c1
|
||||
5.00
|
||||
11.11
|
||||
95.95
|
||||
DROP TABLE t5;
|
||||
CREATE TABLE t5(c1 DECIMAL(5,2) PRIMARY KEY) ENGINE = <default_engine>;
|
||||
INSERT INTO t5 VALUES (95.95), (11.11),(5),(-908.92);
|
||||
SELECT c1 FROM t5 ORDER BY c1;
|
||||
c1
|
||||
-908.92
|
||||
5.00
|
||||
11.11
|
||||
95.95
|
||||
SELECT c1 FROM t5 WHERE c1 = '11.11' ORDER BY c1;
|
||||
c1
|
||||
11.11
|
||||
SELECT c1 FROM t5 WHERE c1 <=> '11.11' ORDER BY c1;
|
||||
c1
|
||||
11.11
|
||||
SELECT c1 FROM t5 WHERE c1 >= '5' ORDER BY c1;
|
||||
c1
|
||||
5.00
|
||||
11.11
|
||||
95.95
|
||||
SELECT c1 FROM t5 WHERE c1 <= '95.95' ORDER BY c1;
|
||||
c1
|
||||
-908.92
|
||||
5.00
|
||||
11.11
|
||||
95.95
|
||||
SELECT c1 FROM t5 WHERE c1 != '-908.92' ORDER BY c1;
|
||||
c1
|
||||
5.00
|
||||
11.11
|
||||
95.95
|
||||
SELECT c1 FROM t5 WHERE c1 < '95.95' ORDER BY c1;
|
||||
c1
|
||||
-908.92
|
||||
5.00
|
||||
11.11
|
||||
SELECT c1 FROM t5 WHERE c1 > '-908.92' ORDER BY c1;
|
||||
c1
|
||||
5.00
|
||||
11.11
|
||||
95.95
|
||||
DROP TABLE t5;
|
@ -164,6 +164,8 @@ id value
|
||||
SET lock_wait_timeout=1;
|
||||
ALTER TABLE t1 ADD INDEX idx(value);
|
||||
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
|
||||
ALTER TABLE t1 ADD INDEX idx(value);
|
||||
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
|
||||
# Connection default
|
||||
SELECT * FROM t1;
|
||||
id value
|
||||
|
@ -94,6 +94,95 @@ SET DEBUG_SYNC= 'RESET';
|
||||
# Bug#42230 during add index, cannot do queries on storage engines
|
||||
# that implement add_index
|
||||
#
|
||||
DROP DATABASE IF EXISTS db1;
|
||||
DROP TABLE IF EXISTS t1;
|
||||
# Test 1: Secondary index, should not block reads (original test case).
|
||||
# Connection default
|
||||
CREATE DATABASE db1;
|
||||
CREATE TABLE db1.t1(id INT NOT NULL AUTO_INCREMENT PRIMARY KEY, value INT) engine=innodb;
|
||||
INSERT INTO db1.t1(value) VALUES (1), (2);
|
||||
SET DEBUG_SYNC= "alter_table_manage_keys SIGNAL manage WAIT_FOR query";
|
||||
# Sending:
|
||||
ALTER TABLE db1.t1 ADD INDEX(value);
|
||||
# Connection con1
|
||||
SET DEBUG_SYNC= "now WAIT_FOR manage";
|
||||
USE db1;
|
||||
SELECT * FROM t1;
|
||||
id value
|
||||
1 1
|
||||
2 2
|
||||
SET DEBUG_SYNC= "now SIGNAL query";
|
||||
# Connection default
|
||||
# Reaping: ALTER TABLE db1.t1 ADD INDEX(value)
|
||||
DROP DATABASE db1;
|
||||
# Test 2: Primary index (implicit), should block reads.
|
||||
CREATE TABLE t1(a INT NOT NULL, b INT NOT NULL) engine=innodb;
|
||||
SET DEBUG_SYNC= "alter_table_manage_keys SIGNAL manage WAIT_FOR query";
|
||||
# Sending:
|
||||
ALTER TABLE t1 ADD UNIQUE INDEX(a);
|
||||
# Connection con1
|
||||
SET DEBUG_SYNC= "now WAIT_FOR manage";
|
||||
USE test;
|
||||
# Sending:
|
||||
SELECT * FROM t1;
|
||||
# Connection con2
|
||||
# Waiting for SELECT to be blocked by the metadata lock on t1
|
||||
SET DEBUG_SYNC= "now SIGNAL query";
|
||||
# Connection default
|
||||
# Reaping: ALTER TABLE t1 ADD UNIQUE INDEX(a)
|
||||
# Connection con1
|
||||
# Reaping: SELECT * FROM t1
|
||||
a b
|
||||
# Test 3: Primary index (explicit), should block reads.
|
||||
# Connection default
|
||||
ALTER TABLE t1 DROP INDEX a;
|
||||
SET DEBUG_SYNC= "alter_table_manage_keys SIGNAL manage WAIT_FOR query";
|
||||
# Sending:
|
||||
ALTER TABLE t1 ADD PRIMARY KEY (a);
|
||||
# Connection con1
|
||||
SET DEBUG_SYNC= "now WAIT_FOR manage";
|
||||
# Sending:
|
||||
SELECT * FROM t1;
|
||||
# Connection con2
|
||||
# Waiting for SELECT to be blocked by the metadata lock on t1
|
||||
SET DEBUG_SYNC= "now SIGNAL query";
|
||||
# Connection default
|
||||
# Reaping: ALTER TABLE t1 ADD PRIMARY KEY (a)
|
||||
# Connection con1
|
||||
# Reaping: SELECT * FROM t1
|
||||
a b
|
||||
# Test 4: Secondary unique index, should not block reads.
|
||||
# Connection default
|
||||
SET DEBUG_SYNC= "alter_table_manage_keys SIGNAL manage WAIT_FOR query";
|
||||
# Sending:
|
||||
ALTER TABLE t1 ADD UNIQUE (b);
|
||||
# Connection con1
|
||||
SET DEBUG_SYNC= "now WAIT_FOR manage";
|
||||
SELECT * FROM t1;
|
||||
a b
|
||||
SET DEBUG_SYNC= "now SIGNAL query";
|
||||
# Connection default
|
||||
# Reaping: ALTER TABLE t1 ADD UNIQUE (b)
|
||||
SET DEBUG_SYNC= "RESET";
|
||||
DROP TABLE t1;
|
||||
#
|
||||
# DISABLED due to Bug#11815600
|
||||
# Bug#11853126 RE-ENABLE CONCURRENT READS WHILE CREATING SECONDARY INDEX
|
||||
# IN INNODB
|
||||
#
|
||||
DROP TABLE IF EXISTS t1;
|
||||
CREATE TABLE t1(a INT NOT NULL, b INT NOT NULL) engine=innodb;
|
||||
INSERT INTO t1 VALUES (1, 12345), (2, 23456);
|
||||
# Connection con1
|
||||
SET SESSION debug= "+d,alter_table_rollback_new_index";
|
||||
ALTER TABLE t1 ADD PRIMARY KEY(a);
|
||||
ERROR HY000: Unknown error
|
||||
SELECT * FROM t1;
|
||||
a b
|
||||
1 12345
|
||||
2 23456
|
||||
# Connection default
|
||||
SELECT * FROM t1;
|
||||
a b
|
||||
1 12345
|
||||
2 23456
|
||||
DROP TABLE t1;
|
||||
|
@ -126,7 +126,7 @@ renamed
|
||||
1
|
||||
select * from v3 where renamed=1 group by renamed;
|
||||
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
|
||||
def v3 v3 renamed renamed 8 11 0 Y 32896 0 63
|
||||
def v3 v3 renamed renamed 8 12 0 Y 32896 0 63
|
||||
renamed
|
||||
drop table t1;
|
||||
drop view v1,v2,v3;
|
||||
|
@ -44,13 +44,13 @@ ERROR 42000: DELETE command denied to user 'ssl_user4'@'localhost' for table 't1
|
||||
drop user ssl_user1@localhost, ssl_user2@localhost,
|
||||
ssl_user3@localhost, ssl_user4@localhost, ssl_user5@localhost;
|
||||
drop table t1;
|
||||
mysqltest: Could not open connection 'default': 2026 SSL connection error
|
||||
mysqltest: Could not open connection 'default': 2026 SSL connection error
|
||||
mysqltest: Could not open connection 'default': 2026 SSL connection error
|
||||
mysqltest: Could not open connection 'default': 2026 SSL connection error: ASN: bad other signature confirmation
|
||||
mysqltest: Could not open connection 'default': 2026 SSL connection error: ASN: bad other signature confirmation
|
||||
mysqltest: Could not open connection 'default': 2026 SSL connection error: ASN: bad other signature confirmation
|
||||
SSL error: Unable to get private key from ''
|
||||
mysqltest: Could not open connection 'default': 2026 SSL connection error
|
||||
mysqltest: Could not open connection 'default': 2026 SSL connection error: Unable to get private key
|
||||
SSL error: Unable to get certificate from ''
|
||||
mysqltest: Could not open connection 'default': 2026 SSL connection error
|
||||
mysqltest: Could not open connection 'default': 2026 SSL connection error: Unable to get certificate
|
||||
SHOW STATUS LIKE 'Ssl_cipher';
|
||||
Variable_name Value
|
||||
Ssl_cipher DHE-RSA-AES256-SHA
|
||||
@ -83,7 +83,7 @@ Ssl_cipher AES128-SHA
|
||||
SHOW STATUS LIKE 'Ssl_cipher';
|
||||
Variable_name Value
|
||||
Ssl_cipher AES128-SHA
|
||||
mysqltest: Could not open connection 'default': 2026 SSL connection error
|
||||
mysqltest: Could not open connection 'default': 2026 SSL connection error: SSL_CTX_new failed
|
||||
CREATE TABLE t1(a int);
|
||||
INSERT INTO t1 VALUES (1), (2);
|
||||
|
||||
@ -189,7 +189,7 @@ UNLOCK TABLES;
|
||||
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
|
||||
|
||||
SSL error: Unable to get private key from 'MYSQL_TEST_DIR/std_data/client-cert.pem'
|
||||
mysqldump: Got error: 2026: SSL connection error when trying to connect
|
||||
mysqldump: Got error: 2026: SSL connection error: Unable to get private key when trying to connect
|
||||
DROP TABLE t1;
|
||||
Variable_name Value
|
||||
Ssl_cipher DHE-RSA-AES256-SHA
|
||||
|
@ -153,7 +153,9 @@ SET DEBUG_SYNC="now WAIT_FOR parked1_2";
|
||||
** until a broadcast signal reaches them causing both threads to
|
||||
** come alive and check the condition.
|
||||
SET DEBUG_SYNC="now SIGNAL go2";
|
||||
** Wait for thd2 to receive the signal
|
||||
SET DEBUG_SYNC="now SIGNAL go3";
|
||||
** Wait for thd3 to receive the signal
|
||||
**
|
||||
** Finally signal the DELETE statement on THD1 one last time.
|
||||
** The stmt will complete the query cache invalidation and return
|
||||
|
@ -238,11 +238,5 @@ SELECT 9;
|
||||
9
|
||||
DROP PROCEDURE p1;
|
||||
DROP FUNCTION f1;
|
||||
DROP VIEW IF EXISTS v1;
|
||||
CREATE VIEW v1 AS SELECT VARIABLE_NAME AS NAME, CONVERT(VARIABLE_VALUE, UNSIGNED) AS VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS;
|
||||
SELECT VALUE INTO @tc FROM v1 WHERE NAME = 'Threads_connected';
|
||||
SELECT NAME FROM v1 WHERE NAME = 'Threads_created' AND VALUE < @tc;
|
||||
NAME
|
||||
DROP VIEW v1;
|
||||
set @@global.concurrent_insert= @old_concurrent_insert;
|
||||
SET GLOBAL log_output = @old_log_output;
|
||||
|
13
mysql-test/r/status_bug17954.result
Normal file
13
mysql-test/r/status_bug17954.result
Normal file
@ -0,0 +1,13 @@
|
||||
set @old_concurrent_insert= @@global.concurrent_insert;
|
||||
set @@global.concurrent_insert= 0;
|
||||
SET @old_log_output = @@global.log_output;
|
||||
SET GLOBAL LOG_OUTPUT = 'FILE';
|
||||
flush status;
|
||||
DROP VIEW IF EXISTS v1;
|
||||
CREATE VIEW v1 AS SELECT VARIABLE_NAME AS NAME, CONVERT(VARIABLE_VALUE, UNSIGNED) AS VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS;
|
||||
SELECT VALUE INTO @tc FROM v1 WHERE NAME = 'Threads_connected';
|
||||
SELECT NAME FROM v1 WHERE NAME = 'Threads_created' AND VALUE < @tc;
|
||||
NAME
|
||||
DROP VIEW v1;
|
||||
set @@global.concurrent_insert= @old_concurrent_insert;
|
||||
SET GLOBAL log_output = @old_log_output;
|
@ -1920,4 +1920,17 @@ SELECT SUM(DISTINCT a) FROM t1;
|
||||
SUM(DISTINCT a)
|
||||
0.0000
|
||||
DROP TABLE t1;
|
||||
#
|
||||
# Bug#55436: buffer overflow in debug binary of dbug_buff in
|
||||
# Field_new_decimal::store_value
|
||||
#
|
||||
SET SQL_MODE='';
|
||||
CREATE TABLE t1(f1 DECIMAL(44,24)) ENGINE=MYISAM;
|
||||
INSERT INTO t1 SET f1 = -64878E-85;
|
||||
Warnings:
|
||||
Note 1265 Data truncated for column 'f1' at row 1
|
||||
SELECT f1 FROM t1;
|
||||
f1
|
||||
0.000000000000000000000000
|
||||
DROP TABLE IF EXISTS t1;
|
||||
End of 5.1 tests
|
||||
|
@ -271,7 +271,7 @@ drop table t2;
|
||||
create table t2 (primary key (auto)) select auto+1 as auto,1 as t1, 'a' as t2, repeat('a',256) as t3, binary repeat('b',256) as t4, repeat('a',4096) as t5, binary repeat('b',4096) as t6, '' as t7, binary '' as t8 from t1;
|
||||
show full columns from t2;
|
||||
Field Type Collation Null Key Default Extra Privileges Comment
|
||||
auto int(6) unsigned NULL NO PRI 0 #
|
||||
auto int(11) unsigned NULL NO PRI 0 #
|
||||
t1 int(1) NULL NO 0 #
|
||||
t2 varchar(1) latin1_swedish_ci NO #
|
||||
t3 varchar(256) latin1_swedish_ci NO #
|
||||
|
@ -1,3 +1,4 @@
|
||||
SET @def_var= @@session.transaction_prealloc_size;
|
||||
SET SESSION transaction_prealloc_size=1024*1024*1024*1;
|
||||
SHOW PROCESSLIST;
|
||||
Id User Host db Command Time State Info
|
||||
@ -18,3 +19,4 @@ SET SESSION transaction_prealloc_size=1024*1024*1024*5;
|
||||
SHOW PROCESSLIST;
|
||||
Id User Host db Command Time State Info
|
||||
<Id> root <Host> test Query <Time> NULL SHOW PROCESSLIST
|
||||
SET @@session.transaction_prealloc_size= @def_var;
|
||||
|
@ -59,3 +59,20 @@ show binlog events from <binlog_start>;
|
||||
Log_name Pos Event_type Server_id End_log_pos Info
|
||||
master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `t1` /* generated by server */
|
||||
###############################################
|
||||
#
|
||||
# Bug#12346411 SQL/LOG.CC:6509: ASSERTION `PREPARED_XIDS > 0' FAILED
|
||||
#
|
||||
DROP TABLE IF EXISTS t1, t2;
|
||||
CREATE TABLE t1(a INT PRIMARY KEY) engine=innodb;
|
||||
CREATE TABLE t2(a INT) engine=myisam;
|
||||
INSERT INTO t1 VALUES (1);
|
||||
START TRANSACTION;
|
||||
INSERT INTO t2 VALUES (1);
|
||||
INSERT IGNORE INTO t1 VALUES (1);
|
||||
COMMIT;
|
||||
INSERT INTO t1 VALUES (2);
|
||||
START TRANSACTION;
|
||||
INSERT INTO t2 VALUES (2);
|
||||
UPDATE IGNORE t1 SET a=1 WHERE a=2;
|
||||
COMMIT;
|
||||
DROP TABLE t1, t2;
|
||||
|
1
mysql-test/suite/binlog/r/binlog_reset_master.result
Normal file
1
mysql-test/suite/binlog/r/binlog_reset_master.result
Normal file
@ -0,0 +1 @@
|
||||
RESET MASTER;
|
@ -698,7 +698,7 @@ master-bin.000001 # Query # # BEGIN
|
||||
master-bin.000001 # Intvar # # INSERT_ID=10
|
||||
master-bin.000001 # Begin_load_query # # ;file_id=#;block_len=#
|
||||
master-bin.000001 # Intvar # # INSERT_ID=10
|
||||
master-bin.000001 # Execute_load_query # # use `test`; LOAD DATA INFILE '../../std_data/rpl_loaddata.dat' INTO TABLE `t4` FIELDS TERMINATED BY '\t' ENCLOSED BY '' ESCAPED BY '\\' LINES TERMINATED BY '\n' (`a`, @b) SET `b`=((@b) + `bug27417`(2)) ;file_id=#
|
||||
master-bin.000001 # Execute_load_query # # use `test`; LOAD DATA INFILE '../../std_data/rpl_loaddata.dat' INTO TABLE `t4` FIELDS TERMINATED BY '\t' ENCLOSED BY '' ESCAPED BY '\\' LINES TERMINATED BY '\n' (`a`, @b) SET `b`= @b + bug27417(2) ;file_id=#
|
||||
master-bin.000001 # Query # # ROLLBACK
|
||||
/* the output must denote there is the query */;
|
||||
drop trigger trg_del_t2;
|
||||
@ -950,7 +950,7 @@ master-bin.000001 # User var # # @`b`=_latin1 0x3135 COLLATE latin1_swedish_ci
|
||||
master-bin.000001 # Begin_load_query # # ;file_id=#;block_len=#
|
||||
master-bin.000001 # Intvar # # INSERT_ID=10
|
||||
master-bin.000001 # User var # # @`b`=_latin1 0x3135 COLLATE latin1_swedish_ci
|
||||
master-bin.000001 # Execute_load_query # # use `test`; LOAD DATA INFILE '../../std_data/rpl_loaddata.dat' INTO TABLE `t4` FIELDS TERMINATED BY '\t' ENCLOSED BY '' ESCAPED BY '\\' LINES TERMINATED BY '\n' (`a`, @b) SET `b`=((@b) + `bug27417`(2)) ;file_id=#
|
||||
master-bin.000001 # Execute_load_query # # use `test`; LOAD DATA INFILE '../../std_data/rpl_loaddata.dat' INTO TABLE `t4` FIELDS TERMINATED BY '\t' ENCLOSED BY '' ESCAPED BY '\\' LINES TERMINATED BY '\n' (`a`, @b) SET `b`= @b + bug27417(2) ;file_id=#
|
||||
master-bin.000001 # Query # # ROLLBACK
|
||||
drop trigger trg_del_t2;
|
||||
drop table t1,t2,t3,t4,t5;
|
||||
|
@ -77,3 +77,29 @@ DROP TEMPORARY TABLE t1;
|
||||
-- echo ###############################################
|
||||
-- source include/show_binlog_events.inc
|
||||
-- echo ###############################################
|
||||
|
||||
|
||||
--echo #
|
||||
--echo # Bug#12346411 SQL/LOG.CC:6509: ASSERTION `PREPARED_XIDS > 0' FAILED
|
||||
--echo #
|
||||
|
||||
--disable_warnings
|
||||
DROP TABLE IF EXISTS t1, t2;
|
||||
--enable_warnings
|
||||
|
||||
CREATE TABLE t1(a INT PRIMARY KEY) engine=innodb;
|
||||
CREATE TABLE t2(a INT) engine=myisam;
|
||||
|
||||
INSERT INTO t1 VALUES (1);
|
||||
START TRANSACTION;
|
||||
INSERT INTO t2 VALUES (1);
|
||||
INSERT IGNORE INTO t1 VALUES (1);
|
||||
COMMIT;
|
||||
|
||||
INSERT INTO t1 VALUES (2);
|
||||
START TRANSACTION;
|
||||
INSERT INTO t2 VALUES (2);
|
||||
UPDATE IGNORE t1 SET a=1 WHERE a=2;
|
||||
COMMIT;
|
||||
|
||||
DROP TABLE t1, t2;
|
||||
|
26
mysql-test/suite/binlog/t/binlog_reset_master.test
Normal file
26
mysql-test/suite/binlog/t/binlog_reset_master.test
Normal file
@ -0,0 +1,26 @@
|
||||
# ==== Purpose ====
|
||||
#
|
||||
# Test bugs in RESET MASTER.
|
||||
|
||||
--source include/have_debug.inc
|
||||
--source include/have_log_bin.inc
|
||||
|
||||
#######################################################################
|
||||
# BUG#12574820: binlog.binlog_tmp_table timing out in daily and weekly trunk run
|
||||
# Problem: MYSQL_BIN_LOG::reset_logs acquired LOCK_thread_count and
|
||||
# LOCK_log in the wrong order. This could cause a deadlock when
|
||||
# RESET MASTER was run concurrently with a disconnecting thread.
|
||||
#######################################################################
|
||||
|
||||
# We use sleep, not debug_sync, because the sync point needs to be in
|
||||
# the thread shut down code after the debug sync facility has been
|
||||
# shut down.
|
||||
--let $write_var= SET DEBUG="+d,sleep_after_lock_thread_count_before_delete_thd"; CREATE TEMPORARY TABLE test.t1 (a INT);
|
||||
--let $write_to_file= GENERATE
|
||||
--disable_query_log
|
||||
--source include/write_var_to_file.inc
|
||||
--enable_query_log
|
||||
|
||||
--exec $MYSQL < $write_to_file
|
||||
RESET MASTER;
|
||||
--remove_file $write_to_file
|
@ -9,5 +9,5 @@
|
||||
# Do not use any TAB characters for whitespace.
|
||||
#
|
||||
##############################################################################
|
||||
binlog_truncate_innodb : BUG#57291 2010-10-20 anitha Originally disabled due to BUG#42643. Product bug fixed, but test changes needed
|
||||
binlog_spurious_ddl_errors : BUG#54195 2010-06-03 alik binlog_spurious_ddl_errors.test fails, thus disabled
|
||||
binlog_truncate_innodb : BUG#11764459 2010-10-20 anitha Originally disabled due to BUG#42643. Product bug fixed, but test changes needed
|
||||
binlog_spurious_ddl_errors : BUG#11761680 2010-06-03 alik binlog_spurious_ddl_errors.test fails, thus disabled
|
||||
|
@ -9,4 +9,4 @@
|
||||
# Do not use any TAB characters for whitespace.
|
||||
#
|
||||
##############################################################################
|
||||
federated_transactions : Bug#29523 Transactions do not work
|
||||
federated_transactions : Bug#11746899 Transactions do not work
|
||||
|
@ -885,31 +885,31 @@ create table t1(a blob,b blob,c blob,d blob,e blob,f blob,g blob,h blob,
|
||||
i blob,j blob,k blob,l blob,m blob,n blob,o blob,p blob,
|
||||
q blob,r blob,s blob,t blob,u blob)
|
||||
engine=innodb row_format=dynamic;
|
||||
create index t1a on t1 (a(1));
|
||||
create index t1b on t1 (b(1));
|
||||
create index t1c on t1 (c(1));
|
||||
create index t1d on t1 (d(1));
|
||||
create index t1e on t1 (e(1));
|
||||
create index t1f on t1 (f(1));
|
||||
create index t1g on t1 (g(1));
|
||||
create index t1h on t1 (h(1));
|
||||
create index t1i on t1 (i(1));
|
||||
create index t1j on t1 (j(1));
|
||||
create index t1k on t1 (k(1));
|
||||
create index t1l on t1 (l(1));
|
||||
create index t1m on t1 (m(1));
|
||||
create index t1n on t1 (n(1));
|
||||
create index t1o on t1 (o(1));
|
||||
create index t1p on t1 (p(1));
|
||||
create index t1q on t1 (q(1));
|
||||
create index t1r on t1 (r(1));
|
||||
create index t1s on t1 (s(1));
|
||||
create index t1t on t1 (t(1));
|
||||
create index t1u on t1 (u(1));
|
||||
create index t1a on t1 (a(767));
|
||||
create index t1b on t1 (b(767));
|
||||
create index t1c on t1 (c(767));
|
||||
create index t1d on t1 (d(767));
|
||||
create index t1e on t1 (e(767));
|
||||
create index t1f on t1 (f(767));
|
||||
create index t1g on t1 (g(767));
|
||||
create index t1h on t1 (h(767));
|
||||
create index t1i on t1 (i(767));
|
||||
create index t1j on t1 (j(767));
|
||||
create index t1k on t1 (k(767));
|
||||
create index t1l on t1 (l(767));
|
||||
create index t1m on t1 (m(767));
|
||||
create index t1n on t1 (n(767));
|
||||
create index t1o on t1 (o(767));
|
||||
create index t1p on t1 (p(767));
|
||||
create index t1q on t1 (q(767));
|
||||
create index t1r on t1 (r(767));
|
||||
create index t1s on t1 (s(767));
|
||||
create index t1t on t1 (t(767));
|
||||
create index t1u on t1 (u(767));
|
||||
ERROR HY000: Too big row
|
||||
create index t1ut on t1 (u(1), t(1));
|
||||
create index t1ut on t1 (u(767), t(767));
|
||||
ERROR HY000: Too big row
|
||||
create index t1st on t1 (s(1), t(1));
|
||||
create index t1st on t1 (s(767), t(767));
|
||||
show create table t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
@ -934,32 +934,32 @@ t1 CREATE TABLE `t1` (
|
||||
`s` blob,
|
||||
`t` blob,
|
||||
`u` blob,
|
||||
KEY `t1a` (`a`(1)),
|
||||
KEY `t1b` (`b`(1)),
|
||||
KEY `t1c` (`c`(1)),
|
||||
KEY `t1d` (`d`(1)),
|
||||
KEY `t1e` (`e`(1)),
|
||||
KEY `t1f` (`f`(1)),
|
||||
KEY `t1g` (`g`(1)),
|
||||
KEY `t1h` (`h`(1)),
|
||||
KEY `t1i` (`i`(1)),
|
||||
KEY `t1j` (`j`(1)),
|
||||
KEY `t1k` (`k`(1)),
|
||||
KEY `t1l` (`l`(1)),
|
||||
KEY `t1m` (`m`(1)),
|
||||
KEY `t1n` (`n`(1)),
|
||||
KEY `t1o` (`o`(1)),
|
||||
KEY `t1p` (`p`(1)),
|
||||
KEY `t1q` (`q`(1)),
|
||||
KEY `t1r` (`r`(1)),
|
||||
KEY `t1s` (`s`(1)),
|
||||
KEY `t1t` (`t`(1)),
|
||||
KEY `t1st` (`s`(1),`t`(1))
|
||||
KEY `t1a` (`a`(767)),
|
||||
KEY `t1b` (`b`(767)),
|
||||
KEY `t1c` (`c`(767)),
|
||||
KEY `t1d` (`d`(767)),
|
||||
KEY `t1e` (`e`(767)),
|
||||
KEY `t1f` (`f`(767)),
|
||||
KEY `t1g` (`g`(767)),
|
||||
KEY `t1h` (`h`(767)),
|
||||
KEY `t1i` (`i`(767)),
|
||||
KEY `t1j` (`j`(767)),
|
||||
KEY `t1k` (`k`(767)),
|
||||
KEY `t1l` (`l`(767)),
|
||||
KEY `t1m` (`m`(767)),
|
||||
KEY `t1n` (`n`(767)),
|
||||
KEY `t1o` (`o`(767)),
|
||||
KEY `t1p` (`p`(767)),
|
||||
KEY `t1q` (`q`(767)),
|
||||
KEY `t1r` (`r`(767)),
|
||||
KEY `t1s` (`s`(767)),
|
||||
KEY `t1t` (`t`(767)),
|
||||
KEY `t1st` (`s`(767),`t`(767))
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=DYNAMIC
|
||||
create index t1u on t1 (u(1));
|
||||
create index t1u on t1 (u(767));
|
||||
ERROR HY000: Too big row
|
||||
alter table t1 row_format=compact;
|
||||
create index t1u on t1 (u(1));
|
||||
create index t1u on t1 (u(767));
|
||||
drop table t1;
|
||||
set global innodb_file_per_table=0;
|
||||
set global innodb_file_format=Antelope;
|
||||
|
185
mysql-test/suite/innodb/r/innodb_index_large_prefix.result
Normal file
185
mysql-test/suite/innodb/r/innodb_index_large_prefix.result
Normal file
@ -0,0 +1,185 @@
|
||||
set global innodb_file_format="Barracuda";
|
||||
set global innodb_file_per_table=1;
|
||||
set global innodb_large_prefix=1;
|
||||
create table worklog5743(a TEXT not null, primary key (a(1000)))
|
||||
ROW_FORMAT=DYNAMIC, engine = innodb;
|
||||
insert into worklog5743 values(repeat("a", 20000));
|
||||
update worklog5743 set a = (repeat("b", 16000));
|
||||
create index idx on worklog5743(a(2000));
|
||||
begin;
|
||||
update worklog5743 set a = (repeat("x", 17000));
|
||||
select @@session.tx_isolation;
|
||||
@@session.tx_isolation
|
||||
REPEATABLE-READ
|
||||
select a = repeat("x", 17000) from worklog5743;
|
||||
a = repeat("x", 17000)
|
||||
0
|
||||
select a = repeat("b", 16000) from worklog5743;
|
||||
a = repeat("b", 16000)
|
||||
1
|
||||
SET SESSION TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
|
||||
select @@session.tx_isolation;
|
||||
@@session.tx_isolation
|
||||
READ-UNCOMMITTED
|
||||
select a = repeat("x", 17000) from worklog5743;
|
||||
a = repeat("x", 17000)
|
||||
1
|
||||
rollback;
|
||||
drop table worklog5743;
|
||||
create table worklog5743(a1 int, a2 TEXT not null)
|
||||
ROW_FORMAT=DYNAMIC, engine = innodb;
|
||||
create index idx on worklog5743(a1, a2(2000));
|
||||
insert into worklog5743 values(9, repeat("a", 10000));
|
||||
begin;
|
||||
update worklog5743 set a1 = 1000;
|
||||
select @@session.tx_isolation;
|
||||
@@session.tx_isolation
|
||||
REPEATABLE-READ
|
||||
explain select a1, a2 = repeat("a", 10000) from worklog5743 where a1 = 9;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE worklog5743 ref idx idx 5 const 1 Using where
|
||||
select a1, a2 = repeat("a", 10000) from worklog5743 where a1 = 9;
|
||||
a1 a2 = repeat("a", 10000)
|
||||
9 1
|
||||
SET SESSION TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
|
||||
select @@session.tx_isolation;
|
||||
@@session.tx_isolation
|
||||
READ-UNCOMMITTED
|
||||
select a1, a2 = repeat("a", 10000) from worklog5743 where a1 = 9;
|
||||
a1 a2 = repeat("a", 10000)
|
||||
rollback;
|
||||
drop table worklog5743;
|
||||
create table worklog5743(a1 int, a2 TEXT not null)
|
||||
ROW_FORMAT=DYNAMIC, engine = innodb;
|
||||
create index idx on worklog5743(a1, a2(50));
|
||||
insert into worklog5743 values(9, repeat("a", 10000));
|
||||
begin;
|
||||
update worklog5743 set a1 = 1000;
|
||||
select @@session.tx_isolation;
|
||||
@@session.tx_isolation
|
||||
REPEATABLE-READ
|
||||
explain select a1, a2 = repeat("a", 10000) from worklog5743 where a1 = 9;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE worklog5743 ref idx idx 5 const 1 Using where
|
||||
select a1, a2 = repeat("a", 10000) from worklog5743 where a1 = 9;
|
||||
a1 a2 = repeat("a", 10000)
|
||||
9 1
|
||||
SET SESSION TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
|
||||
select @@session.tx_isolation;
|
||||
@@session.tx_isolation
|
||||
READ-UNCOMMITTED
|
||||
select a1, a2 = repeat("a", 10000) from worklog5743 where a1 = 9;
|
||||
a1 a2 = repeat("a", 10000)
|
||||
rollback;
|
||||
drop table worklog5743;
|
||||
create table worklog5743_2(a1 int, a2 TEXT not null)
|
||||
ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=2, engine = innodb;
|
||||
create table worklog5743_4(a1 int, a2 TEXT not null)
|
||||
ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=4, engine = innodb;
|
||||
create index idx1 on worklog5743_2(a1, a2(942));
|
||||
ERROR HY000: Too big row
|
||||
create index idx1 on worklog5743_2(a1, a2(940));
|
||||
create index idx1 on worklog5743_4(a1, a2(1966));
|
||||
ERROR HY000: Too big row
|
||||
create index idx1 on worklog5743_4(a1, a2(1964));
|
||||
insert into worklog5743_2 values(9, repeat("a", 10000));
|
||||
insert into worklog5743_4 values(9, repeat("a", 10000));
|
||||
begin;
|
||||
update worklog5743_2 set a1 = 1000;
|
||||
update worklog5743_4 set a1 = 1000;
|
||||
select @@session.tx_isolation;
|
||||
@@session.tx_isolation
|
||||
REPEATABLE-READ
|
||||
explain select a1, a2 = repeat("a", 10000) from worklog5743_2 where a1 = 9;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE worklog5743_2 ref idx1 idx1 5 const 1 Using where
|
||||
select a1, a2 = repeat("a", 10000) from worklog5743_2 where a1 = 9;
|
||||
a1 a2 = repeat("a", 10000)
|
||||
9 1
|
||||
select a1, a2 = repeat("a", 10000) from worklog5743_4 where a1 = 9;
|
||||
a1 a2 = repeat("a", 10000)
|
||||
9 1
|
||||
SET SESSION TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
|
||||
select @@session.tx_isolation;
|
||||
@@session.tx_isolation
|
||||
READ-UNCOMMITTED
|
||||
select a1, a2 = repeat("a", 10000) from worklog5743_2 where a1 = 9;
|
||||
a1 a2 = repeat("a", 10000)
|
||||
select a1, a2 = repeat("a", 10000) from worklog5743_4 where a1 = 9;
|
||||
a1 a2 = repeat("a", 10000)
|
||||
rollback;
|
||||
drop table worklog5743_2;
|
||||
drop table worklog5743_4;
|
||||
create table worklog5743(a1 int, a2 varchar(3000))
|
||||
ROW_FORMAT=DYNAMIC, engine = innodb;
|
||||
create index idx on worklog5743(a1, a2);
|
||||
insert into worklog5743 values(9, repeat("a", 3000));
|
||||
begin;
|
||||
update worklog5743 set a1 = 1000;
|
||||
select @@session.tx_isolation;
|
||||
@@session.tx_isolation
|
||||
REPEATABLE-READ
|
||||
explain select a1 from worklog5743 where a1 = 9;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE worklog5743 ref idx idx 5 const 1 Using where; Using index
|
||||
select a1 from worklog5743 where a1 = 9;
|
||||
a1
|
||||
9
|
||||
SET SESSION TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
|
||||
select @@session.tx_isolation;
|
||||
@@session.tx_isolation
|
||||
READ-UNCOMMITTED
|
||||
select a1 from worklog5743 where a1 = 9;
|
||||
a1
|
||||
rollback;
|
||||
drop table worklog5743;
|
||||
create table worklog5743(a TEXT not null, primary key (a(1000)))
|
||||
engine = innodb;
|
||||
ERROR HY000: Index column size too large. The maximum column size is 767 bytes.
|
||||
create table worklog5743(a TEXT) engine = innodb;
|
||||
create index idx on worklog5743(a(1000));
|
||||
ERROR HY000: Index column size too large. The maximum column size is 767 bytes.
|
||||
create index idx on worklog5743(a(725));
|
||||
insert into worklog5743 values(repeat("a", 20000));
|
||||
begin;
|
||||
insert into worklog5743 values(repeat("b", 20000));
|
||||
update worklog5743 set a = (repeat("x", 25000));
|
||||
select @@session.tx_isolation;
|
||||
@@session.tx_isolation
|
||||
REPEATABLE-READ
|
||||
select a = repeat("a", 20000) from worklog5743;
|
||||
a = repeat("a", 20000)
|
||||
1
|
||||
SET SESSION TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
|
||||
select @@session.tx_isolation;
|
||||
@@session.tx_isolation
|
||||
READ-UNCOMMITTED
|
||||
select a = repeat("x", 25000) from worklog5743;
|
||||
a = repeat("x", 25000)
|
||||
1
|
||||
1
|
||||
rollback;
|
||||
drop table worklog5743;
|
||||
create table worklog5743(a TEXT not null) ROW_FORMAT=DYNAMIC, engine = innodb;
|
||||
create index idx on worklog5743(a(3073));
|
||||
Warnings:
|
||||
Warning 1071 Specified key was too long; max key length is 3072 bytes
|
||||
Warning 1071 Specified key was too long; max key length is 3072 bytes
|
||||
create index idx2 on worklog5743(a(3072));
|
||||
show create table worklog5743;
|
||||
Table Create Table
|
||||
worklog5743 CREATE TABLE `worklog5743` (
|
||||
`a` text NOT NULL,
|
||||
KEY `idx` (`a`(3072)),
|
||||
KEY `idx2` (`a`(3072))
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=DYNAMIC
|
||||
drop table worklog5743;
|
||||
create table worklog5743(a TEXT not null) engine = innodb;
|
||||
create index idx on worklog5743(a(768));
|
||||
ERROR HY000: Index column size too large. The maximum column size is 767 bytes.
|
||||
create index idx2 on worklog5743(a(767));
|
||||
drop table worklog5743;
|
||||
SET GLOBAL innodb_file_format=Antelope;
|
||||
SET GLOBAL innodb_file_per_table=0;
|
||||
SET GLOBAL innodb_file_format_max=Antelope;
|
||||
SET GLOBAL innodb_large_prefix=0;
|
@ -2663,7 +2663,6 @@ COUNT(*)
|
||||
1537
|
||||
SET SESSION sort_buffer_size = DEFAULT;
|
||||
DROP TABLE t1;
|
||||
End of 5.1 tests
|
||||
#
|
||||
# Test for bug #39932 "create table fails if column for FK is in different
|
||||
# case than in corr index".
|
||||
@ -2685,6 +2684,23 @@ t2 CREATE TABLE `t2` (
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=latin1
|
||||
drop table t2, t1;
|
||||
#
|
||||
# Test for bug #11762012 - "54553: INNODB ASSERTS IN HA_INNOBASE::
|
||||
# UPDATE_ROW, TEMPORARY TABLE, TABLE LOCK".
|
||||
#
|
||||
DROP TABLE IF EXISTS t1;
|
||||
CREATE TEMPORARY TABLE t1 (c int) ENGINE = InnoDB;
|
||||
INSERT INTO t1 VALUES (1);
|
||||
LOCK TABLES t1 READ;
|
||||
# Even though temporary table was locked for READ we
|
||||
# still allow writes to it to be compatible with MyISAM.
|
||||
# This is possible since due to fact that temporary tables
|
||||
# are specific to connection and therefore locking for them
|
||||
# is irrelevant.
|
||||
UPDATE t1 SET c = 5;
|
||||
UNLOCK TABLES;
|
||||
DROP TEMPORARY TABLE t1;
|
||||
End of 5.1 tests
|
||||
#
|
||||
# Bug#44613 SELECT statement inside FUNCTION takes a shared lock
|
||||
#
|
||||
DROP TABLE IF EXISTS t1;
|
||||
|
1354
mysql-test/suite/innodb/r/innodb_prefix_index_liftedlimit.result
Normal file
1354
mysql-test/suite/innodb/r/innodb_prefix_index_liftedlimit.result
Normal file
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,91 @@
|
||||
set global innodb_file_format="Barracuda";
|
||||
set global innodb_file_per_table=1;
|
||||
set global innodb_large_prefix=1;
|
||||
DROP TABLE IF EXISTS worklog5743;
|
||||
CREATE TABLE worklog5743 (
|
||||
col_1_text TEXT(4000) , col_2_text TEXT(4000) ,
|
||||
PRIMARY KEY (col_1_text(3072))
|
||||
) ROW_FORMAT=DYNAMIC, engine = innodb;
|
||||
INSERT INTO worklog5743 VALUES(REPEAT("a", 3500) , REPEAT("o", 3500));
|
||||
SELECT col_1_text = REPEAT("a", 3500) , col_2_text = REPEAT("o", 3500) FROM
|
||||
worklog5743;
|
||||
col_1_text = REPEAT("a", 3500) col_2_text = REPEAT("o", 3500)
|
||||
1 1
|
||||
"In connection 1"
|
||||
SELECT col_1_text = REPEAT("a", 3500) , col_2_text = REPEAT("o", 3500) FROM
|
||||
worklog5743;
|
||||
col_1_text = REPEAT("a", 3500) col_2_text = REPEAT("o", 3500)
|
||||
1 1
|
||||
SELECT COUNT(*) FROM worklog5743;
|
||||
COUNT(*)
|
||||
1
|
||||
"In connection 2"
|
||||
START TRANSACTION;
|
||||
INSERT INTO worklog5743 VALUES(REPEAT("b", 3500) , REPEAT("o", 3500));
|
||||
"In connection 1"
|
||||
SELECT col_1_text = REPEAT("a", 3500) , col_2_text = REPEAT("o", 3500) FROM
|
||||
worklog5743;
|
||||
col_1_text = REPEAT("a", 3500) col_2_text = REPEAT("o", 3500)
|
||||
1 1
|
||||
SELECT COUNT(*) FROM worklog5743;
|
||||
COUNT(*)
|
||||
1
|
||||
START TRANSACTION;
|
||||
"In connection default ....restarting the server"
|
||||
SELECT COUNT(*) FROM worklog5743;
|
||||
COUNT(*)
|
||||
1
|
||||
SELECT col_1_text = REPEAT("a", 3500) , col_2_text = REPEAT("o", 3500) FROM
|
||||
worklog5743;
|
||||
col_1_text = REPEAT("a", 3500) col_2_text = REPEAT("o", 3500)
|
||||
1 1
|
||||
"In connection 1"
|
||||
SELECT col_1_text = REPEAT("a", 3500) , col_2_text = REPEAT("o", 3500) FROM
|
||||
worklog5743;
|
||||
col_1_text = REPEAT("a", 3500) col_2_text = REPEAT("o", 3500)
|
||||
1 1
|
||||
SELECT COUNT(*) FROM worklog5743;
|
||||
COUNT(*)
|
||||
1
|
||||
START TRANSACTION;
|
||||
INSERT INTO worklog5743 VALUES(REPEAT("b", 3500) , REPEAT("o", 3500));
|
||||
DELETE FROM worklog5743 WHERE col_1_text = REPEAT("b", 3500);
|
||||
SELECT col_1_text = REPEAT("a", 3500) , col_2_text = REPEAT("o", 3500) FROM
|
||||
worklog5743;
|
||||
col_1_text = REPEAT("a", 3500) col_2_text = REPEAT("o", 3500)
|
||||
1 1
|
||||
"In connection default ....restarting the server"
|
||||
SELECT COUNT(*) FROM worklog5743;
|
||||
COUNT(*)
|
||||
1
|
||||
SELECT col_1_text = REPEAT("a", 3500) , col_2_text = REPEAT("o", 3500) FROM
|
||||
worklog5743;
|
||||
col_1_text = REPEAT("a", 3500) col_2_text = REPEAT("o", 3500)
|
||||
1 1
|
||||
"In connection 1"
|
||||
SELECT col_1_text = REPEAT("a", 3500) , col_2_text = REPEAT("o", 3500) FROM
|
||||
worklog5743;
|
||||
col_1_text = REPEAT("a", 3500) col_2_text = REPEAT("o", 3500)
|
||||
1 1
|
||||
SELECT COUNT(*) FROM worklog5743;
|
||||
COUNT(*)
|
||||
1
|
||||
START TRANSACTION;
|
||||
UPDATE worklog5743 SET col_1_text = REPEAT("b", 3500) WHERE col_1_text = REPEAT("a", 3500);
|
||||
SELECT col_1_text = REPEAT("b", 3500) , col_2_text = REPEAT("o", 3500) FROM
|
||||
worklog5743;
|
||||
col_1_text = REPEAT("b", 3500) col_2_text = REPEAT("o", 3500)
|
||||
1 1
|
||||
"In connection default ....restarting the server"
|
||||
SELECT COUNT(*) FROM worklog5743;
|
||||
COUNT(*)
|
||||
1
|
||||
SELECT col_1_text = REPEAT("a", 3500) , col_2_text = REPEAT("o", 3500) FROM
|
||||
worklog5743;
|
||||
col_1_text = REPEAT("a", 3500) col_2_text = REPEAT("o", 3500)
|
||||
1 1
|
||||
DROP TABLE worklog5743;
|
||||
SET GLOBAL innodb_file_format=Antelope;
|
||||
SET GLOBAL innodb_file_per_table=0;
|
||||
SET GLOBAL innodb_file_format_max=Antelope;
|
||||
SET GLOBAL innodb_large_prefix=0;
|
@ -426,36 +426,36 @@ create table t1(a blob,b blob,c blob,d blob,e blob,f blob,g blob,h blob,
|
||||
i blob,j blob,k blob,l blob,m blob,n blob,o blob,p blob,
|
||||
q blob,r blob,s blob,t blob,u blob)
|
||||
engine=innodb row_format=dynamic;
|
||||
create index t1a on t1 (a(1));
|
||||
create index t1b on t1 (b(1));
|
||||
create index t1c on t1 (c(1));
|
||||
create index t1d on t1 (d(1));
|
||||
create index t1e on t1 (e(1));
|
||||
create index t1f on t1 (f(1));
|
||||
create index t1g on t1 (g(1));
|
||||
create index t1h on t1 (h(1));
|
||||
create index t1i on t1 (i(1));
|
||||
create index t1j on t1 (j(1));
|
||||
create index t1k on t1 (k(1));
|
||||
create index t1l on t1 (l(1));
|
||||
create index t1m on t1 (m(1));
|
||||
create index t1n on t1 (n(1));
|
||||
create index t1o on t1 (o(1));
|
||||
create index t1p on t1 (p(1));
|
||||
create index t1q on t1 (q(1));
|
||||
create index t1r on t1 (r(1));
|
||||
create index t1s on t1 (s(1));
|
||||
create index t1t on t1 (t(1));
|
||||
create index t1a on t1 (a(767));
|
||||
create index t1b on t1 (b(767));
|
||||
create index t1c on t1 (c(767));
|
||||
create index t1d on t1 (d(767));
|
||||
create index t1e on t1 (e(767));
|
||||
create index t1f on t1 (f(767));
|
||||
create index t1g on t1 (g(767));
|
||||
create index t1h on t1 (h(767));
|
||||
create index t1i on t1 (i(767));
|
||||
create index t1j on t1 (j(767));
|
||||
create index t1k on t1 (k(767));
|
||||
create index t1l on t1 (l(767));
|
||||
create index t1m on t1 (m(767));
|
||||
create index t1n on t1 (n(767));
|
||||
create index t1o on t1 (o(767));
|
||||
create index t1p on t1 (p(767));
|
||||
create index t1q on t1 (q(767));
|
||||
create index t1r on t1 (r(767));
|
||||
create index t1s on t1 (s(767));
|
||||
create index t1t on t1 (t(767));
|
||||
--error 139
|
||||
create index t1u on t1 (u(1));
|
||||
create index t1u on t1 (u(767));
|
||||
--error 139
|
||||
create index t1ut on t1 (u(1), t(1));
|
||||
create index t1st on t1 (s(1), t(1));
|
||||
create index t1ut on t1 (u(767), t(767));
|
||||
create index t1st on t1 (s(767), t(767));
|
||||
show create table t1;
|
||||
--error 139
|
||||
create index t1u on t1 (u(1));
|
||||
create index t1u on t1 (u(767));
|
||||
alter table t1 row_format=compact;
|
||||
create index t1u on t1 (u(1));
|
||||
create index t1u on t1 (u(767));
|
||||
|
||||
drop table t1;
|
||||
|
||||
|
271
mysql-test/suite/innodb/t/innodb_index_large_prefix.test
Normal file
271
mysql-test/suite/innodb/t/innodb_index_large_prefix.test
Normal file
@ -0,0 +1,271 @@
|
||||
# Testcase for worklog #5743: Lift the limit of index key prefixes
|
||||
|
||||
--source include/have_innodb.inc
|
||||
|
||||
let $innodb_file_format_orig=`select @@innodb_file_format`;
|
||||
let $innodb_file_per_table_orig=`select @@innodb_file_per_table`;
|
||||
let $innodb_file_format_max_orig=`select @@innodb_file_format_max`;
|
||||
let $innodb_large_prefix_orig=`select @@innodb_large_prefix`;
|
||||
|
||||
set global innodb_file_format="Barracuda";
|
||||
set global innodb_file_per_table=1;
|
||||
set global innodb_large_prefix=1;
|
||||
|
||||
# Create a table of DYNAMIC format, with a primary index of 1000 bytes in
|
||||
# size
|
||||
create table worklog5743(a TEXT not null, primary key (a(1000)))
|
||||
ROW_FORMAT=DYNAMIC, engine = innodb;
|
||||
|
||||
# Do some insertion and update to excercise the external cache
|
||||
# code path
|
||||
insert into worklog5743 values(repeat("a", 20000));
|
||||
|
||||
# default session, update the table
|
||||
update worklog5743 set a = (repeat("b", 16000));
|
||||
|
||||
# Create a secondary index
|
||||
create index idx on worklog5743(a(2000));
|
||||
|
||||
# Start a few sessions to do selections on table being updated in default
|
||||
# session, so it would rebuild the previous version from undo log.
|
||||
# 1) Default session: Initiate an update on the externally stored column
|
||||
# 2) Session con1: Select from table with repeated read
|
||||
# 3) Session con2: Select from table with read uncommitted
|
||||
# 4) Default session: rollback updates
|
||||
|
||||
begin;
|
||||
update worklog5743 set a = (repeat("x", 17000));
|
||||
|
||||
# Start a new session to select the column to force it build
|
||||
# an earlier version of the clustered index through undo log. So it should
|
||||
# just see the result of repeat("b", 16000)
|
||||
select @@session.tx_isolation;
|
||||
--connect (con1,localhost,root,,)
|
||||
select a = repeat("x", 17000) from worklog5743;
|
||||
select a = repeat("b", 16000) from worklog5743;
|
||||
|
||||
# Start another session doing "read uncommitted" query, it
|
||||
# should see the uncommitted update
|
||||
--connect (con2,localhost,root,,)
|
||||
SET SESSION TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
|
||||
select @@session.tx_isolation;
|
||||
select a = repeat("x", 17000) from worklog5743;
|
||||
|
||||
# Roll back the transaction
|
||||
--connection default
|
||||
rollback;
|
||||
|
||||
drop table worklog5743;
|
||||
|
||||
# Create a table with only a secondary index has large prefix column
|
||||
create table worklog5743(a1 int, a2 TEXT not null)
|
||||
ROW_FORMAT=DYNAMIC, engine = innodb;
|
||||
|
||||
create index idx on worklog5743(a1, a2(2000));
|
||||
|
||||
insert into worklog5743 values(9, repeat("a", 10000));
|
||||
|
||||
begin;
|
||||
|
||||
update worklog5743 set a1 = 1000;
|
||||
|
||||
# Do a select from another connection that would use the secondary index
|
||||
--connection con1
|
||||
select @@session.tx_isolation;
|
||||
explain select a1, a2 = repeat("a", 10000) from worklog5743 where a1 = 9;
|
||||
select a1, a2 = repeat("a", 10000) from worklog5743 where a1 = 9;
|
||||
|
||||
# Do read uncommitted in another session, it would show there is no
|
||||
# row with a1 = 9
|
||||
--connection con2
|
||||
SET SESSION TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
|
||||
select @@session.tx_isolation;
|
||||
select a1, a2 = repeat("a", 10000) from worklog5743 where a1 = 9;
|
||||
|
||||
--connection default
|
||||
rollback;
|
||||
|
||||
drop table worklog5743;
|
||||
|
||||
# Create a table with a secondary index has small (50 bytes) prefix column
|
||||
create table worklog5743(a1 int, a2 TEXT not null)
|
||||
ROW_FORMAT=DYNAMIC, engine = innodb;
|
||||
|
||||
create index idx on worklog5743(a1, a2(50));
|
||||
|
||||
insert into worklog5743 values(9, repeat("a", 10000));
|
||||
|
||||
begin;
|
||||
|
||||
update worklog5743 set a1 = 1000;
|
||||
|
||||
# Do a select from another connection that would use the secondary index
|
||||
--connection con1
|
||||
select @@session.tx_isolation;
|
||||
explain select a1, a2 = repeat("a", 10000) from worklog5743 where a1 = 9;
|
||||
select a1, a2 = repeat("a", 10000) from worklog5743 where a1 = 9;
|
||||
|
||||
# Do read uncommitted in another session, it would show there is no
|
||||
# row with a1 = 9
|
||||
--connection con2
|
||||
SET SESSION TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
|
||||
select @@session.tx_isolation;
|
||||
select a1, a2 = repeat("a", 10000) from worklog5743 where a1 = 9;
|
||||
|
||||
--connection default
|
||||
rollback;
|
||||
|
||||
drop table worklog5743;
|
||||
|
||||
# Create a table of ROW_FORMAT=COMPRESSED format
|
||||
create table worklog5743_2(a1 int, a2 TEXT not null)
|
||||
ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=2, engine = innodb;
|
||||
|
||||
create table worklog5743_4(a1 int, a2 TEXT not null)
|
||||
ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=4, engine = innodb;
|
||||
|
||||
# The maximum overall index record (not prefix) length for this table
|
||||
# is page_zip_empty_size() / 2, which is 960. "Too big row" error (
|
||||
# HA_ERR_TO_BIG_ROW) will be printed if this limit is exceeded.
|
||||
# Considering other fields and their overhead, the maximum length
|
||||
# for column a2 is 940 or 941 depending on the zlib version used and
|
||||
# compressBound() value used in page_zip_empty_size() (please refer
|
||||
# to Bug #47495 for more detail).
|
||||
-- error 139
|
||||
create index idx1 on worklog5743_2(a1, a2(942));
|
||||
|
||||
create index idx1 on worklog5743_2(a1, a2(940));
|
||||
|
||||
# similarly, the maximum index record length for the table is
|
||||
# 1984. Considering other fields and their overhead, the
|
||||
# maximum length for column a2 is 1964 or 1965 (please refer
|
||||
# to Bug #47495 for more detail).
|
||||
-- error 139
|
||||
create index idx1 on worklog5743_4(a1, a2(1966));
|
||||
|
||||
create index idx1 on worklog5743_4(a1, a2(1964));
|
||||
|
||||
insert into worklog5743_2 values(9, repeat("a", 10000));
|
||||
insert into worklog5743_4 values(9, repeat("a", 10000));
|
||||
|
||||
begin;
|
||||
|
||||
update worklog5743_2 set a1 = 1000;
|
||||
update worklog5743_4 set a1 = 1000;
|
||||
|
||||
# Do a select from another connection that would use the secondary index
|
||||
--connection con1
|
||||
select @@session.tx_isolation;
|
||||
explain select a1, a2 = repeat("a", 10000) from worklog5743_2 where a1 = 9;
|
||||
select a1, a2 = repeat("a", 10000) from worklog5743_2 where a1 = 9;
|
||||
select a1, a2 = repeat("a", 10000) from worklog5743_4 where a1 = 9;
|
||||
|
||||
# Do read uncommitted in another session, it would show there is no
|
||||
# row with a1 = 9
|
||||
--connection con2
|
||||
SET SESSION TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
|
||||
select @@session.tx_isolation;
|
||||
select a1, a2 = repeat("a", 10000) from worklog5743_2 where a1 = 9;
|
||||
select a1, a2 = repeat("a", 10000) from worklog5743_4 where a1 = 9;
|
||||
|
||||
--connection default
|
||||
rollback;
|
||||
|
||||
drop table worklog5743_2;
|
||||
drop table worklog5743_4;
|
||||
|
||||
# Create a table with varchar column, and create index directly on this
|
||||
# large column (without prefix)
|
||||
create table worklog5743(a1 int, a2 varchar(3000))
|
||||
ROW_FORMAT=DYNAMIC, engine = innodb;
|
||||
|
||||
# Create an index with large column without prefix
|
||||
create index idx on worklog5743(a1, a2);
|
||||
|
||||
insert into worklog5743 values(9, repeat("a", 3000));
|
||||
|
||||
begin;
|
||||
|
||||
update worklog5743 set a1 = 1000;
|
||||
|
||||
# Do a select from another connection that would use the secondary index
|
||||
--connection con1
|
||||
select @@session.tx_isolation;
|
||||
explain select a1 from worklog5743 where a1 = 9;
|
||||
select a1 from worklog5743 where a1 = 9;
|
||||
|
||||
# Do read uncommitted, it would show there is no row with a1 = 9
|
||||
--connection con2
|
||||
SET SESSION TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
|
||||
select @@session.tx_isolation;
|
||||
select a1 from worklog5743 where a1 = 9;
|
||||
|
||||
--connection default
|
||||
rollback;
|
||||
|
||||
drop table worklog5743;
|
||||
|
||||
# Create a table with old format, and the limit is 768 bytes.
|
||||
-- error ER_INDEX_COLUMN_TOO_LONG
|
||||
create table worklog5743(a TEXT not null, primary key (a(1000)))
|
||||
engine = innodb;
|
||||
|
||||
create table worklog5743(a TEXT) engine = innodb;
|
||||
|
||||
# Excercise the column length check in ha_innobase::add_index()
|
||||
-- error ER_INDEX_COLUMN_TOO_LONG
|
||||
create index idx on worklog5743(a(1000));
|
||||
|
||||
# This should be successful
|
||||
create index idx on worklog5743(a(725));
|
||||
|
||||
# Perform some DMLs
|
||||
insert into worklog5743 values(repeat("a", 20000));
|
||||
|
||||
begin;
|
||||
insert into worklog5743 values(repeat("b", 20000));
|
||||
update worklog5743 set a = (repeat("x", 25000));
|
||||
|
||||
# Start a new session to select the table to force it build
|
||||
# an earlier version of the cluster index through undo log
|
||||
select @@session.tx_isolation;
|
||||
--connection con1
|
||||
select a = repeat("a", 20000) from worklog5743;
|
||||
|
||||
--connection con2
|
||||
SET SESSION TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
|
||||
select @@session.tx_isolation;
|
||||
select a = repeat("x", 25000) from worklog5743;
|
||||
|
||||
--connection default
|
||||
rollback;
|
||||
|
||||
drop table worklog5743;
|
||||
|
||||
# Some border line test on the column length.
|
||||
# We have a limit of 3072 bytes for Barracuda table
|
||||
create table worklog5743(a TEXT not null) ROW_FORMAT=DYNAMIC, engine = innodb;
|
||||
|
||||
# Length exceeds maximum supported key length, will auto-truncated to 3072
|
||||
create index idx on worklog5743(a(3073));
|
||||
|
||||
create index idx2 on worklog5743(a(3072));
|
||||
|
||||
show create table worklog5743;
|
||||
|
||||
drop table worklog5743;
|
||||
|
||||
# We have a limit of 767 bytes for Antelope table
|
||||
create table worklog5743(a TEXT not null) engine = innodb;
|
||||
|
||||
-- error ER_INDEX_COLUMN_TOO_LONG
|
||||
create index idx on worklog5743(a(768));
|
||||
|
||||
create index idx2 on worklog5743(a(767));
|
||||
|
||||
drop table worklog5743;
|
||||
|
||||
eval SET GLOBAL innodb_file_format=$innodb_file_format_orig;
|
||||
eval SET GLOBAL innodb_file_per_table=$innodb_file_per_table_orig;
|
||||
eval SET GLOBAL innodb_file_format_max=$innodb_file_format_max_orig;
|
||||
eval SET GLOBAL innodb_large_prefix=$innodb_large_prefix_orig;
|
@ -830,8 +830,6 @@ SET SESSION sort_buffer_size = DEFAULT;
|
||||
|
||||
DROP TABLE t1;
|
||||
|
||||
--echo End of 5.1 tests
|
||||
|
||||
|
||||
--echo #
|
||||
--echo # Test for bug #39932 "create table fails if column for FK is in different
|
||||
@ -851,6 +849,28 @@ show create table t2;
|
||||
drop table t2, t1;
|
||||
|
||||
|
||||
--echo #
|
||||
--echo # Test for bug #11762012 - "54553: INNODB ASSERTS IN HA_INNOBASE::
|
||||
--echo # UPDATE_ROW, TEMPORARY TABLE, TABLE LOCK".
|
||||
--echo #
|
||||
--disable_warnings
|
||||
DROP TABLE IF EXISTS t1;
|
||||
--enable_warnings
|
||||
CREATE TEMPORARY TABLE t1 (c int) ENGINE = InnoDB;
|
||||
INSERT INTO t1 VALUES (1);
|
||||
LOCK TABLES t1 READ;
|
||||
--echo # Even though temporary table was locked for READ we
|
||||
--echo # still allow writes to it to be compatible with MyISAM.
|
||||
--echo # This is possible since due to fact that temporary tables
|
||||
--echo # are specific to connection and therefore locking for them
|
||||
--echo # is irrelevant.
|
||||
UPDATE t1 SET c = 5;
|
||||
UNLOCK TABLES;
|
||||
DROP TEMPORARY TABLE t1;
|
||||
|
||||
--echo End of 5.1 tests
|
||||
|
||||
|
||||
--echo #
|
||||
--echo # Bug#44613 SELECT statement inside FUNCTION takes a shared lock
|
||||
--echo #
|
||||
|
1339
mysql-test/suite/innodb/t/innodb_prefix_index_liftedlimit.test
Normal file
1339
mysql-test/suite/innodb/t/innodb_prefix_index_liftedlimit.test
Normal file
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,125 @@
|
||||
######## suite/innodb/t/innodb_prefix_iindex_restart_server.test #####
|
||||
# #
|
||||
# Testcase for worklog WL#5743: Lift the limit of index key prefixes #
|
||||
# Test scenario : Stop the server in between when prefix index are #
|
||||
# created and see if state is preserved after restart #
|
||||
# #
|
||||
# Creation: #
|
||||
# 2011-06-02 Implemented this test as part of WL#5743 #
|
||||
# #
|
||||
######################################################################
|
||||
|
||||
# Test restart the server and "shutdown_server" looks for pid file
|
||||
# which is not there with embedded mode
|
||||
--source include/not_embedded.inc
|
||||
--source include/have_innodb.inc
|
||||
# Save innodb variables
|
||||
let $innodb_file_format_orig=`select @@innodb_file_format`;
|
||||
let $innodb_file_per_table_orig=`select @@innodb_file_per_table`;
|
||||
let $innodb_file_format_max_orig=`select @@innodb_file_format_max`;
|
||||
let $innodb_large_prefix_orig=`select @@innodb_large_prefix`;
|
||||
|
||||
# Set Innodb file format as feature works for Barracuda file format
|
||||
set global innodb_file_format="Barracuda";
|
||||
set global innodb_file_per_table=1;
|
||||
set global innodb_large_prefix=1;
|
||||
|
||||
-- disable_warnings
|
||||
DROP TABLE IF EXISTS worklog5743;
|
||||
-- enable_warnings
|
||||
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
# Stop the server in between when prefix index are created and see if state is
|
||||
# correct when server is restarted.
|
||||
# Server is restarted at differnt points.
|
||||
|
||||
CREATE TABLE worklog5743 (
|
||||
col_1_text TEXT(4000) , col_2_text TEXT(4000) ,
|
||||
PRIMARY KEY (col_1_text(3072))
|
||||
) ROW_FORMAT=DYNAMIC, engine = innodb;
|
||||
INSERT INTO worklog5743 VALUES(REPEAT("a", 3500) , REPEAT("o", 3500));
|
||||
SELECT col_1_text = REPEAT("a", 3500) , col_2_text = REPEAT("o", 3500) FROM
|
||||
worklog5743;
|
||||
|
||||
--echo "In connection 1"
|
||||
--connect (con1,localhost,root,,)
|
||||
SELECT col_1_text = REPEAT("a", 3500) , col_2_text = REPEAT("o", 3500) FROM
|
||||
worklog5743;
|
||||
SELECT COUNT(*) FROM worklog5743;
|
||||
|
||||
|
||||
--echo "In connection 2"
|
||||
--connect (con2,localhost,root,,)
|
||||
START TRANSACTION;
|
||||
INSERT INTO worklog5743 VALUES(REPEAT("b", 3500) , REPEAT("o", 3500));
|
||||
|
||||
|
||||
--echo "In connection 1"
|
||||
--connection con1
|
||||
SELECT col_1_text = REPEAT("a", 3500) , col_2_text = REPEAT("o", 3500) FROM
|
||||
worklog5743;
|
||||
SELECT COUNT(*) FROM worklog5743;
|
||||
START TRANSACTION;
|
||||
|
||||
|
||||
--echo "In connection default ....restarting the server"
|
||||
--connection default
|
||||
# Restart the server
|
||||
-- source include/restart_mysqld.inc
|
||||
SELECT COUNT(*) FROM worklog5743;
|
||||
SELECT col_1_text = REPEAT("a", 3500) , col_2_text = REPEAT("o", 3500) FROM
|
||||
worklog5743;
|
||||
|
||||
--disconnect con1
|
||||
--disconnect con2
|
||||
|
||||
--echo "In connection 1"
|
||||
--connect (con1,localhost,root,,)
|
||||
SELECT col_1_text = REPEAT("a", 3500) , col_2_text = REPEAT("o", 3500) FROM
|
||||
worklog5743;
|
||||
SELECT COUNT(*) FROM worklog5743;
|
||||
START TRANSACTION;
|
||||
INSERT INTO worklog5743 VALUES(REPEAT("b", 3500) , REPEAT("o", 3500));
|
||||
DELETE FROM worklog5743 WHERE col_1_text = REPEAT("b", 3500);
|
||||
SELECT col_1_text = REPEAT("a", 3500) , col_2_text = REPEAT("o", 3500) FROM
|
||||
worklog5743;
|
||||
|
||||
--echo "In connection default ....restarting the server"
|
||||
--connection default
|
||||
# Restart the server
|
||||
-- source include/restart_mysqld.inc
|
||||
SELECT COUNT(*) FROM worklog5743;
|
||||
SELECT col_1_text = REPEAT("a", 3500) , col_2_text = REPEAT("o", 3500) FROM
|
||||
worklog5743;
|
||||
|
||||
--disconnect con1
|
||||
|
||||
--echo "In connection 1"
|
||||
--connect (con2,localhost,root,,)
|
||||
SELECT col_1_text = REPEAT("a", 3500) , col_2_text = REPEAT("o", 3500) FROM
|
||||
worklog5743;
|
||||
SELECT COUNT(*) FROM worklog5743;
|
||||
START TRANSACTION;
|
||||
UPDATE worklog5743 SET col_1_text = REPEAT("b", 3500) WHERE col_1_text = REPEAT("a", 3500);
|
||||
SELECT col_1_text = REPEAT("b", 3500) , col_2_text = REPEAT("o", 3500) FROM
|
||||
worklog5743;
|
||||
|
||||
--echo "In connection default ....restarting the server"
|
||||
--connection default
|
||||
# Restart the server
|
||||
-- source include/restart_mysqld.inc
|
||||
SELECT COUNT(*) FROM worklog5743;
|
||||
SELECT col_1_text = REPEAT("a", 3500) , col_2_text = REPEAT("o", 3500) FROM
|
||||
worklog5743;
|
||||
|
||||
DROP TABLE worklog5743;
|
||||
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
eval SET GLOBAL innodb_file_format=$innodb_file_format_orig;
|
||||
eval SET GLOBAL innodb_file_per_table=$innodb_file_per_table_orig;
|
||||
eval SET GLOBAL innodb_file_format_max=$innodb_file_format_max_orig;
|
||||
eval SET GLOBAL innodb_large_prefix=$innodb_large_prefix_orig;
|
||||
|
@ -17,6 +17,7 @@
|
||||
|
||||
--source include/not_embedded.inc
|
||||
--source include/have_perfschema.inc
|
||||
--source include/not_threadpool.inc
|
||||
|
||||
|
||||
# Setup : in this main thread
|
||||
|
@ -17,6 +17,7 @@
|
||||
|
||||
--source include/not_embedded.inc
|
||||
--source include/have_perfschema.inc
|
||||
--source include/not_threadpool.inc
|
||||
|
||||
# Setup
|
||||
|
||||
|
@ -93,4 +93,31 @@ Slave 44
|
||||
DROP TABLE t1;
|
||||
SET SESSION sql_mode=@old_mode;
|
||||
[slave]
|
||||
|
||||
Bug #60580/#11902767:
|
||||
"statement improperly replicated crashes slave sql thread"
|
||||
|
||||
[master]
|
||||
CREATE TABLE t1(f1 INT, f2 INT);
|
||||
CREATE TABLE t2(f1 INT, f2 TIMESTAMP);
|
||||
INSERT INTO t2 VALUES(1, '2011-03-22 21:01:28');
|
||||
INSERT INTO t2 VALUES(2, '2011-03-21 21:01:28');
|
||||
INSERT INTO t2 VALUES(3, '2011-03-20 21:01:28');
|
||||
CREATE TABLE t3 AS SELECT * FROM t2;
|
||||
CREATE VIEW v1 AS SELECT * FROM t2
|
||||
WHERE f1 IN (SELECT f1 FROM t3 WHERE (t3.f2 IS NULL));
|
||||
SELECT 1 INTO OUTFILE 'MYSQLD_DATADIR/bug60580.csv' FROM DUAL;
|
||||
LOAD DATA LOCAL INFILE 'MYSQLD_DATADIR/bug60580.csv' INTO TABLE t1 (@f1) SET f2 = (SELECT f1 FROM v1 WHERE f1=@f1);
|
||||
SELECT * FROM t1;
|
||||
f1 f2
|
||||
NULL NULL
|
||||
[slave]
|
||||
SELECT * FROM t1;
|
||||
f1 f2
|
||||
NULL NULL
|
||||
[master]
|
||||
DROP VIEW v1;
|
||||
DROP TABLE t1, t2, t3;
|
||||
[slave]
|
||||
include/rpl_end.inc
|
||||
# End of 5.1 tests
|
||||
|
@ -1,7 +1,6 @@
|
||||
include/master-slave.inc
|
||||
[connection master]
|
||||
stop slave;
|
||||
include/wait_for_slave_to_stop.inc
|
||||
include/stop_slave.inc
|
||||
create table t1 (a int);
|
||||
drop table t1;
|
||||
create table t1 (a int);
|
||||
@ -9,10 +8,8 @@ drop table t1;
|
||||
reset slave;
|
||||
start slave io_thread;
|
||||
include/wait_for_slave_param.inc [Slave_IO_State]
|
||||
stop slave io_thread;
|
||||
include/stop_slave_io.inc
|
||||
reset slave;
|
||||
start slave;
|
||||
select master_pos_wait('master-bin.001',200,6)=-1;
|
||||
master_pos_wait('master-bin.001',200,6)=-1
|
||||
0
|
||||
include/start_slave.inc
|
||||
include/assert.inc [Assert that master_pos_wait does not timeout nor it returns NULL]
|
||||
include/rpl_end.inc
|
||||
|
@ -8,8 +8,7 @@ SHOW SLAVE HOSTS;
|
||||
Server_id Host Port Master_id
|
||||
3 slave2 DEFAULT_PORT 1
|
||||
2 SLAVE_PORT 1
|
||||
STOP SLAVE IO_THREAD;
|
||||
include/wait_for_slave_io_to_stop.inc
|
||||
include/stop_slave_io.inc
|
||||
SHOW SLAVE HOSTS;
|
||||
Server_id Host Port Master_id
|
||||
2 SLAVE_PORT 1
|
||||
|
@ -534,7 +534,7 @@ BIT(6) BIT(5) ALL_LOSSY,ALL_NON_LOSSY <Correct value>
|
||||
BIT(5) BIT(12) ALL_LOSSY,ALL_NON_LOSSY <Correct value>
|
||||
BIT(12) BIT(5) ALL_LOSSY,ALL_NON_LOSSY <Correct value>
|
||||
DROP TABLE type_conversions;
|
||||
call mtr.add_suppression("Slave SQL.*Column 0 of table .test.t1. cannot be converted from type.* Error_code: 1677");
|
||||
call mtr.add_suppression("Slave SQL.*Column 1 of table .test.t1. cannot be converted from type.* Error_code: 1677");
|
||||
DROP TABLE t1;
|
||||
set global slave_type_conversions = @saved_slave_type_conversions;
|
||||
include/rpl_end.inc
|
||||
|
@ -10,8 +10,8 @@
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
rpl_row_create_table : Bug#51574 2010-02-27 andrei failed different way than earlier with bug#45576
|
||||
rpl_spec_variables : BUG#47661 2009-10-27 jasonh rpl_spec_variables fails on PB2 hpux
|
||||
rpl_get_master_version_and_clock : Bug#59178 Jan 05 2011 joro Valgrind warnings rpl_get_master_version_and_clock
|
||||
rpl_row_create_table : Bug#11759274 2010-02-27 andrei failed different way than earlier with bug#45576
|
||||
rpl_spec_variables : BUG#11755836 2009-10-27 jasonh rpl_spec_variables fails on PB2 hpux
|
||||
rpl_get_master_version_and_clock : Bug#11766137 Jan 05 2011 joro Valgrind warnings rpl_get_master_version_and_clock
|
||||
rpl_row_until : BUG#59543 Jan 26 2011 alfranio Replication test from eits suite rpl_row_until times out
|
||||
rpl_stm_until : BUG#59543 Jan 26 2011 alfranio Replication test from eits suite rpl_row_until times out
|
||||
|
@ -185,5 +185,56 @@ SET SESSION sql_mode=@old_mode;
|
||||
--echo [slave]
|
||||
sync_slave_with_master;
|
||||
|
||||
connection master;
|
||||
|
||||
--echo
|
||||
--echo Bug #60580/#11902767:
|
||||
--echo "statement improperly replicated crashes slave sql thread"
|
||||
--echo
|
||||
|
||||
--echo [master]
|
||||
connection master;
|
||||
let $MYSQLD_DATADIR= `select @@datadir`;
|
||||
|
||||
CREATE TABLE t1(f1 INT, f2 INT);
|
||||
CREATE TABLE t2(f1 INT, f2 TIMESTAMP);
|
||||
|
||||
INSERT INTO t2 VALUES(1, '2011-03-22 21:01:28');
|
||||
INSERT INTO t2 VALUES(2, '2011-03-21 21:01:28');
|
||||
INSERT INTO t2 VALUES(3, '2011-03-20 21:01:28');
|
||||
|
||||
CREATE TABLE t3 AS SELECT * FROM t2;
|
||||
|
||||
CREATE VIEW v1 AS SELECT * FROM t2
|
||||
WHERE f1 IN (SELECT f1 FROM t3 WHERE (t3.f2 IS NULL));
|
||||
|
||||
--replace_result $MYSQLD_DATADIR MYSQLD_DATADIR
|
||||
eval SELECT 1 INTO OUTFILE '$MYSQLD_DATADIR/bug60580.csv' FROM DUAL;
|
||||
|
||||
--replace_result $MYSQLD_DATADIR MYSQLD_DATADIR
|
||||
eval LOAD DATA LOCAL INFILE '$MYSQLD_DATADIR/bug60580.csv' INTO TABLE t1 (@f1) SET f2 = (SELECT f1 FROM v1 WHERE f1=@f1);
|
||||
|
||||
SELECT * FROM t1;
|
||||
|
||||
sleep 1;
|
||||
|
||||
--echo [slave]
|
||||
sync_slave_with_master;
|
||||
|
||||
SELECT * FROM t1;
|
||||
|
||||
--remove_file $MYSQLD_DATADIR/bug60580.csv
|
||||
|
||||
--echo [master]
|
||||
connection master;
|
||||
|
||||
DROP VIEW v1;
|
||||
DROP TABLE t1, t2, t3;
|
||||
|
||||
--echo [slave]
|
||||
sync_slave_with_master;
|
||||
|
||||
connection master;
|
||||
--source include/rpl_end.inc
|
||||
|
||||
--echo # End of 5.1 tests
|
||||
|
@ -2,9 +2,9 @@
|
||||
# to force the deadlock after one event.
|
||||
|
||||
source include/master-slave.inc;
|
||||
--let $master_log_file= query_get_value(SHOW MASTER STATUS, File, 1)
|
||||
connection slave;
|
||||
stop slave;
|
||||
--source include/wait_for_slave_to_stop.inc
|
||||
--source include/stop_slave.inc
|
||||
connection master;
|
||||
# This will generate a master's binlog > 10 bytes
|
||||
create table t1 (a int);
|
||||
@ -20,20 +20,33 @@ let $slave_param_value= Waiting for the slave SQL thread to free enough relay lo
|
||||
source include/wait_for_slave_param.inc;
|
||||
|
||||
# A bug caused the I/O thread to refuse stopping.
|
||||
stop slave io_thread;
|
||||
--source include/stop_slave_io.inc
|
||||
reset slave;
|
||||
start slave;
|
||||
# The I/O thread stops filling the relay log when
|
||||
# it's >10b. And the SQL thread cannot purge this relay log
|
||||
# as purge is done only when the SQL thread switches to another
|
||||
# relay log, which does not exist here.
|
||||
# So we should have a deadlock.
|
||||
# if it is not resolved automatically we'll detect
|
||||
# it with master_pos_wait that waits for farther than 1Ob;
|
||||
# it will timeout after 10 seconds;
|
||||
# also the slave will probably not cooperate to shutdown
|
||||
# (as 2 threads are locked)
|
||||
select master_pos_wait('master-bin.001',200,6)=-1;
|
||||
--source include/start_slave.inc
|
||||
|
||||
# The I/O thread stops filling the relay log when it's >10b. And the
|
||||
# SQL thread cannot purge this relay log as purge is done only when
|
||||
# the SQL thread switches to another relay log, which does not exist
|
||||
# here. So we should have a deadlock. If it is not resolved
|
||||
# automatically we'll detect it with master_pos_wait that waits for
|
||||
# farther than 1Ob; it will timeout after 300 seconds (which is inline
|
||||
# with the default used for sync_slave_with_master and will protect us
|
||||
# against slow test envs); also the slave will probably not cooperate
|
||||
# to shutdown (as 2 threads are locked)
|
||||
--let $outcome= `SELECT MASTER_POS_WAIT('$master_log_file',200,300) AS mpw;`
|
||||
|
||||
# master_pos_wait returns:
|
||||
#
|
||||
# * >= 0, the number of events the slave had to wait to advance to the
|
||||
# position
|
||||
#
|
||||
# * -1, if there was a timeout
|
||||
#
|
||||
# * NULL, if an error occurred, or the SQL thread was not started,
|
||||
# slave master info is not initialized, the arguments are incorrect
|
||||
--let $assert_text= Assert that master_pos_wait does not timeout nor it returns NULL
|
||||
--let $assert_cond= $outcome IS NOT NULL AND $outcome <> -1
|
||||
--source include/assert.inc
|
||||
|
||||
# End of 4.1 tests
|
||||
--source include/rpl_end.inc
|
||||
|
@ -23,14 +23,13 @@ connection master;
|
||||
let $show_statement= SHOW SLAVE HOSTS;
|
||||
let $field= Server_id;
|
||||
# 3 is server_id of slave2.
|
||||
let $connection= ='3';
|
||||
let $condition= ='3';
|
||||
source include/wait_show_condition.inc;
|
||||
--replace_result $SLAVE_MYPORT SLAVE_PORT $DEFAULT_MASTER_PORT DEFAULT_PORT
|
||||
SHOW SLAVE HOSTS;
|
||||
|
||||
connection slave2;
|
||||
STOP SLAVE IO_THREAD;
|
||||
source include/wait_for_slave_io_to_stop.inc;
|
||||
--source include/stop_slave_io.inc
|
||||
|
||||
connection master;
|
||||
let $show_statement= SHOW SLAVE HOSTS;
|
||||
|
1
mysql-test/suite/rpl/t/rpl_typeconv-master.opt
Normal file
1
mysql-test/suite/rpl/t/rpl_typeconv-master.opt
Normal file
@ -0,0 +1 @@
|
||||
--testcase-timeout=40
|
@ -61,7 +61,7 @@ SELECT RPAD(Source, 15, ' ') AS Source_Type,
|
||||
enable_query_log;
|
||||
DROP TABLE type_conversions;
|
||||
|
||||
call mtr.add_suppression("Slave SQL.*Column 0 of table .test.t1. cannot be converted from type.* Error_code: 1677");
|
||||
call mtr.add_suppression("Slave SQL.*Column 1 of table .test.t1. cannot be converted from type.* Error_code: 1677");
|
||||
|
||||
connection master;
|
||||
DROP TABLE t1;
|
||||
|
@ -14,8 +14,10 @@ There should be *no* variables listed below:
|
||||
INNODB_ROLLBACK_SEGMENTS
|
||||
INNODB_STATS_METHOD
|
||||
INNODB_FILE_FORMAT_MAX
|
||||
INNODB_LARGE_PREFIX
|
||||
INNODB_ROLLBACK_SEGMENTS
|
||||
INNODB_STATS_METHOD
|
||||
INNODB_FILE_FORMAT_MAX
|
||||
INNODB_LARGE_PREFIX
|
||||
drop table t1;
|
||||
drop table t2;
|
||||
|
@ -14,6 +14,7 @@
|
||||
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
--source include/not_embedded.inc
|
||||
--source include/not_threadpool.inc
|
||||
|
||||
# 2010-01-28 OBN Added support to load 'innodb' and 'semisync' if possible.
|
||||
# As we need to have there variables loaded if the components exist but do
|
||||
|
@ -9,9 +9,9 @@
|
||||
# Do not use any TAB characters for whitespace.
|
||||
#
|
||||
##############################################################################
|
||||
query_cache_size_basic_32 : Bug#36747: Allocating a large query cache is not deterministic
|
||||
query_cache_size_basic_64 : Bug#36747: Allocating a large query cache is not deterministic
|
||||
transaction_prealloc_size_basic_32 : Bug#36747
|
||||
transaction_prealloc_size_basic_64 : Bug#36747
|
||||
#thread_cache_size_func : Bug#40575: 2008-11-07 joro main.thread_cache_size_func fails in pushbuild when run with pool of threads
|
||||
query_cache_size_basic_32 : Bug#11748572: Allocating a large query cache is not deterministic
|
||||
query_cache_size_basic_64 : Bug#11748572: Allocating a large query cache is not deterministic
|
||||
transaction_prealloc_size_basic_32 : Bug#11748572
|
||||
transaction_prealloc_size_basic_64 : Bug#11748572
|
||||
#thread_cache_size_func : Bug#11750172: 2008-11-07 joro main.thread_cache_size_func fails in pushbuild when run with pool of threads
|
||||
|
||||
|
@ -31,6 +31,7 @@
|
||||
#
|
||||
|
||||
--source include/not_embedded.inc
|
||||
--source include/not_threadpool.inc
|
||||
|
||||
SET @global_slow_launch_time = @@GLOBAL.slow_launch_time;
|
||||
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user