1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-09 22:24:09 +03:00

Merge tag 'mariadb-10.0.24' into 10.0-galera

This commit is contained in:
Nirbhay Choubey
2016-02-23 20:53:29 -05:00
305 changed files with 9175 additions and 4277 deletions

3
.gitignore vendored
View File

@@ -59,6 +59,9 @@ include/mysql_version.h
include/mysqld_ername.h
include/mysqld_error.h
include/sql_state.h
include/probes_mysql.d
include/probes_mysql_dtrace.h
include/probes_mysql_nodtrace.h
info_macros.cmake
libmysql*/libmysql*_exports_file.cc
libmysql*/merge_archives_mysql*.cmake

View File

@@ -31,6 +31,7 @@ Usage: $0 [-h|-n] [configure-options]
-h, --help Show this help message.
-n, --just-print Don't actually run any commands; just print them.
-c, --just-configure Stop after running configure.
Combined with --just-print shows configure options.
--extra-configs=xxx Add this to configure options
--extra-flags=xxx Add this C and CXX flags
--extra-cflags=xxx Add this to C flags
@@ -257,6 +258,10 @@ fi
# (http://samba.org/ccache) is installed, use it.
# We use 'grep' and hope 'grep' will work as expected
# (returns 0 if finds lines)
# As cmake doesn't like CC and CXX with a space, use symlinks from
# /usr/lib64/ccache if they exits.
if test "$USING_GCOV" != "1"
then
# Not using gcov; Safe to use ccache
@@ -265,8 +270,14 @@ fi
if ccache -V > /dev/null 2>&1 && test "$CCACHE_GCOV_VERSION_ENABLED" = "1"
then
echo "$CC" | grep "ccache" > /dev/null || CC="ccache $CC"
echo "$CXX" | grep "ccache" > /dev/null || CXX="ccache $CXX"
if test -x /usr/lib64/ccache/gcc
then
CC=/usr/lib64/ccache/gcc
fi
if test -x /usr/lib64/ccache/g++
then
CXX=/usr/lib64/ccache/g++
fi
fi
# gcov

45
CREDITS
View File

@@ -1,25 +1,30 @@
MariaDB is brought to you by the MariaDB foundation, a USA non profit
organization.
MariaDB is brought to you by the MariaDB Foundation, a non profit
organization registered in the USA.
The current main members and sponsors of the MariaDB foundation are:
The current main members and sponsors of the MariaDB Foundation are:
Automattic http://automattic.com (2014)
SkySQL Ab http://www.skysql.com (2013, 2014)
Booking.com http://www.booking.com (2013)
Parallels http://www.parallels.com/products/plesk (2013)
MariaDB Corporation http://www.mariadb.com (2013 - 2016)
Booking.com http://www.booking.com (2013 - 2016)
Parallels http://www.parallels.com/products/plesk (2013 - 2016)
Automattic http://automattic.com (2014 - 2016)
Verkkokauppa.com http://verkkokauppa.com (2015 - 2016)
Visma http://visma.com/ (2015 - 2016)
Webyog http://webyog.com (2015 - 2016)
Wikimedia Foundation http://wikimedia.org (2015 - 2016)
Acronis http://acronis.com (2016)
For a full list of supporters and sponsors see
https://mariadb.org/en/supporters/
https://mariadb.org/about/supporters/
You can also do this by doing SHOW CONTRIBUTORS.
You can also do this by running SHOW CONTRIBUTORS.
For all corporate memberships and sponsorships please contact the
MariaDB foundation Board via foundation@mariadb.org.
MariaDB Foundation Board via foundation@mariadb.org.
The MariaDB foundation is responsible for the MariaDB source
The MariaDB Foundation is responsible for the MariaDB source
repository, the official MariaDB binaries and http://mariadb.org.
The MariaDB foundation provides also, among other things, the
The MariaDB Foundation also provides, among other things, the
following services to the MariaDB community:
- Code reviews and applying patches for MariaDB
@@ -28,17 +33,19 @@ following services to the MariaDB community:
- Bug fixing in MariaDB (for bugs that affects a large part of the community)
- Building the official MariaDB binaries
- Maintaining http://mariadb.org
- Documenting MariaDB in the MariaDB Knowledge Base http://mariadb.com/kb
To be able to do the above we need help from cooperations and individuals!
To be able to do the above we need help from corporations and individuals!
You can help support MariaDB by be becoming a MariaDB developer or a
member or sponsor of the MariaDB foundation!
You can help support MariaDB by becoming a MariaDB developer or a
member or sponsor of the MariaDB Foundation. To donate or sponsor,
go to https://mariadb.org/donate/
You can get a list of all main authors of MariaDB / MySQL by doing
You can get a list of all the main authors of MariaDB / MySQL by running
SHOW AUTHORS;
You can get a list sponsors and contributors by doing
You can get a list sponsors and contributors by running
SHOW CONTRIBUTORS;
You can read more about the MariaDB foundation at:
https://mariadb.org/en/foundation/
You can read more about the MariaDB Foundation at:
https://mariadb.org/about/

10
README
View File

@@ -56,17 +56,17 @@ About MariaDB
MariaDB is designed as a drop-in replacement of MySQL(R) with more
features, new storage engines, fewer bugs, and better performance.
MariaDB is brought to you by the MariaDB foundation.
Please read the file CREDITS for details about the MariaDB foundation,
MariaDB is brought to you by the MariaDB Foundation.
Please read the CREDITS file for details about the MariaDB Foundation,
and who is developing MariaDB.
MariaDB is developed by many of the original developers of MySQL who
now work for MariadB foundation and SkySQL Ab, and by many people in
now work for the MariadB Foundation and the MariaDB Corporation, and by many people in
the community.
MySQL, which is the base of MariaDB, is a product and trademark of Oracle
Corporation, Inc. For a list of developers and other contributors,
see the Credits appendix. You can also do 'SHOW authors' to get a
see the Credits appendix. You can also run 'SHOW authors' to get a
list of active contributors.
A description of the MariaDB project and a manual can be found at:
@@ -105,7 +105,7 @@ http://mariadb.org/jira
Bugs in the MySQL code can also be submitted at http://bugs.mysql.com
The code for MariaDB, including all revision history, can be found at:
https://code.launchpad.net/maria
https://github.com/MariaDB/server
***************************************************************************

View File

@@ -1,3 +1,3 @@
MYSQL_VERSION_MAJOR=10
MYSQL_VERSION_MINOR=0
MYSQL_VERSION_PATCH=23
MYSQL_VERSION_PATCH=24

View File

@@ -1346,6 +1346,44 @@ sig_handler mysql_end(int sig)
exit(status.exit_status);
}
/*
set connection-specific options and call mysql_real_connect
*/
static bool do_connect(MYSQL *mysql, const char *host, const char *user,
const char *password, const char *database, ulong flags)
{
if (opt_secure_auth)
mysql_options(mysql, MYSQL_SECURE_AUTH, (char *) &opt_secure_auth);
#if defined(HAVE_OPENSSL) && !defined(EMBEDDED_LIBRARY)
if (opt_use_ssl)
{
mysql_ssl_set(mysql, opt_ssl_key, opt_ssl_cert, opt_ssl_ca,
opt_ssl_capath, opt_ssl_cipher);
mysql_options(mysql, MYSQL_OPT_SSL_CRL, opt_ssl_crl);
mysql_options(mysql, MYSQL_OPT_SSL_CRLPATH, opt_ssl_crlpath);
}
mysql_options(mysql,MYSQL_OPT_SSL_VERIFY_SERVER_CERT,
(char*)&opt_ssl_verify_server_cert);
#endif
if (opt_protocol)
mysql_options(mysql,MYSQL_OPT_PROTOCOL,(char*)&opt_protocol);
#ifdef HAVE_SMEM
if (shared_memory_base_name)
mysql_options(mysql,MYSQL_SHARED_MEMORY_BASE_NAME,shared_memory_base_name);
#endif
if (opt_plugin_dir && *opt_plugin_dir)
mysql_options(mysql, MYSQL_PLUGIN_DIR, opt_plugin_dir);
if (opt_default_auth && *opt_default_auth)
mysql_options(mysql, MYSQL_DEFAULT_AUTH, opt_default_auth);
mysql_options(mysql, MYSQL_OPT_CONNECT_ATTR_RESET, 0);
mysql_options4(mysql, MYSQL_OPT_CONNECT_ATTR_ADD,
"program_name", "mysql");
return mysql_real_connect(mysql, host, user, password, database,
opt_mysql_port, opt_mysql_unix_port, flags);
}
/*
This function handles sigint calls
@@ -1367,11 +1405,7 @@ sig_handler handle_sigint(int sig)
}
kill_mysql= mysql_init(kill_mysql);
mysql_options(kill_mysql, MYSQL_OPT_CONNECT_ATTR_RESET, 0);
mysql_options4(kill_mysql, MYSQL_OPT_CONNECT_ATTR_ADD,
"program_name", "mysql");
if (!mysql_real_connect(kill_mysql,current_host, current_user, opt_password,
"", opt_mysql_port, opt_mysql_unix_port,0))
if (!do_connect(kill_mysql,current_host, current_user, opt_password, "", 0))
{
tee_fprintf(stdout, "Ctrl-C -- sorry, cannot connect to server to kill query, giving up ...\n");
goto err;
@@ -4580,27 +4614,8 @@ sql_real_connect(char *host,char *database,char *user,char *password,
}
if (opt_compress)
mysql_options(&mysql,MYSQL_OPT_COMPRESS,NullS);
if (opt_secure_auth)
mysql_options(&mysql, MYSQL_SECURE_AUTH, (char *) &opt_secure_auth);
if (using_opt_local_infile)
mysql_options(&mysql,MYSQL_OPT_LOCAL_INFILE, (char*) &opt_local_infile);
#if defined(HAVE_OPENSSL) && !defined(EMBEDDED_LIBRARY)
if (opt_use_ssl)
{
mysql_ssl_set(&mysql, opt_ssl_key, opt_ssl_cert, opt_ssl_ca,
opt_ssl_capath, opt_ssl_cipher);
mysql_options(&mysql, MYSQL_OPT_SSL_CRL, opt_ssl_crl);
mysql_options(&mysql, MYSQL_OPT_SSL_CRLPATH, opt_ssl_crlpath);
}
mysql_options(&mysql,MYSQL_OPT_SSL_VERIFY_SERVER_CERT,
(char*)&opt_ssl_verify_server_cert);
#endif
if (opt_protocol)
mysql_options(&mysql,MYSQL_OPT_PROTOCOL,(char*)&opt_protocol);
#ifdef HAVE_SMEM
if (shared_memory_base_name)
mysql_options(&mysql,MYSQL_SHARED_MEMORY_BASE_NAME,shared_memory_base_name);
#endif
if (safe_updates)
{
char init_command[100];
@@ -4612,18 +4627,8 @@ sql_real_connect(char *host,char *database,char *user,char *password,
mysql_options(&mysql, MYSQL_SET_CHARSET_NAME, default_charset);
if (opt_plugin_dir && *opt_plugin_dir)
mysql_options(&mysql, MYSQL_PLUGIN_DIR, opt_plugin_dir);
if (opt_default_auth && *opt_default_auth)
mysql_options(&mysql, MYSQL_DEFAULT_AUTH, opt_default_auth);
mysql_options(&mysql, MYSQL_OPT_CONNECT_ATTR_RESET, 0);
mysql_options4(&mysql, MYSQL_OPT_CONNECT_ATTR_ADD,
"program_name", "mysql");
if (!mysql_real_connect(&mysql, host, user, password,
database, opt_mysql_port, opt_mysql_unix_port,
connect_flag | CLIENT_MULTI_STATEMENTS))
if (!do_connect(&mysql, host, user, password, database,
connect_flag | CLIENT_MULTI_STATEMENTS))
{
if (!silent ||
(mysql_errno(&mysql) != CR_CONN_HOST_ERROR &&

View File

@@ -184,7 +184,8 @@ static const char *load_default_groups[]=
static void free_used_memory(void)
{
/* Free memory allocated by 'load_defaults' */
free_defaults(defaults_argv);
if (defaults_argv)
free_defaults(defaults_argv);
dynstr_free(&ds_args);
dynstr_free(&conn_args);
@@ -1101,7 +1102,6 @@ int main(int argc, char **argv)
if (opt_systables_only && !opt_silent)
printf("The --upgrade-system-tables option was used, user tables won't be touched.\n");
/*
Read the mysql_upgrade_info file to check if mysql_upgrade
already has been run for this installation of MySQL

View File

@@ -43,7 +43,7 @@ static my_bool opt_alldbs = 0, opt_check_only_changed = 0, opt_extended = 0,
opt_silent = 0, opt_auto_repair = 0, ignore_errors = 0,
tty_password= 0, opt_frm= 0, debug_info_flag= 0, debug_check_flag= 0,
opt_fix_table_names= 0, opt_fix_db_names= 0, opt_upgrade= 0,
opt_do_tables= 1;
opt_persistent_all= 0, opt_do_tables= 1;
static my_bool opt_write_binlog= 1, opt_flush_tables= 0;
static uint verbose = 0, opt_mysql_port=0;
static int my_end_arg;
@@ -160,6 +160,10 @@ static struct my_option my_long_options[] =
{"password", 'p',
"Password to use when connecting to server. If password is not given, it's solicited on the tty.",
0, 0, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0},
{"persistent", 'Z',
"When using ANALYZE TABLE use the PERSISTENT FOR ALL option.",
&opt_persistent_all, &opt_persistent_all, 0, GET_BOOL, NO_ARG,
0, 0, 0, 0, 0, 0},
#ifdef __WIN__
{"pipe", 'W', "Use named pipes to connect to server.", 0, 0, 0, GET_NO_ARG,
NO_ARG, 0, 0, 0, 0, 0, 0},
@@ -915,6 +919,7 @@ static int handle_request_for_tables(char *tables, size_t length, my_bool view)
case DO_ANALYZE:
DBUG_ASSERT(!view);
op= (opt_write_binlog) ? "ANALYZE" : "ANALYZE NO_WRITE_TO_BINLOG";
if (opt_persistent_all) end = strmov(end, " PERSISTENT FOR ALL");
break;
case DO_OPTIMIZE:
DBUG_ASSERT(!view);

View File

@@ -5121,12 +5121,13 @@ static int my_kill(int pid, int sig)
{
#ifdef __WIN__
HANDLE proc;
if ((proc= OpenProcess(PROCESS_TERMINATE, FALSE, pid)) == NULL)
if ((proc= OpenProcess(SYNCHRONIZE|PROCESS_TERMINATE, FALSE, pid)) == NULL)
return -1;
if (sig == 0)
{
DWORD wait_result= WaitForSingleObject(proc, 0);
CloseHandle(proc);
return 0;
return wait_result == WAIT_OBJECT_0?-1:0;
}
(void)TerminateProcess(proc, 201);
CloseHandle(proc);

View File

@@ -86,6 +86,9 @@ IF(ENABLE_DTRACE)
${CMAKE_BINARY_DIR}/include/probes_mysql_dtrace.h
${CMAKE_BINARY_DIR}/include/probes_mysql_nodtrace.h
)
ELSE()
CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/include/probes_mysql_nodtrace.h.in
${CMAKE_BINARY_DIR}/include/probes_mysql_nodtrace.h COPYONLY)
ENDIF()
FUNCTION(DTRACE_INSTRUMENT target)

View File

@@ -20,18 +20,22 @@ MACRO (CHECK_JEMALLOC)
SET(CMAKE_REQUIRED_LIBRARIES pthread dl m)
SET(what bundled)
ELSE()
SET(libname jemalloc)
SET(libname jemalloc c)
SET(what system)
ENDIF()
CHECK_LIBRARY_EXISTS(${libname} malloc_stats_print "" HAVE_JEMALLOC)
FOREACH(lib ${libname})
CHECK_LIBRARY_EXISTS(${lib} malloc_stats_print "" HAVE_JEMALLOC_IN_${lib})
IF (HAVE_JEMALLOC_IN_${lib})
SET(LIBJEMALLOC ${lib})
SET(MALLOC_LIBRARY "${what} jemalloc")
BREAK()
ENDIF()
ENDFOREACH()
SET(CMAKE_REQUIRED_LIBRARIES)
IF (HAVE_JEMALLOC)
SET(LIBJEMALLOC ${libname})
SET(MALLOC_LIBRARY "${what} jemalloc")
ELSEIF (NOT WITH_JEMALLOC STREQUAL "auto")
MESSAGE(FATAL_ERROR "${libname} is not found")
IF (NOT LIBJEMALLOC AND NOT WITH_JEMALLOC STREQUAL "auto")
MESSAGE(FATAL_ERROR "jemalloc is not found")
ENDIF()
ENDIF()
ENDMACRO()

View File

@@ -87,6 +87,11 @@ MACRO(CREATE_EXPORT_FILE VAR TARGET API_FUNCTIONS)
ENDFOREACH()
SET(CONTENT "${CONTENT} (void *)0\n}\;")
CONFIGURE_FILE_CONTENT(${CONTENT} ${EXPORTS})
# Avoid "function redeclared as variable" error
# when using gcc/clang option -flto(link time optimization)
IF(" ${CMAKE_C_FLAGS} ${CMAKE_CXX_FLAGS} " MATCHES " -flto")
SET_SOURCE_FILES_PROPERTIES(${EXPORTS} PROPERTIES COMPILE_FLAGS "-fno-lto")
ENDIF()
SET(${VAR} ${EXPORTS})
ENDIF()
ENDMACRO()

View File

@@ -74,7 +74,7 @@ MACRO(MYSQL_ADD_PLUGIN)
SET(WITH_${plugin} 1)
ELSEIF(WITHOUT_${plugin} OR WITHOUT_${plugin}_STORAGE_ENGINE OR
WITH_NONE OR ${plugin}_DISABLED)
WITH_NONE OR ARG_DISABLED)
SET(WITHOUT_${plugin} 1)
SET(WITH_${plugin}_STORAGE_ENGINE 0)
SET(WITH_${plugin} 0)

View File

@@ -55,6 +55,7 @@ MACRO (MYSQL_USE_BUNDLED_SSL)
SET(SSL_INCLUDE_DIRS ${INC_DIRS})
SET(SSL_INTERNAL_INCLUDE_DIRS ${CMAKE_SOURCE_DIR}/extra/yassl/taocrypt/mySTL)
SET(SSL_DEFINES "-DHAVE_YASSL -DYASSL_PREFIX -DHAVE_OPENSSL -DMULTI_THREADED")
SET(HAVE_ERR_remove_thread_state OFF CACHE INTERNAL "yassl doesn't have ERR_remove_thread_state")
CHANGE_SSL_SETTINGS("bundled")
ADD_SUBDIRECTORY(extra/yassl)
ADD_SUBDIRECTORY(extra/yassl/taocrypt)
@@ -199,6 +200,10 @@ MACRO (MYSQL_CHECK_SSL)
SET(SSL_INCLUDE_DIRS ${OPENSSL_INCLUDE_DIR})
SET(SSL_INTERNAL_INCLUDE_DIRS "")
SET(SSL_DEFINES "-DHAVE_OPENSSL")
SET(CMAKE_REQUIRED_LIBRARIES ${SSL_LIBRARIES})
CHECK_SYMBOL_EXISTS(ERR_remove_thread_state "openssl/err.h"
HAVE_ERR_remove_thread_state)
ELSE()
IF(WITH_SSL STREQUAL "system")
MESSAGE(SEND_ERROR "Cannot find appropriate system libraries for SSL. Use WITH_SSL=bundled to enable SSL support")

View File

@@ -93,6 +93,7 @@
#cmakedefine HAVE_SYS_TYPES_H 1
#cmakedefine HAVE_SYS_UN_H 1
#cmakedefine HAVE_SYS_VADVISE_H 1
#cmakedefine HAVE_UCONTEXT_H 1
#cmakedefine HAVE_TERM_H 1
#cmakedefine HAVE_TERMBITS_H 1
#cmakedefine HAVE_TERMIOS_H 1
@@ -290,7 +291,6 @@
#cmakedefine HAVE_THR_YIELD 1
#cmakedefine HAVE_TIME 1
#cmakedefine HAVE_TIMES 1
#cmakedefine HAVE_UCONTEXT 1
#cmakedefine HAVE_VALLOC 1
#cmakedefine HAVE_VIDATTR 1
#define HAVE_VIO_READ_BUFF 1
@@ -467,7 +467,7 @@
#cmakedefine HAVE_BSD_SIGNALS 1
#cmakedefine HAVE_SVR3_SIGNALS 1
#cmakedefine HAVE_V7_SIGNALS 1
#cmakedefine HAVE_ERR_remove_thread_state 1
#cmakedefine HAVE_SOLARIS_STYLE_GETHOST 1

View File

@@ -792,16 +792,36 @@ ENDIF()
#
# Test for how the C compiler does inline, if at all
#
# SunPro is weird, apparently it only supports inline at -xO3 or -xO4.
# And if CMAKE_C_FLAGS has -xO4 but CMAKE_C_FLAGS_${CMAKE_BUILD_TYPE} has -xO2
# then CHECK_C_SOURCE_COMPILES will succeed but the built will fail.
# We must test all flags here.
# XXX actually, we can do this for all compilers, not only SunPro
IF (CMAKE_CXX_COMPILER_ID MATCHES "SunPro" AND
CMAKE_GENERATOR MATCHES "Makefiles")
STRING(TOUPPER "CMAKE_C_FLAGS_${CMAKE_BUILD_TYPE}" flags)
SET(CMAKE_REQUIRED_FLAGS "${${flags}}")
ENDIF()
CHECK_C_SOURCE_COMPILES("
static inline int foo(){return 0;}
extern int bar(int x);
static inline int foo(){return bar(1);}
int main(int argc, char *argv[]){return 0;}"
C_HAS_inline)
IF(NOT C_HAS_inline)
CHECK_C_SOURCE_COMPILES("
static __inline int foo(){return 0;}
extern int bar(int x);
static __inline int foo(){return bar(1);}
int main(int argc, char *argv[]){return 0;}"
C_HAS___inline)
SET(C_INLINE __inline)
IF(C_HAS___inline)
SET(C_INLINE __inline)
ElSE()
SET(C_INLINE)
MESSAGE(WARNING "C compiler does not support funcion inlining")
IF(NOT NOINLINE)
MESSAGE(FATAL_ERROR "Use -DNOINLINE=TRUE to allow compilation without inlining")
ENDIF()
ENDIF()
ENDIF()
IF(NOT CMAKE_CROSSCOMPILING AND NOT MSVC)
@@ -1059,5 +1079,8 @@ CHECK_STRUCT_HAS_MEMBER("struct dirent" d_ino "dirent.h" STRUCT_DIRENT_HAS_D_IN
CHECK_STRUCT_HAS_MEMBER("struct dirent" d_namlen "dirent.h" STRUCT_DIRENT_HAS_D_NAMLEN)
SET(SPRINTF_RETURNS_INT 1)
CHECK_INCLUDE_FILE(ucontext.h HAVE_UCONTEXT_H)
IF(NOT HAVE_UCONTEXT_H)
CHECK_INCLUDE_FILE(sys/ucontext.h HAVE_UCONTEXT_H)
ENDIF()
CHECK_STRUCT_HAS_MEMBER("struct timespec" tv_sec "time.h" STRUCT_TIMESPEC_HAS_TV_SEC)
CHECK_STRUCT_HAS_MEMBER("struct timespec" tv_nsec "time.h" STRUCT_TIMESPEC_HAS_TV_NSEC)

View File

@@ -264,6 +264,11 @@ fi
db_stop # in case invoke failes
# If we upgrade from MySQL mysql.service may be masked, which also
# means init.d script is disabled. Unmask mysql service explicitely.
# Ignore exit code as command is not available everywhere.
deb-systemd-helper unmask mysql.service > /dev/null || true
#DEBHELPER#
exit 0

View File

@@ -280,6 +280,11 @@ fi
db_stop # in case invoke failes
# If we upgrade from MySQL mysql.service may be masked, which also
# means init.d script is disabled. Unmask mysql service explicitely.
# Ignore exit code as command is not available everywhere.
deb-systemd-helper unmask mysql.service > /dev/null || true
#DEBHELPER#
exit 0

View File

@@ -12,6 +12,17 @@ before calling SSL_new();
*** end Note ***
yaSSL Release notes, version 2.3.9 (12/01/2015)
This release of yaSSL fixes two client side Diffie-Hellman problems.
yaSSL was only handling the cases of zero or one leading zeros for the key
agreement instead of potentially any number. This caused about 1 in 50,000
connections to fail when using DHE cipher suites. The second problem was
the case where a server would send a public value shorter than the prime
value, causing about 1 in 128 client connections to fail, and also
caused the yaSSL client to read off the end of memory. All client side
DHE cipher suite users should update.
Thanks to Adam Langely (agl@imperialviolet.org) for the detailed report!
yaSSL Release notes, version 2.3.8 (9/17/2015)
This release of yaSSL fixes a high security vulnerability. All users
SHOULD update. If using yaSSL for TLS on the server side with private

View File

@@ -378,6 +378,7 @@ public:
uint get_agreedKeyLength() const;
const byte* get_agreedKey() const;
uint get_publicKeyLength() const;
const byte* get_publicKey() const;
void makeAgreement(const byte*, unsigned int);

View File

@@ -34,7 +34,7 @@
#include "rsa.h"
#define YASSL_VERSION "2.3.8"
#define YASSL_VERSION "2.3.9"
#if defined(__cplusplus)

View File

@@ -751,9 +751,10 @@ struct DiffieHellman::DHImpl {
byte* publicKey_;
byte* privateKey_;
byte* agreedKey_;
uint pubKeyLength_;
DHImpl(TaoCrypt::RandomNumberGenerator& r) : ranPool_(r), publicKey_(0),
privateKey_(0), agreedKey_(0) {}
privateKey_(0), agreedKey_(0), pubKeyLength_(0) {}
~DHImpl()
{
ysArrayDelete(agreedKey_);
@@ -762,7 +763,7 @@ struct DiffieHellman::DHImpl {
}
DHImpl(const DHImpl& that) : dh_(that.dh_), ranPool_(that.ranPool_),
publicKey_(0), privateKey_(0), agreedKey_(0)
publicKey_(0), privateKey_(0), agreedKey_(0), pubKeyLength_(0)
{
uint length = dh_.GetByteLength();
AllocKeys(length, length, length);
@@ -810,7 +811,7 @@ DiffieHellman::DiffieHellman(const byte* p, unsigned int pSz, const byte* g,
using TaoCrypt::Integer;
pimpl_->dh_.Initialize(Integer(p, pSz).Ref(), Integer(g, gSz).Ref());
pimpl_->publicKey_ = NEW_YS opaque[pubSz];
pimpl_->publicKey_ = NEW_YS opaque[pimpl_->pubKeyLength_ = pubSz];
memcpy(pimpl_->publicKey_, pub, pubSz);
}
@@ -869,6 +870,10 @@ const byte* DiffieHellman::get_agreedKey() const
return pimpl_->agreedKey_;
}
uint DiffieHellman::get_publicKeyLength() const
{
return pimpl_->pubKeyLength_;
}
const byte* DiffieHellman::get_publicKey() const
{

View File

@@ -109,15 +109,12 @@ void ClientDiffieHellmanPublic::build(SSL& ssl)
uint keyLength = dhClient.get_agreedKeyLength(); // pub and agree same
alloc(keyLength, true);
dhClient.makeAgreement(dhServer.get_publicKey(), keyLength);
dhClient.makeAgreement(dhServer.get_publicKey(),
dhServer.get_publicKeyLength());
c16toa(keyLength, Yc_);
memcpy(Yc_ + KEY_OFFSET, dhClient.get_publicKey(), keyLength);
// because of encoding first byte might be zero, don't use it for preMaster
if (*dhClient.get_agreedKey() == 0)
ssl.set_preMaster(dhClient.get_agreedKey() + 1, keyLength - 1);
else
ssl.set_preMaster(dhClient.get_agreedKey(), keyLength);
ssl.set_preMaster(dhClient.get_agreedKey(), keyLength);
}
@@ -321,11 +318,7 @@ void ClientDiffieHellmanPublic::read(SSL& ssl, input_buffer& input)
}
dh.makeAgreement(Yc_, keyLength);
// because of encoding, first byte might be 0, don't use for preMaster
if (*dh.get_agreedKey() == 0)
ssl.set_preMaster(dh.get_agreedKey() + 1, dh.get_agreedKeyLength() - 1);
else
ssl.set_preMaster(dh.get_agreedKey(), dh.get_agreedKeyLength());
ssl.set_preMaster(dh.get_agreedKey(), dh.get_agreedKeyLength());
ssl.makeMasterSecret();
}

View File

@@ -807,6 +807,19 @@ void SSL::set_random(const opaque* random, ConnectionEnd sender)
// store client pre master secret
void SSL::set_preMaster(const opaque* pre, uint sz)
{
uint i(0); // trim leading zeros
uint fullSz(sz);
while (i++ < fullSz && *pre == 0) {
sz--;
pre++;
}
if (sz == 0) {
SetError(bad_input);
return;
}
secure_.use_connection().AllocPreSecret(sz);
memcpy(secure_.use_connection().pre_master_secret_, pre, sz);
}
@@ -924,6 +937,8 @@ void SSL::order_error()
// Create and store the master secret see page 32, 6.1
void SSL::makeMasterSecret()
{
if (GetError()) return;
if (isTLS())
makeTLSMasterSecret();
else {

View File

@@ -31,7 +31,7 @@
Attention: Please, note, uint3korr reads 4 bytes (not 3)!
It means, that you have to provide enough allocated space.
*/
#if defined(HAVE_purify) && !defined(_WIN32)
#if defined(HAVE_valgrind) && !defined(_WIN32)
#define uint3korr(A) (uint32) (((uint32) ((uchar) (A)[0])) +\
(((uint32) ((uchar) (A)[1])) << 8) +\
(((uint32) ((uchar) (A)[2])) << 16))

View File

@@ -31,7 +31,7 @@
#define MY_CONTEXT_USE_X86_64_GCC_ASM
#elif defined(__GNUC__) && __GNUC__ >= 3 && defined(__i386__)
#define MY_CONTEXT_USE_I386_GCC_ASM
#elif defined(HAVE_UCONTEXT)
#elif defined(HAVE_UCONTEXT_H)
#define MY_CONTEXT_USE_UCONTEXT
#else
#define MY_CONTEXT_DISABLE

View File

@@ -200,20 +200,6 @@
#define likely(x) __builtin_expect(((x) != 0),1)
#define unlikely(x) __builtin_expect(((x) != 0),0)
/*
now let's figure out if inline functions are supported
autoconf defines 'inline' to be empty, if not
*/
#define inline_test_1(X) X ## 1
#define inline_test_2(X) inline_test_1(X)
#if inline_test_2(inline) != 1
#define HAVE_INLINE
#else
#error Compiler does not support inline!
#endif
#undef inline_test_2
#undef inline_test_1
/* Fix problem with S_ISLNK() on Linux */
#if defined(TARGET_OS_LINUX) || defined(__GLIBC__)
#undef _GNU_SOURCE
@@ -454,7 +440,7 @@ extern "C" int madvise(void *addr, size_t len, int behav);
#endif
#ifndef STDERR_FILENO
#define STDERR_FILENO 2
#define STDERR_FILENO fileno(stderr)
#endif
/*
@@ -833,6 +819,9 @@ inline unsigned long long my_double2ulonglong(double d)
#else
#define finite(x) (1.0 / fabs(x) > 0.0)
#endif /* HAVE_FINITE */
#elif (__cplusplus >= 201103L)
#include <cmath>
static inline bool isfinite(double x) { return std::isfinite(x); }
#endif /* isfinite */
#ifndef HAVE_ISNAN

View File

@@ -146,6 +146,10 @@ typedef my_socket YASSL_SOCKET_T;
#include <openssl/ssl.h>
#include <openssl/err.h>
#ifdef HAVE_ERR_remove_thread_state
#define ERR_remove_state(X) ERR_remove_thread_state(NULL)
#endif
enum enum_ssl_init_error
{
SSL_INITERR_NOERROR= 0, SSL_INITERR_CERT, SSL_INITERR_KEY,
@@ -204,7 +208,7 @@ void vio_end(void);
/* shutdown(2) flags */
#ifndef SHUT_RD
#define SHUT_RD SD_BOTH
#define SHUT_RD SD_RECEIVE
#endif
/*

View File

@@ -1,5 +1,5 @@
/* Copyright (c) 2011, 2015, Oracle and/or its affiliates.
Copyright (c) 2011, 2015, MariaDB
/* Copyright (c) 2011, 2016, Oracle and/or its affiliates.
Copyright (c) 2011, 2016, MariaDB
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
@@ -17,7 +17,7 @@
#ifndef _welcome_copyright_notice_h_
#define _welcome_copyright_notice_h_
#define COPYRIGHT_NOTICE_CURRENT_YEAR "2015"
#define COPYRIGHT_NOTICE_CURRENT_YEAR "2016"
/*
This define specifies copyright notice which is displayed by every MySQL

View File

@@ -1,6 +1,6 @@
'\" t
.\"
.TH "\FBMYSQLCHECK\FR" "1" "04/08/2015" "MariaDB 10\&.0" "MariaDB Database System"
.TH "\FBMYSQLCHECK\FR" "1" "27/12/2015" "MariaDB 10\&.0" "MariaDB Database System"
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
@@ -677,6 +677,22 @@ Specifying a password on the command line should be considered insecure\&. You c
.sp -1
.IP \(bu 2.3
.\}
.\" mysqlcheck: persisent option
.\" persistent option: mysql
\fB\-\-persistent\fR,
\fB\-Z\fR
.sp
Used with ANALYZE TABLE to append the option PERSISENT FOR ALL.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
.\" mysqlcheck: pipe option
.\" pipe option: mysql
\fB\-\-pipe\fR,

View File

@@ -45,7 +45,13 @@ drop table t1;
connection slave;
flush tables with read lock;
start slave;
source include/wait_for_slave_to_start.inc;
# The IO thread will not be able to read the GTID because of flush tables
let $slave_param= Slave_IO_Running;
let $slave_param_value= Preparing;
source include/wait_for_slave_param.inc;
--source include/wait_for_slave_sql_to_start.inc
--error 1192
stop slave;

View File

@@ -357,14 +357,14 @@ int main(int argc, const char** argv )
CloseHandle(job_handle);
message("Job terminated and closed");
if (!jobobject_assigned)
{
GenerateConsoleCtrlEvent(CTRL_BREAK_EVENT, process_info.dwProcessId);
TerminateProcess(process_info.hProcess, 202);
}
if (wait_res != WAIT_OBJECT_0 + CHILD)
{
if (!jobobject_assigned)
{
TerminateProcess(process_info.hProcess, 202);
}
/* The child has not yet returned, wait for it */
message("waiting for child to exit");
if ((wait_res= WaitForSingleObject(wait_handles[CHILD], INFINITE))

View File

@@ -498,6 +498,7 @@ sub process_suite {
# disabled.def
parse_disabled($suite->{dir} .'/disabled.def', $suitename);
parse_disabled($suite->{dir} .'/t/disabled.def', $suitename);
# combinations
if (@::opt_combinations)

View File

@@ -2,15 +2,9 @@ drop table if exists t1,t2,t3;
create table t1 (a int not null primary key, b int, c varchar(80), e enum('a','b'));
insert into t1 (a) values (1),(2),(3);
alter online table t1 modify b int default 5;
ERROR 0A000: LOCK=NONE/SHARED is not supported for this operation. Try LOCK=EXCLUSIVE.
alter online table t1 change b new_name int;
ERROR 0A000: LOCK=NONE/SHARED is not supported for this operation. Try LOCK=EXCLUSIVE.
alter online table t1 modify e enum('a','b','c');
ERROR 0A000: LOCK=NONE/SHARED is not supported for this operation. Try LOCK=EXCLUSIVE.
alter online table t1 comment "new comment";
ERROR 0A000: LOCK=NONE/SHARED is not supported for this operation. Try LOCK=EXCLUSIVE.
alter online table t1 rename to t2;
ERROR 0A000: LOCK=NONE/SHARED is not supported for this operation. Try LOCK=EXCLUSIVE.
alter online table t1 algorithm=INPLACE, lock=NONE;
alter online table t1;
alter table t1 algorithm=INPLACE;
@@ -40,10 +34,13 @@ alter online table t1 add f int;
ERROR 0A000: LOCK=NONE is not supported for this operation. Try LOCK=SHARED.
alter online table t1 engine=memory;
ERROR 0A000: LOCK=NONE is not supported. Reason: COPY algorithm requires a lock. Try LOCK=SHARED.
alter online table t1 rename to t2;
ERROR 0A000: LOCK=NONE/SHARED is not supported for this operation. Try LOCK=EXCLUSIVE.
alter table t1 engine=innodb;
alter table t1 add index (b);
alter online table t1 add index c (c);
alter online table t1 drop index b;
alter online table t1 comment "new comment";
drop table t1;
create temporary table t1 (a int not null primary key, b int, c varchar(80), e enum('a','b'));
insert into t1 (a) values (1),(2),(3);

View File

@@ -1,15 +1,13 @@
SHOW CONTRIBUTORS;
Name Location Comment
Booking.com http://www.booking.com Founding member of the MariaDB foundation
SkySQL Ab http://www.skysql.com Founding member of the MariaDB foundation
Auttomatic http://automattic.com Member of the MariaDB foundation
Parallels http://www.parallels.com/products/plesk Founding member of the MariaDB foundation
Verkkokauppa.com Finland Sponsor of the MariaDB foundation
Webyog Bangalor Sponsor of the MariaDB foundation
Percona USA Sponsor of the MariaDB foundation
Jelastic.com Russia Sponsor of the MariaDB foundation
Planetta.net Finland Sponsor of the MariaDB foundation
Open query Australia Sponsor of the MariaDB foundation
Booking.com http://www.booking.com Founding member of the MariaDB Foundation
MariaDB Corporation https://mariadb.com Founding member of the MariaDB Foundation
Auttomattic http://automattic.com Member of the MariaDB Foundation
Parallels http://www.parallels.com/products/plesk Founding member of the MariaDB Foundation
Acronis http://www.acronis.com Member of the MariaDB Foundation
Verkkokauppa.com Finland Sponsor of the MariaDB Foundation
Webyog Bangalore Sponsor of the MariaDB Foundation
Wikimedia Foundation USA Sponsor of the MariaDB Foundation
Google USA Sponsoring parallel replication and GTID
Facebook USA Sponsoring non-blocking API, LIMIT ROWS EXAMINED etc
Ronald Bradford Brisbane, Australia EFF contribution for UC2006 Auction

View File

@@ -2662,5 +2662,21 @@ Warnings:
Note 1291 Column 'a' has duplicated value '' in ENUM
drop table t1;
set @@session.collation_server=default;
#
# MDEV-7765: Crash (Assertion `!table || (!table->write_set ||
# bitmap_is_set(table->write_set, field_index) ||
# bitmap_is_set(table->vcol_set, field_index))' fails)
# on using function over not created table
#
CREATE function f1() returns int
BEGIN
declare n int;
set n:= (select count(*) from t1);
return n;
end|
create table t1 as select f1();
ERROR 42S02: Table 'test.t1' doesn't exist
drop function f1;
End of 5.5 tests
create table t1;
ERROR 42000: A table must have at least 1 column

View File

@@ -116,7 +116,7 @@ hex(a) STRCMP(a,'a') STRCMP(a,'a ')
DROP TABLE t1;
select insert('txs',2,1,'hi'),insert('is ',4,0,'a'),insert('txxxxt',2,4,'es');
insert('txs',2,1,'hi') insert('is ',4,0,'a') insert('txxxxt',2,4,'es')
this is a test
this is test
select insert("aa",100,1,"b"),insert("aa",1,3,"b");
insert("aa",100,1,"b") insert("aa",1,3,"b")
aa b
@@ -5370,9 +5370,10 @@ SET sql_mode=default;
SET NAMES utf8;
CREATE TABLE t1 (a INT);
INSERT INTO t1 VALUES (0), (0), (1), (0), (0);
SELECT COUNT(*) FROM t1, t1 t2
SELECT COUNT(*) FROM t1, t1 t2
GROUP BY INSERT('', t2.a, t1.a, (@@global.max_binlog_size));
ERROR 23000: Duplicate entry '107374182410737418241' for key 'group_key'
COUNT(*)
25
DROP TABLE t1;
#
# Bug#11764503 (Bug#57341) Query in EXPLAIN EXTENDED shows wrong characters
@@ -6082,6 +6083,22 @@ c0 c1 c2 c3 c4
2012-06-11 15:18:24 2012-06-11 15:18:24 2012-06-11 15:18:24 2012-06-11 15:18:24 2012-06-11 15:18:24
DROP TABLE t2, t1;
#
# MDEV-9319 ALTER from a bigger to a smaller blob type truncates too much data
#
SET NAMES utf8;
CREATE TABLE t1 (a TEXT CHARACTER SET utf8);
INSERT INTO t1 VALUES (REPEAT('',100));
SELECT OCTET_LENGTH(a) FROM t1;
OCTET_LENGTH(a)
300
ALTER TABLE t1 MODIFY a TINYTEXT CHARACTER SET utf8;
Warnings:
Warning 1265 Data truncated for column 'a' at row 1
SELECT OCTET_LENGTH(a),a FROM t1;
OCTET_LENGTH(a) a
255
DROP TABLE t1;
#
# End of 5.5 tests
#
#

View File

@@ -116,7 +116,7 @@ hex(a) STRCMP(a,'a') STRCMP(a,'a ')
DROP TABLE t1;
select insert('txs',2,1,'hi'),insert('is ',4,0,'a'),insert('txxxxt',2,4,'es');
insert('txs',2,1,'hi') insert('is ',4,0,'a') insert('txxxxt',2,4,'es')
this is a test
this is test
select insert("aa",100,1,"b"),insert("aa",1,3,"b");
insert("aa",100,1,"b") insert("aa",1,3,"b")
aa b
@@ -2809,6 +2809,22 @@ Warning 1292 Truncated incorrect INTEGER value: 'a'
DROP TABLE t1;
# End of test for Bug#13581962,Bug#14096619
#
# MDEV-9319 ALTER from a bigger to a smaller blob type truncates too much data
#
SET NAMES utf8mb4;
CREATE TABLE t1 (a TEXT CHARACTER SET utf8mb4);
INSERT INTO t1 VALUES (REPEAT('😎',100));
SELECT OCTET_LENGTH(a) FROM t1;
OCTET_LENGTH(a)
400
ALTER TABLE t1 MODIFY a TINYTEXT CHARACTER SET utf8mb4;
Warnings:
Warning 1265 Data truncated for column 'a' at row 1
SELECT OCTET_LENGTH(a),a FROM t1;
OCTET_LENGTH(a) a
252 😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎
DROP TABLE t1;
#
# End of 5.5 tests
#
#

View File

@@ -116,7 +116,7 @@ hex(a) STRCMP(a,'a') STRCMP(a,'a ')
DROP TABLE t1;
select insert('txs',2,1,'hi'),insert('is ',4,0,'a'),insert('txxxxt',2,4,'es');
insert('txs',2,1,'hi') insert('is ',4,0,'a') insert('txxxxt',2,4,'es')
this is a test
this is test
select insert("aa",100,1,"b"),insert("aa",1,3,"b");
insert("aa",100,1,"b") insert("aa",1,3,"b")
aa b

View File

@@ -116,7 +116,7 @@ hex(a) STRCMP(a,'a') STRCMP(a,'a ')
DROP TABLE t1;
select insert('txs',2,1,'hi'),insert('is ',4,0,'a'),insert('txxxxt',2,4,'es');
insert('txs',2,1,'hi') insert('is ',4,0,'a') insert('txxxxt',2,4,'es')
this is a test
this is test
select insert("aa",100,1,"b"),insert("aa",1,3,"b");
insert("aa",100,1,"b") insert("aa",1,3,"b")
aa b

View File

@@ -116,7 +116,7 @@ hex(a) STRCMP(a,'a') STRCMP(a,'a ')
DROP TABLE t1;
select insert('txs',2,1,'hi'),insert('is ',4,0,'a'),insert('txxxxt',2,4,'es');
insert('txs',2,1,'hi') insert('is ',4,0,'a') insert('txxxxt',2,4,'es')
this is a test
this is test
select insert("aa",100,1,"b"),insert("aa",1,3,"b");
insert("aa",100,1,"b") insert("aa",1,3,"b")
aa b

View File

@@ -604,4 +604,349 @@ select x.id, message from (select id from t1) x left join
where coalesce(message,0) <> 0;
id message
drop table t1,t2;
#
# MDEV-7827: Assertion `!table || (!table->read_set ||
# bitmap_is_set(table->read_set, field_index))' failed
# in Field_long::val_str on EXPLAIN EXTENDED
#
CREATE TABLE t1 (f1 INT, f2 INT, KEY(f2)) ENGINE=MyISAM;
INSERT INTO t1 VALUES (6,9);
CREATE TABLE t2 (f3 INT) ENGINE=MyISAM;
INSERT INTO t2 VALUES (2),(0);
EXPLAIN EXTENDED
SELECT f1 FROM ( SELECT * FROM t1 ) AS sq
WHERE f1 IN (
SELECT f3 FROM t2 WHERE f2 IN (
SELECT f3 FROM t2 HAVING f3 >= 8
)
);
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY <derived2> system NULL NULL NULL NULL 1 100.00
1 PRIMARY <subquery4> eq_ref distinct_key distinct_key 4 sq.f2 1 100.00
1 PRIMARY t2 ALL NULL NULL NULL NULL 2 100.00 Using where; FirstMatch(<subquery4>); Using join buffer (flat, BNL join)
4 MATERIALIZED t2 ALL NULL NULL NULL NULL 2 100.00
2 DERIVED t1 system NULL NULL NULL NULL 1 100.00
Warnings:
Note 1276 Field or reference 'sq.f2' of SELECT #3 was resolved in SELECT #1
Note 1003 select 6 AS `f1` from <materialize> (select `test`.`t2`.`f3` from `test`.`t2` having (`test`.`t2`.`f3` >= 8)) semi join (`test`.`t2`) where ((`test`.`t2`.`f3` = 6) and (9 = `<subquery4>`.`f3`))
DROP TABLE t2,t1;
#
# MDEV-9462: Out of memory using explain on 2 empty tables
#
CREATE TABLE `t1` (
`REC_GROUP` char(2) DEFAULT NULL,
`CLIENT_INFO` text CHARACTER SET utf8,
`NAME` text,
`PHONE_NUMBER` text,
`ATTENTION_NAME` text,
`PAYMENT_TERM` text CHARACTER SET utf8,
`CREDIT_LIMIT` decimal(12,2) DEFAULT NULL,
`LAST_PAY_DATE` text CHARACTER SET utf8,
`TOTAL` double DEFAULT NULL,
`TOTAL_MCL` double DEFAULT NULL,
`TOTAL_MFS` double DEFAULT NULL,
`TOTAL_MIS` double DEFAULT NULL,
`BEFORE_DUE_7_MCL` double DEFAULT NULL,
`BEFORE_DUE_7_MFS` double DEFAULT NULL,
`BEFORE_DUE_7_MIS` double DEFAULT NULL,
`PER1_MCL` double DEFAULT NULL,
`PER1_MFS` double DEFAULT NULL,
`PER1_MIS` double DEFAULT NULL,
`PER2_MCL` double DEFAULT NULL,
`PER2_MFS` double DEFAULT NULL,
`PER2_MIS` double DEFAULT NULL,
`PER3_MCL` double DEFAULT NULL,
`PER3_MFS` double DEFAULT NULL,
`PER3_MIS` double DEFAULT NULL,
`PER4_MCL` double DEFAULT NULL,
`PER4_MFS` double DEFAULT NULL,
`PER4_MIS` double DEFAULT NULL,
`PER5_MCL` double DEFAULT NULL,
`PER5_MFS` double DEFAULT NULL,
`PER5_MIS` double DEFAULT NULL,
`PER6_MCL` double DEFAULT NULL,
`PER6_MFS` double DEFAULT NULL,
`PER6_MIS` double DEFAULT NULL,
`PER7_MCL` double DEFAULT NULL,
`PER7_MFS` double DEFAULT NULL,
`PER7_MIS` double DEFAULT NULL,
`BEFORE_DUE_7` double DEFAULT NULL,
`PER1` double DEFAULT NULL,
`PER2` double DEFAULT NULL,
`PER3` double DEFAULT NULL,
`PER4` double DEFAULT NULL,
`PER5` double DEFAULT NULL,
`PER6` double DEFAULT NULL,
`PER7` double DEFAULT NULL,
`REF` varchar(30) DEFAULT NULL,
`TYPE` varchar(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL
);
CREATE TABLE `t2` (
`RECEIVABLE_GROUP` char(2) DEFAULT NULL,
`CLIENT_NUMBER` varchar(35) DEFAULT NULL,
`CLIENT_NAME` varchar(73) DEFAULT NULL,
`PHONE_NUMBER` char(12) DEFAULT NULL,
`ATTENTION_NAME` char(26) DEFAULT NULL,
`PAYMENT_TERM` varchar(26) CHARACTER SET utf8 DEFAULT NULL,
`CREDIT_LIMIT` decimal(12,2) DEFAULT NULL,
`LAST_PAY_DATE` varchar(42) CHARACTER SET utf8 DEFAULT NULL,
`TOTAL` decimal(12,2) DEFAULT NULL,
`BEFORE_DUE_7` decimal(12,2) DEFAULT NULL,
`PER1` decimal(12,2) DEFAULT NULL,
`PER2` decimal(12,2) DEFAULT NULL,
`PER3` decimal(12,2) DEFAULT NULL,
`PER4` decimal(12,2) DEFAULT NULL,
`PER5` decimal(12,2) DEFAULT NULL,
`PER6` decimal(12,2) DEFAULT NULL,
`PER7` decimal(12,2) DEFAULT NULL,
`DIVISION` varchar(3) CHARACTER SET utf8 NOT NULL,
`CLIENT_INFO` varchar(294) CHARACTER SET utf8 DEFAULT NULL,
`EXCHANGE_RATE` double NOT NULL,
`REF` varchar(30) DEFAULT NULL
);
explain
SELECT A.RECEIVABLE_GROUP,A.CLIENT_INFO,A.CLIENT_NAME,A.PHONE_NUMBER,A.ATTENTION_NAME,A.PAYMENT_TERM,A.CREDIT_LIMIT,A.LAST_PAY_DATE,A.TOTAL,
COALESCE(B.TOTAL_MCL,0) AS TOTAL_MCL,
COALESCE(C.TOTAL_MFS,0) AS TOTAL_MFS,
COALESCE(D.TOTAL_MIS,0) AS TOTAL_MIS,
COALESCE(F.BEFORE_DUE_7_MCL,0) AS BEFORE_DUE_7_MCL,
COALESCE(G.BEFORE_DUE_7_MFS,0) AS BEFORE_DUE_7_MFS,
COALESCE(H.BEFORE_DUE_7_MIS,0) AS BEFORE_DUE_7_MIS,
COALESCE(I.PER1_MCL,0) AS PER1_MCL,
COALESCE(J.PER1_MFS,0) AS PER1_MFS,
COALESCE(K.PER1_MIS,0) AS PER1_MIS,
COALESCE(L.PER2_MCL,0) AS PER2_MCL,
COALESCE(M.PER2_MFS,0) AS PER2_MFS,
COALESCE(N.PER2_MIS,0) AS PER2_MIS,
COALESCE(O.PER3_MCL,0) AS PER3_MCL,
COALESCE(P.PER3_MFS,0) AS PER3_MFS,
COALESCE(R.PER3_MIS,0) AS PER3_MIS,
COALESCE(S.PER4_MCL,0) AS PER4_MCL,
COALESCE(T.PER4_MFS,0) AS PER4_MFS,
COALESCE(U.PER4_MIS,0) AS PER4_MIS,
COALESCE(V.PER5_MCL,0) AS PER5_MCL,
COALESCE(X.PER5_MFS,0) AS PER5_MFS,
COALESCE(Z.PER5_MIS,0) AS PER5_MIS,
COALESCE(Q.PER6_MCL,0) AS PER6_MCL,
COALESCE(Y.PER6_MFS,0) AS PER6_MFS,
COALESCE(W.PER6_MIS,0) AS PER6_MIS,
COALESCE(A1.PER7_MCL,0) AS PER7_MCL,
COALESCE(B1.PER7_MFS,0) AS PER7_MFS,
COALESCE(C1.PER7_MIS,0) AS PER7_MIS,
A.BEFORE_DUE_7,A.PER1,A.PER2,A.PER3,A.PER4,A.PER5,A.PER6,A.PER7,
CONCAT(A.DIVISION,'-',A.CLIENT_NUMBER) AS REF,"2" AS TYPE FROM
(SELECT RECEIVABLE_GROUP,DIVISION,CLIENT_NUMBER,
GROUP_CONCAT(DISTINCT CLIENT_INFO SEPARATOR '<br>') AS CLIENT_INFO,
GROUP_CONCAT(DISTINCT CLIENT_NAME SEPARATOR '<br>') AS CLIENT_NAME,
GROUP_CONCAT( DISTINCT `PHONE_NUMBER` SEPARATOR '<br>' ) AS PHONE_NUMBER ,
GROUP_CONCAT( DISTINCT `ATTENTION_NAME` SEPARATOR '<br>' ) AS ATTENTION_NAME,
GROUP_CONCAT( DISTINCT `PAYMENT_TERM` SEPARATOR '<br>' ) AS PAYMENT_TERM,
CREDIT_LIMIT ,
GROUP_CONCAT( `LAST_PAY_DATE` SEPARATOR '<br>' ) AS LAST_PAY_DATE,
SUM( `TOTAL`*EXCHANGE_RATE ) AS TOTAL,
SUM( `BEFORE_DUE_7`*EXCHANGE_RATE ) AS BEFORE_DUE_7,
SUM( `PER1`*EXCHANGE_RATE ) AS PER1,
SUM( `PER2`*EXCHANGE_RATE ) AS PER2,
SUM( `PER3`*EXCHANGE_RATE ) AS PER3,
SUM( `PER4`*EXCHANGE_RATE ) AS PER4,
SUM( `PER5`*EXCHANGE_RATE ) AS PER5,
SUM( `PER6`*EXCHANGE_RATE ) AS PER6,
SUM( `PER7`*EXCHANGE_RATE ) AS PER7
FROM `t2`
WHERE REF IS NULL GROUP BY RECEIVABLE_GROUP,DIVISION,CLIENT_NUMBER,CREDIT_LIMIT) AS A
LEFT JOIN
(SELECT RECEIVABLE_GROUP,DIVISION,CLIENT_NUMBER,CREDIT_LIMIT,SUM( `TOTAL`*EXCHANGE_RATE ) AS TOTAL_MCL
FROM `t2`
WHERE REF IS NULL AND DIVISION="MCL" GROUP BY RECEIVABLE_GROUP,DIVISION,CLIENT_NUMBER,CREDIT_LIMIT) AS B ON A.CLIENT_NUMBER=B.CLIENT_NUMBER AND
A.DIVISION=B.DIVISION AND A.RECEIVABLE_GROUP=B.RECEIVABLE_GROUP AND A.CREDIT_LIMIT=B.CREDIT_LIMIT
LEFT JOIN
(SELECT RECEIVABLE_GROUP,DIVISION,CLIENT_NUMBER,CREDIT_LIMIT,SUM( `TOTAL`*EXCHANGE_RATE ) AS TOTAL_MFS
FROM `t2`
WHERE REF IS NULL AND DIVISION="MFS" GROUP BY RECEIVABLE_GROUP,DIVISION,CLIENT_NUMBER,CREDIT_LIMIT) AS C ON A.CLIENT_NUMBER=C.CLIENT_NUMBER
AND
A.DIVISION=C.DIVISION AND A.RECEIVABLE_GROUP=C.RECEIVABLE_GROUP AND A.CREDIT_LIMIT=C.CREDIT_LIMIT
LEFT JOIN
(SELECT RECEIVABLE_GROUP,DIVISION,CLIENT_NUMBER,CREDIT_LIMIT,SUM( `TOTAL`*EXCHANGE_RATE ) AS TOTAL_MIS
FROM `t2`
WHERE REF IS NULL AND DIVISION="MIS" GROUP BY RECEIVABLE_GROUP,DIVISION,CLIENT_NUMBER,CREDIT_LIMIT) AS D ON A.CLIENT_NUMBER=D.CLIENT_NUMBER AND
A.DIVISION=D.DIVISION AND A.RECEIVABLE_GROUP=D.RECEIVABLE_GROUP AND A.CREDIT_LIMIT=D.CREDIT_LIMIT
LEFT JOIN
(SELECT RECEIVABLE_GROUP,DIVISION,CLIENT_NUMBER,CREDIT_LIMIT,SUM( BEFORE_DUE_7*EXCHANGE_RATE ) AS BEFORE_DUE_7_MCL
FROM `t2`
WHERE REF IS NULL AND DIVISION="MCL" GROUP BY RECEIVABLE_GROUP,DIVISION,CLIENT_NUMBER,CREDIT_LIMIT) AS F ON A.CLIENT_NUMBER=F.CLIENT_NUMBER AND
A.DIVISION=F.DIVISION AND A.RECEIVABLE_GROUP=F.RECEIVABLE_GROUP AND A.CREDIT_LIMIT=F.CREDIT_LIMIT
LEFT JOIN
(SELECT RECEIVABLE_GROUP,DIVISION,CLIENT_NUMBER,CREDIT_LIMIT,SUM( BEFORE_DUE_7*EXCHANGE_RATE ) AS BEFORE_DUE_7_MFS
FROM `t2`
WHERE REF IS NULL AND DIVISION="MFS" GROUP BY RECEIVABLE_GROUP,DIVISION,CLIENT_NUMBER,CREDIT_LIMIT) AS G ON A.CLIENT_NUMBER=G.CLIENT_NUMBER AND
A.DIVISION=G.DIVISION AND A.RECEIVABLE_GROUP=G.RECEIVABLE_GROUP AND A.CREDIT_LIMIT=G.CREDIT_LIMIT
LEFT JOIN
(SELECT RECEIVABLE_GROUP,DIVISION,CLIENT_NUMBER,CREDIT_LIMIT,SUM( BEFORE_DUE_7*EXCHANGE_RATE ) AS BEFORE_DUE_7_MIS
FROM `t2`
WHERE REF IS NULL AND DIVISION="MIS" GROUP BY RECEIVABLE_GROUP,DIVISION,CLIENT_NUMBER,CREDIT_LIMIT) AS H ON A.CLIENT_NUMBER=H.CLIENT_NUMBER AND
A.DIVISION=H.DIVISION AND A.RECEIVABLE_GROUP=H.RECEIVABLE_GROUP AND A.CREDIT_LIMIT=H.CREDIT_LIMIT
LEFT JOIN
(SELECT RECEIVABLE_GROUP,DIVISION,CLIENT_NUMBER,CREDIT_LIMIT,SUM( PER1*EXCHANGE_RATE ) AS PER1_MCL
FROM `t2`
WHERE REF IS NULL AND DIVISION="MCL" GROUP BY RECEIVABLE_GROUP,DIVISION,CLIENT_NUMBER,CREDIT_LIMIT) AS I ON A.CLIENT_NUMBER=I.CLIENT_NUMBER AND
A.DIVISION=I.DIVISION AND A.RECEIVABLE_GROUP=I.RECEIVABLE_GROUP AND A.CREDIT_LIMIT=I.CREDIT_LIMIT
LEFT JOIN
(SELECT RECEIVABLE_GROUP,DIVISION,CLIENT_NUMBER,CREDIT_LIMIT,SUM( PER1*EXCHANGE_RATE ) AS PER1_MFS
FROM `t2`
WHERE REF IS NULL AND DIVISION="MFS" GROUP BY RECEIVABLE_GROUP,DIVISION,CLIENT_NUMBER,CREDIT_LIMIT) AS J ON A.CLIENT_NUMBER=J.CLIENT_NUMBER AND
A.DIVISION=J.DIVISION AND A.RECEIVABLE_GROUP=J.RECEIVABLE_GROUP AND A.CREDIT_LIMIT=J.CREDIT_LIMIT
LEFT JOIN
(SELECT RECEIVABLE_GROUP,DIVISION,CLIENT_NUMBER,CREDIT_LIMIT,SUM( PER1*EXCHANGE_RATE ) AS PER1_MIS
FROM `t2`
WHERE REF IS NULL AND DIVISION="MIS" GROUP BY RECEIVABLE_GROUP,DIVISION,CLIENT_NUMBER,CREDIT_LIMIT) AS K ON A.CLIENT_NUMBER=K.CLIENT_NUMBER AND
A.DIVISION=K.DIVISION AND A.RECEIVABLE_GROUP=K.RECEIVABLE_GROUP AND A.CREDIT_LIMIT=K.CREDIT_LIMIT
LEFT JOIN
(SELECT RECEIVABLE_GROUP,DIVISION,CLIENT_NUMBER,CREDIT_LIMIT,SUM( PER2*EXCHANGE_RATE ) AS PER2_MCL
FROM `t2`
WHERE REF IS NULL AND DIVISION="MCL" GROUP BY RECEIVABLE_GROUP,DIVISION,CLIENT_NUMBER,CREDIT_LIMIT) AS L ON A.CLIENT_NUMBER=L.CLIENT_NUMBER AND
A.DIVISION=L.DIVISION AND A.RECEIVABLE_GROUP=L.RECEIVABLE_GROUP AND A.CREDIT_LIMIT=L.CREDIT_LIMIT
LEFT JOIN
(SELECT RECEIVABLE_GROUP,DIVISION,CLIENT_NUMBER,CREDIT_LIMIT,SUM( PER2*EXCHANGE_RATE ) AS PER2_MFS
FROM `t2`
WHERE REF IS NULL AND DIVISION="MFS" GROUP BY RECEIVABLE_GROUP,DIVISION,CLIENT_NUMBER,CREDIT_LIMIT) AS M ON A.CLIENT_NUMBER=M.CLIENT_NUMBER AND
A.DIVISION=M.DIVISION AND A.RECEIVABLE_GROUP=M.RECEIVABLE_GROUP AND A.CREDIT_LIMIT=M.CREDIT_LIMIT
LEFT JOIN
(SELECT RECEIVABLE_GROUP,DIVISION,CLIENT_NUMBER,CREDIT_LIMIT,SUM( PER2*EXCHANGE_RATE ) AS PER2_MIS
FROM `t2`
WHERE REF IS NULL AND DIVISION="MIS" GROUP BY RECEIVABLE_GROUP,DIVISION,CLIENT_NUMBER,CREDIT_LIMIT) AS N ON A.CLIENT_NUMBER=N.CLIENT_NUMBER AND
A.DIVISION=N.DIVISION AND A.RECEIVABLE_GROUP=N.RECEIVABLE_GROUP AND A.CREDIT_LIMIT=N.CREDIT_LIMIT
LEFT JOIN
(SELECT RECEIVABLE_GROUP,DIVISION,CLIENT_NUMBER,CREDIT_LIMIT,SUM( PER3*EXCHANGE_RATE ) AS PER3_MCL
FROM `t2`
WHERE REF IS NULL AND DIVISION="MCL" GROUP BY RECEIVABLE_GROUP,DIVISION,CLIENT_NUMBER,CREDIT_LIMIT) AS O ON A.CLIENT_NUMBER=O.CLIENT_NUMBER AND
A.DIVISION=O.DIVISION AND A.RECEIVABLE_GROUP=O.RECEIVABLE_GROUP AND A.CREDIT_LIMIT=O.CREDIT_LIMIT
LEFT JOIN
(SELECT RECEIVABLE_GROUP,DIVISION,CLIENT_NUMBER,CREDIT_LIMIT,SUM( PER3*EXCHANGE_RATE ) AS PER3_MFS
FROM `t2`
WHERE REF IS NULL AND DIVISION="MFS" GROUP BY RECEIVABLE_GROUP,DIVISION,CLIENT_NUMBER,CREDIT_LIMIT) AS P ON A.CLIENT_NUMBER=P.CLIENT_NUMBER AND
A.DIVISION=P.DIVISION AND A.RECEIVABLE_GROUP=P.RECEIVABLE_GROUP AND A.CREDIT_LIMIT=P.CREDIT_LIMIT
LEFT JOIN
(SELECT RECEIVABLE_GROUP,DIVISION,CLIENT_NUMBER,CREDIT_LIMIT,SUM( PER3*EXCHANGE_RATE ) AS PER3_MIS
FROM `t2`
WHERE REF IS NULL AND DIVISION="MIS" GROUP BY RECEIVABLE_GROUP,DIVISION,CLIENT_NUMBER,CREDIT_LIMIT) AS R ON A.CLIENT_NUMBER=R.CLIENT_NUMBER AND
A.DIVISION=R.DIVISION AND A.RECEIVABLE_GROUP=R.RECEIVABLE_GROUP AND A.CREDIT_LIMIT=R.CREDIT_LIMIT
LEFT JOIN
(SELECT RECEIVABLE_GROUP,DIVISION,CLIENT_NUMBER,CREDIT_LIMIT,SUM( PER4*EXCHANGE_RATE ) AS PER4_MCL
FROM `t2`
WHERE REF IS NULL AND DIVISION="MCL" GROUP BY RECEIVABLE_GROUP,DIVISION,CLIENT_NUMBER,CREDIT_LIMIT) AS S ON A.CLIENT_NUMBER=S.CLIENT_NUMBER AND
A.DIVISION=S.DIVISION AND A.RECEIVABLE_GROUP=S.RECEIVABLE_GROUP AND A.CREDIT_LIMIT=S.CREDIT_LIMIT
LEFT JOIN
(SELECT RECEIVABLE_GROUP,DIVISION,CLIENT_NUMBER,CREDIT_LIMIT,SUM( PER4*EXCHANGE_RATE ) AS PER4_MFS
FROM `t2`
WHERE REF IS NULL AND DIVISION="MFS" GROUP BY RECEIVABLE_GROUP,DIVISION,CLIENT_NUMBER,CREDIT_LIMIT) AS T ON A.CLIENT_NUMBER=T.CLIENT_NUMBER AND
A.DIVISION=T.DIVISION AND A.RECEIVABLE_GROUP=T.RECEIVABLE_GROUP AND A.CREDIT_LIMIT=T.CREDIT_LIMIT
LEFT JOIN
(SELECT RECEIVABLE_GROUP,DIVISION,CLIENT_NUMBER,CREDIT_LIMIT,SUM( PER4*EXCHANGE_RATE ) AS PER4_MIS
FROM `t2`
WHERE REF IS NULL AND DIVISION="MIS" GROUP BY RECEIVABLE_GROUP,DIVISION,CLIENT_NUMBER,CREDIT_LIMIT) AS U ON A.CLIENT_NUMBER=U.CLIENT_NUMBER AND
A.DIVISION=U.DIVISION AND A.RECEIVABLE_GROUP=U.RECEIVABLE_GROUP AND A.CREDIT_LIMIT=U.CREDIT_LIMIT
LEFT JOIN
(SELECT RECEIVABLE_GROUP,DIVISION,CLIENT_NUMBER,CREDIT_LIMIT,SUM( PER5*EXCHANGE_RATE ) AS PER5_MCL
FROM `t2`
WHERE REF IS NULL AND DIVISION="MCL" GROUP BY RECEIVABLE_GROUP,DIVISION,CLIENT_NUMBER,CREDIT_LIMIT) AS V ON A.CLIENT_NUMBER=V.CLIENT_NUMBER AND
A.DIVISION=V.DIVISION AND A.RECEIVABLE_GROUP=V.RECEIVABLE_GROUP AND A.CREDIT_LIMIT=V.CREDIT_LIMIT
LEFT JOIN
(SELECT RECEIVABLE_GROUP,DIVISION,CLIENT_NUMBER,CREDIT_LIMIT,SUM( PER5*EXCHANGE_RATE ) AS PER5_MFS
FROM `t2`
WHERE REF IS NULL AND DIVISION="MFS" GROUP BY RECEIVABLE_GROUP,DIVISION,CLIENT_NUMBER,CREDIT_LIMIT) AS X ON A.CLIENT_NUMBER=X.CLIENT_NUMBER AND
A.DIVISION=X.DIVISION AND A.RECEIVABLE_GROUP=X.RECEIVABLE_GROUP AND A.CREDIT_LIMIT=X.CREDIT_LIMIT
LEFT JOIN
(SELECT RECEIVABLE_GROUP,DIVISION,CLIENT_NUMBER,CREDIT_LIMIT,SUM( PER5*EXCHANGE_RATE ) AS PER5_MIS
FROM `t2`
WHERE REF IS NULL AND DIVISION="MIS" GROUP BY RECEIVABLE_GROUP,DIVISION,CLIENT_NUMBER,CREDIT_LIMIT) AS Z ON A.CLIENT_NUMBER=Z.CLIENT_NUMBER AND
A.DIVISION=Z.DIVISION AND A.RECEIVABLE_GROUP=Z.RECEIVABLE_GROUP AND A.CREDIT_LIMIT=Z.CREDIT_LIMIT
LEFT JOIN
(SELECT RECEIVABLE_GROUP,DIVISION,CLIENT_NUMBER,CREDIT_LIMIT,SUM( PER6*EXCHANGE_RATE ) AS PER6_MCL
FROM `t2`
WHERE REF IS NULL AND DIVISION="MCL" GROUP BY RECEIVABLE_GROUP,DIVISION,CLIENT_NUMBER,CREDIT_LIMIT) AS Q ON A.CLIENT_NUMBER=Q.CLIENT_NUMBER AND
A.DIVISION=Q.DIVISION AND A.RECEIVABLE_GROUP=Q.RECEIVABLE_GROUP AND A.CREDIT_LIMIT=Q.CREDIT_LIMIT
LEFT JOIN
(SELECT RECEIVABLE_GROUP,DIVISION,CLIENT_NUMBER,CREDIT_LIMIT,SUM( PER6*EXCHANGE_RATE ) AS PER6_MFS
FROM `t2`
WHERE REF IS NULL AND DIVISION="MFS" GROUP BY RECEIVABLE_GROUP,DIVISION,CLIENT_NUMBER,CREDIT_LIMIT) AS Y ON A.CLIENT_NUMBER=Y.CLIENT_NUMBER AND
A.DIVISION=Y.DIVISION AND A.RECEIVABLE_GROUP=Y.RECEIVABLE_GROUP AND A.CREDIT_LIMIT=Y.CREDIT_LIMIT
LEFT JOIN
(SELECT RECEIVABLE_GROUP,DIVISION,CLIENT_NUMBER,CREDIT_LIMIT,SUM( PER6*EXCHANGE_RATE ) AS PER6_MIS
FROM `t2`
WHERE REF IS NULL AND DIVISION="MIS" GROUP BY RECEIVABLE_GROUP,DIVISION,CLIENT_NUMBER,CREDIT_LIMIT) AS W ON A.CLIENT_NUMBER=W.CLIENT_NUMBER AND
A.DIVISION=W.DIVISION AND A.RECEIVABLE_GROUP=W.RECEIVABLE_GROUP AND A.CREDIT_LIMIT=W.CREDIT_LIMIT
LEFT JOIN
(SELECT RECEIVABLE_GROUP,DIVISION,CLIENT_NUMBER,CREDIT_LIMIT,SUM( PER7*EXCHANGE_RATE ) AS PER7_MCL
FROM `t2`
WHERE REF IS NULL AND DIVISION="MCL" GROUP BY RECEIVABLE_GROUP,DIVISION,CLIENT_NUMBER,CREDIT_LIMIT) AS A1 ON A.CLIENT_NUMBER=A1.CLIENT_NUMBER AND
A.DIVISION=A1.DIVISION AND A.RECEIVABLE_GROUP=A1.RECEIVABLE_GROUP AND A.CREDIT_LIMIT=A1.CREDIT_LIMIT
LEFT JOIN
(SELECT RECEIVABLE_GROUP,DIVISION,CLIENT_NUMBER,CREDIT_LIMIT,SUM( PER7*EXCHANGE_RATE ) AS PER7_MFS
FROM `t2`
WHERE REF IS NULL AND DIVISION="MFS" GROUP BY RECEIVABLE_GROUP,DIVISION,CLIENT_NUMBER,CREDIT_LIMIT) AS B1 ON A.CLIENT_NUMBER=B1.CLIENT_NUMBER AND
A.DIVISION=B1.DIVISION AND A.RECEIVABLE_GROUP=B1.RECEIVABLE_GROUP AND A.CREDIT_LIMIT=B1.CREDIT_LIMIT
LEFT JOIN
(SELECT RECEIVABLE_GROUP,DIVISION,CLIENT_NUMBER,CREDIT_LIMIT,SUM( PER7*EXCHANGE_RATE ) AS PER7_MIS
FROM `t2`
WHERE REF IS NULL AND DIVISION="MIS" GROUP BY RECEIVABLE_GROUP,DIVISION,CLIENT_NUMBER,CREDIT_LIMIT) AS C1 ON A.CLIENT_NUMBER=C1.CLIENT_NUMBER AND
A.DIVISION=C1.DIVISION AND A.RECEIVABLE_GROUP=C1.RECEIVABLE_GROUP AND A.CREDIT_LIMIT=C1.CREDIT_LIMIT
ORDER BY TOTAL DESC;
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY <derived2> system NULL NULL NULL NULL 0 const row not found
1 PRIMARY <derived3> system NULL NULL NULL NULL 0 const row not found
1 PRIMARY <derived4> system NULL NULL NULL NULL 0 const row not found
1 PRIMARY <derived5> system NULL NULL NULL NULL 0 const row not found
1 PRIMARY <derived6> system NULL NULL NULL NULL 0 const row not found
1 PRIMARY <derived7> system NULL NULL NULL NULL 0 const row not found
1 PRIMARY <derived8> system NULL NULL NULL NULL 0 const row not found
1 PRIMARY <derived9> system NULL NULL NULL NULL 0 const row not found
1 PRIMARY <derived10> system NULL NULL NULL NULL 0 const row not found
1 PRIMARY <derived11> system NULL NULL NULL NULL 0 const row not found
1 PRIMARY <derived12> system NULL NULL NULL NULL 0 const row not found
1 PRIMARY <derived13> system NULL NULL NULL NULL 0 const row not found
1 PRIMARY <derived14> system NULL NULL NULL NULL 0 const row not found
1 PRIMARY <derived15> system NULL NULL NULL NULL 0 const row not found
1 PRIMARY <derived16> system NULL NULL NULL NULL 0 const row not found
1 PRIMARY <derived17> system NULL NULL NULL NULL 0 const row not found
1 PRIMARY <derived18> system NULL NULL NULL NULL 0 const row not found
1 PRIMARY <derived19> system NULL NULL NULL NULL 0 const row not found
1 PRIMARY <derived20> system NULL NULL NULL NULL 0 const row not found
1 PRIMARY <derived21> system NULL NULL NULL NULL 0 const row not found
1 PRIMARY <derived22> system NULL NULL NULL NULL 0 const row not found
1 PRIMARY <derived23> system NULL NULL NULL NULL 0 const row not found
1 PRIMARY <derived24> system NULL NULL NULL NULL 0 const row not found
1 PRIMARY <derived25> system NULL NULL NULL NULL 0 const row not found
1 PRIMARY <derived26> system NULL NULL NULL NULL 0 const row not found
1 PRIMARY <derived27> system NULL NULL NULL NULL 0 const row not found
1 PRIMARY <derived28> system NULL NULL NULL NULL 0 const row not found
1 PRIMARY <derived29> system NULL NULL NULL NULL 0 const row not found
29 DERIVED NULL NULL NULL NULL NULL NULL NULL no matching row in const table
28 DERIVED NULL NULL NULL NULL NULL NULL NULL no matching row in const table
27 DERIVED NULL NULL NULL NULL NULL NULL NULL no matching row in const table
26 DERIVED NULL NULL NULL NULL NULL NULL NULL no matching row in const table
25 DERIVED NULL NULL NULL NULL NULL NULL NULL no matching row in const table
24 DERIVED NULL NULL NULL NULL NULL NULL NULL no matching row in const table
23 DERIVED NULL NULL NULL NULL NULL NULL NULL no matching row in const table
22 DERIVED NULL NULL NULL NULL NULL NULL NULL no matching row in const table
21 DERIVED NULL NULL NULL NULL NULL NULL NULL no matching row in const table
20 DERIVED NULL NULL NULL NULL NULL NULL NULL no matching row in const table
19 DERIVED NULL NULL NULL NULL NULL NULL NULL no matching row in const table
18 DERIVED NULL NULL NULL NULL NULL NULL NULL no matching row in const table
17 DERIVED NULL NULL NULL NULL NULL NULL NULL no matching row in const table
16 DERIVED NULL NULL NULL NULL NULL NULL NULL no matching row in const table
15 DERIVED NULL NULL NULL NULL NULL NULL NULL no matching row in const table
14 DERIVED NULL NULL NULL NULL NULL NULL NULL no matching row in const table
13 DERIVED NULL NULL NULL NULL NULL NULL NULL no matching row in const table
12 DERIVED NULL NULL NULL NULL NULL NULL NULL no matching row in const table
11 DERIVED NULL NULL NULL NULL NULL NULL NULL no matching row in const table
10 DERIVED NULL NULL NULL NULL NULL NULL NULL no matching row in const table
9 DERIVED NULL NULL NULL NULL NULL NULL NULL no matching row in const table
8 DERIVED NULL NULL NULL NULL NULL NULL NULL no matching row in const table
7 DERIVED NULL NULL NULL NULL NULL NULL NULL no matching row in const table
6 DERIVED NULL NULL NULL NULL NULL NULL NULL no matching row in const table
5 DERIVED NULL NULL NULL NULL NULL NULL NULL no matching row in const table
4 DERIVED NULL NULL NULL NULL NULL NULL NULL no matching row in const table
3 DERIVED NULL NULL NULL NULL NULL NULL NULL no matching row in const table
2 DERIVED NULL NULL NULL NULL NULL NULL NULL no matching row in const table
DROP TABLES t1,t2;
set optimizer_switch=@save_derived_optimizer_switch;

View File

@@ -90,7 +90,7 @@ create table events_smode_test(ev_name char(10), a date);
"This should never insert something"
create event ee_16407_2 on schedule every 60 second do
begin
select get_lock('ee_16407_2', 60) /*ee_16407_2*/;
select get_lock('ee_16407_2', 60); /*ee_16407_2*/
select release_lock('ee_16407_2');
insert into events_test.events_smode_test values('ee_16407_2','1980-19-02');
end|
@@ -99,7 +99,7 @@ ERROR 22007: Incorrect date value: '1980-19-02' for column 'a' at row 1
"This is ok"
create event ee_16407_3 on schedule every 60 second do
begin
select get_lock('ee_16407_2', 60) /*ee_16407_3*/;
select get_lock('ee_16407_2', 60); /*ee_16407_3*/
select release_lock('ee_16407_2');
insert into events_test.events_smode_test values ('ee_16407_3','1980-02-19');
insert into events_test.events_smode_test values ('ee_16407_3','1980-02-29');
@@ -108,7 +108,7 @@ set sql_mode=""|
"This will insert rows but they will be truncated"
create event ee_16407_4 on schedule every 60 second do
begin
select get_lock('ee_16407_2', 60) /*ee_16407_4*/;
select get_lock('ee_16407_2', 60); /*ee_16407_4*/
select release_lock('ee_16407_2');
insert into events_test.events_smode_test values ('ee_16407_4','10-11-1956');
end|
@@ -156,13 +156,13 @@ create procedure ee_16407_5_pendant() begin insert into events_test.events_smode
create procedure ee_16407_6_pendant() begin insert into events_test.events_smode_test values('ee_16407_6','2004-02-29'); end|
create event ee_16407_5 on schedule every 60 second do
begin
select get_lock('ee_16407_5', 60) /*ee_16407_5*/;
select get_lock('ee_16407_5', 60); /*ee_16407_5*/
select release_lock('ee_16407_5');
call events_test.ee_16407_5_pendant();
end|
create event ee_16407_6 on schedule every 60 second do
begin
select get_lock('ee_16407_5', 60) /*ee_16407_6*/;
select get_lock('ee_16407_5', 60); /*ee_16407_6*/
select release_lock('ee_16407_5');
call events_test.ee_16407_6_pendant();
end|

View File

@@ -203,7 +203,7 @@ CONCAT('"',CONCAT_WS('";"',repeat('a',60),repeat('b',60),repeat('c',60),repeat('
"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa";"bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb";"cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc";"dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd"
select insert('txs',2,1,'hi'),insert('is ',4,0,'a'),insert('txxxxt',2,4,'es');
insert('txs',2,1,'hi') insert('is ',4,0,'a') insert('txxxxt',2,4,'es')
this is a test
this is test
select replace('aaaa','a','b'),replace('aaaa','aa','b'),replace('aaaa','a','bb'),replace('aaaa','','b'),replace('bbbb','a','c');
replace('aaaa','a','b') replace('aaaa','aa','b') replace('aaaa','a','bb') replace('aaaa','','b') replace('bbbb','a','c')
bbbb bb bbbbbbbb aaaa bbbb
@@ -2335,7 +2335,7 @@ INSERT('abc', 3, 3, '1234')
ab1234
SELECT INSERT('abc', 4, 3, '1234');
INSERT('abc', 4, 3, '1234')
abc1234
abc
SELECT INSERT('abc', 5, 3, '1234');
INSERT('abc', 5, 3, '1234')
abc
@@ -2625,7 +2625,7 @@ CREATE TABLE t1 ( a TEXT );
SELECT 'aaaaaaaaaaaaaa' INTO OUTFILE 'MYSQLTEST_VARDIR/tmp/bug58165.txt';;
SELECT insert( substring_index( 'a', 'a', 'b' ), 1, 0, 'x' );
insert( substring_index( 'a', 'a', 'b' ), 1, 0, 'x' )
x
Warnings:
Warning 1292 Truncated incorrect INTEGER value: 'b'
LOAD DATA INFILE 'MYSQLTEST_VARDIR/tmp/bug58165.txt' INTO TABLE t1;;

View File

@@ -1722,6 +1722,43 @@ select 1 from t1 where 1 < some (select cast(a as datetime) from t1);
1
1
drop table t1;
#
# Bug #21564557: INCONSISTENT OUTPUT FROM 5.5 AND 5.6
# UNIX_TIMESTAMP(STR_TO_DATE('201506', "%Y%M"
#
SELECT UNIX_TIMESTAMP(STR_TO_DATE('201506', "%Y%m"));
UNIX_TIMESTAMP(STR_TO_DATE('201506', "%Y%m"))
NULL
Warnings:
Warning 1411 Incorrect datetime value: '201506' for function str_to_date
SELECT UNIX_TIMESTAMP('2015-06-00');
UNIX_TIMESTAMP('2015-06-00')
NULL
Warnings:
Warning 1292 Incorrect datetime value: '2015-06-00'
SELECT UNIX_TIMESTAMP(STR_TO_DATE('0000-00-00 10:30:30', '%Y-%m-%d %h:%i:%s'));
UNIX_TIMESTAMP(STR_TO_DATE('0000-00-00 10:30:30', '%Y-%m-%d %h:%i:%s'))
NULL
set sql_mode= 'TRADITIONAL';
SELECT @@sql_mode;
@@sql_mode
STRICT_TRANS_TABLES,STRICT_ALL_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,TRADITIONAL,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION
SELECT UNIX_TIMESTAMP(STR_TO_DATE('201506', "%Y%m"));
UNIX_TIMESTAMP(STR_TO_DATE('201506', "%Y%m"))
NULL
Warnings:
Warning 1411 Incorrect datetime value: '201506' for function str_to_date
SELECT UNIX_TIMESTAMP('2015-06-00');
UNIX_TIMESTAMP('2015-06-00')
NULL
Warnings:
Warning 1292 Incorrect datetime value: '2015-06-00'
SELECT UNIX_TIMESTAMP(STR_TO_DATE('0000-00-00 10:30:30', '%Y-%m-%d %h:%i:%s'));
UNIX_TIMESTAMP(STR_TO_DATE('0000-00-00 10:30:30', '%Y-%m-%d %h:%i:%s'))
NULL
Warnings:
Warning 1411 Incorrect datetime value: '0000-00-00 10:30:30' for function str_to_date
set sql_mode= default;
select time('10:10:10') > 10;
time('10:10:10') > 10
1

View File

@@ -35,3 +35,36 @@ c1
Ann
Alice
DROP TABLE t1, t2, t3, t4, t5;
create table t1 (c1 varchar(100));
create table t2 (c1 varchar(100));
create view t3 as select * from t1;
insert into t1 values ('ann'), ('alice');
insert into t2 values ('bob'), ('brian');
create temporary table t4 (c1 varchar(100)) engine=MERGE union=(t2, t1);
create temporary table t5 (c1 varchar(100)) engine=MERGE union=(t3, t1);
select * from t5;
ERROR HY000: Unable to open underlying table which is differently defined or of non-MyISAM type or doesn't exist
lock tables t1 read, t2 read, t3 read, t4 read;
select * from t5;
ERROR HY000: Unable to open underlying table which is differently defined or of non-MyISAM type or doesn't exist
select * from t4;
c1
bob
brian
ann
alice
unlock tables;
drop table t2;
create view t2 as select * from t1;
select * from t4;
ERROR HY000: Unable to open underlying table which is differently defined or of non-MyISAM type or doesn't exist
lock tables t1 read, t2 read, t3 read;
select * from t4;
ERROR HY000: Unable to open underlying table which is differently defined or of non-MyISAM type or doesn't exist
select * from t4;
ERROR HY000: Unable to open underlying table which is differently defined or of non-MyISAM type or doesn't exist
select * from t4;
ERROR HY000: Unable to open underlying table which is differently defined or of non-MyISAM type or doesn't exist
unlock tables;
drop view t2, t3;
drop table t1;

View File

@@ -29,9 +29,11 @@ select length(data) from t1;
length(data)
18874368
alter table t1 modify data blob;
Warnings:
Warning 1265 Data truncated for column 'data' at row 1
select length(data) from t1;
length(data)
0
65535
drop table t1;
CREATE TABLE t1 (data BLOB) ENGINE=myisam;
INSERT INTO t1 (data) VALUES (NULL);

View File

@@ -318,4 +318,64 @@ master-bin.000001 # Gtid # # GTID #-#-#
master-bin.000001 # Query # # use `test`; REPAIR VIEW `v4` FROM MYSQL
drop table if exists kv;
drop view v1,v2,v3,v4;
rename table mysql.event to mysql.ev_bk;
flush tables;
The --upgrade-system-tables option was used, user tables won't be touched.
MySQL upgrade detected
Phase 1/6: Checking and upgrading mysql database
Processing databases
mysql
mysql.column_stats OK
mysql.columns_priv OK
mysql.db OK
mysql.ev_bk OK
mysql.event OK
mysql.func OK
mysql.gtid_slave_pos OK
mysql.help_category OK
mysql.help_keyword OK
mysql.help_relation OK
mysql.help_topic OK
mysql.host OK
mysql.index_stats OK
mysql.innodb_index_stats
Error : Unknown storage engine 'InnoDB'
error : Corrupt
mysql.innodb_table_stats
Error : Unknown storage engine 'InnoDB'
error : Corrupt
mysql.plugin OK
mysql.proc OK
mysql.procs_priv OK
mysql.proxies_priv OK
mysql.roles_mapping OK
mysql.servers OK
mysql.table_stats OK
mysql.tables_priv OK
mysql.time_zone OK
mysql.time_zone_leap_second OK
mysql.time_zone_name OK
mysql.time_zone_transition OK
mysql.time_zone_transition_type OK
mysql.user OK
Repairing tables
mysql.innodb_index_stats
Error : Unknown storage engine 'InnoDB'
error : Corrupt
mysql.innodb_table_stats
Error : Unknown storage engine 'InnoDB'
error : Corrupt
Phase 2/6: Fixing views from mysql
test.v1 OK
test.v2 OK
test.v3 OK
Phase 3/6: Running 'mysql_fix_privilege_tables'
Phase 4/6: Fixing table and database names ... Skipped
Phase 5/6: Checking and upgrading tables... Skipped
Phase 6/6: Running 'FLUSH PRIVILEGES'
OK
drop table mysql.event;
rename table mysql.ev_bk to mysql.event;
drop view v1,v2,v3;
drop table t1;

View File

@@ -347,6 +347,9 @@ CREATE TABLE test.`t.1` (id int);
mysqlcheck test t.1
test.t.1 OK
drop table test.`t.1`;
#
# MDEV-8123 mysqlcheck: new --process-views option conflicts with --quick, --extended and such
#
create view v1 as select 1;
mysqlcheck --process-views test
test.v1 OK
@@ -361,6 +364,9 @@ test.v1 OK
mysqlcheck --process-views --check-upgrade test
test.v1 OK
drop view v1;
#
# MDEV-8124 mysqlcheck: --auto-repair runs REPAIR TABLE instead of REPAIR VIEW on views
#
create table t1(a int);
mysqlcheck --process-views --check-upgrade --auto-repair test
test.t1 OK
@@ -370,3 +376,16 @@ Repairing views
test.v1 OK
drop view v1;
drop table t1;
#
#MDEV-7384 [PATCH] add PERSISENT FOR ALL option to mysqlanalyze/mysqlcheck
#
create table t1(a int);
insert into t1 (a) values (1), (2), (3);
select * from mysql.column_stats;
db_name table_name column_name min_value max_value nulls_ratio avg_length avg_frequency hist_size hist_type histogram
test.t1 Engine-independent statistics collected
status : OK
select * from mysql.column_stats where db_name = 'test' and table_name = 't1';
db_name table_name column_name min_value max_value nulls_ratio avg_length avg_frequency hist_size hist_type histogram
test t1 a 1 3 0.0000 4.0000 1.0000 0 NULL NULL
drop table t1;

View File

@@ -3467,3 +3467,21 @@ id select_type table partitions type possible_keys key key_len ref rows Extra
1 PRIMARY t2 p_1000 ref PRIMARY PRIMARY 8 const 2 Using index
1 PRIMARY t1 p_1000 ALL PRIMARY NULL NULL NULL 6 Using where; Using join buffer (flat, BNL join)
drop table t1,t2;
#
# MDEV-9505: Valgrind failure in SEL_ARG::store_min,find_used_partitions,...
#
create table t1 (a int, b char(10), c varchar(5), d int)
partition by range columns(a,b,c)
subpartition by key (c,d)
subpartitions 3
( partition p0 values less than (1,'abc','abc'),
partition p1 values less than (2,'abc','abc'),
partition p2 values less than (3,'abc','abc'),
partition p3 values less than (4,'abc','abc')
);
insert into t1 values (1,'a','b',1),(2,'a','b',2),(3,'a','b',3);
select * from t1 where (a = 1 AND b < 'd' AND (c = 'b' OR (c = 'c' AND d = 1)) OR
(a = 1 AND b >= 'a' AND (c = 'c' OR (c = 'd' AND d = 2))));
a b c d
1 a b 1
drop table t1;

View File

@@ -0,0 +1,13 @@
select timestampdiff(microsecond,'2000-01-01 00:00:00','2001-01-01 00:00:00.123456');
timestampdiff(microsecond,'2000-01-01 00:00:00','2001-01-01 00:00:00.123456')
31622400123456
explain extended select timestampdiff(microsecond,'2000-01-01 00:00:00','2001-01-01 00:00:00.123456');
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used
Warnings:
Note 1003 select timestampdiff(MICROSECOND,'2000-01-01 00:00:00','2001-01-01 00:00:00.123456') AS `timestampdiff(microsecond,'2000-01-01 00:00:00','2001-01-01 00:00:00.123456')`
create view v1 as select timestampdiff(microsecond,'2000-01-01 00:00:00','2001-01-01 00:00:00.123456');
select * from v1;
Name_exp_1
31622400123456
drop view v1;

View File

@@ -348,3 +348,18 @@ select found_rows();
found_rows()
75
drop table t1;
create table t1(c1 int);
insert into t1 values(1),(2),(3),(4),(5);
select * from t1 order by c1 limit 2,1;
c1
3
select found_rows();
found_rows()
3
select sql_calc_found_rows * from t1 order by c1 limit 2,1;
c1
3
select found_rows();
found_rows()
5
drop table t1;

View File

@@ -4323,57 +4323,57 @@ test.t1 repair status OK
test.t2 repair status OK
test.t3 repair status OK
test.v1 repair Error 'test.v1' is not BASE TABLE
test.v1 repair error Corrupt
test.v1 repair status Operation failed
Table Op Msg_type Msg_text
test.t1 optimize status OK
test.t2 optimize status OK
test.t3 optimize status OK
test.v1 optimize Error 'test.v1' is not BASE TABLE
test.v1 optimize error Corrupt
test.v1 optimize status Operation failed
Table Op Msg_type Msg_text
test.t1 analyze status Table is already up to date
test.t2 analyze status Table is already up to date
test.t3 analyze status Table is already up to date
test.v1 analyze Error 'test.v1' is not BASE TABLE
test.v1 analyze error Corrupt
test.v1 analyze status Operation failed
call bug13012()|
Table Op Msg_type Msg_text
test.t1 repair status OK
test.t2 repair status OK
test.t3 repair status OK
test.v1 repair Error 'test.v1' is not BASE TABLE
test.v1 repair error Corrupt
test.v1 repair status Operation failed
Table Op Msg_type Msg_text
test.t1 optimize status OK
test.t2 optimize status OK
test.t3 optimize status OK
test.v1 optimize Error 'test.v1' is not BASE TABLE
test.v1 optimize error Corrupt
test.v1 optimize status Operation failed
Table Op Msg_type Msg_text
test.t1 analyze status Table is already up to date
test.t2 analyze status Table is already up to date
test.t3 analyze status Table is already up to date
test.v1 analyze Error 'test.v1' is not BASE TABLE
test.v1 analyze error Corrupt
test.v1 analyze status Operation failed
call bug13012()|
Table Op Msg_type Msg_text
test.t1 repair status OK
test.t2 repair status OK
test.t3 repair status OK
test.v1 repair Error 'test.v1' is not BASE TABLE
test.v1 repair error Corrupt
test.v1 repair status Operation failed
Table Op Msg_type Msg_text
test.t1 optimize status OK
test.t2 optimize status OK
test.t3 optimize status OK
test.v1 optimize Error 'test.v1' is not BASE TABLE
test.v1 optimize error Corrupt
test.v1 optimize status Operation failed
Table Op Msg_type Msg_text
test.t1 analyze status Table is already up to date
test.t2 analyze status Table is already up to date
test.t3 analyze status Table is already up to date
test.v1 analyze Error 'test.v1' is not BASE TABLE
test.v1 analyze error Corrupt
test.v1 analyze status Operation failed
drop procedure bug13012|
drop view v1|
select * from t1 order by data|

View File

@@ -0,0 +1,5 @@
#T1: Host name (/CN=localhost/) as OU name in the server certificate, server certificate verification should fail.
#T2: Host name (localhost) as common name in the server certificate, server certificate verification should pass.
Variable_name Value
Ssl_version TLS_VERSION
# restart server using restart

View File

@@ -7086,6 +7086,20 @@ NULL
deallocate prepare stmt;
drop table t1,t2,t3,t4;
#
# MDEV-7122
# Assertion `0' failed in subselect_hash_sj_engine::init
#
SET SESSION big_tables=1;
CREATE TABLE t1(a char(255) DEFAULT '', KEY(a(10))) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
INSERT INTO t1 VALUES(0),(0),(0);
SELECT * FROM t1 WHERE a IN(SELECT MIN(a) FROM t1);
a
0
0
0
DROP TABLE t1;
SET SESSION big_tables=0;
#
# MDEV-7930: Assertion `table_share->tmp_table != NO_TMP_TABLE ||
# m_lock_type != 2' failed in handler::ha_index_read_map
#

View File

@@ -349,9 +349,9 @@ WHERE t.a IN (SELECT b FROM t1);
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY t1 system NULL NULL NULL NULL 1 100.00
1 PRIMARY t2 ALL NULL NULL NULL NULL 2 100.00 Using where
3 MATERIALIZED t1 system NULL NULL NULL NULL 1 100.00
3 DEPENDENT SUBQUERY t1 system NULL NULL NULL NULL 1 100.00
Warnings:
Note 1003 select `test`.`t2`.`a` AS `a`,0 AS `a`,0 AS `b` from `test`.`t2` where <expr_cache><0>(<in_optimizer>(0,0 in ( <materialize> (select 0 from dual ), <primary_index_lookup>(0 in <temporary table> on distinct_key where ((0 = `<subquery3>`.`b`))))))
Note 1003 select `test`.`t2`.`a` AS `a`,0 AS `a`,0 AS `b` from `test`.`t2` where <expr_cache><0>(<in_optimizer>(0,<exists>(select 0 from dual where (<cache>(0) = 0))))
SELECT * FROM t2 RIGHT JOIN v1 AS t ON t.a != 0
WHERE t.a IN (SELECT b FROM t1);
a a b
@@ -362,9 +362,9 @@ WHERE t.a IN (SELECT b FROM t1);
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY t1 system NULL NULL NULL NULL 1 100.00
1 PRIMARY t2 ALL NULL NULL NULL NULL 2 100.00 Using where
2 MATERIALIZED t1 system NULL NULL NULL NULL 1 100.00
2 DEPENDENT SUBQUERY t1 system NULL NULL NULL NULL 1 100.00
Warnings:
Note 1003 select `test`.`t2`.`a` AS `a`,0 AS `a`,0 AS `b` from `test`.`t2` where <expr_cache><0>(<in_optimizer>(0,0 in ( <materialize> (select 0 from dual ), <primary_index_lookup>(0 in <temporary table> on distinct_key where ((0 = `<subquery2>`.`b`))))))
Note 1003 select `test`.`t2`.`a` AS `a`,0 AS `a`,0 AS `b` from `test`.`t2` where <expr_cache><0>(<in_optimizer>(0,<exists>(select 0 from dual where (<cache>(0) = 0))))
DROP VIEW v1;
DROP TABLE t1,t2;
#

View File

@@ -7086,6 +7086,20 @@ NULL
deallocate prepare stmt;
drop table t1,t2,t3,t4;
#
# MDEV-7122
# Assertion `0' failed in subselect_hash_sj_engine::init
#
SET SESSION big_tables=1;
CREATE TABLE t1(a char(255) DEFAULT '', KEY(a(10))) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
INSERT INTO t1 VALUES(0),(0),(0);
SELECT * FROM t1 WHERE a IN(SELECT MIN(a) FROM t1);
a
0
0
0
DROP TABLE t1;
SET SESSION big_tables=0;
#
# MDEV-7930: Assertion `table_share->tmp_table != NO_TMP_TABLE ||
# m_lock_type != 2' failed in handler::ha_index_read_map
#

View File

@@ -7079,6 +7079,20 @@ NULL
deallocate prepare stmt;
drop table t1,t2,t3,t4;
#
# MDEV-7122
# Assertion `0' failed in subselect_hash_sj_engine::init
#
SET SESSION big_tables=1;
CREATE TABLE t1(a char(255) DEFAULT '', KEY(a(10))) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
INSERT INTO t1 VALUES(0),(0),(0);
SELECT * FROM t1 WHERE a IN(SELECT MIN(a) FROM t1);
a
0
0
0
DROP TABLE t1;
SET SESSION big_tables=0;
#
# MDEV-7930: Assertion `table_share->tmp_table != NO_TMP_TABLE ||
# m_lock_type != 2' failed in handler::ha_index_read_map
#

View File

@@ -7077,6 +7077,20 @@ NULL
deallocate prepare stmt;
drop table t1,t2,t3,t4;
#
# MDEV-7122
# Assertion `0' failed in subselect_hash_sj_engine::init
#
SET SESSION big_tables=1;
CREATE TABLE t1(a char(255) DEFAULT '', KEY(a(10))) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
INSERT INTO t1 VALUES(0),(0),(0);
SELECT * FROM t1 WHERE a IN(SELECT MIN(a) FROM t1);
a
0
0
0
DROP TABLE t1;
SET SESSION big_tables=0;
#
# MDEV-7930: Assertion `table_share->tmp_table != NO_TMP_TABLE ||
# m_lock_type != 2' failed in handler::ha_index_read_map
#

View File

@@ -7092,6 +7092,20 @@ NULL
deallocate prepare stmt;
drop table t1,t2,t3,t4;
#
# MDEV-7122
# Assertion `0' failed in subselect_hash_sj_engine::init
#
SET SESSION big_tables=1;
CREATE TABLE t1(a char(255) DEFAULT '', KEY(a(10))) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
INSERT INTO t1 VALUES(0),(0),(0);
SELECT * FROM t1 WHERE a IN(SELECT MIN(a) FROM t1);
a
0
0
0
DROP TABLE t1;
SET SESSION big_tables=0;
#
# MDEV-7930: Assertion `table_share->tmp_table != NO_TMP_TABLE ||
# m_lock_type != 2' failed in handler::ha_index_read_map
#

View File

@@ -7077,6 +7077,20 @@ NULL
deallocate prepare stmt;
drop table t1,t2,t3,t4;
#
# MDEV-7122
# Assertion `0' failed in subselect_hash_sj_engine::init
#
SET SESSION big_tables=1;
CREATE TABLE t1(a char(255) DEFAULT '', KEY(a(10))) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
INSERT INTO t1 VALUES(0),(0),(0);
SELECT * FROM t1 WHERE a IN(SELECT MIN(a) FROM t1);
a
0
0
0
DROP TABLE t1;
SET SESSION big_tables=0;
#
# MDEV-7930: Assertion `table_share->tmp_table != NO_TMP_TABLE ||
# m_lock_type != 2' failed in handler::ha_index_read_map
#

View File

@@ -2997,4 +2997,69 @@ explain
select 1 from t1 where _cp932 "1" in (select '1' from t1);
ERROR HY000: Illegal mix of collations (cp932_japanese_ci,COERCIBLE) and (latin1_swedish_ci,COERCIBLE) for operation '='
drop table t1;
#
# MDEV-7823: Server crashes in next_depth_first_tab on nested IN clauses with SQ inside
#
set @tmp_mdev7823=@@optimizer_switch;
set optimizer_switch=default;
CREATE TABLE t1 (f1 INT);
INSERT INTO t1 VALUES (1);
CREATE TABLE t2 (f2 INT, KEY(f2));
INSERT INTO t2 VALUES (8),(0);
CREATE TABLE t3 (f3 INT);
INSERT INTO t3 VALUES (1),(2);
CREATE TABLE t4 (f4 INT);
INSERT INTO t4 VALUES (0),(5);
explain
SELECT * FROM t1, t2, t3 WHERE f2 IN ( f1 IN ( SELECT f4 FROM t4 ) );
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 system NULL NULL NULL NULL 1
1 PRIMARY t2 ref f2 f2 5 const 0 Using where; Using index
1 PRIMARY t3 ALL NULL NULL NULL NULL 2 Using join buffer (flat, BNL join)
2 DEPENDENT SUBQUERY t4 ALL NULL NULL NULL NULL 2 Using where
SELECT * FROM t1, t2, t3 WHERE f2 IN ( f1 IN ( SELECT f4 FROM t4 ) );
f1 f2 f3
1 0 1
1 0 2
drop table t1,t2,t3,t4;
set optimizer_switch= @tmp_mdev7823;
#
# MDEV-6859: scalar subqueries in a comparison produced unexpected result
#
set @tmp_mdev6859=@@optimizer_switch;
set optimizer_switch=default;
CREATE TABLE t1 (
project_number varchar(50) NOT NULL,
PRIMARY KEY (project_number)
) ENGINE=MyISAM;
INSERT INTO t1 (project_number) VALUES ('aaa'),('bbb');
CREATE TABLE t2 (
id int(10) unsigned NOT NULL AUTO_INCREMENT,
project_number varchar(50) NOT NULL,
history_date date NOT NULL,
country varchar(50) NOT NULL,
PRIMARY KEY (id)
) ENGINE=MyISAM;
INSERT INTO t2 (id, project_number, history_date, country) VALUES
(1, 'aaa', '2014-08-09', 'france'),(2, 'aaa', '2014-09-09', 'singapore');
CREATE TABLE t3 (
region varchar(50) NOT NULL,
country varchar(50) NOT NULL
) ENGINE=MyISAM;
INSERT INTO t3 (region, country) VALUES ('apac', 'singapore'),('eame', 'france');
SELECT SQL_NO_CACHE a.project_number
FROM t1 a
WHERE ( SELECT z.country
FROM t2 z
WHERE z.project_number = a.project_number AND z.history_date <= '2014-09-01'
ORDER BY z.id DESC LIMIT 1
) IN (
SELECT r.country
FROM t3 r
WHERE r.region = 'eame'
);
project_number
aaa
drop table t1, t2, t3;
set optimizer_switch= @tmp_mdev6859;
set optimizer_switch=@subselect_sj_tmp;

View File

@@ -3011,6 +3011,71 @@ explain
select 1 from t1 where _cp932 "1" in (select '1' from t1);
ERROR HY000: Illegal mix of collations (cp932_japanese_ci,COERCIBLE) and (latin1_swedish_ci,COERCIBLE) for operation '='
drop table t1;
#
# MDEV-7823: Server crashes in next_depth_first_tab on nested IN clauses with SQ inside
#
set @tmp_mdev7823=@@optimizer_switch;
set optimizer_switch=default;
CREATE TABLE t1 (f1 INT);
INSERT INTO t1 VALUES (1);
CREATE TABLE t2 (f2 INT, KEY(f2));
INSERT INTO t2 VALUES (8),(0);
CREATE TABLE t3 (f3 INT);
INSERT INTO t3 VALUES (1),(2);
CREATE TABLE t4 (f4 INT);
INSERT INTO t4 VALUES (0),(5);
explain
SELECT * FROM t1, t2, t3 WHERE f2 IN ( f1 IN ( SELECT f4 FROM t4 ) );
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 system NULL NULL NULL NULL 1
1 PRIMARY t2 ref f2 f2 5 const 0 Using where; Using index
1 PRIMARY t3 ALL NULL NULL NULL NULL 2 Using join buffer (flat, BNL join)
2 DEPENDENT SUBQUERY t4 ALL NULL NULL NULL NULL 2 Using where
SELECT * FROM t1, t2, t3 WHERE f2 IN ( f1 IN ( SELECT f4 FROM t4 ) );
f1 f2 f3
1 0 1
1 0 2
drop table t1,t2,t3,t4;
set optimizer_switch= @tmp_mdev7823;
#
# MDEV-6859: scalar subqueries in a comparison produced unexpected result
#
set @tmp_mdev6859=@@optimizer_switch;
set optimizer_switch=default;
CREATE TABLE t1 (
project_number varchar(50) NOT NULL,
PRIMARY KEY (project_number)
) ENGINE=MyISAM;
INSERT INTO t1 (project_number) VALUES ('aaa'),('bbb');
CREATE TABLE t2 (
id int(10) unsigned NOT NULL AUTO_INCREMENT,
project_number varchar(50) NOT NULL,
history_date date NOT NULL,
country varchar(50) NOT NULL,
PRIMARY KEY (id)
) ENGINE=MyISAM;
INSERT INTO t2 (id, project_number, history_date, country) VALUES
(1, 'aaa', '2014-08-09', 'france'),(2, 'aaa', '2014-09-09', 'singapore');
CREATE TABLE t3 (
region varchar(50) NOT NULL,
country varchar(50) NOT NULL
) ENGINE=MyISAM;
INSERT INTO t3 (region, country) VALUES ('apac', 'singapore'),('eame', 'france');
SELECT SQL_NO_CACHE a.project_number
FROM t1 a
WHERE ( SELECT z.country
FROM t2 z
WHERE z.project_number = a.project_number AND z.history_date <= '2014-09-01'
ORDER BY z.id DESC LIMIT 1
) IN (
SELECT r.country
FROM t3 r
WHERE r.region = 'eame'
);
project_number
aaa
drop table t1, t2, t3;
set optimizer_switch= @tmp_mdev6859;
set optimizer_switch=@subselect_sj_tmp;
#
# BUG#49129: Wrong result with IN-subquery with join_cache_level=6 and firstmatch=off

View File

@@ -1000,9 +1000,42 @@ COUNT(*)
DROP FUNCTION f1;
DROP TABLE t1;
End of 5.1 tests
#
# Start of 5.5 tests
#
CREATE TABLE t1 ( f1 blob, f2 blob );
INSERT INTO t1 VALUES ('','');
SELECT f1,f2,"found row" FROM t1 WHERE f1 = f2 ;
f1 f2 found row
found row
DROP TABLE t1;
#
# MDEV-9319 ALTER from a bigger to a smaller blob type truncates too much data
#
CREATE TABLE t1 (a MEDIUMBLOB);
INSERT INTO t1 VALUES (REPEAT(0x61,128000));
SELECT LENGTH(a) FROM t1;
LENGTH(a)
128000
ALTER TABLE t1 MODIFY a BLOB;
Warnings:
Warning 1265 Data truncated for column 'a' at row 1
SELECT LENGTH(a) FROM t1;
LENGTH(a)
65535
DROP TABLE t1;
CREATE TABLE t1 (a BLOB);
INSERT INTO t1 VALUES (REPEAT(0x61,65000));
SELECT LENGTH(a) FROM t1;
LENGTH(a)
65000
ALTER TABLE t1 MODIFY a TINYBLOB;
Warnings:
Warning 1265 Data truncated for column 'a' at row 1
SELECT LENGTH(a) FROM t1;
LENGTH(a)
255
DROP TABLE t1;
#
# End of 5.5 tests
#

View File

@@ -438,3 +438,12 @@ id select_type table type possible_keys key key_len ref rows Extra
select 1 from t1 as t1_0 inner join t1 as t2 on (t1_0.a <=> now()) join t1 on 1;
1
drop table t1;
#
# MDEV-9511 Valgrind warnings 'Invalid read' in Field_newdate::cmp and Field_newdate::val_str
#
CREATE TABLE t1 (f1 DATE, f2 VARCHAR(1));
INSERT INTO t1 VALUES ('2003-04-27','a'),('1900-01-01','a');
SELECT GROUP_CONCAT(f2, IF(f1, f2, f1), f1 ORDER BY 2,1,3) FROM t1;
GROUP_CONCAT(f2, IF(f1, f2, f1), f1 ORDER BY 2,1,3)
aa1900-01-01,aa2003-04-27
DROP TABLE t1;

View File

@@ -2422,28 +2422,28 @@ CREATE VIEW v1 AS SELECT id FROM t1;
OPTIMIZE TABLE v1;
Table Op Msg_type Msg_text
test.v1 optimize Error 'test.v1' is not BASE TABLE
test.v1 optimize error Corrupt
test.v1 optimize status Operation failed
ANALYZE TABLE v1;
Table Op Msg_type Msg_text
test.v1 analyze Error 'test.v1' is not BASE TABLE
test.v1 analyze error Corrupt
test.v1 analyze status Operation failed
REPAIR TABLE v1;
Table Op Msg_type Msg_text
test.v1 repair Error 'test.v1' is not BASE TABLE
test.v1 repair error Corrupt
test.v1 repair status Operation failed
DROP TABLE t1;
OPTIMIZE TABLE v1;
Table Op Msg_type Msg_text
test.v1 optimize Error 'test.v1' is not BASE TABLE
test.v1 optimize error Corrupt
test.v1 optimize status Operation failed
ANALYZE TABLE v1;
Table Op Msg_type Msg_text
test.v1 analyze Error 'test.v1' is not BASE TABLE
test.v1 analyze error Corrupt
test.v1 analyze status Operation failed
REPAIR TABLE v1;
Table Op Msg_type Msg_text
test.v1 repair Error 'test.v1' is not BASE TABLE
test.v1 repair error Corrupt
test.v1 repair status Operation failed
DROP VIEW v1;
create definer = current_user() sql security invoker view v1 as select 1;
show create view v1;
@@ -5510,6 +5510,14 @@ execute stmt;
deallocate prepare stmt;
drop view v1,v2;
drop table `t1`;
create table t1 (a int, b int);
create view v1 as select a+b from t1;
alter table v1 check partition p1;
Table Op Msg_type Msg_text
test.v1 check Error 'test.v1' is not BASE TABLE
test.v1 check status Operation failed
drop view v1;
drop table t1;
# -----------------------------------------------------------------
# -- End of 5.5 tests.
# -----------------------------------------------------------------

View File

@@ -0,0 +1,20 @@
-----BEGIN CERTIFICATE-----
MIIDWzCCAkOgAwIBAgIJAO/QdKLEDQdXMA0GCSqGSIb3DQEBCwUAMEQxCzAJBgNV
BAYTAklOMREwDwYDVQQIDAhLYXJuYXRrYTESMBAGA1UEBwwJQmFuZ2Fsb3JlMQ4w
DAYDVQQKDAVNeVNRTDAeFw0xNjAxMDUxMDA1MDhaFw0yNTExMTMxMDA1MDhaMEQx
CzAJBgNVBAYTAklOMREwDwYDVQQIDAhLYXJuYXRrYTESMBAGA1UEBwwJQmFuZ2Fs
b3JlMQ4wDAYDVQQKDAVNeVNRTDCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoC
ggEBAKdOCuS2CzfBTJ2x8SAzY0J7cYJfNJvMDF1cvANnhkIhtnkWt/HZ5DJ9NxeX
q5h7FJLAi4gddqdk/tvQJw0V6gZepJr/mKVnMPivF5+oHPc9ZJQMX6B3FBNwWylm
ACd5GKx8I/H/MXyuhQTcoV//Ab+2pI8RHeYbBsm3lHH+tX7bRU6mUFjneqMpiCkb
JHt6BWZiWR10O6pMuGQ9+dDdsLhEV1fj3CctEPwW6rs4IZzD8xl5n+8cy7qu6eYH
Wt/snwsTzkrufeMRqTtqelxON9eoQwYOR1oH3vNEVlcbuoJAvaWOqBROUBdf12SP
TYSdP9nlRh7lTKQOywN4kYt6LqUCAwEAAaNQME4wHQYDVR0OBBYEFJ4c9tKaUU0P
EjBq5G207jjXI7RAMB8GA1UdIwQYMBaAFJ4c9tKaUU0PEjBq5G207jjXI7RAMAwG
A1UdEwQFMAMBAf8wDQYJKoZIhvcNAQELBQADggEBABRnUyj21oFi0SGJg/K5+8Lc
4n6OwVU/NgLOysIB0baIP/Rqeaze59xG/v9FPQgBlWcJK3RabOywx5bxAxdcus+1
yp5j4h37Qq1/qkgqmevvdSAPa0OBQbLb+58/naV+ywUpCYZ6flLdCMH3fXuDSlSq
qrCznextjojtWbnzrBmCmJmXWGd2gSaJDvb90ZZp/Elt3vN1sgjW0M/JEkb4MJ1r
6nfD/FHr2lUwBHm2yk7Blovx7x4d/Ip3pglk63cNO/Rn0SBTdoVDS2LB9du3Phq2
TZiL3NrRMGUNwmdaavyrJxaPq5D+Sfa4LYP3MMYD4KhLogNzIl299n5joyizlJw=
-----END CERTIFICATE-----

View File

@@ -0,0 +1,19 @@
-----BEGIN CERTIFICATE-----
MIIDJzCCAg8CAQEwDQYJKoZIhvcNAQELBQAwRDELMAkGA1UEBhMCSU4xETAPBgNV
BAgMCEthcm5hdGthMRIwEAYDVQQHDAlCYW5nYWxvcmUxDjAMBgNVBAoMBU15U1FM
MB4XDTE2MDEwNTEwMDgyN1oXDTI1MTExMzEwMDgyN1owbzELMAkGA1UEBhMCSU4x
EjAQBgNVBAgMCTpLYXJuYXRrYTETMBEGA1UEBwwKOkJhbmdhbG9yZTEPMA0GA1UE
CgwGOk15U1FMMRcwFQYDVQQLDA4vQ049bG9jYWxob3N0LzENMAsGA1UEAwwEZmFp
bDCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAL3wnWuJodzZYq9TAJRm
HU7995FA3TEWdUinYTgGP79aTVQ4M9aeINlB6whWXOI8seh9Ja7C6kMzqOgYbgCl
WlDPAVJWktFYeWXOLxbpzh1KWkS6jBkWT02t7H7JcYbil7xjlJUxLz4UOOUDUDIP
6yqdA9VE3osESttjzj57Zm2xPqzbIHVJfORn7EexH4pryS7439p6i4XtfL31NJ8V
07M3j3a8GqbcEqXYvcUCrLnywDQ1igP817b6ta52nbgYWiqdn0mJs535UJ/p/rSl
D4Ae/6G3BSEY7whir6xY6vsd4KJ6w+wRCHnY0ky6OdDJVJLH1iqh7si7P3RBGkxw
Y7MCAwEAATANBgkqhkiG9w0BAQsFAAOCAQEAggbw1jj2b7H5KDdeGJGIoOGkQAcs
GNSJussCfdk7qnzYXKmjyNppC86jjaOrXona5f+SNCuujdu86Tv8V69EH57k4lUc
DW7J4AD3vUb/tBzB0tsI/76Z4gm1XoCsnCGGpWd8GQAg/QNn/ZfJB2Vb/9ObN6rH
0HV7ouB6OGZSsb71+grKiN6mDyB1lZynCGvqBxOCKFISfcRbCNFHo/pONlHaNGPE
vjDH1bPZbEHj8owYgkdcQe0a8EbJYeQfm6fH8V8bmUcG7N60DrCnq4l1qwwVkh1S
7RpIDgrWkU+esIIdYZIIbtDxQP1Sm7kUh++7b+bcHnyw3KtDVSCw7MIedA==
-----END CERTIFICATE-----

View File

@@ -0,0 +1,19 @@
-----BEGIN CERTIFICATE-----
MIIDEzCCAfsCAQEwDQYJKoZIhvcNAQELBQAwRDELMAkGA1UEBhMCSU4xETAPBgNV
BAgMCEthcm5hdGthMRIwEAYDVQQHDAlCYW5nYWxvcmUxDjAMBgNVBAoMBU15U1FM
MB4XDTE2MDEwNTEwMDU1OVoXDTI1MTExMzEwMDU1OVowWzELMAkGA1UEBhMCSU4x
EjAQBgNVBAgMCTpLYXJuYXRrYTETMBEGA1UEBwwKOkJhbmdhbG9yZTEPMA0GA1UE
CgwGOk15U1FMMRIwEAYDVQQDDAlsb2NhbGhvc3QwggEiMA0GCSqGSIb3DQEBAQUA
A4IBDwAwggEKAoIBAQDAmkbUwDe+nrqL8A8uwlIZk74HHCDjUAWrskKF9leEIQsB
5exFZ8JEo1u6mdR4laQWsxizGdTPqIEidkDyyEMh4+joHgyQEPD/G3rFVW8yEFHb
42O04O96BEPFXNPDRuX3MxI+lGbYDjxTS/WhVub4/3SqLjC28FJmEUXIHA0/A+c5
hlYXK0u+aPAqXxHIjBgB4BxxHXZKqecmvR3LhXoVmhJmndsVfKajB27nDKc8/OTI
H2SXb6h3nRPDXRfwB/C5i+004tEsVeIgkYshcCgLSyDdeVieUP2pm3EAmDSjmtLF
6CgY/EBSfH+JCKFUk75bA4k8CCGzBfIeOcsKHwgFAgMBAAEwDQYJKoZIhvcNAQEL
BQADggEBAInDuHtDkeT6dkWmRJCP56c4xiQqib2QuYUuMSrAhf07xlLHc6iHnD2X
hCWCrja6uwF90DnPjeouKMAUe5txq/uKA8/Y/NfXN6nPiAeHLI0qnTv7Mr9TQ8zU
DNDwRz6onlI2cS4GhrwAnlpiaxu7AjMUWHtfBFGFrgn3PawjDQpsBZNcxw1QsLc0
E0hFrWLOd0vDETEhoRge88N7a0jqK0Rd9cvRWnvjI+IsjQMLZzKufivIHPzI9K+9
Wtp8iRHcaBr5DpsBjgsO7dqVRbsNyaWsdHdLt+CQSGXpv7P6fq3K6nJFTBeIgSfS
gflrHVKYZRkKDDDpX4yHNdnIqrvy4RU=
-----END CERTIFICATE-----

View File

@@ -0,0 +1,27 @@
-----BEGIN RSA PRIVATE KEY-----
MIIEpQIBAAKCAQEAvfCda4mh3Nlir1MAlGYdTv33kUDdMRZ1SKdhOAY/v1pNVDgz
1p4g2UHrCFZc4jyx6H0lrsLqQzOo6BhuAKVaUM8BUlaS0Vh5Zc4vFunOHUpaRLqM
GRZPTa3sfslxhuKXvGOUlTEvPhQ45QNQMg/rKp0D1UTeiwRK22POPntmbbE+rNsg
dUl85GfsR7EfimvJLvjf2nqLhe18vfU0nxXTszePdrwaptwSpdi9xQKsufLANDWK
A/zXtvq1rnaduBhaKp2fSYmznflQn+n+tKUPgB7/obcFIRjvCGKvrFjq+x3gonrD
7BEIedjSTLo50MlUksfWKqHuyLs/dEEaTHBjswIDAQABAoIBAQCSUyNzDPydXvsf
hhoUOParPAvU4tuETYDdD9Vdi7Lgf3jDQOjulbNIq/ec3KuBvrBwIrk9APvn+YxO
AUP9S2Vgi5jBDeDdVgNv4n90b3pSJk2UVQJI8V72wN5Ibnf/KeErSKvWo6V5daq/
AuZtKsZIdd3WFtA62HuyuBjTGc23Alj1C0EKnN0Rx1uBwDvx/OVQ266Us/x8jJqW
ZxIOfcvfNzBQEa5hAzbQCReVaC+rBLRAcMM2yGP7aDa+8cRkwuVlSqpX8CXBdLoU
PqmU49etcW72Rb1AFt9WgEu1Oh9UYbHFSB+FEbO8IGcGBsuYHf9zkxQyjpy/iKyT
H5dTu7YBAoGBAOWqEGepZVrfB+P6X18n3vbJhgYmF0sa0mCmwkFYgk36yNqsZ8at
lQjm5mbn4wjEKHIcQ/T1taq73W471M+PxMnn0WTwoG5jsyarZGgy6/95YXiyZtQe
qgA4P3aKkCteRP22DjG7uxmm9Hoqx8Z31vfRTLAHN1IEHPHHkg/J3gPTAoGBANO4
aqKeY4vcDvVkvxVbADrw++tZGwA+RuxfO4HKKru59VdA2PsAxhXwb3Dfejwj7hYW
yE9edHjGpMr1+dpf8YJYs7qjajHe1HxBOYqQGHycIdw+Gv56R4HpaS9eW3x8l/Pi
b4xnAodv2qIriACOe7br+rll4wKX46Wt64zdvpShAoGAT0r3HQM0Vjp4u/J+qRjX
9za+yjKuiiS5i9snaG5JlujGHhG2Rrc5pHgsBk17alRnbnZp1BJdZZQ1MFEB+aO2
mssp1YLqsRJFEU3NfdhO+MaMq6JUtFnd8fN5ndDbU83ZXgtUPUGGqKWm9OL+VHyd
wLQHmSL0q6F16Ngxirf0qjcCgYEAtSmiJVA+gdhk/FmeoBlkEwtNpM50Kjsf2PaM
Jrzk4Al5A5Y7lFvPI8q+sOio4XklKsWH1VJPe2EOdZUQnGlocE6SS+u03MN9Mm1l
XUl7inTXDGwgEQx0z5b4KE4nHlhGdauWI5+pLFbrz8RL9Z32AkneGnIyU2/AnW46
lijQAMECgYEAmgp/88ndIw49RCtMhYhtXQ87AsEAP6kzXQyKppDkn0os+xI5igIL
i/UDxB33hx3yjrUZwoGDV9MwlMhZNX5Tf5bwjPmmh1NR6KdEpPt5AkklX4s6uil2
Bxl1P5l1jl/PbEYtv5LDZKIPANWRzViMSIWqjUWlbdqE7/vjx+Oo+cc=
-----END RSA PRIVATE KEY-----

View File

@@ -0,0 +1,27 @@
-----BEGIN RSA PRIVATE KEY-----
MIIEowIBAAKCAQEAwJpG1MA3vp66i/APLsJSGZO+Bxwg41AFq7JChfZXhCELAeXs
RWfCRKNbupnUeJWkFrMYsxnUz6iBInZA8shDIePo6B4MkBDw/xt6xVVvMhBR2+Nj
tODvegRDxVzTw0bl9zMSPpRm2A48U0v1oVbm+P90qi4wtvBSZhFFyBwNPwPnOYZW
FytLvmjwKl8RyIwYAeAccR12SqnnJr0dy4V6FZoSZp3bFXymowdu5wynPPzkyB9k
l2+od50Tw10X8AfwuYvtNOLRLFXiIJGLIXAoC0sg3XlYnlD9qZtxAJg0o5rSxego
GPxAUnx/iQihVJO+WwOJPAghswXyHjnLCh8IBQIDAQABAoIBAHPQUSc9LkgBSks7
XuXPE28t1+aOk3gcdkx4NGg5aQaal/PcPea+LaL4WAAs4AZidPjxWLjZn43+1SfT
09opcbS/Rx3Mc+FtTn0YGQrwBJ0mExMV+K6bU2Ubi2TyHKQfzciHfUEEG5Nve/ba
hikuCFVRxuVOQRzABcw6NqvNsmlg892lfw6/+RDwMBcz7ocwzmiOUoIxgjyFo9G4
aJvRmHLij5892H6qveik+A/Xr+8leGQHiQET2wW/F9MFP5ypIT7aeE6remeZH7fG
f4/Zfei/TE4xK2ElNR/91byzeKIVY4vjtTndAiBuqpfYuICb40MC02LNW5Oe6VN2
3mQ6EgECgYEA7O4ndBnbs/00gyTGyNg6I+3wRTibhNH4R8RZFJiLfKRKOlUiLhUo
+bQeO4bCQ6YY++TYDvMEXTlA3jow9R9Mj2AWc6bNmQmJd/065QyFHftywT66I+V4
rz1ohSJyHXcv4DxqNk3o3Vb4N8GFjZKcodSgTv2Lk+9ipDYFcQiZop0CgYEA0BrF
SIyLTnjoVht/7RbIGEqhMQUiz5mx7qQ1TPB+YTG77G2xXJNg5d6S7WT4LN+cqbxN
YdndIbW4NdV7bH7FlG9q7jfkuZ+AY2BPU047tcDeyO0HYYEhVY+EyZqHci/26mvt
JrawdqS5HQS1y/rKfytm7YBGTvqoNZHvOHc6aokCgYEAxcjlbJkte+pyzMuFmiJP
HrFBczeXM+BoJ9j0GCpjvvAS+vEYsGl/pDvFRSHwx7I/hv/5kTkzOnNSAHGJbwbq
zYGEHJVxakC43k6pvI2gDnBa0pD/qHmmLnvP5dvkcU6Oy90DOUP+kc9JNJo7V/y8
/qdWD7q+qwcaTETAdCSexE0CgYA/DN1Y7bwHOnqqHArWOmDFe1b7EyNI4rgWJYpA
lVy09eyJ5XInKj/hZV3+rujCL723b2XCj89/tx7osJWEeaRDJL6xDh4uXzT25uch
xkIw/w6Asc/aqtT+p00EB92hqwaUX76qTA+K4r1zHUo3UvSnMu8sZgDnTOpJ0L05
zmXUgQKBgDT+IFrAzOty4B0mJncTCC/TulpW704bEZwNJfQSdtiBQr/vqoXygBQc
bHfpncpSfhzHB5lhRUv02TqXgl53D70nM7JD5nx98WYTTBxsbvxPlt4gBRZkfgq5
tHKclAArc1SbfW5Z8oYyl7h33LQJK116QSyiIIGieH5VXNPwnqUs
-----END RSA PRIVATE KEY-----

View File

@@ -48,7 +48,7 @@ sub skip_combinations {
return 0 unless socket my $sock, PF_INET6, SOCK_STREAM, getprotobyname('tcp');
# eval{}, if there's no Socket::sockaddr_in6 at all, old Perl installation
eval { connect $sock, sockaddr_in6(7, Socket::IN6ADDR_LOOPBACK) };
return $! != 101;
return $@ eq "";
}
$skip{'include/check_ipv6.inc'} = 'No IPv6' unless ipv6_ok();

View File

@@ -2157,6 +2157,12 @@ DROP TABLE federated.t1;
End of 5.1 tests
SET @@GLOBAL.CONCURRENT_INSERT= @OLD_MASTER_CONCURRENT_INSERT;
SET @@GLOBAL.CONCURRENT_INSERT= @OLD_SLAVE_CONCURRENT_INSERT;
#
# MDEV-9346 - The federatedx and spider engine make mysqld crash when
# they are configured withtout username
#
CREATE TABLE t1 (a INT) ENGINE=FEDERATED CONNECTION='mysql://@127.0.0.1:SLAVE_PORT/federated/t1';
ERROR HY000: Can't create federated table. Foreign data src error: database: 'federated' username: '' hostname: '127.0.0.1'
DROP TABLE IF EXISTS federated.t1;
DROP DATABASE IF EXISTS federated;
DROP TABLE IF EXISTS federated.t1;

View File

@@ -2000,4 +2000,13 @@ SET @@GLOBAL.CONCURRENT_INSERT= @OLD_SLAVE_CONCURRENT_INSERT;
connection default;
--echo #
--echo # MDEV-9346 - The federatedx and spider engine make mysqld crash when
--echo # they are configured withtout username
--echo #
connection master;
--replace_result $SLAVE_MYPORT SLAVE_PORT
--error ER_CANT_CREATE_FEDERATED_TABLE
eval CREATE TABLE t1 (a INT) ENGINE=FEDERATED CONNECTION='mysql://@127.0.0.1:$SLAVE_MYPORT/federated/t1';
source include/federated_cleanup.inc;

View File

@@ -1,30 +0,0 @@
CREATE TABLE `test_wo_keys` (
`f01` int AUTO_INCREMENT,
`f02` bigint, `f03` bigint, `f04` enum('a','b'),
`f05` date, `f06` int, `f07` int, `f08` double, `f09` int,
`f10` bigint, `f11` double, `f12` enum('a','b','c','d','e'),
`f13` int, `f14` int, `f15` varchar(255), `f16` int, `f17` int, `f18` int,
`f19` double, `f20` double, `f21` double, `f22` double, `f23` double, `f24` tinyint,
`f25` double, `f26` double, `f27` double, `f28` double, `f29` int unsigned,
`f30` int unsigned, `f31` bigint, `f32` int unsigned, `f33` bigint,
`f34` int unsigned, `f35` int unsigned,
PRIMARY KEY `f01` (`f01`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
show status like '%merge_buffers%';
Variable_name Value
Innodb_os_merge_buffers_written 0
Innodb_os_merge_buffers_read 0
Innodb_os_merge_buffers_merged 0
ALTER TABLE test_wo_keys
ADD KEY `f06` (`f06`), ADD KEY `f05` (`f05`), ADD KEY `f04` (`f04`), ADD KEY `f23` (`f23`),
ADD KEY `f10` (`f10`), ADD KEY `f11` (`f11`), ADD KEY `f09` (`f09`), ADD KEY `f22` (`f22`),
ADD KEY `f21` (`f21`), ADD KEY `f07` (`f07`), ADD KEY `f08` (`f08`), ADD KEY `f18` (`f18`),
ADD KEY `f19` (`f19`), ADD KEY `f20` (`f20`), ADD KEY `f29` (`f29`,`f31`,`f33`),
ADD KEY `f35` (`f35`), ADD KEY `f25` (`f25`), ADD KEY `f26` (`f26`),
ADD KEY `f27` (`f27`), ADD KEY `f28` (`f28`);
show status like '%merge_buffers%';
Variable_name Value
Innodb_os_merge_buffers_written 0
Innodb_os_merge_buffers_read 0
Innodb_os_merge_buffers_merged 0
DROP TABLE test_wo_keys;

View File

@@ -43,3 +43,95 @@ KEY `mdl_courmodu_gro_ix` (`groupingid`)
# Inserting 2701 rows into the table...
ALTER TABLE moodle19.mdl_course_modules ADD stefantest LONGTEXT CHARACTER SET utf8 COLLATE utf8_general_ci AFTER showdescription;
drop database moodle19;
use test;
CREATE TABLE `w_findispmon05u` (
`atpkey` INT(11) NOT NULL DEFAULT '0',
`atzo05` INT(11) NULL DEFAULT NULL,
`pos` BIGINT(21) NULL DEFAULT NULL,
`f5BnvB` INT(9) NULL DEFAULT NULL,
`f5atbvb` INT(11) NULL DEFAULT NULL,
`f5atbwmg` INT(11) NULL DEFAULT NULL,
`f5pBneu` BIGINT(12) NULL DEFAULT NULL,
`atbwdt` INT(11) NULL DEFAULT NULL,
`atbwzt` INT(11) NULL DEFAULT NULL,
`atbart` VARCHAR(10) NULL DEFAULT NULL
)
COLLATE='utf8_general_ci'
ENGINE=InnoDB;
ALTER TABLE `w_findispmon05u`
CHANGE COLUMN `atpkey` `f5atpkey` INT(11) NOT NULL DEFAULT '0' FIRST,
CHANGE COLUMN `atzo05` `f5atzo05` INT(11) NULL DEFAULT NULL AFTER `f5atpkey`,
CHANGE COLUMN `atbwdt` `f5atbwdt` INT(11) NULL DEFAULT NULL AFTER `f5pBneu`,
CHANGE COLUMN `atbwzt` `f5atbwzt` INT(11) NULL DEFAULT NULL AFTER `f5atbwdt`,
CHANGE COLUMN `atbart` `f5atbart` VARCHAR(10) NULL DEFAULT NULL AFTER `f5atbwzt`,
ADD INDEX `atpkey` (`f5atpkey`),
ADD INDEX `inatkey` (`f5atzo05`, `pos`),
ADD INDEX `pos` (`pos`, `f5atzo05`);
SHOW WARNINGS;
Level Code Message
SHOW CREATE TABLE `w_findispmon05u`;
Table Create Table
w_findispmon05u CREATE TABLE `w_findispmon05u` (
`f5atpkey` int(11) NOT NULL DEFAULT '0',
`f5atzo05` int(11) DEFAULT NULL,
`pos` bigint(21) DEFAULT NULL,
`f5BnvB` int(9) DEFAULT NULL,
`f5atbvb` int(11) DEFAULT NULL,
`f5atbwmg` int(11) DEFAULT NULL,
`f5pBneu` bigint(12) DEFAULT NULL,
`f5atbwdt` int(11) DEFAULT NULL,
`f5atbwzt` int(11) DEFAULT NULL,
`f5atbart` varchar(10) DEFAULT NULL,
KEY `atpkey` (`f5atpkey`),
KEY `inatkey` (`f5atzo05`,`pos`),
KEY `pos` (`pos`,`f5atzo05`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8
DROP TABLE `w_findispmon05u`;
CREATE TABLE t (
a INT NOT NULL,
b INT NOT NULL,
PRIMARY KEY (a)
) ENGINE=INNODB;
ALTER TABLE t
CHANGE COLUMN b c INT NOT NULL,
ADD UNIQUE INDEX (c);
SHOW WARNINGS;
Level Code Message
SHOW CREATE TABLE t;
Table Create Table
t CREATE TABLE `t` (
`a` int(11) NOT NULL,
`c` int(11) NOT NULL,
PRIMARY KEY (`a`),
UNIQUE KEY `c` (`c`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
ALTER TABLE t
CHANGE COLUMN c b INT NOT NULL,
ADD UNIQUE INDEX (c);
ERROR 42000: Key column 'c' doesn't exist in table
DROP TABLE t;
CREATE TABLE parent (
a INT NOT NULL,
b INT NOT NULL,
PRIMARY KEY (a)
) ENGINE=INNODB;
CREATE TABLE child (
a INT NOT NULL,
b INT NOT NULL,
PRIMARY KEY (a)
) ENGINE=INNODB;
ALTER TABLE child
CHANGE COLUMN b c INT NOT NULL,
ADD FOREIGN KEY (c) REFERENCES parent(a);
SHOW WARNINGS;
Level Code Message
SHOW CREATE TABLE child;
Table Create Table
child CREATE TABLE `child` (
`a` int(11) NOT NULL,
`c` int(11) NOT NULL,
PRIMARY KEY (`a`),
KEY `c` (`c`),
CONSTRAINT `child_ibfk_1` FOREIGN KEY (`c`) REFERENCES `parent` (`a`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
DROP TABLE child, parent;

View File

@@ -123,9 +123,6 @@ os_log_bytes_written disabled
os_log_fsyncs disabled
os_log_pending_fsyncs disabled
os_log_pending_writes disabled
os_merge_blocks_written disabled
os_merge_blocks_read disabled
os_merge_blocks_merged disabled
trx_rw_commits disabled
trx_ro_commits disabled
trx_nl_ro_commits disabled
@@ -257,9 +254,6 @@ lock_row_lock_time disabled
lock_row_lock_time_max disabled
lock_row_lock_waits disabled
lock_row_lock_time_avg disabled
os_merge_blocks_written disabled
os_merge_blocks_read disabled
os_merge_blocks_merged disabled
innodb_rwlock_s_spin_waits disabled
innodb_rwlock_x_spin_waits disabled
innodb_rwlock_s_spin_rounds disabled
@@ -298,9 +292,6 @@ os_log_bytes_written disabled
os_log_fsyncs disabled
os_log_pending_fsyncs enabled
os_log_pending_writes enabled
os_merge_blocks_written disabled
os_merge_blocks_read disabled
os_merge_blocks_merged disabled
set global innodb_monitor_enable="";
ERROR 42000: Variable 'innodb_monitor_enable' can't be set to the value of ''
set global innodb_monitor_enable="_";

View File

@@ -0,0 +1,51 @@
#
# Bug #19183565 CREATE DYNAMIC INNODB_TMPDIR VARIABLE TO CONTROL
# WHERE INNODB WRITES TEMP FILES
#
# If innodb_tmpdir is NULL or "", temporary file will be created in
# server configuration variable location(--tmpdir)
create table t1(a int primary key)engine=innodb;
show session variables like 'innodb_tmpdir';
Variable_name Value
innodb_tmpdir
alter table t1 add column b int not null;
set global innodb_tmpdir=NULL;
# Connection con1
show session variables like 'innodb_tmpdir';
Variable_name Value
innodb_tmpdir
alter table t1 add key(b);
drop table t1;
# innodb_tmpdir with invalid path.
create table t1(a int primary key)engine=innodb;
set global innodb_tmpdir='wrong_value';
ERROR 42000: Variable 'innodb_tmpdir' can't be set to the value of 'wrong_value'
show warnings;
Level Code Message
Warning 1210 InnoDB: Path doesn't exist.
Error 1231 Variable 'innodb_tmpdir' can't be set to the value of 'wrong_value'
drop table t1;
# innodb_tmpdir with mysql data directory path.
create table t1(a text, b text, fulltext(a,b))engine=innodb;
insert into t1 values('test1', 'test2');
insert into t1 values('text1', 'text2');
set global innodb_tmpdir = @@global.datadir;
ERROR 42000: Variable 'innodb_tmpdir' can't be set to the value of 'MYSQL_DATADIR'
show warnings;
Level Code Message
Warning 1210 InnoDB: Path Location should not be same as mysql data directory location.
Error 1231 DATADIR/data/'
drop table t1;
# innodb_tmpdir with valid location.
create table t1(a text, b text, fulltext(a,b))engine=innodb;
insert into t1 values('test1', 'test2');
insert into t1 values('text1', 'text2');
set @tmpdir = @@global.tmpdir;
set global innodb_tmpdir = @tmpdir;
show session variables like 'innodb_tmpdir';
Variable_name Value
innodb_tmpdir
# Connection con3
alter table t1 add fulltext(b);
set global innodb_tmpdir=NULL;
drop table t1;

View File

@@ -1,32 +0,0 @@
--source include/have_innodb.inc
#
# MDEV-8696: Adding indexes on empty table is slow with large innodb_sort_buffer_size.
#
CREATE TABLE `test_wo_keys` (
`f01` int AUTO_INCREMENT,
`f02` bigint, `f03` bigint, `f04` enum('a','b'),
`f05` date, `f06` int, `f07` int, `f08` double, `f09` int,
`f10` bigint, `f11` double, `f12` enum('a','b','c','d','e'),
`f13` int, `f14` int, `f15` varchar(255), `f16` int, `f17` int, `f18` int,
`f19` double, `f20` double, `f21` double, `f22` double, `f23` double, `f24` tinyint,
`f25` double, `f26` double, `f27` double, `f28` double, `f29` int unsigned,
`f30` int unsigned, `f31` bigint, `f32` int unsigned, `f33` bigint,
`f34` int unsigned, `f35` int unsigned,
PRIMARY KEY `f01` (`f01`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
show status like '%merge_buffers%';
ALTER TABLE test_wo_keys
ADD KEY `f06` (`f06`), ADD KEY `f05` (`f05`), ADD KEY `f04` (`f04`), ADD KEY `f23` (`f23`),
ADD KEY `f10` (`f10`), ADD KEY `f11` (`f11`), ADD KEY `f09` (`f09`), ADD KEY `f22` (`f22`),
ADD KEY `f21` (`f21`), ADD KEY `f07` (`f07`), ADD KEY `f08` (`f08`), ADD KEY `f18` (`f18`),
ADD KEY `f19` (`f19`), ADD KEY `f20` (`f20`), ADD KEY `f29` (`f29`,`f31`,`f33`),
ADD KEY `f35` (`f35`), ADD KEY `f25` (`f25`), ADD KEY `f26` (`f26`),
ADD KEY `f27` (`f27`), ADD KEY `f28` (`f28`);
show status like '%merge_buffers%';
DROP TABLE test_wo_keys;

View File

@@ -57,3 +57,84 @@ while ($num)
ALTER TABLE moodle19.mdl_course_modules ADD stefantest LONGTEXT CHARACTER SET utf8 COLLATE utf8_general_ci AFTER showdescription;
drop database moodle19;
#
# Mdev-9469: Incorrect key file on alter table
#
use test;
CREATE TABLE `w_findispmon05u` (
`atpkey` INT(11) NOT NULL DEFAULT '0',
`atzo05` INT(11) NULL DEFAULT NULL,
`pos` BIGINT(21) NULL DEFAULT NULL,
`f5BnvB` INT(9) NULL DEFAULT NULL,
`f5atbvb` INT(11) NULL DEFAULT NULL,
`f5atbwmg` INT(11) NULL DEFAULT NULL,
`f5pBneu` BIGINT(12) NULL DEFAULT NULL,
`atbwdt` INT(11) NULL DEFAULT NULL,
`atbwzt` INT(11) NULL DEFAULT NULL,
`atbart` VARCHAR(10) NULL DEFAULT NULL
)
COLLATE='utf8_general_ci'
ENGINE=InnoDB;
ALTER TABLE `w_findispmon05u`
CHANGE COLUMN `atpkey` `f5atpkey` INT(11) NOT NULL DEFAULT '0' FIRST,
CHANGE COLUMN `atzo05` `f5atzo05` INT(11) NULL DEFAULT NULL AFTER `f5atpkey`,
CHANGE COLUMN `atbwdt` `f5atbwdt` INT(11) NULL DEFAULT NULL AFTER `f5pBneu`,
CHANGE COLUMN `atbwzt` `f5atbwzt` INT(11) NULL DEFAULT NULL AFTER `f5atbwdt`,
CHANGE COLUMN `atbart` `f5atbart` VARCHAR(10) NULL DEFAULT NULL AFTER `f5atbwzt`,
ADD INDEX `atpkey` (`f5atpkey`),
ADD INDEX `inatkey` (`f5atzo05`, `pos`),
ADD INDEX `pos` (`pos`, `f5atzo05`);
SHOW WARNINGS;
SHOW CREATE TABLE `w_findispmon05u`;
DROP TABLE `w_findispmon05u`;
CREATE TABLE t (
a INT NOT NULL,
b INT NOT NULL,
PRIMARY KEY (a)
) ENGINE=INNODB;
ALTER TABLE t
CHANGE COLUMN b c INT NOT NULL,
ADD UNIQUE INDEX (c);
SHOW WARNINGS;
SHOW CREATE TABLE t;
# this should fail
--error 1072
ALTER TABLE t
CHANGE COLUMN c b INT NOT NULL,
ADD UNIQUE INDEX (c);
DROP TABLE t;
#
# Check Foreign Keys
#
CREATE TABLE parent (
a INT NOT NULL,
b INT NOT NULL,
PRIMARY KEY (a)
) ENGINE=INNODB;
CREATE TABLE child (
a INT NOT NULL,
b INT NOT NULL,
PRIMARY KEY (a)
) ENGINE=INNODB;
ALTER TABLE child
CHANGE COLUMN b c INT NOT NULL,
ADD FOREIGN KEY (c) REFERENCES parent(a);
SHOW WARNINGS;
SHOW CREATE TABLE child;
DROP TABLE child, parent;

View File

@@ -0,0 +1,68 @@
--source include/have_innodb.inc
--source include/count_sessions.inc
if (`select plugin_auth_version <= "5.6.28-MariaDB-76.1" from information_schema.plugins where plugin_name='innodb'`)
{
--skip Not fixed in XtraDB as of 5.6.28-MariaDB-76.1 or earlier
}
--echo #
--echo # Bug #19183565 CREATE DYNAMIC INNODB_TMPDIR VARIABLE TO CONTROL
--echo # WHERE INNODB WRITES TEMP FILES
--echo #
--echo # If innodb_tmpdir is NULL or "", temporary file will be created in
--echo # server configuration variable location(--tmpdir)
create table t1(a int primary key)engine=innodb;
show session variables like 'innodb_tmpdir';
alter table t1 add column b int not null;
set global innodb_tmpdir=NULL;
--echo # Connection con1
connect (con1,localhost,root);
show session variables like 'innodb_tmpdir';
alter table t1 add key(b);
connection default;
disconnect con1;
drop table t1;
--echo # innodb_tmpdir with invalid path.
create table t1(a int primary key)engine=innodb;
--error ER_WRONG_VALUE_FOR_VAR
set global innodb_tmpdir='wrong_value';
show warnings;
drop table t1;
--echo # innodb_tmpdir with mysql data directory path.
let $MYSQLD_DATADIR= `select @@datadir`;
create table t1(a text, b text, fulltext(a,b))engine=innodb;
insert into t1 values('test1', 'test2');
insert into t1 values('text1', 'text2');
--replace_result $MYSQLD_DATADIR MYSQL_DATADIR
--error ER_WRONG_VALUE_FOR_VAR
set global innodb_tmpdir = @@global.datadir;
--replace_regex /.*mysqld.1/DATADIR/
show warnings;
drop table t1;
--echo # innodb_tmpdir with valid location.
let $MYSQL_TMP_DIR= `select @@tmpdir`;
create table t1(a text, b text, fulltext(a,b))engine=innodb;
insert into t1 values('test1', 'test2');
insert into t1 values('text1', 'text2');
set @tmpdir = @@global.tmpdir;
set global innodb_tmpdir = @tmpdir;
show session variables like 'innodb_tmpdir';
--echo # Connection con3
connect (con3,localhost,root);
# Following alter using innodb_tmpdir as a path to create temporary files
alter table t1 add fulltext(b);
disconnect con3;
connection default;
set global innodb_tmpdir=NULL;
drop table t1;
--source include/wait_until_count_sessions.inc

View File

@@ -1 +1 @@
--loose-innodb-file-format-check --loose-innodb-file-per-table=1 --skip-stack-trace --skip-core-file
--loose-innodb-file-format-check --loose-innodb-file-per-table=1 --skip-stack-trace --skip-core-file --loose-innodb-buffer-pool-size=32M

View File

@@ -52,7 +52,7 @@ insert into marker set a = 1;
optimize table test.v1;
Table Op Msg_type Msg_text
test.v1 optimize Error 'test.v1' is not BASE TABLE
test.v1 optimize error Corrupt
test.v1 optimize status Operation failed
insert into marker set a = 1;
select * from test.v1;
a b

View File

@@ -88,3 +88,10 @@ UNLOCK TABLES;
--echo
UPDATE performance_schema.setup_instruments SET timed='NO'
ORDER BY RAND();
# MTR is configured to start with everything set to ON,
# so we need to restore it after the previous update
--disable_query_log
update performance_schema.setup_instruments set timed='YES';
--enable_query_log

View File

@@ -1,9 +1,8 @@
install soname 'auth_0x0100';
select plugin_name, plugin_type_version from information_schema.plugins where plugin_type='authentication' order by plugin_name;
select plugin_name, plugin_type_version from information_schema.plugins where
plugin_type='authentication' and plugin_library is not null order by plugin_name;
plugin_name plugin_type_version
auth_0x0100 1.0
mysql_native_password 2.0
mysql_old_password 2.0
create user tt identified via auth_0x0100;
grant select on test.* to zzzzzzzzzzzzzzzz;
connect(localhost,tt,,test,MASTER_MYPORT,MASTER_MYSOCK);

View File

@@ -8,6 +8,7 @@ select * from information_schema.feedback where variable_name like 'feed%'
VARIABLE_NAME VARIABLE_VALUE
FEEDBACK used 1
FEEDBACK version 1.1
FEEDBACK_HTTP_PROXY
FEEDBACK_SEND_RETRY_WAIT 60
FEEDBACK_SEND_TIMEOUT 60
FEEDBACK_URL http://mariadb.org/feedback_plugin/post

View File

@@ -10,6 +10,7 @@ select * from information_schema.feedback where variable_name like 'feed%'
and variable_name not like '%debug%';
VARIABLE_NAME VARIABLE_VALUE
FEEDBACK version 1.1
FEEDBACK_HTTP_PROXY
FEEDBACK_SEND_RETRY_WAIT 60
FEEDBACK_SEND_TIMEOUT 60
FEEDBACK_URL http://mariadb.org/feedback_plugin/post

View File

@@ -10,6 +10,7 @@ select * from information_schema.feedback where variable_name like 'feed%'
and variable_name not like '%debug%';
VARIABLE_NAME VARIABLE_VALUE
FEEDBACK version 1.1
FEEDBACK_HTTP_PROXY
FEEDBACK_SEND_RETRY_WAIT 60
FEEDBACK_SEND_TIMEOUT 60
FEEDBACK_URL http://mariadb.org/feedback_plugin/post

View File

@@ -8,6 +8,7 @@ server_audit_file_rotate_now OFF
server_audit_file_rotate_size 1000000
server_audit_file_rotations 9
server_audit_incl_users
server_audit_loc_info
server_audit_logging OFF
server_audit_mode 0
server_audit_output_type file
@@ -71,6 +72,7 @@ server_audit_file_rotate_now OFF
server_audit_file_rotate_size 1000000
server_audit_file_rotations 9
server_audit_incl_users odin, root, dva, tri
server_audit_loc_info
server_audit_logging ON
server_audit_mode 0
server_audit_output_type file
@@ -216,6 +218,7 @@ server_audit_file_rotate_now OFF
server_audit_file_rotate_size 1000000
server_audit_file_rotations 9
server_audit_incl_users odin, root, dva, tri
server_audit_loc_info
server_audit_logging ON
server_audit_mode 1
server_audit_output_type file
@@ -289,7 +292,7 @@ TIME,HOSTNAME,root,localhost,ID,ID,READ,mysql,proc,
TIME,HOSTNAME,root,localhost,ID,ID,WRITE,mysql,proc,
TIME,HOSTNAME,root,localhost,ID,ID,WRITE,mysql,event,
TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'drop database sa_db',0
TIME,HOSTNAME,root,localhost,ID,0,DISCONNECT,sa_db,,0
TIME,HOSTNAME,root,localhost,ID,0,DISCONNECT,,,0
TIME,HOSTNAME,root,localhost,ID,ID,QUERY,test,'create database sa_db',0
TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'use sa_db',0
TIME,HOSTNAME,root,localhost,ID,ID,WRITE,mysql,user,

View File

@@ -35,6 +35,15 @@ SET SQL_MODE = '';
drop table t1;
SELECT TABLE_NAME FROM information_schema.TABLES WHERE TABLE_SCHEMA = 'not_exists' AND TABLE_NAME = 'not_exists';
TABLE_NAME
CREATE procedure e1()
BEGIN
START TRANSACTION;
INSERT INTO test.non_exists VALUES (0,0,0) /* e1 */;
COMMIT;
END|
CALL e1();
ERROR 42S02: Table 'test.non_exists' doesn't exist
DROP PROCEDURE e1;
uninstall plugin SQL_ERROR_LOG;
Warnings:
Warning 1620 Plugin is busy and will be uninstalled on shutdown
@@ -45,3 +54,4 @@ TIME HOSTNAME ERROR 1000: new message : RESIGNAL SQLSTATE '40000' SET
MYSQL_ERRNO = 1000,
MESSAGE_TEXT = 'new message'
TIME HOSTNAME ERROR 1366: Incorrect integer value: 'aa' for column 'id' at row 1 : insert into t1 values ('aa')
TIME HOSTNAME ERROR 1146: Table 'test.non_exists' doesn't exist : INSERT INTO test.non_exists VALUES (0,0,0) /* e1 */

View File

@@ -8,6 +8,7 @@ server_audit_file_rotate_now OFF
server_audit_file_rotate_size 1000000
server_audit_file_rotations 9
server_audit_incl_users
server_audit_loc_info
server_audit_logging OFF
server_audit_mode 0
server_audit_output_type file
@@ -71,6 +72,7 @@ server_audit_file_rotate_now OFF
server_audit_file_rotate_size 1000000
server_audit_file_rotations 9
server_audit_incl_users odin, root, dva, tri
server_audit_loc_info
server_audit_logging ON
server_audit_mode 0
server_audit_output_type file
@@ -216,6 +218,7 @@ server_audit_file_rotate_now OFF
server_audit_file_rotate_size 1000000
server_audit_file_rotations 9
server_audit_incl_users odin, root, dva, tri
server_audit_loc_info
server_audit_logging ON
server_audit_mode 1
server_audit_output_type file
@@ -289,7 +292,7 @@ TIME,HOSTNAME,root,localhost,ID,ID,READ,mysql,proc,
TIME,HOSTNAME,root,localhost,ID,ID,WRITE,mysql,proc,
TIME,HOSTNAME,root,localhost,ID,ID,WRITE,mysql,event,
TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'drop database sa_db',0
TIME,HOSTNAME,root,localhost,ID,0,DISCONNECT,sa_db,,0
TIME,HOSTNAME,root,localhost,ID,0,DISCONNECT,,,0
TIME,HOSTNAME,root,localhost,ID,ID,QUERY,test,'create database sa_db',0
TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'use sa_db',0
TIME,HOSTNAME,root,localhost,ID,ID,WRITE,mysql,user,

View File

@@ -6,7 +6,8 @@ if (!$AUTH_0X0100_SO) {
install soname 'auth_0x0100';
select plugin_name, plugin_type_version from information_schema.plugins where plugin_type='authentication' order by plugin_name;
select plugin_name, plugin_type_version from information_schema.plugins where
plugin_type='authentication' and plugin_library is not null order by plugin_name;
create user tt identified via auth_0x0100;
grant select on test.* to zzzzzzzzzzzzzzzz;

View File

@@ -48,6 +48,24 @@ drop table t1;
SELECT TABLE_NAME FROM information_schema.TABLES WHERE TABLE_SCHEMA = 'not_exists' AND TABLE_NAME = 'not_exists';
#
# MDEV-6421 SQL_ERROR_LOG doesn't log comments in Events
# actually testing SP call is enough for that.
DELIMITER |;
CREATE procedure e1()
BEGIN
START TRANSACTION;
INSERT INTO test.non_exists VALUES (0,0,0) /* e1 */;
COMMIT;
END|
DELIMITER ;|
--error ER_NO_SUCH_TABLE
CALL e1();
DROP PROCEDURE e1;
uninstall plugin SQL_ERROR_LOG;
let $MYSQLD_DATADIR= `SELECT @@datadir`;

View File

@@ -0,0 +1,29 @@
include/master-slave.inc
[connection master]
Test case 1:- table name with one character latin name.
SET @s:=CONCAT("CREATE TABLE `",REPEAT(CHAR(131),1),"` (a INT)");
PREPARE STMT FROM @s;
EXECUTE stmt;
SET @s:=CONCAT("INSERT INTO `",REPEAT(CHAR(131),1),"` VALUES (1)");
PREPARE STMT FROM @s;
EXECUTE stmt;
SET @s:=CONCAT("DROP TABLE `",REPEAT(CHAR(131),1), "`");
PREPARE STMT FROM @s;
EXECUTE stmt;
Test case 2:- table name and database names with one character latin name.
SET @s:=CONCAT("CREATE DATABASE `",REPEAT(CHAR(131),1),"`");
PREPARE STMT FROM @s;
EXECUTE stmt;
SET @s:=CONCAT("CREATE TABLE `",REPEAT(CHAR(131),1),"`.`",REPEAT(CHAR(131),1),"` (a INT)");
PREPARE STMT FROM @s;
EXECUTE stmt;
SET @s:=CONCAT("INSERT INTO `",REPEAT(CHAR(131),1),"`.`",REPEAT(CHAR(131),1),"` VALUES (1)");
PREPARE STMT FROM @s;
EXECUTE stmt;
SET @s:=CONCAT("DROP TABLE `",REPEAT(CHAR(131),1),"`.`",REPEAT(CHAR(131),1), "`");
PREPARE STMT FROM @s;
EXECUTE stmt;
SET @s:=CONCAT("DROP DATABASE `",REPEAT(CHAR(131),1),"`");
PREPARE STMT FROM @s;
EXECUTE stmt;
include/rpl_end.inc

View File

@@ -929,6 +929,8 @@ a
31
32
SET sql_slave_skip_counter= 1;
ERROR HY000: When using parallel replication and GTID with multiple replication domains, @@sql_slave_skip_counter can not be used. Instead, setting @@gtid_slave_pos explicitly can be used to skip to after a given GTID position.
include/stop_slave_io.inc
include/start_slave.inc
include/sync_with_master_gtid.inc
SELECT * FROM t2 WHERE a >= 30 ORDER BY a;

View File

@@ -22,7 +22,8 @@ include/wait_for_slave_to_stop.inc
drop table t1;
flush tables with read lock;
start slave;
include/wait_for_slave_to_start.inc
include/wait_for_slave_param.inc [Slave_IO_Running]
include/wait_for_slave_sql_to_start.inc
stop slave;
ERROR HY000: Can't execute the given command because you have active locked tables or an active transaction
unlock tables;

View File

@@ -14,6 +14,10 @@ DROP TABLE t1;
[connection slave]
include/install_semisync.inc
[connection slave]
show global status like "Slave%_running";
Variable_name Value
Slave_running ON
Slaves_running 1
UNINSTALL PLUGIN rpl_semi_sync_slave;
Warnings:
Warning 1620 Plugin is busy and will be uninstalled on shutdown
@@ -21,6 +25,10 @@ select plugin_name,plugin_status from information_schema.plugins where plugin_na
plugin_name plugin_status
rpl_semi_sync_slave DELETED
[connection master]
show global status like "Slave%_connect%";
Variable_name Value
Slave_connections 2
Slaves_connected 1
UNINSTALL PLUGIN rpl_semi_sync_master;
Warnings:
Warning 1620 Plugin is busy and will be uninstalled on shutdown

View File

@@ -22,7 +22,8 @@ include/wait_for_slave_to_stop.inc
drop table t1;
flush tables with read lock;
start slave;
include/wait_for_slave_to_start.inc
include/wait_for_slave_param.inc [Slave_IO_Running]
include/wait_for_slave_sql_to_start.inc
stop slave;
ERROR HY000: Can't execute the given command because you have active locked tables or an active transaction
unlock tables;

View File

@@ -0,0 +1,53 @@
include/master-slave.inc
[connection master]
CREATE TABLE t1(id INT AUTO_INCREMENT, i INT, PRIMARY KEY (id)) ENGINE=INNODB;
CREATE TABLE t2(id INT AUTO_INCREMENT, i INT, PRIMARY KEY (id)) ENGINE=INNODB;
CREATE TRIGGER trig1 AFTER INSERT ON t1
FOR EACH ROW
INSERT INTO t2(i) VALUES(new.i);
START TRANSACTION;
INSERT INTO t2(i) VALUES (1);
ROLLBACK;
INSERT INTO t1(i) VALUES(2);
START TRANSACTION;
LOCK TABLES t1 WRITE, t2 WRITE;
INSERT INTO t1(i) VALUES(3);
UNLOCK TABLES;
COMMIT;
include/diff_tables.inc [master:t1, slave:t1]
include/diff_tables.inc [master:t2, slave:t2]
DROP TABLE t1,t2;
CREATE TABLE t1(i INT) ENGINE=INNODB;
CREATE TABLE t2(id INT AUTO_INCREMENT, i INT, PRIMARY KEY (id)) ENGINE=INNODB;
INSERT INTO t1 values (1), (2), (3);
START TRANSACTION;
INSERT INTO t2(i) VALUES (1);
ROLLBACK;
INSERT INTO t2(i) SELECT i FROM t1;
START TRANSACTION;
LOCK TABLES t2 WRITE, t1 READ;
INSERT INTO t2(i) SELECT i FROM t1;
UNLOCK TABLES;
COMMIT;
include/diff_tables.inc [master:t1, slave:t1]
include/diff_tables.inc [master:t2, slave:t2]
DROP TABLE t1,t2;
CREATE TABLE t1(i int, id INT AUTO_INCREMENT, PRIMARY KEY (i, id)) ENGINE=MYISAM;
INSERT INTO t1 (i) values (1);
START TRANSACTION;
LOCK TABLES t1 WRITE;
INSERT INTO t1 (i) values (2);
UNLOCK TABLES;
COMMIT;
include/diff_tables.inc [master:t1, slave:t1]
DROP TABLE t1;
CREATE TABLE t1(i INT, j INT, UNIQUE KEY(i), UNIQUE KEY(j)) ENGINE=INNODB;
INSERT INTO t1 (i,j) VALUES (1,2) ON DUPLICATE KEY UPDATE j=j+1;
START TRANSACTION;
LOCK TABLES t1 WRITE;
INSERT INTO t1 (i,j) VALUES (1,2) ON DUPLICATE KEY UPDATE j=j+1;
UNLOCK TABLES;
COMMIT;
include/diff_tables.inc [master:t1, slave:t1]
DROP TABLE t1;
include/rpl_end.inc

Some files were not shown because too many files have changed in this diff Show More