mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
Merge branch '10.1' into 10.2
This commit is contained in:
3
.gitignore
vendored
3
.gitignore
vendored
@ -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
|
||||
|
@ -348,11 +348,9 @@ IF(WITH_UNIT_TESTS)
|
||||
ENDIF()
|
||||
ENDIF()
|
||||
|
||||
IF(NOT WITHOUT_SERVER)
|
||||
SET (MYSQLD_STATIC_PLUGIN_LIBS "" CACHE INTERNAL "")
|
||||
# Add storage engines and plugins.
|
||||
CONFIGURE_PLUGINS()
|
||||
ENDIF()
|
||||
SET (MYSQLD_STATIC_PLUGIN_LIBS "" CACHE INTERNAL "")
|
||||
# Add storage engines and plugins.
|
||||
CONFIGURE_PLUGINS()
|
||||
|
||||
ADD_SUBDIRECTORY(include)
|
||||
ADD_SUBDIRECTORY(dbug)
|
||||
@ -382,6 +380,10 @@ IF(NOT WITHOUT_SERVER)
|
||||
ADD_SUBDIRECTORY(mysql-test)
|
||||
ADD_SUBDIRECTORY(mysql-test/lib/My/SafeProcess)
|
||||
ADD_SUBDIRECTORY(sql-bench)
|
||||
IF(WIN32)
|
||||
ADD_SUBDIRECTORY(win/upgrade_wizard)
|
||||
ADD_SUBDIRECTORY(win/packaging)
|
||||
ENDIF()
|
||||
ENDIF()
|
||||
|
||||
IF(UNIX)
|
||||
@ -391,10 +393,7 @@ ENDIF()
|
||||
INCLUDE(cmake/abi_check.cmake)
|
||||
INCLUDE(cmake/tags.cmake)
|
||||
|
||||
IF(WIN32)
|
||||
ADD_SUBDIRECTORY(win/upgrade_wizard)
|
||||
ADD_SUBDIRECTORY(win/packaging)
|
||||
ENDIF()
|
||||
|
||||
|
||||
|
||||
INCLUDE(for_clients)
|
||||
|
45
CREDITS
45
CREDITS
@ -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/
|
||||
|
8
README
8
README
@ -1,17 +1,17 @@
|
||||
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:
|
||||
|
@ -1344,6 +1344,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
|
||||
@ -1365,11 +1403,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;
|
||||
@ -4575,27 +4609,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];
|
||||
@ -4607,18 +4622,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 &&
|
||||
|
@ -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);
|
||||
@ -1110,7 +1111,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
|
||||
|
@ -94,6 +94,7 @@ ELSEIF(DEB)
|
||||
ELSE()
|
||||
SET(WITH_SSL bundled CACHE STRING "")
|
||||
SET(WITH_ZLIB bundled CACHE STRING "")
|
||||
SET(WITH_JEMALLOC static CACHE STRING "")
|
||||
ENDIF()
|
||||
|
||||
IF(NOT COMPILATION_COMMENT)
|
||||
|
@ -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)
|
||||
|
@ -25,7 +25,7 @@ MACRO(EXTRACT_LINK_LIBRARIES target var)
|
||||
# Filter out "general", it is not a library, just CMake hint
|
||||
# Also, remove duplicates
|
||||
IF(NOT lib STREQUAL "general" AND NOT ${var} MATCHES "-l${lib} ")
|
||||
IF (lib MATCHES "^\\-l")
|
||||
IF (lib MATCHES "^\\-")
|
||||
SET(${var} "${${var}} ${lib} ")
|
||||
ELSEIF(lib MATCHES "^/")
|
||||
IF (lib MATCHES "\\.(a|so([0-9.]*)|lib|dll|dylib)$")
|
||||
|
@ -137,7 +137,7 @@ SET(INSTALL_SCRIPTDIR_RPM "bin")
|
||||
SET(INSTALL_SYSCONFDIR_RPM "/etc")
|
||||
SET(INSTALL_SYSCONF2DIR_RPM "/etc/my.cnf.d")
|
||||
#
|
||||
IF(CMAKE_SYSTEM_PROCESSOR MATCHES "x86_64")
|
||||
IF(CMAKE_SIZEOF_VOID_P EQUAL 8)
|
||||
SET(INSTALL_LIBDIR_RPM "lib64")
|
||||
SET(INSTALL_PLUGINDIR_RPM "lib64/mysql/plugin")
|
||||
ELSE()
|
||||
|
@ -3,20 +3,6 @@ INCLUDE (CheckLibraryExists)
|
||||
SET(WITH_JEMALLOC auto CACHE STRING
|
||||
"Build with jemalloc. Possible values are 'yes', 'no', 'static', 'auto'")
|
||||
|
||||
MACRO(JEMALLOC_TRY_STATIC)
|
||||
SET(libname jemalloc_pic)
|
||||
SET(CMAKE_REQUIRED_LIBRARIES pthread dl m)
|
||||
SET(what bundled)
|
||||
CHECK_LIBRARY_EXISTS(${libname} malloc_stats_print "" HAVE_STATIC_JEMALLOC)
|
||||
SET(CMAKE_REQUIRED_LIBRARIES)
|
||||
ENDMACRO()
|
||||
|
||||
MACRO(JEMALLOC_TRY_DYNAMIC)
|
||||
SET(libname jemalloc)
|
||||
SET(what system)
|
||||
CHECK_LIBRARY_EXISTS(${libname} malloc_stats_print "" HAVE_DYNAMIC_JEMALLOC)
|
||||
ENDMACRO()
|
||||
|
||||
MACRO (CHECK_JEMALLOC)
|
||||
# compatibility with old WITH_JEMALLOC values
|
||||
IF(WITH_JEMALLOC STREQUAL "bundled")
|
||||
@ -26,21 +12,30 @@ MACRO (CHECK_JEMALLOC)
|
||||
SET(WITH_JEMALLOC "yes")
|
||||
ENDIF()
|
||||
|
||||
IF (WITH_JEMALLOC STREQUAL "yes" OR WITH_JEMALLOC STREQUAL "auto")
|
||||
JEMALLOC_TRY_DYNAMIC()
|
||||
ENDIF()
|
||||
IF(WITH_JEMALLOC STREQUAL "yes" OR WITH_JEMALLOC STREQUAL "auto" OR
|
||||
WITH_JEMALLOC STREQUAL "static")
|
||||
|
||||
IF (WITH_JEMALLOC STREQUAL "static" OR WITH_JEMALLOC STREQUAL "auto"
|
||||
AND NOT HAVE_DYNAMIC_JEMALLOC)
|
||||
JEMALLOC_TRY_STATIC()
|
||||
ENDIF()
|
||||
IF(WITH_JEMALLOC STREQUAL "static")
|
||||
SET(libname jemalloc_pic)
|
||||
SET(CMAKE_REQUIRED_LIBRARIES pthread dl m)
|
||||
SET(what bundled)
|
||||
ELSE()
|
||||
SET(libname jemalloc c)
|
||||
SET(what system)
|
||||
ENDIF()
|
||||
|
||||
IF (libname)
|
||||
IF (HAVE_DYNAMIC_JEMALLOC OR HAVE_STATIC_JEMALLOC)
|
||||
SET(LIBJEMALLOC ${libname})
|
||||
SET(MALLOC_LIBRARY "${what} jemalloc")
|
||||
ELSEIF (NOT WITH_JEMALLOC STREQUAL "auto")
|
||||
MESSAGE(FATAL_ERROR "${libname} is not found")
|
||||
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 (NOT LIBJEMALLOC AND NOT WITH_JEMALLOC STREQUAL "auto")
|
||||
MESSAGE(FATAL_ERROR "jemalloc is not found")
|
||||
ENDIF()
|
||||
ENDIF()
|
||||
ENDMACRO()
|
||||
|
@ -34,6 +34,7 @@ MACRO(MYSQL_ADD_PLUGIN)
|
||||
"LINK_LIBRARIES;DEPENDENCIES"
|
||||
${ARGN}
|
||||
)
|
||||
IF(NOT WITHOUT_SERVER OR ARG_CLIENT)
|
||||
|
||||
# Add common include directories
|
||||
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include
|
||||
@ -236,13 +237,17 @@ MACRO(MYSQL_ADD_PLUGIN)
|
||||
INSTALL_MYSQL_TEST("${CMAKE_CURRENT_SOURCE_DIR}/mysql-test/" "plugin/${subpath}")
|
||||
ENDIF()
|
||||
|
||||
ENDIF(NOT WITHOUT_SERVER OR ARG_CLIENT)
|
||||
ENDMACRO()
|
||||
|
||||
|
||||
# Add all CMake projects under storage and plugin
|
||||
# subdirectories, configure sql_builtins.cc
|
||||
MACRO(CONFIGURE_PLUGINS)
|
||||
FILE(GLOB dirs_storage ${CMAKE_SOURCE_DIR}/storage/*)
|
||||
IF(NOT WITHOUT_SERVER)
|
||||
FILE(GLOB dirs_storage ${CMAKE_SOURCE_DIR}/storage/*)
|
||||
ENDIF()
|
||||
|
||||
FILE(GLOB dirs_plugin ${CMAKE_SOURCE_DIR}/plugin/*)
|
||||
FOREACH(dir ${dirs_storage} ${dirs_plugin})
|
||||
IF (EXISTS ${dir}/CMakeLists.txt)
|
||||
|
@ -26,7 +26,7 @@ ENDIF()
|
||||
OPTION(WITH_WSREP "WSREP replication API (to use, e.g. Galera Replication library)" ${with_wsrep_default})
|
||||
|
||||
# Set the patch version
|
||||
SET(WSREP_PATCH_VERSION "11")
|
||||
SET(WSREP_PATCH_VERSION "13")
|
||||
|
||||
# Obtain wsrep API version
|
||||
FILE(STRINGS "${MySQL_SOURCE_DIR}/wsrep/wsrep_api.h" WSREP_API_VERSION
|
||||
|
@ -196,6 +196,7 @@ CHECK_INCLUDE_FILES (ndir.h HAVE_NDIR_H)
|
||||
CHECK_INCLUDE_FILES (netinet/in.h HAVE_NETINET_IN_H)
|
||||
CHECK_INCLUDE_FILES (paths.h HAVE_PATHS_H)
|
||||
CHECK_INCLUDE_FILES (poll.h HAVE_POLL_H)
|
||||
CHECK_INCLUDE_FILES (sys/poll.h HAVE_SYS_POLL_H)
|
||||
CHECK_INCLUDE_FILES (pwd.h HAVE_PWD_H)
|
||||
CHECK_INCLUDE_FILES (sched.h HAVE_SCHED_H)
|
||||
CHECK_INCLUDE_FILES (select.h HAVE_SELECT_H)
|
||||
@ -727,16 +728,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)
|
||||
|
2
debian/additions/my.cnf
vendored
2
debian/additions/my.cnf
vendored
@ -177,7 +177,7 @@ quote-names
|
||||
max_allowed_packet = 16M
|
||||
|
||||
[mysql]
|
||||
#no-auto-rehash # faster start of mysql but no tab completition
|
||||
#no-auto-rehash # faster start of mysql but no tab completion
|
||||
|
||||
[isamchk]
|
||||
key_buffer = 16M
|
||||
|
536
debian/additions/mysqlreport
vendored
536
debian/additions/mysqlreport
vendored
@ -1,10 +1,11 @@
|
||||
#!/usr/bin/perl -w
|
||||
|
||||
# mysqlreport v3.5 Apr 16 2008
|
||||
# mysqlreport v4.0 Oct 23 2015
|
||||
# http://hackmysql.com/mysqlreport
|
||||
|
||||
# mysqlreport makes an easy-to-read report of important MySQL status values.
|
||||
# mysqlreport makes an easy-to-read report of important MySQL/MariaDB status values.
|
||||
# Copyright 2006-2008 Daniel Nichter
|
||||
# Copyright 2012-2015 Jean Weisbuch
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU General Public License
|
||||
@ -36,15 +37,18 @@ my ($stat_name, $stat_val, $stat_label);
|
||||
my $MySQL_version;
|
||||
my (%stats, %vars); # SHOW STATUS, SHOW VARIABLES
|
||||
my (%DMS_vals, %Com_vals, %ib_vals);
|
||||
my ($dbh, $query);
|
||||
my $dbh;
|
||||
my ($questions, $key_read_ratio, $key_write_ratio, $dms, $slow_query_t);
|
||||
my ($key_cache_block_size, $key_buffer_used, $key_buffer_usage);
|
||||
my ($qc_mem_used, $qc_hi_r, $qc_ip_r); # Query Cache
|
||||
my $have_innodb_vals;
|
||||
my ($ib_bp_used, $ib_bp_total, $ib_bp_read_ratio);
|
||||
my ($relative_live, $relative_infiles);
|
||||
my $real_uptime;
|
||||
my (%stats_present, %stats_past); # For relative reports
|
||||
my ($pagecache_read_ratio, $pagecache_write_ratio, $pagecache_block_size, $pagecache_buffer_used, $pagecache_buffer_usage); # AriaDB pagecache stats
|
||||
my ($binlog_cache_ratio, $binlog_stmt_cache_ratio); # binary log cache
|
||||
my $dbms;
|
||||
my ($rows, $rows_using_indexes);
|
||||
|
||||
GetOptions (
|
||||
\%op,
|
||||
@ -127,13 +131,19 @@ $| = 1 if ($op{'detach'} || $relative_live);
|
||||
|
||||
print "tmp file: $tmpfile\n" if $op{debug};
|
||||
|
||||
# Connect to MySQL
|
||||
# Connect to MySQL/MariaDB
|
||||
if(!$op{'infile'} && !$relative_infiles)
|
||||
{
|
||||
connect_to_MySQL();
|
||||
}
|
||||
|
||||
$have_innodb_vals = 1; # This might be set to 0 later in get_MySQL_version()
|
||||
my $have_innodb_vals = 1; # This might be set to 0 later in get_MySQL_version()
|
||||
my $have_aria_vals = 0;
|
||||
my $have_subquerycache_vals = 0;
|
||||
my $have_binlog_vals = 0;
|
||||
my $have_tokudb_engine = 0;
|
||||
my $use_thread_pool = 0;
|
||||
my $use_xtradb = 0;
|
||||
|
||||
if(defined $op{'r'})
|
||||
{
|
||||
@ -163,6 +173,9 @@ else
|
||||
|
||||
set_myisam_vals();
|
||||
set_ib_vals() if $have_innodb_vals;
|
||||
set_aria_vals() if $have_aria_vals;
|
||||
set_subquerycache_vals() if $have_subquerycache_vals;
|
||||
set_binlog_vals() if $have_binlog_vals;
|
||||
|
||||
write_report();
|
||||
}
|
||||
@ -177,8 +190,8 @@ exit;
|
||||
sub show_help_and_exit
|
||||
{
|
||||
print <<"HELP";
|
||||
mysqlreport v3.5 Apr 16 2008
|
||||
mysqlreport makes an easy-to-read report of important MySQL status values.
|
||||
mysqlreport v4.0 Oct 23 2015
|
||||
mysqlreport makes an easy-to-read report of important MySQL/MariaDB status values.
|
||||
|
||||
Command line options (abbreviations work):
|
||||
--user USER Connect to MySQL as USER
|
||||
@ -264,6 +277,9 @@ sub collect_reports
|
||||
|
||||
set_myisam_vals();
|
||||
set_ib_vals() if $have_innodb_vals;
|
||||
set_aria_vals() if $have_aria_vals;
|
||||
set_subquerycache_vals() if $have_subquerycache_vals;
|
||||
set_binlog_vals() if $have_binlog_vals;
|
||||
|
||||
print "#\n# Beginning report, 0 0:0:0\n#\n";
|
||||
|
||||
@ -403,6 +419,9 @@ sub relative_infile_report
|
||||
|
||||
set_myisam_vals();
|
||||
set_ib_vals() if $have_innodb_vals;
|
||||
set_aria_vals() if $have_aria_vals;
|
||||
set_subquerycache_vals() if $have_subquerycache_vals;
|
||||
set_binlog_vals() if $have_binlog_vals;
|
||||
|
||||
print "#\n# Beginning report, 0 0:0:0\n#\n";
|
||||
|
||||
@ -422,7 +441,7 @@ sub get_vals
|
||||
{
|
||||
print "get_vals\n" if $op{debug};
|
||||
|
||||
my @row;
|
||||
my (@row, $query);
|
||||
|
||||
# Get status values
|
||||
if($MySQL_version >= 50002)
|
||||
@ -434,7 +453,9 @@ sub get_vals
|
||||
$query = $dbh->prepare("SHOW STATUS;");
|
||||
}
|
||||
$query->execute();
|
||||
while(@row = $query->fetchrow_array()) { $stats{$row[0]} = $row[1]; }
|
||||
# To avoid problems if the variable capitalization would change (eg. TokuDB on MariaDB 5.5 => 10.0), the $stats index is forced to have its first char uppercase and the rest lowercase
|
||||
while(@row = $query->fetchrow_array()) { $stats{ucfirst(lc($row[0]))} = $row[1]; }
|
||||
$query->finish();
|
||||
|
||||
$real_uptime = $stats{'Uptime'};
|
||||
}
|
||||
@ -443,18 +464,23 @@ sub get_vars
|
||||
{
|
||||
print "get_vars\n" if $op{debug};
|
||||
|
||||
my @row;
|
||||
my (@row, $query);
|
||||
|
||||
# Get server system variables
|
||||
$query = $dbh->prepare("SHOW VARIABLES;");
|
||||
$query->execute();
|
||||
while(@row = $query->fetchrow_array()) { $vars{$row[0]} = $row[1]; }
|
||||
|
||||
$query->finish();
|
||||
# table_cache was renamed to table_open_cache in MySQL 5.1.3
|
||||
if($MySQL_version >= 50103)
|
||||
{
|
||||
$vars{'table_cache'} = $vars{'table_open_cache'};
|
||||
}
|
||||
# log_slow_queries was renamed to slow_query_log in MySQL 5.1.29
|
||||
if($MySQL_version >= 50129)
|
||||
{
|
||||
$vars{'log_slow_queries'} = $vars{'slow_query_log'};
|
||||
}
|
||||
}
|
||||
|
||||
sub read_infile
|
||||
@ -507,10 +533,10 @@ sub read_infile
|
||||
else { print "read_infile: ignore '$_'\n" if $op{debug}; }
|
||||
|
||||
last if $1 eq 'Uptime'; # exit while() if end of status values
|
||||
$_ = <INFILE>; # otherwise, read next line of status values
|
||||
$_ = <INFILE>; # otherwise, read next line of status values
|
||||
}
|
||||
}
|
||||
elsif($1 eq 'back_log') # system variable values
|
||||
elsif($1 eq 'back_log') # system variable values
|
||||
{
|
||||
print "read_infile: start vars\n" if $op{debug};
|
||||
|
||||
@ -525,7 +551,7 @@ sub read_infile
|
||||
else { print "read_infile: ignore '$_'\n" if $op{debug}; }
|
||||
|
||||
last if $1 eq 'wait_timeout'; # exit while() if end of vars
|
||||
$_ = <INFILE>; # otherwise, read next line of vars
|
||||
$_ = <INFILE>; # otherwise, read next line of vars
|
||||
}
|
||||
}
|
||||
elsif($1 eq '=') # old style, manually added system variable values
|
||||
@ -542,7 +568,7 @@ sub read_infile
|
||||
}
|
||||
else { print "read_infile: ignore '$_'\n" if $op{debug}; }
|
||||
|
||||
$_ = <INFILE>; # otherwise, read next line of old vars
|
||||
$_ = <INFILE>; # otherwise, read next line of old vars
|
||||
}
|
||||
|
||||
redo;
|
||||
@ -572,25 +598,116 @@ sub get_MySQL_version
|
||||
|
||||
if($op{'infile'} || $relative_infiles)
|
||||
{
|
||||
($major, $minor, $patch) = ($vars{'version'} =~ /(\d{1,2})\.(\d{1,2})\.(\d{1,2})/);
|
||||
($major, $minor, $patch) = ($vars{'version'} =~ /^(\d{1,2})\.(\d{1,2})\.(\d{1,2})/);
|
||||
if($vars{'version'} =~ /^\d{1,2}\.\d{1,2}\.\d{1,2}-MariaDB/) {
|
||||
print "MariaDB detected\n" if $op{debug};
|
||||
$dbms = "MariaDB";
|
||||
} else {
|
||||
$dbms = "MySQL";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
my @row;
|
||||
my (@row, $query);
|
||||
|
||||
$query = $dbh->prepare("SHOW VARIABLES LIKE 'version';");
|
||||
$query->execute();
|
||||
@row = $query->fetchrow_array();
|
||||
($major, $minor, $patch) = ($row[1] =~ /(\d{1,2})\.(\d{1,2})\.(\d{1,2})/);
|
||||
$query->finish();
|
||||
($major, $minor, $patch) = ($row[1] =~ /^(\d{1,2})\.(\d{1,2})\.(\d{1,2})/);
|
||||
if($row[1] =~ /^\d{1,2}\.\d{1,2}\.\d{1,2}-MariaDB/)
|
||||
{
|
||||
print "MariaDB detected\n" if $op{debug};
|
||||
$dbms = "MariaDB";
|
||||
}
|
||||
else
|
||||
{
|
||||
$dbms = "MySQL";
|
||||
}
|
||||
}
|
||||
|
||||
# The major version number is kept as is while the minor version and the revision number are forced to 2 digits
|
||||
# e.g.: 5.5.9 will be 50509, 10.0.5 will be 100005 and 10.1.23 will be 100123
|
||||
$MySQL_version = sprintf("%d%02d%02d", $major, $minor, $patch);
|
||||
print "Version $MySQL_version\n" if $op{debug};
|
||||
|
||||
# Innodb_ status values were added in 5.0.2
|
||||
if($MySQL_version < 50002)
|
||||
{
|
||||
$have_innodb_vals = 0;
|
||||
print "get_MySQL_version: no InnoDB reports because MySQL version is older than 5.0.2\n" if $op{debug};
|
||||
} else {
|
||||
$have_innodb_vals = $dbh->selectall_arrayref("SELECT SUPPORT FROM information_schema.engines WHERE ENGINE = 'InnoDB';", undef)->[0][0];
|
||||
if(defined($have_innodb_vals) && ($have_innodb_vals eq "YES" || $have_innodb_vals eq "DEFAULT"))
|
||||
{
|
||||
print "InnoDB detected\n" if $op{debug};
|
||||
$have_innodb_vals = 1;
|
||||
} else {
|
||||
print "InnoDB is not activated\n" if $op{debug};
|
||||
$have_innodb_vals = 0;
|
||||
}
|
||||
}
|
||||
|
||||
if($dbms eq "MariaDB") {
|
||||
$have_aria_vals = $dbh->selectall_arrayref("SELECT SUPPORT FROM information_schema.engines WHERE ENGINE = 'Aria';", undef)->[0][0];
|
||||
if(defined($have_aria_vals) && $have_aria_vals eq "YES")
|
||||
{
|
||||
print "Aria engine detected\n" if $op{debug};
|
||||
$have_aria_vals = 1;
|
||||
} else {
|
||||
$have_aria_vals = 0;
|
||||
}
|
||||
|
||||
# MariaDB 5.3+, activated by default since 5.3.2
|
||||
$have_subquerycache_vals = $dbh->selectall_arrayref("SELECT VARIABLE_VALUE REGEXP ',subquery_cache=on,|^subquery_cache=on,|,subquery_cache=on\$' AS SUBQUERY_CACHE FROM information_schema.global_variables WHERE VARIABLE_NAME = 'optimizer_switch';", undef)->[0][0];
|
||||
if(defined($have_subquerycache_vals) && $have_subquerycache_vals eq "1")
|
||||
{
|
||||
print "Subquery cache is activated\n" if $op{debug};
|
||||
$have_subquerycache_vals = 1;
|
||||
} else {
|
||||
$have_subquerycache_vals = 0;
|
||||
}
|
||||
}
|
||||
|
||||
if($MySQL_version >= 50000)
|
||||
{
|
||||
# These checks use the 'information_schema' virtual database that has been added on MySQL 5.0
|
||||
|
||||
# MariaDB 5.5.21+ and Percona Server 5.5.30+ use the same thread pool implementation
|
||||
$use_thread_pool = $dbh->selectall_arrayref("SELECT VARIABLE_VALUE FROM information_schema.global_variables WHERE VARIABLE_NAME = 'thread_handling';", undef)->[0][0];
|
||||
if(defined($use_thread_pool) && $use_thread_pool eq "pool-of-threads") {
|
||||
print "Thread pool is used\n" if $op{debug};
|
||||
$use_thread_pool = 1;
|
||||
} else {
|
||||
$use_thread_pool = 0;
|
||||
}
|
||||
|
||||
$have_binlog_vals = $dbh->selectall_arrayref("SELECT VARIABLE_VALUE FROM information_schema.global_variables WHERE VARIABLE_NAME = 'log_bin';", undef)->[0][0];
|
||||
if(defined($have_binlog_vals) && $have_binlog_vals eq "ON")
|
||||
{
|
||||
print "Binary log is activated\n" if $op{debug};
|
||||
$have_binlog_vals = 1;
|
||||
} else {
|
||||
$have_binlog_vals = 0;
|
||||
}
|
||||
|
||||
$have_tokudb_engine = $dbh->selectall_arrayref("SELECT SUPPORT FROM information_schema.engines WHERE ENGINE = 'TokuDB';", undef)->[0][0];
|
||||
if(defined($have_tokudb_engine) && ($have_tokudb_engine eq "YES" || $have_tokudb_engine eq "DEFAULT"))
|
||||
{
|
||||
print "TokuDB detected\n" if $op{debug};
|
||||
$have_tokudb_engine = 1;
|
||||
} else {
|
||||
$have_tokudb_engine = 0;
|
||||
}
|
||||
|
||||
$use_xtradb = $dbh->selectall_arrayref("SELECT 1 FROM INFORMATION_SCHEMA.ENGINES WHERE ENGINE = 'InnoDB' AND COMMENT LIKE 'Percona-XtraDB%';", undef)->[0][0];
|
||||
if(defined($use_xtradb) && $use_xtradb eq "1")
|
||||
{
|
||||
print "XtraDB detected\n" if $op{debug};
|
||||
$use_xtradb = 1;
|
||||
} else {
|
||||
$use_xtradb = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -598,6 +715,7 @@ sub set_myisam_vals
|
||||
{
|
||||
print "set_myisam_vals\n" if $op{debug};
|
||||
|
||||
# should be moved elsewere
|
||||
$questions = $stats{'Questions'};
|
||||
|
||||
$key_read_ratio = sprintf "%.2f",
|
||||
@ -638,7 +756,6 @@ sub set_myisam_vals
|
||||
$dms = $DMS_vals{SELECT} + $DMS_vals{INSERT} + $DMS_vals{REPLACE} + $DMS_vals{UPDATE} + $DMS_vals{DELETE};
|
||||
|
||||
$slow_query_t = format_u_time($vars{long_query_time});
|
||||
|
||||
}
|
||||
|
||||
sub set_ib_vals
|
||||
@ -658,6 +775,46 @@ sub set_ib_vals
|
||||
0);
|
||||
}
|
||||
|
||||
sub set_aria_vals
|
||||
{
|
||||
print "set_aria_vals\n" if $op{debug};
|
||||
|
||||
$pagecache_read_ratio = sprintf "%.2f",
|
||||
($stats{'Aria_pagecache_read_requests'} ?
|
||||
100 - ($stats{'Aria_pagecache_reads'} / $stats{'Aria_pagecache_read_requests'}) * 100 :
|
||||
0);
|
||||
|
||||
$pagecache_write_ratio = sprintf "%.2f",
|
||||
($stats{'Aria_pagecache_write_requests'} ?
|
||||
100 - ($stats{'Aria_pagecache_writes'} / $stats{'Aria_pagecache_write_requests'}) * 100 :
|
||||
0);
|
||||
|
||||
$pagecache_block_size = (defined $vars{'aria_block_size'} ?
|
||||
$vars{'aria_block_size'} :
|
||||
1024);
|
||||
|
||||
$pagecache_buffer_used = $stats{'Aria_pagecache_blocks_used'} * $pagecache_block_size;
|
||||
|
||||
$pagecache_buffer_usage = $vars{'aria_pagecache_buffer_size'} -
|
||||
($stats{'Aria_pagecache_blocks_unused'} * $pagecache_block_size);
|
||||
}
|
||||
|
||||
sub set_subquerycache_vals
|
||||
{
|
||||
print "set_subquerycache_vals\n" if $op{debug};
|
||||
}
|
||||
|
||||
sub set_binlog_vals
|
||||
{
|
||||
print "set_binlog_vals\n" if $op{debug};
|
||||
|
||||
if($stats{'Binlog_cache_use'} gt 0) { $binlog_cache_ratio = $stats{'Binlog_cache_disk_use'} / $stats{'Binlog_cache_use'}; }
|
||||
else { $binlog_cache_ratio = 0; }
|
||||
|
||||
if(defined($stats{'Binlog_stmt_cache_use'}) && $stats{'Binlog_stmt_cache_use'} gt 0) { $binlog_stmt_cache_ratio = $stats{'Binlog_stmt_cache_disk_use'} / $stats{'Binlog_stmt_cache_use'}; }
|
||||
else { $binlog_stmt_cache_ratio = 0; }
|
||||
}
|
||||
|
||||
sub write_relative_report
|
||||
{
|
||||
print "write_relative_report\n" if $op{debug};
|
||||
@ -708,6 +865,10 @@ sub write_relative_report
|
||||
$stats{'Innodb_row_lock_time_max'} = $stats_present{'Innodb_row_lock_time_max'};
|
||||
}
|
||||
}
|
||||
if($have_aria_vals)
|
||||
{
|
||||
$stats{'Aria_pagecache_blocks_used'} = $stats_present{'Aria_pagecache_blocks_used'};
|
||||
}
|
||||
|
||||
get_Com_values();
|
||||
|
||||
@ -715,6 +876,9 @@ sub write_relative_report
|
||||
|
||||
set_myisam_vals();
|
||||
set_ib_vals() if $have_innodb_vals;
|
||||
set_aria_vals() if $have_aria_vals;
|
||||
set_subquerycache_vals() if $have_subquerycache_vals;
|
||||
set_binlog_vals() if $have_binlog_vals;
|
||||
|
||||
write_report();
|
||||
}
|
||||
@ -731,15 +895,27 @@ sub write_report
|
||||
$~ = 'SLOW_DMS', write;
|
||||
write_DMS();
|
||||
write_Com();
|
||||
write_Rows();
|
||||
$~ = 'SAS', write;
|
||||
write_qcache();
|
||||
$~ = 'REPORT_END', write;
|
||||
$~ = 'THREADS', write;
|
||||
if($use_thread_pool)
|
||||
{
|
||||
$~ = 'THREADPOOL', write;
|
||||
} else {
|
||||
$~ = 'THREADPERCONNECTION', write;
|
||||
}
|
||||
$~ = 'TAB', write;
|
||||
|
||||
write_InnoDB() if $have_innodb_vals;
|
||||
write_Aria() if $have_aria_vals;
|
||||
write_Subquerycache() if $have_subquerycache_vals;
|
||||
write_Binlog() if $have_binlog_vals;
|
||||
write_TokuDB() if $have_tokudb_engine;
|
||||
}
|
||||
|
||||
sub sec_to_dhms # Seconds to days hours:minutes:seconds
|
||||
sub sec_to_dhms # Seconds to days+hours:minutes:seconds
|
||||
{
|
||||
my $s = shift;
|
||||
my ($d, $h, $m) = (0, 0, 0);
|
||||
@ -761,7 +937,7 @@ sub sec_to_dhms # Seconds to days hours:minutes:seconds
|
||||
$m = int $s / 60;
|
||||
$s -= $m * 60;
|
||||
|
||||
return "$d $h:$m:$s";
|
||||
return "$d+$h:$m:$s";
|
||||
}
|
||||
|
||||
sub make_short
|
||||
@ -782,12 +958,11 @@ sub make_short
|
||||
}
|
||||
|
||||
# What began as a simple but great idea has become the new standard:
|
||||
# long_query_time in microseconds. For MySQL 5.1.21+ and 6.0.4+ this
|
||||
# is now standard. For 4.1 and 5.0 patches, the architects of this
|
||||
# idea provide: http://www.mysqlperformanceblog.com/mysql-patches/
|
||||
# long_query_time in microseconds. For MySQL 5.1.21+ this is now
|
||||
# standard. For 4.1 and 5.0 patches, the architects of this idea
|
||||
# provide: http://www.mysqlperformanceblog.com/mysql-patches/
|
||||
# Relevant notes in MySQL manual:
|
||||
# http://dev.mysql.com/doc/refman/5.1/en/slow-query-log.html
|
||||
# http://dev.mysql.com/doc/refman/6.0/en/slow-query-log.html
|
||||
#
|
||||
# The format_u_time sub simply beautifies long_query_time.
|
||||
|
||||
@ -848,7 +1023,7 @@ sub email_report # Email given report to $op{'email'}
|
||||
open SENDMAIL, "|/usr/sbin/sendmail -t";
|
||||
print SENDMAIL "From: mysqlreport\n";
|
||||
print SENDMAIL "To: $op{email}\n";
|
||||
print SENDMAIL "Subject: MySQL status report on " . ($mycnf{'host'} || 'localhost') . "\n\n";
|
||||
print SENDMAIL "Subject: $dbms status report on " . ($mycnf{'host'} || 'localhost') . "\n\n";
|
||||
print SENDMAIL `cat $report`;
|
||||
close SENDMAIL;
|
||||
}
|
||||
@ -979,6 +1154,7 @@ sub write_qcache
|
||||
# ergo this method is slightly more reliable
|
||||
return if not exists $vars{'query_cache_size'};
|
||||
return if $vars{'query_cache_size'} == 0;
|
||||
return if defined($vars{'query_cache_type'}) and $vars{'query_cache_type'} eq 'OFF';
|
||||
|
||||
$qc_mem_used = $vars{'query_cache_size'} - $stats{'Qcache_free_memory'};
|
||||
$qc_hi_r = sprintf "%.2f", $stats{'Qcache_hits'} / ($stats{'Qcache_inserts'} ||= 1);
|
||||
@ -988,6 +1164,36 @@ sub write_qcache
|
||||
write;
|
||||
}
|
||||
|
||||
sub write_Subquerycache
|
||||
{
|
||||
print "write_Subquerycache\n" if $op{debug};
|
||||
|
||||
return if not defined $stats{'Subquery_cache_hit'};
|
||||
return if $stats{'Subquery_cache_hit'} == 0 && $stats{'Subquery_cache_miss'} == 0;
|
||||
|
||||
$~ = 'SUBQUERYCACHE';
|
||||
write;
|
||||
}
|
||||
|
||||
sub write_Binlog
|
||||
{
|
||||
print "write_Binlog\n" if $op{debug};
|
||||
|
||||
return if $binlog_cache_ratio == 0 && $binlog_stmt_cache_ratio == 0;
|
||||
$~ = 'BINLOG';
|
||||
write;
|
||||
}
|
||||
|
||||
sub write_TokuDB
|
||||
{
|
||||
print "write_TokuDB\n" if $op{debug};
|
||||
|
||||
return if $stats{'Tokudb_cachetable_size_current'} == 0;
|
||||
|
||||
$~ = 'TOKUDB';
|
||||
write;
|
||||
}
|
||||
|
||||
sub write_InnoDB
|
||||
{
|
||||
print "write_InnoDB\n" if $op{debug};
|
||||
@ -998,6 +1204,11 @@ sub write_InnoDB
|
||||
|
||||
$~ = 'IB';
|
||||
write;
|
||||
if($use_xtradb)
|
||||
{
|
||||
$~ = 'IB_XTRADB';
|
||||
write;
|
||||
}
|
||||
|
||||
# Innodb_row_lock_ values were added in MySQL 5.0.3
|
||||
if($MySQL_version >= 50003)
|
||||
@ -1005,12 +1216,44 @@ sub write_InnoDB
|
||||
$~ = 'IB_LOCK';
|
||||
write;
|
||||
}
|
||||
if($use_xtradb)
|
||||
{
|
||||
$~ = 'IB_LOCK_XTRADB';
|
||||
write;
|
||||
}
|
||||
|
||||
# Data, Pages, Rows
|
||||
$~ = 'IB_DPR';
|
||||
write;
|
||||
}
|
||||
|
||||
|
||||
sub write_Aria
|
||||
{
|
||||
print "write_Aria\n" if $op{debug};
|
||||
|
||||
return if not defined $stats{'Aria_pagecache_blocks_used'};
|
||||
|
||||
$~ = 'PAGECACHE_BUFF_MAX';
|
||||
write;
|
||||
|
||||
if($pagecache_buffer_usage != -1) { $~ = 'PAGECACHE_BUFF_USAGE', write }
|
||||
|
||||
$~ = 'PAGECACHE_RATIOS';
|
||||
write;
|
||||
}
|
||||
|
||||
sub write_Rows
|
||||
{
|
||||
print "write_Rows\n" if $op{debug};
|
||||
|
||||
$rows_using_indexes = $stats{'Handler_read_first'} + $stats{'Handler_read_key'} + $stats{'Handler_read_next'} + $stats{'Handler_read_prev'};
|
||||
$rows = $rows_using_indexes + $stats{'Handler_read_rnd'} + $stats{'Handler_read_rnd_next'} + $stats{'Sort_rows'};
|
||||
|
||||
$~ = 'ROWS';
|
||||
write;
|
||||
}
|
||||
|
||||
sub have_op
|
||||
{
|
||||
my $key = shift;
|
||||
@ -1043,19 +1286,17 @@ sub exit_tasks_and_cleanup
|
||||
}
|
||||
else
|
||||
{
|
||||
if($WIN) { `del $tmpfile`; }
|
||||
else { `rm -f $tmpfile`; }
|
||||
unlink $tmpfile;
|
||||
}
|
||||
|
||||
if(!$op{'infile'} && !$relative_infiles)
|
||||
{
|
||||
if($op{'flush-status'})
|
||||
{
|
||||
$query = $dbh->prepare("FLUSH STATUS;");
|
||||
my $query = $dbh->prepare("FLUSH STATUS;");
|
||||
$query->execute();
|
||||
$query->finish();
|
||||
}
|
||||
|
||||
$query->finish();
|
||||
$dbh->disconnect();
|
||||
}
|
||||
}
|
||||
@ -1065,19 +1306,19 @@ sub exit_tasks_and_cleanup
|
||||
#
|
||||
|
||||
format MYSQL_TIME =
|
||||
MySQL @<<<<<<<<<<<<<<<< uptime @<<<<<<<<<<< @>>>>>>>>>>>>>>>>>>>>>>>>
|
||||
$vars{'version'}, sec_to_dhms($real_uptime), (($op{infile} || $relative_infiles) ? '' : scalar localtime)
|
||||
@<<<<<< @<<<<<<<<<<<<<<<<<< uptime @<<<<<<<<<<< @<<<<<<<<<<<<<<<<<<<<<<<
|
||||
$dbms, $vars{'version'}, sec_to_dhms($real_uptime), (($op{infile} || $relative_infiles) ? '' : scalar localtime)
|
||||
.
|
||||
|
||||
format KEY_BUFF_MAX =
|
||||
|
||||
__ Key _________________________________________________________________
|
||||
Buffer used @>>>>>> of @>>>>>> %Used: @>>>>>
|
||||
Buffer used @>>>>>> of @>>>>>> %Used: @>>>>>
|
||||
make_short($key_buffer_used, 1), make_short($vars{'key_buffer_size'}, 1), perc($key_buffer_used, $vars{'key_buffer_size'})
|
||||
.
|
||||
|
||||
format KEY_BUFF_USAGE =
|
||||
Current @>>>>>> %Usage: @>>>>>
|
||||
Current @>>>>>> %Usage: @>>>>>
|
||||
make_short($key_buffer_usage, 1), perc($key_buffer_usage, $vars{'key_buffer_size'})
|
||||
.
|
||||
|
||||
@ -1088,166 +1329,197 @@ Read hit @>>>>>%
|
||||
$key_read_ratio
|
||||
|
||||
__ Questions ___________________________________________________________
|
||||
Total @>>>>>>>> @>>>>>/s
|
||||
Total @>>>>>>>> @>>>>>/s
|
||||
make_short($questions), t($questions)
|
||||
.
|
||||
|
||||
format DTQ =
|
||||
@<<<<<<< @>>>>>>>> @>>>>>/s @>>>>>> @>>>>>
|
||||
@<<<<<<< @>>>>>>>> @>>>>>/s @>>>>>> @>>>>>
|
||||
$stat_name, make_short($stat_val), t($stat_val), $stat_label, perc($stat_val, $questions)
|
||||
.
|
||||
|
||||
format SLOW_DMS =
|
||||
Slow @<<<<<<< @>>>>>> @>>>>>/s @>>>>> %DMS: @>>>>> Log: @>>
|
||||
Slow @<<<<<<< @>>>>>> @>>>>>/s @>>>>> %DMS: @>>>>> Log: @>>
|
||||
$slow_query_t, make_short($stats{'Slow_queries'}), t($stats{'Slow_queries'}), perc($stats{'Slow_queries'}, $questions), perc($stats{'Slow_queries'}, $dms), $vars{'log_slow_queries'}
|
||||
DMS @>>>>>>>> @>>>>>/s @>>>>>
|
||||
DMS @>>>>>>>> @>>>>>/s @>>>>>
|
||||
make_short($dms), t($dms), perc($dms, $questions)
|
||||
.
|
||||
|
||||
format DMS =
|
||||
@<<<<<<< @>>>>>>>> @>>>>>/s @>>>>> @>>>>>
|
||||
@<<<<<<< @>>>>>>>> @>>>>>/s @>>>>> @>>>>>
|
||||
$stat_name, make_short($stat_val), t($stat_val), perc($stat_val, $questions), perc($stat_val, $dms)
|
||||
.
|
||||
|
||||
format COM_1 =
|
||||
Com_ @>>>>>>>> @>>>>>/s @>>>>>
|
||||
Com_ @>>>>>>>> @>>>>>/s @>>>>>
|
||||
make_short($stat_val), t($stat_val), perc($stat_val, $questions)
|
||||
.
|
||||
|
||||
format COM_2 =
|
||||
@<<<<<<<<<< @>>>>>> @>>>>>/s @>>>>>
|
||||
@<<<<<<<<<< @>>>>>> @>>>>>/s @>>>>>
|
||||
$stat_name, make_short($stat_val), t($stat_val), perc($stat_val, $questions)
|
||||
.
|
||||
|
||||
format SAS =
|
||||
|
||||
__ SELECT and Sort _____________________________________________________
|
||||
Scan @>>>>>> @>>>>/s %SELECT: @>>>>>
|
||||
Scan @>>>>>> @>>>>>/s %SELECT: @>>>>>
|
||||
make_short($stats{'Select_scan'}), t($stats{'Select_scan'}), perc($stats{'Select_scan'}, $stats{'Com_select'})
|
||||
Range @>>>>>> @>>>>/s @>>>>>
|
||||
Range @>>>>>> @>>>>>/s @>>>>>
|
||||
make_short($stats{'Select_range'}), t($stats{'Select_range'}), perc($stats{'Select_range'}, $stats{'Com_select'})
|
||||
Full join @>>>>>> @>>>>/s @>>>>>
|
||||
Full join @>>>>>> @>>>>>/s @>>>>>
|
||||
make_short($stats{'Select_full_join'}), t($stats{'Select_full_join'}), perc($stats{'Select_full_join'}, $stats{'Com_select'})
|
||||
Range check @>>>>>> @>>>>/s @>>>>>
|
||||
Range check @>>>>>> @>>>>>/s @>>>>>
|
||||
make_short($stats{'Select_range_check'}), t($stats{'Select_range_check'}), perc($stats{'Select_range_check'}, $stats{'Com_select'})
|
||||
Full rng join @>>>>>> @>>>>/s @>>>>>
|
||||
Full rng join @>>>>>> @>>>>>/s @>>>>>
|
||||
make_short($stats{'Select_full_range_join'}), t($stats{'Select_full_range_join'}), perc($stats{'Select_full_range_join'}, $stats{'Com_select'})
|
||||
Sort scan @>>>>>> @>>>>/s
|
||||
Sort scan @>>>>>> @>>>>>/s
|
||||
make_short($stats{'Sort_scan'}), t($stats{'Sort_scan'})
|
||||
Sort range @>>>>>> @>>>>/s
|
||||
Sort range @>>>>>> @>>>>>/s
|
||||
make_short($stats{'Sort_range'}), t($stats{'Sort_range'})
|
||||
Sort mrg pass @>>>>>> @>>>>/s
|
||||
Sort mrg pass @>>>>>> @>>>>>/s
|
||||
make_short($stats{'Sort_merge_passes'}), t($stats{'Sort_merge_passes'})
|
||||
.
|
||||
|
||||
format QCACHE =
|
||||
|
||||
__ Query Cache _________________________________________________________
|
||||
Memory usage @>>>>>> of @>>>>>> %Used: @>>>>>
|
||||
Memory usage @>>>>>> of @>>>>>> %Usage: @>>>>>
|
||||
make_short($qc_mem_used, 1), make_short($vars{'query_cache_size'}, 1), perc($qc_mem_used, $vars{'query_cache_size'})
|
||||
Block Fragmnt @>>>>>%
|
||||
perc($stats{'Qcache_free_blocks'}, $stats{'Qcache_total_blocks'})
|
||||
Hits @>>>>>> @>>>>/s
|
||||
Hits @>>>>>> @>>>>>/s
|
||||
make_short($stats{'Qcache_hits'}), t($stats{'Qcache_hits'})
|
||||
Inserts @>>>>>> @>>>>/s
|
||||
Inserts @>>>>>> @>>>>>/s
|
||||
make_short($stats{'Qcache_inserts'}), t($stats{'Qcache_inserts'})
|
||||
Insrt:Prune @>>>>>>:1 @>>>>/s
|
||||
Insrt:Prune @>>>>>>:1 @>>>>>/s
|
||||
make_short($qc_ip_r), t($stats{'Qcache_inserts'} - $stats{'Qcache_lowmem_prunes'})
|
||||
Hit:Insert @>>>>>>:1
|
||||
$qc_hi_r, t($qc_hi_r)
|
||||
.
|
||||
|
||||
format SUBQUERYCACHE =
|
||||
|
||||
__ Subquery Cache ______________________________________________________
|
||||
Hit ratio @>>>>>%
|
||||
perc($stats{'Subquery_cache_hit'} / ($stats{'Subquery_cache_hit'} + $stats{'Subquery_cache_miss'}))
|
||||
Hits @>>>>>> @>>>>>/s
|
||||
make_short($stats{'Subquery_cache_hit'}), t($stats{'Subquery_cache_hit'})
|
||||
Miss @>>>>>> @>>>>>/s
|
||||
make_short($stats{'Subquery_cache_miss'}), t($stats{'Subquery_cache_miss'})
|
||||
.
|
||||
|
||||
# Not really the end...
|
||||
format REPORT_END =
|
||||
|
||||
__ Table Locks _________________________________________________________
|
||||
Waited @>>>>>>>> @>>>>>/s %Total: @>>>>>
|
||||
Waited @>>>>>>>> @>>>>>/s %Total: @>>>>>
|
||||
make_short($stats{'Table_locks_waited'}), t($stats{'Table_locks_waited'}), perc($stats{'Table_locks_waited'}, $stats{'Table_locks_waited'} + $stats{'Table_locks_immediate'});
|
||||
Immediate @>>>>>>>> @>>>>>/s
|
||||
Immediate @>>>>>>>> @>>>>>/s
|
||||
make_short($stats{'Table_locks_immediate'}), t($stats{'Table_locks_immediate'})
|
||||
|
||||
__ Tables ______________________________________________________________
|
||||
Open @>>>>>>>> of @>>> %Cache: @>>>>>
|
||||
Open @>>>>>>>> of @>>>>> %Cache: @>>>>>
|
||||
$stats{'Open_tables'}, $vars{'table_cache'}, perc($stats{'Open_tables'}, $vars{'table_cache'})
|
||||
Opened @>>>>>>>> @>>>>>/s
|
||||
Opened @>>>>>>>> @>>>>>/s
|
||||
make_short($stats{'Opened_tables'}), t($stats{'Opened_tables'})
|
||||
|
||||
__ Connections _________________________________________________________
|
||||
Max used @>>>>>>>> of @>>> %Max: @>>>>>
|
||||
Max used @>>>>>>>> of @>>>>> %Max: @>>>>>
|
||||
$stats{'Max_used_connections'}, $vars{'max_connections'}, perc($stats{'Max_used_connections'}, $vars{'max_connections'})
|
||||
Total @>>>>>>>> @>>>>>/s
|
||||
Total @>>>>>>>> @>>>>>/s
|
||||
make_short($stats{'Connections'}), t($stats{'Connections'})
|
||||
|
||||
__ Created Temp ________________________________________________________
|
||||
Disk table @>>>>>>>> @>>>>>/s
|
||||
make_short($stats{'Created_tmp_disk_tables'}), t($stats{'Created_tmp_disk_tables'})
|
||||
Table @>>>>>>>> @>>>>>/s Size: @>>>>>
|
||||
Disk table @>>>>>>>> @>>>>>/s %Disk: @>>>>>
|
||||
make_short($stats{'Created_tmp_disk_tables'}), t($stats{'Created_tmp_disk_tables'}), perc($stats{'Created_tmp_disk_tables'}, $stats{'Created_tmp_tables'})
|
||||
Table @>>>>>>>> @>>>>>/s Size: @>>>>>
|
||||
make_short($stats{'Created_tmp_tables'}), t($stats{'Created_tmp_tables'}), make_short($vars{'tmp_table_size'}, 1, 1)
|
||||
File @>>>>>>>> @>>>>>/s
|
||||
File @>>>>>>>> @>>>>>/s
|
||||
make_short($stats{'Created_tmp_files'}), t($stats{'Created_tmp_files'})
|
||||
.
|
||||
|
||||
format THREADS =
|
||||
|
||||
__ Threads _____________________________________________________________
|
||||
Running @>>>>>>>> of @>>>>>
|
||||
$stats{'Threads_running'}, $stats{'Threads_connected'}
|
||||
Created @>>>>>>>> @>>>>>/s
|
||||
make_short($stats{'Threads_created'}), t($stats{'Threads_created'})
|
||||
Slow @>>>>>>>> @>>>>>/s
|
||||
$stats{'Slow_launch_threads'}, t($stats{'Slow_launch_threads'})
|
||||
.
|
||||
|
||||
format THREADPERCONNECTION =
|
||||
Cached @>>>>>>>> of @>>>>> %Hit: @>>>>>
|
||||
$stats{'Threads_cached'}, $vars{'thread_cache_size'}, make_short(100 - perc($stats{'Threads_created'}, $stats{'Connections'}))
|
||||
.
|
||||
|
||||
format THREADPOOL =
|
||||
Threadpool @>>>>>>>> of @>>>>> %Used: @>>>>>
|
||||
$stats{'Threadpool_threads'} + $stats{'Threadpool_idle_threads'}, $vars{'thread_pool_max_threads'}, make_short(perc($stats{'Threadpool_threads'} + $stats{'Threadpool_idle_threads'}, $vars{'thread_pool_max_threads'}))
|
||||
Running @>>>>>>>> of @>>>>> %Running: @>>>>>
|
||||
$stats{'Threadpool_threads'}, $vars{'thread_pool_max_threads'}, make_short(perc($stats{'Threadpool_threads'}, $vars{'thread_pool_max_threads'}))
|
||||
Idle @>>>>>>>> of @>>>>> %Idle: @>>>>>
|
||||
$stats{'Threadpool_idle_threads'}, $vars{'thread_pool_max_threads'}, make_short(perc($stats{'Threadpool_idle_threads'}, $vars{'thread_pool_max_threads'}))
|
||||
.
|
||||
|
||||
format TAB =
|
||||
|
||||
__ Threads _____________________________________________________________
|
||||
Running @>>>>>>>> of @>>>
|
||||
$stats{'Threads_running'}, $stats{'Threads_connected'}
|
||||
Cached @>>>>>>>> of @>>> %Hit: @>>>>>
|
||||
$stats{'Threads_cached'}, $vars{'thread_cache_size'}, make_short(100 - perc($stats{'Threads_created'}, $stats{'Connections'}))
|
||||
Created @>>>>>>>> @>>>>>/s
|
||||
make_short($stats{'Threads_created'}), t($stats{'Threads_created'})
|
||||
Slow @>>>>>>>> @>>>>>/s
|
||||
$stats{'Slow_launch_threads'}, t($stats{'Slow_launch_threads'})
|
||||
|
||||
__ Aborted _____________________________________________________________
|
||||
Clients @>>>>>>>> @>>>>>/s
|
||||
Clients @>>>>>>>> @>>>>>/s
|
||||
make_short($stats{'Aborted_clients'}), t($stats{'Aborted_clients'})
|
||||
Connects @>>>>>>>> @>>>>>/s
|
||||
Connects @>>>>>>>> @>>>>>/s
|
||||
make_short($stats{'Aborted_connects'}), t($stats{'Aborted_connects'})
|
||||
|
||||
__ Bytes _______________________________________________________________
|
||||
Sent @>>>>>>>> @>>>>>/s
|
||||
Sent @>>>>>>>> @>>>>>/s
|
||||
make_short($stats{'Bytes_sent'}), t($stats{'Bytes_sent'})
|
||||
Received @>>>>>>>> @>>>>>/s
|
||||
Received @>>>>>>>> @>>>>>/s
|
||||
make_short($stats{'Bytes_received'}), t($stats{'Bytes_received'})
|
||||
.
|
||||
|
||||
format IB =
|
||||
|
||||
__ InnoDB Buffer Pool __________________________________________________
|
||||
Usage @>>>>>> of @>>>>>> %Used: @>>>>>
|
||||
Usage @>>>>>> of @>>>>>> %Usage: @>>>>>
|
||||
make_short($ib_bp_used, 1), make_short($ib_bp_total, 1), perc($ib_bp_used, $ib_bp_total)
|
||||
Read hit @>>>>>%
|
||||
$ib_bp_read_ratio;
|
||||
Pages
|
||||
Free @>>>>>>>> %Total: @>>>>>
|
||||
Free @>>>>>>>> %Total: @>>>>>
|
||||
make_short($stats{'Innodb_buffer_pool_pages_free'}), perc($stats{'Innodb_buffer_pool_pages_free'}, $stats{'Innodb_buffer_pool_pages_total'})
|
||||
Data @>>>>>>>> @>>>>> %Drty: @>>>>>
|
||||
Data @>>>>>>>> @>>>>> %Drty: @>>>>>
|
||||
make_short($stats{'Innodb_buffer_pool_pages_data'}), perc($stats{'Innodb_buffer_pool_pages_data'}, $stats{'Innodb_buffer_pool_pages_total'}), perc($stats{'Innodb_buffer_pool_pages_dirty'}, $stats{'Innodb_buffer_pool_pages_data'})
|
||||
Misc @>>>>>>>> @>>>>>
|
||||
Misc @>>>>>>>> @>>>>>
|
||||
$stats{'Innodb_buffer_pool_pages_misc'}, perc($stats{'Innodb_buffer_pool_pages_misc'}, $stats{'Innodb_buffer_pool_pages_total'})
|
||||
Latched @>>>>>>>> @>>>>>
|
||||
Latched @>>>>>>>> @>>>>>
|
||||
$stats{'Innodb_buffer_pool_pages_latched'}, perc($stats{'Innodb_buffer_pool_pages_latched'}, $stats{'Innodb_buffer_pool_pages_total'})
|
||||
Reads @>>>>>>>> @>>>>>/s
|
||||
Reads @>>>>>>>> @>>>>>/s
|
||||
make_short($stats{'Innodb_buffer_pool_read_requests'}), t($stats{'Innodb_buffer_pool_read_requests'})
|
||||
From file @>>>>>>>> @>>>>>/s @>>>>>
|
||||
From disk @>>>>>>>> @>>>>>/s %Disk: @>>>>>
|
||||
make_short($stats{'Innodb_buffer_pool_reads'}), t($stats{'Innodb_buffer_pool_reads'}), perc($stats{'Innodb_buffer_pool_reads'}, $stats{'Innodb_buffer_pool_read_requests'})
|
||||
Ahead Rnd @>>>>>>>> @>>>>>/s
|
||||
Ahead Rnd @>>>>>>>> @>>>>>/s
|
||||
$stats{'Innodb_buffer_pool_read_ahead_rnd'}, t($stats{'Innodb_buffer_pool_read_ahead_rnd'})
|
||||
Ahead Sql @>>>>>>>> @>>>>>/s
|
||||
$stats{'Innodb_buffer_pool_read_ahead_seq'}, t($stats{'Innodb_buffer_pool_read_ahead_seq'})
|
||||
Writes @>>>>>>>> @>>>>>/s
|
||||
# Ahead Sql @>>>>>>>> @>>>>>/s
|
||||
#$stats{'Innodb_buffer_pool_read_ahead_seq'}, t($stats{'Innodb_buffer_pool_read_ahead_seq'})
|
||||
Writes @>>>>>>>> @>>>>>/s
|
||||
make_short($stats{'Innodb_buffer_pool_write_requests'}), t($stats{'Innodb_buffer_pool_write_requests'})
|
||||
Flushes @>>>>>>>> @>>>>>/s
|
||||
Wait Free @>>>>>>>> @>>>>>/s %Wait: @>>>>>
|
||||
$stats{'Innodb_buffer_pool_wait_free'}, t($stats{'Innodb_buffer_pool_wait_free'}), perc($stats{'Innodb_buffer_pool_wait_free'}, $stats{'Innodb_buffer_pool_write_requests'})
|
||||
Flushes @>>>>>>>> @>>>>>/s
|
||||
make_short($stats{'Innodb_buffer_pool_pages_flushed'}), t($stats{'Innodb_buffer_pool_pages_flushed'})
|
||||
Wait Free @>>>>>>>> @>>>>>/s
|
||||
$stats{'Innodb_buffer_pool_wait_free'}, t($stats{'Innodb_buffer_pool_wait_free'})
|
||||
.
|
||||
|
||||
format IB_XTRADB =
|
||||
LRU @>>>>>>>> @>>>>>/s %LRU: @>>>>>
|
||||
make_short($stats{'Innodb_buffer_pool_pages_lru_flushed'}), t($stats{'Innodb_buffer_pool_pages_lru_flushed'}), perc($stats{'Innodb_buffer_pool_pages_lru_flushed'}, $stats{'Innodb_buffer_pool_pages_flushed'})
|
||||
.
|
||||
|
||||
format IB_LOCK =
|
||||
|
||||
__ InnoDB Lock _________________________________________________________
|
||||
Waits @>>>>>>>> @>>>>>/s
|
||||
Waits @>>>>>>>> @>>>>>/s
|
||||
$stats{'Innodb_row_lock_waits'}, t($stats{'Innodb_row_lock_waits'})
|
||||
Current @>>>>>>>>
|
||||
$stats{'Innodb_row_lock_current_waits'}
|
||||
@ -1260,15 +1532,20 @@ $stats{'Innodb_row_lock_time_avg'}
|
||||
$stats{'Innodb_row_lock_time_max'}
|
||||
.
|
||||
|
||||
format IB_LOCK_XTRADB =
|
||||
Trx history @>>>>>>>>
|
||||
make_short($stats{'Innodb_history_list_length'})
|
||||
.
|
||||
|
||||
format IB_DPR =
|
||||
|
||||
__ InnoDB Data, Pages, Rows ____________________________________________
|
||||
Data
|
||||
Reads @>>>>>>>> @>>>>>/s
|
||||
Reads @>>>>>>>> @>>>>>/s
|
||||
make_short($stats{'Innodb_data_reads'}), t($stats{'Innodb_data_reads'})
|
||||
Writes @>>>>>>>> @>>>>>/s
|
||||
Writes @>>>>>>>> @>>>>>/s
|
||||
make_short($stats{'Innodb_data_writes'}), t($stats{'Innodb_data_writes'})
|
||||
fsync @>>>>>>>> @>>>>>/s
|
||||
fsync @>>>>>>>> @>>>>>/s
|
||||
make_short($stats{'Innodb_data_fsyncs'}), t($stats{'Innodb_data_fsyncs'})
|
||||
Pending
|
||||
Reads @>>>>>>>>
|
||||
@ -1279,20 +1556,71 @@ $stats{'Innodb_data_pending_writes'}, t($stats{'Innodb_data_pending_writes'})
|
||||
$stats{'Innodb_data_pending_fsyncs'}, t($stats{'Innodb_data_pending_fsyncs'})
|
||||
|
||||
Pages
|
||||
Created @>>>>>>>> @>>>>>/s
|
||||
Created @>>>>>>>> @>>>>>/s
|
||||
make_short($stats{'Innodb_pages_created'}), t($stats{'Innodb_pages_created'})
|
||||
Read @>>>>>>>> @>>>>>/s
|
||||
Read @>>>>>>>> @>>>>>/s
|
||||
make_short($stats{'Innodb_pages_read'}), t($stats{'Innodb_pages_read'})
|
||||
Written @>>>>>>>> @>>>>>/s
|
||||
Written @>>>>>>>> @>>>>>/s
|
||||
make_short($stats{'Innodb_pages_written'}), t($stats{'Innodb_pages_written'})
|
||||
|
||||
Rows
|
||||
Deleted @>>>>>>>> @>>>>>/s
|
||||
Deleted @>>>>>>>> @>>>>>/s
|
||||
make_short($stats{'Innodb_rows_deleted'}), t($stats{'Innodb_rows_deleted'})
|
||||
Inserted @>>>>>>>> @>>>>>/s
|
||||
Inserted @>>>>>>>> @>>>>>/s
|
||||
make_short($stats{'Innodb_rows_inserted'}), t($stats{'Innodb_rows_inserted'})
|
||||
Read @>>>>>>>> @>>>>>/s
|
||||
Read @>>>>>>>> @>>>>>/s
|
||||
make_short($stats{'Innodb_rows_read'}), t($stats{'Innodb_rows_read'})
|
||||
Updated @>>>>>>>> @>>>>>/s
|
||||
Updated @>>>>>>>> @>>>>>/s
|
||||
make_short($stats{'Innodb_rows_updated'}), t($stats{'Innodb_rows_updated'})
|
||||
.
|
||||
|
||||
format PAGECACHE_BUFF_MAX =
|
||||
|
||||
__ Aria Pagecache ______________________________________________________
|
||||
Buffer used @>>>>>> of @>>>>>> %Used: @>>>>>
|
||||
make_short($pagecache_buffer_used, 1), make_short($vars{'aria_pagecache_buffer_size'}, 1), perc($pagecache_buffer_used, $vars{'aria_pagecache_buffer_size'})
|
||||
.
|
||||
|
||||
format PAGECACHE_BUFF_USAGE =
|
||||
Current @>>>>>> %Usage: @>>>>>
|
||||
make_short($pagecache_buffer_usage, 1), perc($pagecache_buffer_usage, $vars{'aria_pagecache_buffer_size'})
|
||||
.
|
||||
|
||||
format PAGECACHE_RATIOS =
|
||||
Write hit @>>>>>%
|
||||
$pagecache_write_ratio
|
||||
Read hit @>>>>>%
|
||||
$pagecache_read_ratio
|
||||
.
|
||||
|
||||
format BINLOG =
|
||||
|
||||
__ Binary Log Cache _____________________________________________________
|
||||
Disk use
|
||||
Transactional @>>>>>%
|
||||
perc($binlog_cache_ratio)
|
||||
Non transactional @>>>>>%
|
||||
perc($binlog_stmt_cache_ratio)
|
||||
.
|
||||
|
||||
format TOKUDB =
|
||||
|
||||
__ TokuDB ______________________________________________________________
|
||||
Cachetable @>>>>>> of @>>>>>> %Usage: @>>>>>
|
||||
make_short($stats{Tokudb_cachetable_size_current}, 1), make_short($vars{tokudb_cache_size}, 1), perc($stats{Tokudb_cachetable_size_current}, $vars{tokudb_cache_size})
|
||||
Miss @>>>>>> @>>>>>/s
|
||||
make_short($stats{'Tokudb_cachetable_miss'}), t($stats{'Tokudb_cachetable_miss'})
|
||||
Evictions @>>>>>> @>>>>>/s
|
||||
make_short($stats{'Tokudb_cachetable_evictions'}), t($stats{'Tokudb_cachetable_evictions'})
|
||||
.
|
||||
|
||||
format ROWS =
|
||||
|
||||
__ Rows ________________________________________________________________
|
||||
Rows @>>>>>>>> @>>>>>/s
|
||||
make_short($rows), t($rows)
|
||||
Using idx @>>>>>>>> @>>>>>/s %Index: @>>>>>
|
||||
make_short($rows_using_indexes), t($rows_using_indexes), perc($rows_using_indexes,$rows)
|
||||
Rows/question @>>>>>>
|
||||
make_short($rows/$questions)
|
||||
.
|
||||
|
2
debian/mariadb-client-10.2.README.Debian
vendored
2
debian/mariadb-client-10.2.README.Debian
vendored
@ -1,4 +1,4 @@
|
||||
FAQ:
|
||||
|
||||
Q: My <tab> completition is gone, why?
|
||||
Q: My <tab> completion is gone, why?
|
||||
A: You have "no-auto-rehash" in the "[mysql]" section of /etc/mysql/my.cnf!
|
||||
|
@ -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
|
||||
|
@ -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);
|
||||
|
||||
|
@ -34,7 +34,7 @@
|
||||
#include "rsa.h"
|
||||
|
||||
|
||||
#define YASSL_VERSION "2.3.8"
|
||||
#define YASSL_VERSION "2.3.9"
|
||||
|
||||
|
||||
#if defined(__cplusplus)
|
||||
|
@ -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
|
||||
{
|
||||
|
@ -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();
|
||||
}
|
||||
|
||||
|
@ -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 {
|
||||
|
@ -32,7 +32,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))
|
||||
|
@ -533,6 +533,7 @@ struct my_charset_handler_st
|
||||
|
||||
extern MY_CHARSET_HANDLER my_charset_8bit_handler;
|
||||
extern MY_CHARSET_HANDLER my_charset_ucs2_handler;
|
||||
extern MY_CHARSET_HANDLER my_charset_utf8_handler;
|
||||
|
||||
|
||||
/*
|
||||
@ -889,6 +890,18 @@ uint32 my_convert(char *to, uint32 to_length, CHARSET_INFO *to_cs,
|
||||
const char *from, uint32 from_length,
|
||||
CHARSET_INFO *from_cs, uint *errors);
|
||||
|
||||
/**
|
||||
An extended version of my_convert(), to pass non-default mb_wc() and wc_mb().
|
||||
For example, String::copy_printable() which is used in
|
||||
Protocol::store_warning() uses this to escape control
|
||||
and non-convertable characters.
|
||||
*/
|
||||
uint32 my_convert_using_func(char *to, uint32 to_length, CHARSET_INFO *to_cs,
|
||||
my_charset_conv_wc_mb mb_wc,
|
||||
const char *from, uint32 from_length,
|
||||
CHARSET_INFO *from_cs,
|
||||
my_charset_conv_mb_wc wc_mb,
|
||||
uint *errors);
|
||||
/*
|
||||
Convert a string between two character sets.
|
||||
Bad byte sequences as well as characters that cannot be
|
||||
|
@ -121,6 +121,15 @@ static inline uint32 my_reverse_bits(uint32 key)
|
||||
_my_bits_reverse_table[(key>>24) ];
|
||||
}
|
||||
|
||||
/*
|
||||
a number with the n lowest bits set
|
||||
an overflow-safe version of (1 << n) - 1
|
||||
*/
|
||||
static inline uint32 my_set_bits(int n)
|
||||
{
|
||||
return (((1UL << (n - 1)) - 1) << 1) | 1;
|
||||
}
|
||||
|
||||
C_MODE_END
|
||||
|
||||
#endif /* MY_BIT_INCLUDED */
|
||||
|
@ -198,20 +198,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
|
||||
@ -452,7 +438,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
|
||||
|
||||
#ifndef SO_EXT
|
||||
@ -823,6 +809,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
|
||||
|
@ -36,9 +36,11 @@ C_MODE_START
|
||||
#ifdef HAVE_ARPA_INET_H
|
||||
#include <arpa/inet.h>
|
||||
#endif
|
||||
#ifdef HAVE_POLL
|
||||
#if defined(HAVE_POLL_H)
|
||||
#include <poll.h>
|
||||
#elif defined(HAVE_SYS_POLL_H)
|
||||
#include <sys/poll.h>
|
||||
#endif
|
||||
#endif /* defined(HAVE_POLL_H) */
|
||||
#ifdef HAVE_SYS_IOCTL_H
|
||||
#include <sys/ioctl.h>
|
||||
#endif
|
||||
|
@ -104,7 +104,7 @@ extern struct wsrep_service_st {
|
||||
const char * (*wsrep_thd_query_state_str_func)(THD *thd);
|
||||
int (*wsrep_thd_retry_counter_func)(THD *thd);
|
||||
void (*wsrep_thd_set_conflict_state_func)(THD *thd, enum wsrep_conflict_state state);
|
||||
bool (*wsrep_thd_skip_append_keys_func)(THD *thd);
|
||||
bool (*wsrep_thd_ignore_table_func)(THD *thd);
|
||||
long long (*wsrep_thd_trx_seqno_func)(THD *thd);
|
||||
struct wsrep_ws_handle * (*wsrep_thd_ws_handle_func)(THD *thd);
|
||||
int (*wsrep_trx_is_aborting_func)(MYSQL_THD thd);
|
||||
@ -145,7 +145,7 @@ extern struct wsrep_service_st {
|
||||
#define wsrep_thd_query_state_str(T) wsrep_service->wsrep_thd_query_state_str_func(T)
|
||||
#define wsrep_thd_retry_counter(T) wsrep_service->wsrep_thd_retry_counter_func(T)
|
||||
#define wsrep_thd_set_conflict_state(T,S) wsrep_service->wsrep_thd_set_conflict_state_func(T,S)
|
||||
#define wsrep_thd_skip_append_keys(T) wsrep_service->wsrep_thd_skip_append_keys_func(T)
|
||||
#define wsrep_thd_ignore_table(T) wsrep_service->wsrep_thd_ignore_table_func(T)
|
||||
#define wsrep_thd_trx_seqno(T) wsrep_service->wsrep_thd_trx_seqno_func(T)
|
||||
#define wsrep_thd_ws_handle(T) wsrep_service->wsrep_thd_ws_handle_func(T)
|
||||
#define wsrep_trx_is_aborting(T) wsrep_service->wsrep_trx_is_aborting_func(T)
|
||||
@ -206,7 +206,7 @@ void wsrep_thd_LOCK(THD *thd);
|
||||
void wsrep_thd_UNLOCK(THD *thd);
|
||||
void wsrep_thd_awake(THD *thd, my_bool signal);
|
||||
void wsrep_thd_set_conflict_state(THD *thd, enum wsrep_conflict_state state);
|
||||
bool wsrep_thd_skip_append_keys(THD *thd);
|
||||
bool wsrep_thd_ignore_table(THD *thd);
|
||||
void wsrep_unlock_rollback();
|
||||
|
||||
#endif
|
||||
|
@ -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
|
||||
|
@ -31,6 +31,14 @@
|
||||
if (WSREP_ON && (WSREP(thd) || (thd && thd->wsrep_exec_mode==TOTAL_ORDER))) \
|
||||
wsrep_to_isolation_end(thd);
|
||||
|
||||
/*
|
||||
Checks if lex->no_write_to_binlog is set for statements that use LOCAL or
|
||||
NO_WRITE_TO_BINLOG.
|
||||
*/
|
||||
#define WSREP_TO_ISOLATION_BEGIN_WRTCHK(db_, table_, table_list_) \
|
||||
if (WSREP(thd) && !thd->lex->no_write_to_binlog \
|
||||
&& wsrep_to_isolation_begin(thd, db_, table_, table_list_)) goto error;
|
||||
|
||||
#define WSREP_DEBUG(...) \
|
||||
if (wsrep_debug) WSREP_LOG(sql_print_information, ##__VA_ARGS__)
|
||||
#define WSREP_INFO(...) WSREP_LOG(sql_print_information, ##__VA_ARGS__)
|
||||
@ -46,6 +54,7 @@
|
||||
#define WSREP_ERROR(...)
|
||||
#define WSREP_TO_ISOLATION_BEGIN(db_, table_, table_list_)
|
||||
#define WSREP_TO_ISOLATION_END
|
||||
#define WSREP_TO_ISOLATION_BEGIN_WRTCHK(db_, table_, table_list_)
|
||||
#endif
|
||||
|
||||
#endif /* WSERP_INCLUDED */
|
||||
|
@ -47,9 +47,11 @@
|
||||
#include <sys/select.h>
|
||||
#endif
|
||||
#endif /* !defined(__WIN__) */
|
||||
#ifdef HAVE_POLL
|
||||
#if defined(HAVE_POLL_H)
|
||||
#include <poll.h>
|
||||
#elif defined(HAVE_SYS_POLL_H)
|
||||
#include <sys/poll.h>
|
||||
#endif
|
||||
#endif /* defined(HAVE_POLL_H) */
|
||||
#ifdef HAVE_SYS_UN_H
|
||||
#include <sys/un.h>
|
||||
#endif
|
||||
|
1
mysql-test/include/galera_clear_sync_point.inc
Normal file
1
mysql-test/include/galera_clear_sync_point.inc
Normal file
@ -0,0 +1 @@
|
||||
SET GLOBAL wsrep_provider_options = 'dbug=';
|
1
mysql-test/include/galera_set_sync_point.inc
Normal file
1
mysql-test/include/galera_set_sync_point.inc
Normal file
@ -0,0 +1 @@
|
||||
--eval SET GLOBAL wsrep_provider_options = 'dbug=d,$galera_sync_point'
|
1
mysql-test/include/galera_signal_sync_point.inc
Normal file
1
mysql-test/include/galera_signal_sync_point.inc
Normal file
@ -0,0 +1 @@
|
||||
--eval SET GLOBAL wsrep_provider_options = 'signal=$galera_sync_point'
|
6
mysql-test/include/galera_wait_sync_point.inc
Normal file
6
mysql-test/include/galera_wait_sync_point.inc
Normal file
@ -0,0 +1,6 @@
|
||||
--let $wait_timeout = 10
|
||||
--let $wsrep_on_orig = `SELECT @@wsrep_on`
|
||||
SET SESSION wsrep_on = 0;
|
||||
--let $wait_condition = SELECT 1 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_debug_sync_waiters' AND VARIABLE_VALUE = '$galera_sync_point'
|
||||
--source include/wait_condition.inc
|
||||
--eval SET SESSION wsrep_on = $wsrep_on_orig
|
@ -40,6 +40,11 @@ BEGIN
|
||||
-- except those that was created during bootstrap
|
||||
SELECT * FROM INFORMATION_SCHEMA.SCHEMATA;
|
||||
|
||||
-- and the mtr_wsrep_notify schema which is populated by the std_data/wsrep_notify.sh script
|
||||
-- and the suite/galera/t/galera_var_notify_cmd.test
|
||||
-- and the wsrep_schema schema that may be created by Galera
|
||||
SELECT * FROM INFORMATION_SCHEMA.SCHEMATA WHERE SCHEMA_NAME NOT IN ('mtr_wsrep_notify', 'wsrep_schema');
|
||||
|
||||
-- The test database should not contain any tables
|
||||
SELECT table_name AS tables_in_test FROM INFORMATION_SCHEMA.TABLES
|
||||
WHERE table_schema='test';
|
||||
|
@ -496,6 +496,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)
|
||||
|
@ -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);
|
||||
|
@ -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
|
||||
|
@ -1889,5 +1889,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
|
||||
|
@ -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
|
||||
@ -5374,8 +5374,7 @@ INSERT INTO t1 VALUES (0), (0), (1), (0), (0);
|
||||
SELECT COUNT(*) FROM t1, t1 t2
|
||||
GROUP BY INSERT('', t2.a, t1.a, (@@global.max_binlog_size));
|
||||
COUNT(*)
|
||||
20
|
||||
5
|
||||
25
|
||||
DROP TABLE t1;
|
||||
#
|
||||
# Bug#11764503 (Bug#57341) Query in EXPLAIN EXTENDED shows wrong characters
|
||||
@ -10259,5 +10258,146 @@ Warnings:
|
||||
Note 1003 select `test`.`t1`.`c` AS `c` from `test`.`t1` where (`test`.`t1`.`c` = 'A')
|
||||
DROP TABLE t1;
|
||||
#
|
||||
# MDEV-7231 Field ROUTINE_DEFINITION in INFORMATION_SCHEMA.`ROUTINES` contains broken procedure body when used shielding quotes inside.
|
||||
#
|
||||
CREATE PROCEDURE p1()
|
||||
BEGIN
|
||||
SELECT CONCAT('ABC = ''',1,''''), CONCAT('ABC = ',2);
|
||||
SELECT '''', """", '\'', "\"";
|
||||
SELECT '<tab> <tab>\t<tab>';
|
||||
SELECT '<nl>
|
||||
<nl>\n<nl>';
|
||||
SELECT 'test';
|
||||
SELECT 'tëst';
|
||||
SELECT 'test\0';
|
||||
SELECT 'tëst\0';
|
||||
SELECT _binary'test';
|
||||
SELECT _binary'test\0';
|
||||
SELECT N'''', N"""", N'\'', N"\"";
|
||||
SELECT N'<tab> <tab>\t<tab>';
|
||||
SELECT N'<nl>
|
||||
<nl>\n<nl>';
|
||||
SELECT N'test';
|
||||
SELECT N'tëst';
|
||||
SELECT N'test\0';
|
||||
SELECT N'tëst\0';
|
||||
END$$
|
||||
SELECT ROUTINE_DEFINITION FROM INFORMATION_SCHEMA.ROUTINES
|
||||
WHERE ROUTINE_SCHEMA='test' AND SPECIFIC_NAME ='p1';
|
||||
ROUTINE_DEFINITION
|
||||
BEGIN
|
||||
SELECT CONCAT('ABC = ''',1,''''), CONCAT('ABC = ',2);
|
||||
SELECT '''', """", '''', """";
|
||||
SELECT '<tab>\t<tab>\t<tab>';
|
||||
SELECT '<nl>\n<nl>\n<nl>';
|
||||
SELECT 'test';
|
||||
SELECT 'tëst';
|
||||
SELECT 'test\0';
|
||||
SELECT 'tëst\0';
|
||||
SELECT 'test';
|
||||
SELECT 'test\0';
|
||||
SELECT N'''', N"""", N'''', N"""";
|
||||
SELECT N'<tab>\t<tab>\t<tab>';
|
||||
SELECT N'<nl>\n<nl>\n<nl>';
|
||||
SELECT N'test';
|
||||
SELECT N'tëst';
|
||||
SELECT N'test\0';
|
||||
SELECT N'tëst\0';
|
||||
END
|
||||
SELECT body_utf8 FROM mysql.proc WHERE name='p1';
|
||||
body_utf8
|
||||
BEGIN
|
||||
SELECT CONCAT('ABC = ''',1,''''), CONCAT('ABC = ',2);
|
||||
SELECT '''', """", '''', """";
|
||||
SELECT '<tab>\t<tab>\t<tab>';
|
||||
SELECT '<nl>\n<nl>\n<nl>';
|
||||
SELECT 'test';
|
||||
SELECT 'tëst';
|
||||
SELECT 'test\0';
|
||||
SELECT 'tëst\0';
|
||||
SELECT 'test';
|
||||
SELECT 'test\0';
|
||||
SELECT N'''', N"""", N'''', N"""";
|
||||
SELECT N'<tab>\t<tab>\t<tab>';
|
||||
SELECT N'<nl>\n<nl>\n<nl>';
|
||||
SELECT N'test';
|
||||
SELECT N'tëst';
|
||||
SELECT N'test\0';
|
||||
SELECT N'tëst\0';
|
||||
END
|
||||
DROP PROCEDURE p1;
|
||||
SET @@SQL_MODE='NO_BACKSLASH_ESCAPES';
|
||||
CREATE PROCEDURE p1()
|
||||
BEGIN
|
||||
SELECT CONCAT('ABC = ''',1,''''), CONCAT('ABC = ',2);
|
||||
SELECT '''', """";
|
||||
SELECT '<tab> <tab>\t<tab>';
|
||||
SELECT '<nl>
|
||||
<nl>\n<nl>';
|
||||
SELECT 'test';
|
||||
SELECT 'tëst';
|
||||
SELECT 'test\0';
|
||||
SELECT 'tëst\0';
|
||||
SELECT _binary'test';
|
||||
SELECT _binary'test\0';
|
||||
SELECT N'''', N"""";
|
||||
SELECT N'<tab> <tab>\t<tab>';
|
||||
SELECT N'<nl>
|
||||
<nl>\n<nl>';
|
||||
SELECT N'test';
|
||||
SELECT N'tëst';
|
||||
SELECT N'test\0';
|
||||
SELECT N'tëst\0';
|
||||
END$$
|
||||
SELECT ROUTINE_DEFINITION FROM INFORMATION_SCHEMA.ROUTINES
|
||||
WHERE ROUTINE_SCHEMA='test' AND SPECIFIC_NAME ='p1';
|
||||
ROUTINE_DEFINITION
|
||||
BEGIN
|
||||
SELECT CONCAT('ABC = ''',1,''''), CONCAT('ABC = ',2);
|
||||
SELECT '''', """";
|
||||
SELECT '<tab> <tab>\t<tab>';
|
||||
SELECT '<nl>
|
||||
<nl>\n<nl>';
|
||||
SELECT 'test';
|
||||
SELECT 'tëst';
|
||||
SELECT 'test\0';
|
||||
SELECT 'tëst\0';
|
||||
SELECT 'test';
|
||||
SELECT 'test\0';
|
||||
SELECT N'''', N"""";
|
||||
SELECT N'<tab> <tab>\t<tab>';
|
||||
SELECT N'<nl>
|
||||
<nl>\n<nl>';
|
||||
SELECT N'test';
|
||||
SELECT N'tëst';
|
||||
SELECT N'test\0';
|
||||
SELECT N'tëst\0';
|
||||
END
|
||||
SELECT body_utf8 FROM mysql.proc WHERE name='p1';
|
||||
body_utf8
|
||||
BEGIN
|
||||
SELECT CONCAT('ABC = ''',1,''''), CONCAT('ABC = ',2);
|
||||
SELECT '''', """";
|
||||
SELECT '<tab> <tab>\t<tab>';
|
||||
SELECT '<nl>
|
||||
<nl>\n<nl>';
|
||||
SELECT 'test';
|
||||
SELECT 'tëst';
|
||||
SELECT 'test\0';
|
||||
SELECT 'tëst\0';
|
||||
SELECT 'test';
|
||||
SELECT 'test\0';
|
||||
SELECT N'''', N"""";
|
||||
SELECT N'<tab> <tab>\t<tab>';
|
||||
SELECT N'<nl>
|
||||
<nl>\n<nl>';
|
||||
SELECT N'test';
|
||||
SELECT N'tëst';
|
||||
SELECT N'test\0';
|
||||
SELECT N'tëst\0';
|
||||
END
|
||||
DROP PROCEDURE p1;
|
||||
SET @@SQL_MODE=default;
|
||||
#
|
||||
# End of 10.1 tests
|
||||
#
|
||||
|
@ -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
|
||||
@ -3382,5 +3382,19 @@ SET NAMES utf8mb4;
|
||||
SELECT * FROM `test😁😁test`;
|
||||
ERROR HY000: Invalid utf8mb4 character string: 'test\xF0\x9F\x98\x81\xF0\x9F\x98\x81test'
|
||||
#
|
||||
# MDEV-7231 Field ROUTINE_DEFINITION in INFORMATION_SCHEMA.`ROUTINES` contains broken procedure body when used shielding quotes inside.
|
||||
#
|
||||
SET NAMES utf8mb4;
|
||||
CREATE FUNCTION f1() RETURNS TEXT CHARACTER SET utf8mb4
|
||||
RETURN CONCAT('😎','x😎','😎y','x😎y');
|
||||
SELECT ROUTINE_DEFINITION FROM INFORMATION_SCHEMA.ROUTINES
|
||||
WHERE ROUTINE_SCHEMA='test' AND SPECIFIC_NAME ='f1';
|
||||
ROUTINE_DEFINITION
|
||||
RETURN CONCAT('?','x?','?y','x?y')
|
||||
SELECT body_utf8 FROM mysql.proc WHERE name='f1';
|
||||
body_utf8
|
||||
RETURN CONCAT('?','x?','?y','x?y')
|
||||
DROP FUNCTION f1;
|
||||
#
|
||||
# End of 10.1 tests
|
||||
#
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -603,6 +603,351 @@ 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;
|
||||
#
|
||||
# Start of 10.1 tests
|
||||
|
@ -204,7 +204,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
|
||||
@ -2343,7 +2343,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
|
||||
@ -2633,7 +2633,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;;
|
||||
@ -4579,8 +4579,7 @@ CREATE TABLE t1 (a INT);
|
||||
INSERT INTO t1 VALUES (0),(0),(1),(0),(0);
|
||||
SELECT COUNT(*) FROM t1, t1 t2 GROUP BY INSERT('', t2.a, t1.a, @@global.max_binlog_size);
|
||||
COUNT(*)
|
||||
20
|
||||
5
|
||||
25
|
||||
DROP TABLE t1;
|
||||
#
|
||||
# End of 10.1 tests
|
||||
|
@ -1729,6 +1729,45 @@ Warnings:
|
||||
Warning 1292 Incorrect datetime value: '1'
|
||||
drop table t1;
|
||||
SET timestamp=DEFAULT;
|
||||
#
|
||||
# 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
|
||||
Warnings:
|
||||
Warning 1411 Incorrect datetime value: '0000-00-00 10:30:30' for function str_to_date
|
||||
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
|
||||
|
@ -2640,3 +2640,41 @@ field1 field2
|
||||
DROP TABLE t1;
|
||||
DROP TABLE where_subselect;
|
||||
# End of Bug #58782
|
||||
#
|
||||
# MDEV-8988: Apparently valid SQL query gives wrong result (nested WHERE)
|
||||
#
|
||||
create table t0(a int);
|
||||
insert into t0 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
|
||||
create table t1 (a int, b int, c int);
|
||||
insert into t1 select A.a + 10*B.a, A.a, A.a + 10*B.a from t0 A, t0 B;
|
||||
insert into t1 values (NULL, NULL, NULL);
|
||||
create table t2 (c int, col1 int, key(c));
|
||||
insert into t2 select t1.a, 100000 from t1;
|
||||
analyze table t2;
|
||||
Table Op Msg_type Msg_text
|
||||
test.t2 analyze status Table is already up to date
|
||||
explain
|
||||
select
|
||||
max(a)+ (select col1 from t2 where t2.c=t1.c)
|
||||
from t1
|
||||
group by t1.b;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 PRIMARY t1 ALL NULL NULL NULL NULL 101 Using temporary; Using filesort
|
||||
2 DEPENDENT SUBQUERY t2 ref c c 5 func 1
|
||||
select
|
||||
max(a) + (select col1 from t2 where t2.c=t1.c)
|
||||
from t1
|
||||
group by t1.b;
|
||||
max(a) + (select col1 from t2 where t2.c=t1.c)
|
||||
NULL
|
||||
100090
|
||||
100091
|
||||
100092
|
||||
100093
|
||||
100094
|
||||
100095
|
||||
100096
|
||||
100097
|
||||
100098
|
||||
100099
|
||||
drop table t0,t1,t2;
|
||||
|
@ -101,3 +101,8 @@ SELECT * FROM information_schema.partitions
|
||||
WHERE table_schema= 'test' AND table_name= 'v1';
|
||||
DROP TABLE t1;
|
||||
DROP VIEW v1;
|
||||
CREATE TABLE t1(i int) ENGINE=Innodb ROW_FORMAT=REDUNDANT DATA DIRECTORY='MYSQLTEST_VARDIR/tmp';
|
||||
SELECT CREATE_OPTIONS FROM INFORMATION_SCHEMA.TABLES where TABLE_NAME='t1';
|
||||
CREATE_OPTIONS
|
||||
row_format=REDUNDANT DATA DIRECTORY='MYSQLTEST_VARDIR/tmp/'
|
||||
DROP TABLE t1;
|
||||
|
@ -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;
|
||||
|
@ -319,4 +319,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;
|
||||
|
@ -3715,7 +3715,7 @@ CREATE TEMPORARY TABLE `TABLES` (
|
||||
`CHECK_TIME` datetime DEFAULT NULL,
|
||||
`TABLE_COLLATION` varchar(32) DEFAULT NULL,
|
||||
`CHECKSUM` bigint(21) unsigned DEFAULT NULL,
|
||||
`CREATE_OPTIONS` varchar(255) DEFAULT NULL,
|
||||
`CREATE_OPTIONS` varchar(2048) DEFAULT NULL,
|
||||
`TABLE_COMMENT` varchar(2048) NOT NULL DEFAULT ''
|
||||
) ENGINE=MEMORY DEFAULT CHARSET=utf8;
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
|
@ -1524,6 +1524,13 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
|
||||
Warnings:
|
||||
Note 1003 select nullif(<cache>(avg(`test`.`t1`.`a`)),0) AS `NULLIF(AVG(a),0)` from `test`.`t1`
|
||||
DROP TABLE t1;
|
||||
create table t1 (col1 varchar(50));
|
||||
create view v1 AS select nullif(count(distinct col1),0) from t1;
|
||||
show create view v1;
|
||||
View Create View character_set_client collation_connection
|
||||
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select nullif(count(distinct `t1`.`col1`),0) AS `nullif(count(distinct col1),0)` from `t1` latin1 latin1_swedish_ci
|
||||
drop view v1;
|
||||
drop table t1;
|
||||
#
|
||||
# End of 10.1 tests
|
||||
#
|
||||
|
13
mysql-test/r/second_frac-9175.result
Normal file
13
mysql-test/r/second_frac-9175.result
Normal 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;
|
@ -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;
|
||||
|
12
mysql-test/r/show.result
Normal file
12
mysql-test/r/show.result
Normal file
@ -0,0 +1,12 @@
|
||||
show statistics;
|
||||
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'statistics' at line 1
|
||||
show spatial_ref_sys
|
||||
--error ER_PARSE_ERROR
|
||||
show system_variables;
|
||||
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'spatial_ref_sys
|
||||
--error ER_PARSE_ERROR
|
||||
show system_variables' at line 2
|
||||
show geometry_columns;
|
||||
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'geometry_columns' at line 1
|
||||
show nonexistent;
|
||||
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'nonexistent' at line 1
|
@ -133,7 +133,7 @@ def information_schema TABLES TABLES UPDATE_TIME Update_time 12 19 0 Y 128 0 63
|
||||
def information_schema TABLES TABLES CHECK_TIME Check_time 12 19 0 Y 128 0 63
|
||||
def information_schema TABLES TABLES TABLE_COLLATION Collation 253 32 0 Y 0 0 8
|
||||
def information_schema TABLES TABLES CHECKSUM Checksum 8 21 0 Y 32800 0 63
|
||||
def information_schema TABLES TABLES CREATE_OPTIONS Create_options 253 255 0 Y 0 0 8
|
||||
def information_schema TABLES TABLES CREATE_OPTIONS Create_options 253 2048 0 Y 0 0 8
|
||||
def information_schema TABLES TABLES TABLE_COMMENT Comment 253 2048 0 N 1 0 8
|
||||
Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment
|
||||
show databases;
|
||||
@ -935,7 +935,7 @@ def information_schema TABLES TABLES TABLE_TYPE TABLE_TYPE 253 192 10 N 1 0 33
|
||||
def information_schema TABLES TABLES ENGINE ENGINE 253 192 6 Y 0 0 33
|
||||
def information_schema TABLES TABLES ROW_FORMAT ROW_FORMAT 253 30 5 Y 0 0 33
|
||||
def information_schema TABLES TABLES TABLE_COLLATION TABLE_COLLATION 253 96 17 Y 0 0 33
|
||||
def information_schema TABLES TABLES CREATE_OPTIONS CREATE_OPTIONS 253 765 0 Y 0 0 33
|
||||
def information_schema TABLES TABLES CREATE_OPTIONS CREATE_OPTIONS 253 6144 0 Y 0 0 33
|
||||
def information_schema TABLES TABLES TABLE_COMMENT TABLE_COMMENT 253 6144 0 N 1 0 33
|
||||
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME TABLE_TYPE ENGINE ROW_FORMAT TABLE_COLLATION CREATE_OPTIONS TABLE_COMMENT
|
||||
def test t1 BASE TABLE MyISAM Fixed latin1_swedish_ci
|
||||
|
@ -4326,57 +4326,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|
|
||||
|
5
mysql-test/r/ssl_cert_verify.result
Normal file
5
mysql-test/r/ssl_cert_verify.result
Normal 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
|
@ -7110,6 +7110,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
|
||||
#
|
||||
|
@ -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;
|
||||
#
|
||||
|
@ -2518,3 +2518,18 @@ a b sq
|
||||
4 4 1
|
||||
4 2 1
|
||||
drop table t1, t2;
|
||||
#
|
||||
# MDEV-9489: Assertion `0' failed in Protocol::end_statement() on
|
||||
# UNION ALL
|
||||
#
|
||||
CREATE TABLE t1 (f1 INT);
|
||||
CREATE TABLE t2 (f2 INT);
|
||||
INSERT INTO t1 VALUES (1),(2);
|
||||
( SELECT 1 FROM t1 WHERE f1 NOT IN ( SELECT f2 FROM t2 ) LIMIT 0 )
|
||||
UNION ALL
|
||||
( SELECT 1 FROM t1 WHERE f1 NOT IN ( SELECT f2 FROM t2 ) )
|
||||
;
|
||||
1
|
||||
1
|
||||
1
|
||||
drop table t1, t2;
|
||||
|
@ -7110,6 +7110,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
|
||||
#
|
||||
|
@ -7103,6 +7103,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
|
||||
#
|
||||
|
@ -7101,6 +7101,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
|
||||
#
|
||||
|
@ -7116,6 +7116,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
|
||||
#
|
||||
|
@ -7101,6 +7101,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
|
||||
#
|
||||
|
@ -3003,4 +3003,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;
|
||||
|
@ -3017,6 +3017,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
|
||||
|
@ -202,6 +202,9 @@ t1 CREATE TABLE `t1` (
|
||||
`a` int(11) NOT NULL,
|
||||
PRIMARY KEY (`a`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1 DATA DIRECTORY='MYSQLTEST_VARDIR/tmp/' INDEX DIRECTORY='MYSQLTEST_VARDIR/run/'
|
||||
select create_options from information_schema.tables where table_name='t1';
|
||||
create_options
|
||||
DATA DIRECTORY='MYSQLTEST_VARDIR/tmp/' INDEX DIRECTORY='MYSQLTEST_VARDIR/run/'
|
||||
# CREATE TABLE LIKE statement on table with INDEX/DATA DIRECTORY
|
||||
# options should not fail. Per documentation newly created table
|
||||
# should not inherit value of these options from the original table.
|
||||
|
@ -322,3 +322,22 @@ select * from t1;
|
||||
id
|
||||
0
|
||||
drop table t1;
|
||||
create table t1 (a int not null, b int);
|
||||
create trigger trgi before update on t1 for each row do 1;
|
||||
insert t1 values (1,1),(2,2),(3,3),(1,4);
|
||||
create table t2 select a as c, b as d from t1;
|
||||
update t1 set a=(select count(c) from t2 where c+1=a+1 group by a);
|
||||
select * from t1;
|
||||
a b
|
||||
2 1
|
||||
1 2
|
||||
1 3
|
||||
2 4
|
||||
drop table t1, t2;
|
||||
create table t1 (a int not null);
|
||||
create table t2 (f1 int unsigned not null, f2 int);
|
||||
insert into t2 values (1, null);
|
||||
create trigger tr1 before update on t1 for each row do 1;
|
||||
create trigger tr2 after update on t2 for each row update t1 set a=new.f2;
|
||||
update t2 set f2=1 where f1=1;
|
||||
drop table t1, t2;
|
||||
|
@ -439,6 +439,15 @@ 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;
|
||||
#
|
||||
# Start of 10.1 tests
|
||||
#
|
||||
#
|
||||
@ -511,12 +520,6 @@ Warnings:
|
||||
Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where (`test`.`t1`.`a` = DATE'2001-01-01')
|
||||
DROP TABLE t1;
|
||||
#
|
||||
# End of 10.1 tests
|
||||
#
|
||||
#
|
||||
# Start of 10.1 tests
|
||||
#
|
||||
#
|
||||
# MDEV-8699 Wrong result for SELECT..WHERE HEX(date_column)!='323030312D30312D3031' AND date_column='2001-01-01x'
|
||||
#
|
||||
CREATE TABLE t1 (a DATE);
|
||||
|
@ -2425,28 +2425,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;
|
||||
@ -5540,6 +5540,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.
|
||||
# -----------------------------------------------------------------
|
||||
|
20
mysql-test/std_data/ca-cert-verify.pem
Normal file
20
mysql-test/std_data/ca-cert-verify.pem
Normal 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-----
|
19
mysql-test/std_data/server-cert-verify-fail.pem
Normal file
19
mysql-test/std_data/server-cert-verify-fail.pem
Normal 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-----
|
19
mysql-test/std_data/server-cert-verify-pass.pem
Normal file
19
mysql-test/std_data/server-cert-verify-pass.pem
Normal 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-----
|
27
mysql-test/std_data/server-key-verify-fail.pem
Normal file
27
mysql-test/std_data/server-key-verify-fail.pem
Normal 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-----
|
27
mysql-test/std_data/server-key-verify-pass.pem
Normal file
27
mysql-test/std_data/server-key-verify-pass.pem
Normal 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-----
|
@ -58,7 +58,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();
|
||||
|
||||
|
@ -0,0 +1,32 @@
|
||||
SET GLOBAL innodb_file_format = `Barracuda`;
|
||||
SET GLOBAL innodb_file_per_table = ON;
|
||||
call mtr.add_suppression("InnoDB: Block in space_id .* in file test/.* encrypted");
|
||||
call mtr.add_suppression("InnoDB: However key management plugin or used key_id 1 is not found or used encryption algorithm or method does not match.");
|
||||
call mtr.add_suppression("InnoDB: Marking tablespace as missing. You may drop this table or install correct key management plugin and key file.");
|
||||
call mtr.add_suppression(".*InnoDB: Cannot open table test/.* from the internal data dictionary of InnoDB though the .frm file for the table exists. See .* for how you can resolve the problem.");
|
||||
call mtr.add_suppression("InnoDB: .ibd file is missing for table test/.*");
|
||||
call mtr.add_suppression("Couldn't load plugins from 'file_key_management*");
|
||||
call mtr.add_suppression("InnoDB: Tablespace id.* is encrypted but encryption service or used key_id .* is not available. Can't continue opening tablespace.");
|
||||
create table t5 (
|
||||
`intcol1` int(32) DEFAULT NULL,
|
||||
`intcol2` int(32) DEFAULT NULL,
|
||||
`charcol1` varchar(128) DEFAULT NULL,
|
||||
`charcol2` varchar(128) DEFAULT NULL,
|
||||
`charcol3` varchar(128) DEFAULT NULL
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
|
||||
insert into t5 values (1,2,'maria','db','encryption');
|
||||
CREATE TABLE `t1` (
|
||||
`intcol1` int(32) DEFAULT NULL,
|
||||
`intcol2` int(32) DEFAULT NULL,
|
||||
`charcol1` varchar(128) DEFAULT NULL,
|
||||
`charcol2` varchar(128) DEFAULT NULL,
|
||||
`charcol3` varchar(128) DEFAULT NULL
|
||||
) ENGINE=InnoDB;
|
||||
insert into t1 values (1,2,'maria','db','encryption');
|
||||
alter table t1 encrypted='yes' `encryption_key_id`=1;
|
||||
select * from t1;
|
||||
ERROR HY000: Got error 192 'Table encrypted but decryption failed. This could be because correct encryption management plugin is not loaded, used encryption key is not available or encryption method does not match.' from InnoDB
|
||||
select * from t5;
|
||||
ERROR HY000: Got error 192 'Table encrypted but decryption failed. This could be because correct encryption management plugin is not loaded, used encryption key is not available or encryption method does not match.' from InnoDB
|
||||
drop table t1;
|
||||
drop table t5;
|
92
mysql-test/suite/encryption/t/innodb-encryption-disable.test
Normal file
92
mysql-test/suite/encryption/t/innodb-encryption-disable.test
Normal file
@ -0,0 +1,92 @@
|
||||
-- source include/have_innodb.inc
|
||||
# embedded does not support restart
|
||||
-- source include/not_embedded.inc
|
||||
-- source include/not_valgrind.inc
|
||||
# Avoid CrashReporter popup on Mac
|
||||
-- source include/not_crashrep.inc
|
||||
-- source filekeys_plugin_exists.inc
|
||||
|
||||
--disable_query_log
|
||||
let $innodb_file_format_orig = `SELECT @@innodb_file_format`;
|
||||
let $innodb_file_per_table_orig = `SELECT @@innodb_file_per_table`;
|
||||
--enable_query_log
|
||||
|
||||
SET GLOBAL innodb_file_format = `Barracuda`;
|
||||
SET GLOBAL innodb_file_per_table = ON;
|
||||
|
||||
#
|
||||
# MDEV-9559: Server without encryption configs crashes if selecting from an implicitly encrypted table
|
||||
#
|
||||
call mtr.add_suppression("InnoDB: Block in space_id .* in file test/.* encrypted");
|
||||
call mtr.add_suppression("InnoDB: However key management plugin or used key_id 1 is not found or used encryption algorithm or method does not match.");
|
||||
call mtr.add_suppression("InnoDB: Marking tablespace as missing. You may drop this table or install correct key management plugin and key file.");
|
||||
call mtr.add_suppression(".*InnoDB: Cannot open table test/.* from the internal data dictionary of InnoDB though the .frm file for the table exists. See .* for how you can resolve the problem.");
|
||||
call mtr.add_suppression("InnoDB: .ibd file is missing for table test/.*");
|
||||
# Suppression for builds where file_key_management plugin is linked statically
|
||||
call mtr.add_suppression("Couldn't load plugins from 'file_key_management*");
|
||||
call mtr.add_suppression("InnoDB: Tablespace id.* is encrypted but encryption service or used key_id .* is not available. Can't continue opening tablespace.");
|
||||
|
||||
--exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
|
||||
--shutdown_server
|
||||
--source include/wait_until_disconnected.inc
|
||||
|
||||
--write_file $MYSQLTEST_VARDIR/keys1.txt
|
||||
1;770A8A65DA156D24EE2A093277530142
|
||||
4;770A8A65DA156D24EE2A093277530143
|
||||
EOF
|
||||
|
||||
--exec echo "restart:--innodb-encrypt-tables --plugin-load-add=file_key_management.so --file-key-management --file-key-management-filename=$MYSQLTEST_VARDIR/keys1.txt" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
|
||||
--enable_reconnect
|
||||
--source include/wait_until_connected_again.inc
|
||||
|
||||
create table t5 (
|
||||
`intcol1` int(32) DEFAULT NULL,
|
||||
`intcol2` int(32) DEFAULT NULL,
|
||||
`charcol1` varchar(128) DEFAULT NULL,
|
||||
`charcol2` varchar(128) DEFAULT NULL,
|
||||
`charcol3` varchar(128) DEFAULT NULL
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
|
||||
|
||||
insert into t5 values (1,2,'maria','db','encryption');
|
||||
|
||||
CREATE TABLE `t1` (
|
||||
`intcol1` int(32) DEFAULT NULL,
|
||||
`intcol2` int(32) DEFAULT NULL,
|
||||
`charcol1` varchar(128) DEFAULT NULL,
|
||||
`charcol2` varchar(128) DEFAULT NULL,
|
||||
`charcol3` varchar(128) DEFAULT NULL
|
||||
) ENGINE=InnoDB;
|
||||
|
||||
insert into t1 values (1,2,'maria','db','encryption');
|
||||
alter table t1 encrypted='yes' `encryption_key_id`=1;
|
||||
|
||||
--exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
|
||||
--shutdown_server
|
||||
--source include/wait_until_disconnected.inc
|
||||
|
||||
--exec echo "restart:--innodb-encrypt-tables=OFF" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
|
||||
--enable_reconnect
|
||||
--source include/wait_until_connected_again.inc
|
||||
|
||||
--error 1296
|
||||
select * from t1;
|
||||
--error 1296
|
||||
select * from t5;
|
||||
|
||||
--exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
|
||||
--shutdown_server
|
||||
--source include/wait_until_disconnected.inc
|
||||
|
||||
--exec echo "restart:--innodb-encrypt-tables --plugin-load-add=file_key_management.so --file-key-management --file-key-management-filename=$MYSQLTEST_VARDIR/keys1.txt" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
|
||||
--enable_reconnect
|
||||
--source include/wait_until_connected_again.inc
|
||||
|
||||
drop table t1;
|
||||
drop table t5;
|
||||
|
||||
--disable_query_log
|
||||
EVAL SET GLOBAL innodb_file_per_table = $innodb_file_per_table_orig;
|
||||
EVAL SET GLOBAL innodb_file_format = $innodb_file_format_orig;
|
||||
--enable_query_log
|
||||
|
||||
--remove_file $MYSQLTEST_VARDIR/keys1.txt
|
@ -2164,6 +2164,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;
|
||||
|
@ -2001,4 +2001,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;
|
||||
|
@ -363,7 +363,7 @@ def information_schema TABLES AUTO_INCREMENT 14 NULL YES bigint NULL NULL 20 0 N
|
||||
def information_schema TABLES AVG_ROW_LENGTH 9 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned select
|
||||
def information_schema TABLES CHECKSUM 19 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned select
|
||||
def information_schema TABLES CHECK_TIME 17 NULL YES datetime NULL NULL NULL NULL 0 NULL NULL datetime select
|
||||
def information_schema TABLES CREATE_OPTIONS 20 NULL YES varchar 255 765 NULL NULL NULL utf8 utf8_general_ci varchar(255) select
|
||||
def information_schema TABLES CREATE_OPTIONS 20 NULL YES varchar 2048 6144 NULL NULL NULL utf8 utf8_general_ci varchar(2048) select
|
||||
def information_schema TABLES CREATE_TIME 15 NULL YES datetime NULL NULL NULL NULL 0 NULL NULL datetime select
|
||||
def information_schema TABLES DATA_FREE 13 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned select
|
||||
def information_schema TABLES DATA_LENGTH 10 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned select
|
||||
@ -906,7 +906,7 @@ NULL information_schema TABLES UPDATE_TIME datetime NULL NULL NULL NULL datetime
|
||||
NULL information_schema TABLES CHECK_TIME datetime NULL NULL NULL NULL datetime
|
||||
3.0000 information_schema TABLES TABLE_COLLATION varchar 32 96 utf8 utf8_general_ci varchar(32)
|
||||
NULL information_schema TABLES CHECKSUM bigint NULL NULL NULL NULL bigint(21) unsigned
|
||||
3.0000 information_schema TABLES CREATE_OPTIONS varchar 255 765 utf8 utf8_general_ci varchar(255)
|
||||
3.0000 information_schema TABLES CREATE_OPTIONS varchar 2048 6144 utf8 utf8_general_ci varchar(2048)
|
||||
3.0000 information_schema TABLES TABLE_COMMENT varchar 2048 6144 utf8 utf8_general_ci varchar(2048)
|
||||
3.0000 information_schema TABLESPACES TABLESPACE_NAME varchar 64 192 utf8 utf8_general_ci varchar(64)
|
||||
3.0000 information_schema TABLESPACES ENGINE varchar 64 192 utf8 utf8_general_ci varchar(64)
|
||||
|
@ -363,7 +363,7 @@ def information_schema TABLES AUTO_INCREMENT 14 NULL YES bigint NULL NULL 20 0 N
|
||||
def information_schema TABLES AVG_ROW_LENGTH 9 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned
|
||||
def information_schema TABLES CHECKSUM 19 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned
|
||||
def information_schema TABLES CHECK_TIME 17 NULL YES datetime NULL NULL NULL NULL 0 NULL NULL datetime
|
||||
def information_schema TABLES CREATE_OPTIONS 20 NULL YES varchar 255 765 NULL NULL NULL utf8 utf8_general_ci varchar(255)
|
||||
def information_schema TABLES CREATE_OPTIONS 20 NULL YES varchar 2048 6144 NULL NULL NULL utf8 utf8_general_ci varchar(2048)
|
||||
def information_schema TABLES CREATE_TIME 15 NULL YES datetime NULL NULL NULL NULL 0 NULL NULL datetime
|
||||
def information_schema TABLES DATA_FREE 13 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned
|
||||
def information_schema TABLES DATA_LENGTH 10 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned
|
||||
@ -906,7 +906,7 @@ NULL information_schema TABLES UPDATE_TIME datetime NULL NULL NULL NULL datetime
|
||||
NULL information_schema TABLES CHECK_TIME datetime NULL NULL NULL NULL datetime
|
||||
3.0000 information_schema TABLES TABLE_COLLATION varchar 32 96 utf8 utf8_general_ci varchar(32)
|
||||
NULL information_schema TABLES CHECKSUM bigint NULL NULL NULL NULL bigint(21) unsigned
|
||||
3.0000 information_schema TABLES CREATE_OPTIONS varchar 255 765 utf8 utf8_general_ci varchar(255)
|
||||
3.0000 information_schema TABLES CREATE_OPTIONS varchar 2048 6144 utf8 utf8_general_ci varchar(2048)
|
||||
3.0000 information_schema TABLES TABLE_COMMENT varchar 2048 6144 utf8 utf8_general_ci varchar(2048)
|
||||
3.0000 information_schema TABLESPACES TABLESPACE_NAME varchar 64 192 utf8 utf8_general_ci varchar(64)
|
||||
3.0000 information_schema TABLESPACES ENGINE varchar 64 192 utf8 utf8_general_ci varchar(64)
|
||||
|
@ -47,7 +47,7 @@ UPDATE_TIME datetime YES NULL
|
||||
CHECK_TIME datetime YES NULL
|
||||
TABLE_COLLATION varchar(32) YES NULL
|
||||
CHECKSUM bigint(21) unsigned YES NULL
|
||||
CREATE_OPTIONS varchar(255) YES NULL
|
||||
CREATE_OPTIONS varchar(2048) YES NULL
|
||||
TABLE_COMMENT varchar(2048) NO
|
||||
SHOW CREATE TABLE information_schema.TABLES;
|
||||
Table Create Table
|
||||
@ -71,7 +71,7 @@ TABLES CREATE TEMPORARY TABLE `TABLES` (
|
||||
`CHECK_TIME` datetime DEFAULT NULL,
|
||||
`TABLE_COLLATION` varchar(32) DEFAULT NULL,
|
||||
`CHECKSUM` bigint(21) unsigned DEFAULT NULL,
|
||||
`CREATE_OPTIONS` varchar(255) DEFAULT NULL,
|
||||
`CREATE_OPTIONS` varchar(2048) DEFAULT NULL,
|
||||
`TABLE_COMMENT` varchar(2048) NOT NULL DEFAULT ''
|
||||
) ENGINE=MEMORY DEFAULT CHARSET=utf8
|
||||
SHOW COLUMNS FROM information_schema.TABLES;
|
||||
@ -95,7 +95,7 @@ UPDATE_TIME datetime YES NULL
|
||||
CHECK_TIME datetime YES NULL
|
||||
TABLE_COLLATION varchar(32) YES NULL
|
||||
CHECKSUM bigint(21) unsigned YES NULL
|
||||
CREATE_OPTIONS varchar(255) YES NULL
|
||||
CREATE_OPTIONS varchar(2048) YES NULL
|
||||
TABLE_COMMENT varchar(2048) NO
|
||||
SELECT table_catalog, table_schema, table_name
|
||||
FROM information_schema.tables WHERE table_catalog IS NULL OR table_catalog <> 'def';
|
||||
|
@ -27,3 +27,5 @@ galera_ssl_upgrade : TODO: investigate
|
||||
mysql-wsrep#90 : TODO: investigate
|
||||
galera_flush : mysql-wsrep/issues/229
|
||||
galera_transaction_read_only : mysql-wsrep/issues/229
|
||||
galera_gcs_fragment : Incorrect arguments to SET
|
||||
galera_flush_local : Fails sporadically
|
||||
|
@ -17,7 +17,7 @@ wsrep-sync-wait=7
|
||||
#ist_port=@OPT.port
|
||||
#sst_port=@OPT.port
|
||||
wsrep-cluster-address=gcomm://
|
||||
wsrep_provider_options='base_port=@mysqld.1.#galera_port;gcache.size=10M'
|
||||
wsrep_provider_options='repl.causal_read_timeout=PT90S;base_port=@mysqld.1.#galera_port;gcache.size=10M'
|
||||
wsrep_node_incoming_address=127.0.0.1:@mysqld.1.port
|
||||
wsrep_sst_receive_address='127.0.0.1:@mysqld.1.#sst_port'
|
||||
|
||||
@ -26,7 +26,7 @@ wsrep_sst_receive_address='127.0.0.1:@mysqld.1.#sst_port'
|
||||
#ist_port=@OPT.port
|
||||
#sst_port=@OPT.port
|
||||
wsrep_cluster_address='gcomm://127.0.0.1:@mysqld.1.#galera_port'
|
||||
wsrep_provider_options='base_port=@mysqld.2.#galera_port;gcache.size=10M'
|
||||
wsrep_provider_options='repl.causal_read_timeout=PT90S;base_port=@mysqld.2.#galera_port;gcache.size=10M'
|
||||
wsrep_node_incoming_address=127.0.0.1:@mysqld.2.port
|
||||
wsrep_sst_receive_address='127.0.0.1:@mysqld.2.#sst_port'
|
||||
|
||||
|
@ -24,6 +24,9 @@ f1 NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`user1`@`%` FUNCTIO
|
||||
MODIFIES SQL DATA
|
||||
COMMENT 'f1_comment'
|
||||
RETURN 'abc' latin1 latin1_swedish_ci latin1_swedish_ci
|
||||
SELECT 1 FROM DUAL;
|
||||
1
|
||||
1
|
||||
SHOW CREATE FUNCTION f1;
|
||||
Function sql_mode Create Function character_set_client collation_connection Database Collation
|
||||
f1 NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`user1`@`%` FUNCTION `f1`(param INTEGER) RETURNS varchar(200) CHARSET latin1
|
||||
|
@ -50,7 +50,7 @@ WSREP_SST_DONOR
|
||||
WSREP_SST_DONOR_REJECTS_QUERIES OFF
|
||||
WSREP_SST_METHOD rsync
|
||||
WSREP_SYNC_WAIT 7
|
||||
<BASE_HOST>; <BASE_PORT>; cert.log_conflicts = no; debug = no; evs.auto_evict = 0; evs.causal_keepalive_period = PT1S; evs.debug_log_mask = 0x1; evs.delay_margin = PT1S; evs.delayed_keep_period = PT30S; evs.inactive_check_period = PT0.5S; evs.inactive_timeout = PT15S; evs.info_log_mask = 0; evs.install_timeout = PT7.5S; evs.join_retrans_period = PT1S; evs.keepalive_period = PT1S; evs.max_install_timeouts = 3; evs.send_window = 4; evs.stats_report_period = PT1M; evs.suspect_timeout = PT5S; evs.use_aggregate = true; evs.user_send_window = 2; evs.version = 0; evs.view_forget_timeout = P1D; <GCACHE_DIR>; gcache.keep_pages_size = 0; gcache.mem_size = 0; <GCACHE_NAME>; gcache.page_size = 128M; gcache.size = 10M; gcs.fc_debug = 0; gcs.fc_factor = 1.0; gcs.fc_limit = 16; gcs.fc_master_slave = no; gcs.max_packet_size = 64500; gcs.max_throttle = 0.25; <GCS_RECV_Q_HARD_LIMIT>; gcs.recv_q_soft_limit = 0.25; gcs.sync_donor = no; <GMCAST_LISTEN_ADDR>; gmcast.mcast_addr = ; gmcast.mcast_ttl = 1; gmcast.peer_timeout = PT3S; gmcast.segment = 0; gmcast.time_wait = PT5S; gmcast.version = 0; <IST_RECV_ADDR>; pc.announce_timeout = PT3S; pc.checksum = false; pc.ignore_quorum = false; pc.ignore_sb = false; pc.linger = PT20S; pc.npvo = false; pc.recovery = true; pc.version = 0; pc.wait_prim = true; pc.wait_prim_timeout = P30S; pc.weight = 1; protonet.backend = asio; protonet.version = 0; repl.causal_read_timeout = PT30S; repl.commit_order = 3; repl.key_format = FLAT8; repl.max_ws_size = 2147483647; repl.proto_max = 7; socket.checksum = 2;
|
||||
<BASE_HOST>; <BASE_PORT>; cert.log_conflicts = no; debug = no; evs.auto_evict = 0; evs.causal_keepalive_period = PT1S; evs.debug_log_mask = 0x1; evs.delay_margin = PT1S; evs.delayed_keep_period = PT30S; evs.inactive_check_period = PT0.5S; evs.inactive_timeout = PT15S; evs.info_log_mask = 0; evs.install_timeout = PT7.5S; evs.join_retrans_period = PT1S; evs.keepalive_period = PT1S; evs.max_install_timeouts = 3; evs.send_window = 4; evs.stats_report_period = PT1M; evs.suspect_timeout = PT5S; evs.use_aggregate = true; evs.user_send_window = 2; evs.version = 0; evs.view_forget_timeout = P1D; <GCACHE_DIR>; gcache.keep_pages_size = 0; gcache.mem_size = 0; <GCACHE_NAME>; gcache.page_size = 128M; gcache.size = 10M; gcs.fc_debug = 0; gcs.fc_factor = 1.0; gcs.fc_limit = 16; gcs.fc_master_slave = no; gcs.max_packet_size = 64500; gcs.max_throttle = 0.25; <GCS_RECV_Q_HARD_LIMIT>; gcs.recv_q_soft_limit = 0.25; gcs.sync_donor = no; <GMCAST_LISTEN_ADDR>; gmcast.mcast_addr = ; gmcast.mcast_ttl = 1; gmcast.peer_timeout = PT3S; gmcast.segment = 0; gmcast.time_wait = PT5S; gmcast.version = 0; <IST_RECV_ADDR>; pc.announce_timeout = PT3S; pc.checksum = false; pc.ignore_quorum = false; pc.ignore_sb = false; pc.linger = PT20S; pc.npvo = false; pc.recovery = true; pc.version = 0; pc.wait_prim = true; pc.wait_prim_timeout = P30S; pc.weight = 1; protonet.backend = asio; protonet.version = 0; repl.causal_read_timeout = PT90S; repl.commit_order = 3; repl.key_format = FLAT8; repl.max_ws_size = 2147483647; repl.proto_max = 7; socket.checksum = 2;
|
||||
SELECT COUNT(*) FROM INFORMATION_SCHEMA.GLOBAL_STATUS
|
||||
WHERE VARIABLE_NAME LIKE 'wsrep_%'
|
||||
AND VARIABLE_NAME != 'wsrep_debug_sync_waiters';
|
||||
|
@ -1,3 +1,4 @@
|
||||
DROP TABLE IF EXISTS t1, t2;
|
||||
FLUSH DES_KEY_FILE;
|
||||
wsrep_last_committed_diff
|
||||
1
|
||||
@ -26,6 +27,37 @@ CREATE TABLE t2 (f1 INTEGER);
|
||||
FLUSH TABLES t2;
|
||||
wsrep_last_committed_diff
|
||||
1
|
||||
FLUSH ERROR LOGS;
|
||||
wsrep_last_committed_diff
|
||||
1
|
||||
FLUSH SLOW LOGS;
|
||||
wsrep_last_committed_diff
|
||||
1
|
||||
FLUSH GENERAL LOGS;
|
||||
wsrep_last_committed_diff
|
||||
1
|
||||
FLUSH ENGINE LOGS;
|
||||
wsrep_last_committed_diff
|
||||
1
|
||||
FLUSH RELAY LOGS;
|
||||
wsrep_last_committed_diff
|
||||
1
|
||||
SET @userstat_old= @@userstat;
|
||||
SET GLOBAL userstat=ON;
|
||||
FLUSH CLIENT_STATISTICS;
|
||||
FLUSH INDEX_STATISTICS;
|
||||
FLUSH TABLE_STATISTICS;
|
||||
FLUSH USER_STATISTICS;
|
||||
wsrep_last_committed_diff
|
||||
1
|
||||
SET @old_thread_statistics= @@global.thread_statistics;
|
||||
SET GLOBAL thread_statistics= ON;
|
||||
FLUSH THREAD_STATISTICS;
|
||||
wsrep_last_committed_diff
|
||||
1
|
||||
FLUSH CHANGED_PAGE_BITMAPS;
|
||||
wsrep_last_committed_diff
|
||||
1
|
||||
CREATE TABLE t1 (f1 INTEGER);
|
||||
FLUSH LOGS;
|
||||
FLUSH TABLES WITH READ LOCK;
|
||||
@ -52,3 +84,5 @@ wsrep_last_committed_diff
|
||||
1
|
||||
DROP TABLE t1;
|
||||
DROP TABLE t2;
|
||||
SET GLOBAL userstat= @userstat_old;
|
||||
SET GLOBAL thread_statistics= @old_thread_statistics;
|
||||
|
145
mysql-test/suite/galera/r/galera_flush_local.result
Normal file
145
mysql-test/suite/galera/r/galera_flush_local.result
Normal file
@ -0,0 +1,145 @@
|
||||
DROP TABLE IF EXISTS t1, t2, x1, x2;
|
||||
CREATE TABLE t1 (f1 INTEGER);
|
||||
CREATE TABLE t2 (f1 INT PRIMARY KEY AUTO_INCREMENT, f2 INTEGER);
|
||||
CREATE TABLE x1 (f1 INTEGER) ENGINE=MyISAM;
|
||||
CREATE TABLE x2 (f1 INT PRIMARY KEY AUTO_INCREMENT, f2 INTEGER) ENGINE=MyISAM;
|
||||
INSERT INTO t1 VALUES (1), (2), (3), (4), (5), (6), (7), (8), (9), (10);
|
||||
INSERT INTO x1 VALUES (1), (2), (3), (4), (5), (6), (7), (8), (9), (10);
|
||||
INSERT INTO t2 (f2) SELECT 1 FROM t1 AS a1, t1 AS a2, t1 AS a3, t1 AS a4;
|
||||
INSERT INTO x2 (f2) VALUES (1), (2), (3), (4), (5), (6), (7), (8), (9), (10);
|
||||
FLUSH LOCAL DES_KEY_FILE;
|
||||
FLUSH LOCAL HOSTS;
|
||||
FLUSH LOCAL QUERY CACHE;
|
||||
FLUSH LOCAL STATUS;
|
||||
FLUSH LOCAL PRIVILEGES;
|
||||
FLUSH LOCAL USER_RESOURCES;
|
||||
FLUSH LOCAL TABLES;
|
||||
FLUSH LOCAL TABLES t2;
|
||||
FLUSH LOCAL ERROR LOGS;
|
||||
FLUSH LOCAL SLOW LOGS;
|
||||
FLUSH LOCAL GENERAL LOGS;
|
||||
FLUSH LOCAL ENGINE LOGS;
|
||||
FLUSH LOCAL RELAY LOGS;
|
||||
FLUSH LOCAL CLIENT_STATISTICS;
|
||||
FLUSH LOCAL INDEX_STATISTICS;
|
||||
FLUSH LOCAL TABLE_STATISTICS;
|
||||
FLUSH LOCAL USER_STATISTICS;
|
||||
FLUSH LOCAL LOGS;
|
||||
FLUSH LOCAL BINARY LOGS;
|
||||
FLUSH LOCAL TABLES WITH READ LOCK;
|
||||
UNLOCK TABLES;
|
||||
FLUSH LOCAL TABLES t1 WITH READ LOCK;
|
||||
UNLOCK TABLES;
|
||||
FLUSH LOCAL TABLES t1 FOR EXPORT;
|
||||
UNLOCK TABLES;
|
||||
LOCK TABLES t1 WRITE;
|
||||
FLUSH LOCAL TABLES t1;
|
||||
UNLOCK TABLES;
|
||||
LOCK TABLES t1 READ;
|
||||
FLUSH LOCAL TABLES t1;
|
||||
ERROR HY000: Table 't1' was locked with a READ lock and can't be updated
|
||||
UNLOCK TABLES;
|
||||
FLUSH LOCAL TABLES t1;
|
||||
ANALYZE LOCAL TABLE t1, t2;
|
||||
Table Op Msg_type Msg_text
|
||||
test.t1 analyze status OK
|
||||
test.t2 analyze status OK
|
||||
OPTIMIZE LOCAL TABLE t1, t2;
|
||||
Table Op Msg_type Msg_text
|
||||
test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
|
||||
test.t1 optimize status OK
|
||||
test.t2 optimize note Table does not support optimize, doing recreate + analyze instead
|
||||
test.t2 optimize status OK
|
||||
REPAIR LOCAL TABLE x1, x2;
|
||||
Table Op Msg_type Msg_text
|
||||
test.x1 repair status OK
|
||||
test.x2 repair status OK
|
||||
wsrep_last_committed_diff
|
||||
1
|
||||
SELECT COUNT(*) = 10 FROM t1;
|
||||
COUNT(*) = 10
|
||||
1
|
||||
SELECT COUNT(*) = 10 FROM x1;
|
||||
COUNT(*) = 10
|
||||
1
|
||||
SELECT COUNT(*) = 10000 FROM t2;
|
||||
COUNT(*) = 10000
|
||||
1
|
||||
SELECT COUNT(*) = 10 FROM x2;
|
||||
COUNT(*) = 10
|
||||
1
|
||||
DROP TABLE t1, t2, x1, x2;
|
||||
CREATE TABLE t1 (f1 INTEGER);
|
||||
CREATE TABLE t2 (f1 INT PRIMARY KEY AUTO_INCREMENT, f2 INTEGER);
|
||||
CREATE TABLE x1 (f1 INTEGER) ENGINE=MyISAM;
|
||||
CREATE TABLE x2 (f1 INT PRIMARY KEY AUTO_INCREMENT, f2 INTEGER) ENGINE=MyISAM;
|
||||
INSERT INTO t1 VALUES (1), (2), (3), (4), (5), (6), (7), (8), (9), (10);
|
||||
INSERT INTO x1 VALUES (1), (2), (3), (4), (5), (6), (7), (8), (9), (10);
|
||||
INSERT INTO t2 (f2) SELECT 1 FROM t1 AS a1, t1 AS a2, t1 AS a3, t1 AS a4;
|
||||
INSERT INTO x2 (f2) VALUES (1), (2), (3), (4), (5), (6), (7), (8), (9), (10);
|
||||
set wsrep_on=0;
|
||||
FLUSH DES_KEY_FILE;
|
||||
FLUSH HOSTS;
|
||||
FLUSH QUERY CACHE;
|
||||
FLUSH STATUS;
|
||||
FLUSH PRIVILEGES;
|
||||
FLUSH USER_RESOURCES;
|
||||
FLUSH TABLES;
|
||||
FLUSH TABLES t2;
|
||||
FLUSH ERROR LOGS;
|
||||
FLUSH SLOW LOGS;
|
||||
FLUSH GENERAL LOGS;
|
||||
FLUSH ENGINE LOGS;
|
||||
FLUSH RELAY LOGS;
|
||||
FLUSH CLIENT_STATISTICS;
|
||||
FLUSH INDEX_STATISTICS;
|
||||
FLUSH TABLE_STATISTICS;
|
||||
FLUSH USER_STATISTICS;
|
||||
FLUSH LOGS;
|
||||
FLUSH BINARY LOGS;
|
||||
FLUSH TABLES WITH READ LOCK;
|
||||
UNLOCK TABLES;
|
||||
FLUSH TABLES t1 WITH READ LOCK;
|
||||
UNLOCK TABLES;
|
||||
FLUSH TABLES t1 FOR EXPORT;
|
||||
UNLOCK TABLES;
|
||||
LOCK TABLES t1 WRITE;
|
||||
FLUSH TABLES t1;
|
||||
UNLOCK TABLES;
|
||||
LOCK TABLES t1 READ;
|
||||
FLUSH TABLES t1;
|
||||
ERROR HY000: Table 't1' was locked with a READ lock and can't be updated
|
||||
UNLOCK TABLES;
|
||||
FLUSH TABLES t1;
|
||||
ANALYZE TABLE t1, t2;
|
||||
Table Op Msg_type Msg_text
|
||||
test.t1 analyze status OK
|
||||
test.t2 analyze status OK
|
||||
OPTIMIZE TABLE t1, t2;
|
||||
Table Op Msg_type Msg_text
|
||||
test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
|
||||
test.t1 optimize status OK
|
||||
test.t2 optimize note Table does not support optimize, doing recreate + analyze instead
|
||||
test.t2 optimize status OK
|
||||
REPAIR TABLE x1, x2;
|
||||
Table Op Msg_type Msg_text
|
||||
test.x1 repair status OK
|
||||
test.x2 repair status OK
|
||||
wsrep_last_committed_diff
|
||||
1
|
||||
wsrep_last_committed_diff2
|
||||
1
|
||||
SELECT COUNT(*) = 10 FROM t1;
|
||||
COUNT(*) = 10
|
||||
1
|
||||
SELECT COUNT(*) = 10 FROM x1;
|
||||
COUNT(*) = 10
|
||||
1
|
||||
SELECT COUNT(*) = 10000 FROM t2;
|
||||
COUNT(*) = 10000
|
||||
1
|
||||
SELECT COUNT(*) = 10 FROM x2;
|
||||
COUNT(*) = 10
|
||||
1
|
||||
set wsrep_on=1;
|
||||
DROP TABLE t1, t2, x1, x2;
|
@ -2,6 +2,8 @@ CREATE TABLE t1 (id INT PRIMARY KEY) ENGINE=InnoDB;
|
||||
SET GLOBAL wsrep_provider_options = 'dbug=d,apply_monitor_slave_enter_sync';
|
||||
INSERT INTO t1 VALUES (1);
|
||||
SET SESSION wsrep_sync_wait = 0;
|
||||
SET SESSION wsrep_on = 0;
|
||||
SET SESSION wsrep_on = 1;
|
||||
SELECT COUNT(*) = 0 FROM t1;
|
||||
COUNT(*) = 0
|
||||
1
|
||||
|
24
mysql-test/suite/galera/r/galera_gcs_fragment.result
Normal file
24
mysql-test/suite/galera/r/galera_gcs_fragment.result
Normal file
@ -0,0 +1,24 @@
|
||||
CREATE TABLE t1 (f1 INT PRIMARY KEY, f2 TEXT);
|
||||
SET GLOBAL wsrep_cluster_address='';
|
||||
SET SESSION wsrep_sync_wait=0;
|
||||
SET GLOBAL wsrep_provider_options = 'dbug=d,gcs_core_after_frag_send';
|
||||
SET SESSION wsrep_retry_autocommit=0;
|
||||
INSERT INTO t1 VALUES (1, "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa");
|
||||
SET SESSION wsrep_on = 0;
|
||||
SET SESSION wsrep_on = 1;
|
||||
SET GLOBAL wsrep_provider_options = 'dbug=';
|
||||
SET SESSION wsrep_on = 0;
|
||||
SET SESSION wsrep_on = 1;
|
||||
INSERT INTO t1 VALUES (2, "bbbbbaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa");
|
||||
SET GLOBAL wsrep_provider_options = 'signal=gcs_core_after_frag_send';
|
||||
ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
|
||||
INSERT INTO t1 VALUES (3, "cccccaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa");
|
||||
SELECT * FROM t1;
|
||||
f1 f2
|
||||
2 bbbbbaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
|
||||
3 cccccaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
|
||||
SELECT * FROM t1;
|
||||
f1 f2
|
||||
2 bbbbbaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
|
||||
3 cccccaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
|
||||
DROP TABLE t1;
|
@ -16,19 +16,19 @@ Log_name Pos Event_type Server_id End_log_pos Info
|
||||
mysqld-bin.000002 # Gtid # # GTID 0-1-1
|
||||
mysqld-bin.000002 # Query # # use `test`; CREATE TABLE t1 (id INT PRIMARY KEY) ENGINE=InnoDB
|
||||
mysqld-bin.000002 # Gtid # # BEGIN GTID 0-1-2
|
||||
mysqld-bin.000002 # Table_map # # table_id: 48 (test.t1)
|
||||
mysqld-bin.000002 # Write_rows_v1 # # table_id: 48 flags: STMT_END_F
|
||||
mysqld-bin.000002 # Xid # # COMMIT /* xid=2 */
|
||||
mysqld-bin.000002 # Table_map # # table_id: # (test.t1)
|
||||
mysqld-bin.000002 # Write_rows_v1 # # table_id: # flags: STMT_END_F
|
||||
mysqld-bin.000002 # Xid # # COMMIT /* xid=# */
|
||||
mysqld-bin.000002 # Gtid # # GTID 0-1-3
|
||||
mysqld-bin.000002 # Query # # use `test`; CREATE TABLE t2 (id INT) ENGINE=InnoDB
|
||||
mysqld-bin.000002 # Gtid # # BEGIN GTID 0-1-4
|
||||
mysqld-bin.000002 # Table_map # # table_id: 49 (test.t2)
|
||||
mysqld-bin.000002 # Write_rows_v1 # # table_id: 49 flags: STMT_END_F
|
||||
mysqld-bin.000002 # Xid # # COMMIT /* xid=4 */
|
||||
mysqld-bin.000002 # Table_map # # table_id: # (test.t2)
|
||||
mysqld-bin.000002 # Write_rows_v1 # # table_id: # flags: STMT_END_F
|
||||
mysqld-bin.000002 # Xid # # COMMIT /* xid=# */
|
||||
mysqld-bin.000002 # Gtid # # BEGIN GTID 0-1-5
|
||||
mysqld-bin.000002 # Table_map # # table_id: 49 (test.t2)
|
||||
mysqld-bin.000002 # Write_rows_v1 # # table_id: 49 flags: STMT_END_F
|
||||
mysqld-bin.000002 # Xid # # COMMIT /* xid=5 */
|
||||
mysqld-bin.000002 # Table_map # # table_id: # (test.t2)
|
||||
mysqld-bin.000002 # Write_rows_v1 # # table_id: # flags: STMT_END_F
|
||||
mysqld-bin.000002 # Xid # # COMMIT /* xid=# */
|
||||
mysqld-bin.000002 # Gtid # # GTID 0-1-6
|
||||
mysqld-bin.000002 # Query # # use `test`; ALTER TABLE t1 ADD COLUMN f2 INTEGER
|
||||
SELECT COUNT(*) = 2 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 't1';
|
||||
@ -39,20 +39,21 @@ Log_name Pos Event_type Server_id End_log_pos Info
|
||||
mysqld-bin.000003 # Gtid # # GTID 0-1-1
|
||||
mysqld-bin.000003 # Query # # use `test`; CREATE TABLE t1 (id INT PRIMARY KEY) ENGINE=InnoDB
|
||||
mysqld-bin.000003 # Gtid # # BEGIN GTID 0-1-2
|
||||
mysqld-bin.000003 # Table_map # # table_id: 30 (test.t1)
|
||||
mysqld-bin.000003 # Write_rows_v1 # # table_id: 30 flags: STMT_END_F
|
||||
mysqld-bin.000003 # Xid # # COMMIT /* xid=2 */
|
||||
mysqld-bin.000003 # Table_map # # table_id: # (test.t1)
|
||||
mysqld-bin.000003 # Write_rows_v1 # # table_id: # flags: STMT_END_F
|
||||
mysqld-bin.000003 # Xid # # COMMIT /* xid=# */
|
||||
mysqld-bin.000003 # Gtid # # GTID 0-1-3
|
||||
mysqld-bin.000003 # Query # # use `test`; CREATE TABLE t2 (id INT) ENGINE=InnoDB
|
||||
mysqld-bin.000003 # Gtid # # BEGIN GTID 0-1-4
|
||||
mysqld-bin.000003 # Table_map # # table_id: 31 (test.t2)
|
||||
mysqld-bin.000003 # Write_rows_v1 # # table_id: 31 flags: STMT_END_F
|
||||
mysqld-bin.000003 # Xid # # COMMIT /* xid=4 */
|
||||
mysqld-bin.000003 # Table_map # # table_id: # (test.t2)
|
||||
mysqld-bin.000003 # Write_rows_v1 # # table_id: # flags: STMT_END_F
|
||||
mysqld-bin.000003 # Xid # # COMMIT /* xid=# */
|
||||
mysqld-bin.000003 # Gtid # # BEGIN GTID 0-1-5
|
||||
mysqld-bin.000003 # Table_map # # table_id: 31 (test.t2)
|
||||
mysqld-bin.000003 # Write_rows_v1 # # table_id: 31 flags: STMT_END_F
|
||||
mysqld-bin.000003 # Xid # # COMMIT /* xid=5 */
|
||||
mysqld-bin.000003 # Table_map # # table_id: # (test.t2)
|
||||
mysqld-bin.000003 # Write_rows_v1 # # table_id: # flags: STMT_END_F
|
||||
mysqld-bin.000003 # Xid # # COMMIT /* xid=# */
|
||||
mysqld-bin.000003 # Gtid # # GTID 0-1-6
|
||||
mysqld-bin.000003 # Query # # use `test`; ALTER TABLE t1 ADD COLUMN f2 INTEGER
|
||||
DROP TABLE t1;
|
||||
DROP TABLE t2;
|
||||
RESET MASTER;
|
||||
|
38
mysql-test/suite/galera/r/galera_mdl_race.result
Normal file
38
mysql-test/suite/galera/r/galera_mdl_race.result
Normal file
@ -0,0 +1,38 @@
|
||||
CREATE TABLE t1 (f1 INTEGER PRIMARY KEY, f2 CHAR(1));
|
||||
CREATE TABLE t2 (f1 INTEGER PRIMARY KEY, f2 CHAR(1));
|
||||
INSERT INTO t1 VALUES (1, 'a');
|
||||
INSERT INTO t1 VALUES (2, 'a');
|
||||
SET AUTOCOMMIT=ON;
|
||||
START TRANSACTION;
|
||||
UPDATE t1 SET f2 = 'b' WHERE f1 = 1;
|
||||
LOCK TABLE t2 WRITE;
|
||||
SET GLOBAL DEBUG = "d,sync.wsrep_before_mdl_wait";
|
||||
Warnings:
|
||||
Warning 1287 '@@debug' is deprecated and will be removed in a future release. Please use '@@debug_dbug' instead
|
||||
SELECT * FROM t2;;
|
||||
SET GLOBAL DEBUG = "d,sync.wsrep_after_BF_victim_lock";
|
||||
Warnings:
|
||||
Warning 1287 '@@debug' is deprecated and will be removed in a future release. Please use '@@debug_dbug' instead
|
||||
UPDATE t1 SET f2 = 'c' WHERE f1 = 1;
|
||||
SET GLOBAL DEBUG = "";
|
||||
Warnings:
|
||||
Warning 1287 '@@debug' is deprecated and will be removed in a future release. Please use '@@debug_dbug' instead
|
||||
SET DEBUG_SYNC = "now SIGNAL signal.wsrep_before_mdl_wait";
|
||||
SET DEBUG_SYNC = "now SIGNAL signal.wsrep_after_BF_victim_lock";
|
||||
UNLOCK TABLES;
|
||||
ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
|
||||
SELECT COUNT(*) = 1 FROM t1 WHERE f2 = 'a';
|
||||
COUNT(*) = 1
|
||||
1
|
||||
SELECT COUNT(*) = 1 FROM t1 WHERE f2 = 'c';
|
||||
COUNT(*) = 1
|
||||
1
|
||||
SELECT COUNT(*) = 1 FROM t1 WHERE f2 = 'a';
|
||||
COUNT(*) = 1
|
||||
1
|
||||
SELECT COUNT(*) = 1 FROM t1 WHERE f2 = 'c';
|
||||
COUNT(*) = 1
|
||||
1
|
||||
DROP TABLE t1;
|
||||
DROP TABLE t2;
|
||||
SET DEBUG_SYNC = "RESET";
|
@ -0,0 +1,58 @@
|
||||
CREATE TABLE t1 (id INT PRIMARY KEY AUTO_INCREMENT) ENGINE=InnoDB;
|
||||
INSERT INTO t1 VALUES (1);
|
||||
SET GLOBAL wsrep_provider_options = "repl.causal_read_timeout=PT1S";
|
||||
SET GLOBAL DEBUG = "d,sync.wsrep_apply_cb";
|
||||
Warnings:
|
||||
Warning 1287 '@@debug' is deprecated and will be removed in a future release. Please use '@@debug_dbug' instead
|
||||
SET SESSION wsrep_sync_wait = 7;
|
||||
SELECT MAX(id) FROM t1;
|
||||
MAX(id)
|
||||
1
|
||||
INSERT INTO t1 VALUES (2);
|
||||
SELECT MAX(id) FROM t1;
|
||||
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
|
||||
SET GLOBAL DEBUG = "";
|
||||
Warnings:
|
||||
Warning 1287 '@@debug' is deprecated and will be removed in a future release. Please use '@@debug_dbug' instead
|
||||
SET DEBUG_SYNC = "now SIGNAL signal.wsrep_apply_cb";
|
||||
FLUSH QUERY CACHE;
|
||||
SET SESSION wsrep_sync_wait = 7;
|
||||
SET GLOBAL DEBUG = "d,sync.wsrep_apply_cb";
|
||||
Warnings:
|
||||
Warning 1287 '@@debug' is deprecated and will be removed in a future release. Please use '@@debug_dbug' instead
|
||||
SET DEBUG_SYNC = "RESET";
|
||||
INSERT INTO t1 VALUES (3);
|
||||
SELECT MAX(id) FROM t1;
|
||||
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
|
||||
SET GLOBAL DEBUG = "";
|
||||
Warnings:
|
||||
Warning 1287 '@@debug' is deprecated and will be removed in a future release. Please use '@@debug_dbug' instead
|
||||
SET DEBUG_SYNC = "now SIGNAL signal.wsrep_apply_cb";
|
||||
INSERT INTO t1 VALUES (4);
|
||||
SET SESSION wsrep_sync_wait = 7;
|
||||
SELECT MAX(id) FROM t1;
|
||||
MAX(id)
|
||||
4
|
||||
SET SESSION wsrep_sync_wait = 7;
|
||||
FLUSH STATUS;
|
||||
SELECT MAX(id) FROM t1;
|
||||
MAX(id)
|
||||
4
|
||||
SELECT VARIABLE_VALUE = 1 FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME = 'Qcache_hits';
|
||||
VARIABLE_VALUE = 1
|
||||
1
|
||||
SET GLOBAL DEBUG = "d,sync.wsrep_apply_cb";
|
||||
Warnings:
|
||||
Warning 1287 '@@debug' is deprecated and will be removed in a future release. Please use '@@debug_dbug' instead
|
||||
INSERT INTO t1 VALUES (5);
|
||||
SET SESSION wsrep_sync_wait = 7;
|
||||
SELECT MAX(id) FROM t1 ;
|
||||
SET GLOBAL DEBUG = "";
|
||||
Warnings:
|
||||
Warning 1287 '@@debug' is deprecated and will be removed in a future release. Please use '@@debug_dbug' instead
|
||||
SET DEBUG_SYNC = "now SIGNAL signal.wsrep_apply_cb";
|
||||
MAX(id)
|
||||
5
|
||||
SELECT VARIABLE_VALUE = 1 FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME = 'Qcache_hits';
|
||||
VARIABLE_VALUE = 1
|
||||
1
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user