Commit df4dd593 authored by Jan Lindström's avatar Jan Lindström

MDEV-6247: Merge 10.0-galera to 10.1.

Merged lp:maria/maria-10.0-galera up to revision 3879.

Added a new functions to handler API to forcefully abort_transaction,
producing fake_trx_id, get_checkpoint and set_checkpoint for XA. These
were added for future possiblity to add more storage engines that
could use galera replication.
parent e974b564
......@@ -12,6 +12,7 @@
*.dll
*.dsp
*.dylib
*.diff
*.exe
*.exp
*.gcda
......
......@@ -215,7 +215,7 @@ all_configs="$SSL_LIBRARY --with-plugins=max --with-plugin-ndbcluster --with-emb
alpha_cflags="$check_cpu_cflags -Wa,-m$cpu_flag"
amd64_cflags="$check_cpu_cflags"
amd64_cxxflags="" # If dropping '--with-big-tables', add here "-DBIG_TABLES"
pentium_cflags="$check_cpu_cflags"
pentium_cflags="$check_cpu_cflags -m32"
pentium64_cflags="$check_cpu_cflags -m64"
ppc_cflags="$check_cpu_cflags"
sparc_cflags=""
......
#! /bin/sh
path=`dirname $0`
. "$path/SETUP.sh"
extra_flags="$amd64_cflags $debug_cflags -g -O0 $wsrep_cflags"
c_warnings="$c_warnings $debug_extra_warnings"
cxx_warnings="$cxx_warnings $debug_extra_warnings"
extra_configs="$amd64_configs $debug_configs $wsrep_configs --with-wsrep"
. "$path/FINISH.sh"
#! /bin/sh
path=`dirname $0`
. "$path/SETUP.sh"
extra_flags="$amd64_cflags $fast_cflags -g $wsrep_cflags"
extra_configs="$amd64_configs $wsrep_configs --with-wsrep"
. "$path/FINISH.sh"
#! /bin/sh -x
path=`dirname $0`
set -- "$@" --with-debug=full
. "$path/SETUP.sh"
extra_flags="$pentium_cflags $debug_cflags -g -O0 $wsrep_cflags"
c_warnings="$c_warnings $debug_extra_warnings"
cxx_warnings="$cxx_warnings $debug_extra_warnings"
extra_configs="$pentium_configs $debug_configs $wsrep_configs --with-wsrep"
. "$path/FINISH.sh"
#! /bin/sh
path=`dirname $0`
. "$path/SETUP.sh"
extra_flags="$pentium_cflags $fast_cflags $wsrep_cflags"
extra_configs="$pentium_configs $wsrep_configs --with-wsrep"
#strip=yes
. "$path/FINISH.sh"
#! /bin/sh
# Copyright (C) 2006, 2007 MySQL AB
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU Library General Public
# License as published by the Free Software Foundation; version 2
# of the License.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Library General Public License for more details.
#
# You should have received a copy of the GNU Library General Public
# License along with this library; if not, write to the Free
# Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
# MA 02111-1307, USA
path=`dirname $0`
. "$path/SETUP.sh"
extra_flags="$pentium64_cflags $fast_cflags -g $wsrep_cflags"
extra_configs="$pentium_configs $static_link $wsrep_configs --with-wsrep"
CC="$CC --pipe"
strip=yes
. "$path/FINISH.sh"
......@@ -158,6 +158,7 @@ INCLUDE(ctest)
INCLUDE(plugin)
INCLUDE(install_macros)
INCLUDE(mysql_add_executable)
INCLUDE(wsrep)
# Handle options
OPTION(DISABLE_SHARED
......@@ -235,6 +236,12 @@ OPTION(ENABLED_LOCAL_INFILE
OPTION(WITH_FAST_MUTEXES "Compile with fast mutexes" OFF)
MARK_AS_ADVANCED(WITH_FAST_MUTEXES)
OPTION(WITH_INNODB_DISALLOW_WRITES "InnoDB freeze writes patch from Google" ${WITH_WSREP})
IF (WITH_INNODB_DISALLOW_WRITES)
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DWITH_INNODB_DISALLOW_WRITES")
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DWITH_INNODB_DISALLOW_WRITES")
ENDIF()
# Set DBUG_OFF and other optional release-only flags for non-debug project types
FOREACH(BUILD_TYPE RELEASE RELWITHDEBINFO MINSIZEREL)
FOREACH(LANG C CXX)
......@@ -369,6 +376,9 @@ ADD_SUBDIRECTORY(vio)
ADD_SUBDIRECTORY(mysys)
ADD_SUBDIRECTORY(mysys_ssl)
ADD_SUBDIRECTORY(libmysql)
IF(WITH_WSREP)
ADD_SUBDIRECTORY(wsrep)
ENDIF()
ADD_SUBDIRECTORY(client)
ADD_SUBDIRECTORY(extra)
ADD_SUBDIRECTORY(libservices)
......@@ -447,6 +457,7 @@ INSTALL_DOCUMENTATION(${CMAKE_BINARY_DIR}/Docs/INFO_SRC
IF(UNIX)
INSTALL_DOCUMENTATION(Docs/INSTALL-BINARY COMPONENT Readme)
INSTALL_DOCUMENTATION(Docs/INSTALL-BINARY Docs/README-wsrep COMPONENT Readme)
ENDIF()
INCLUDE(CPack)
......
This diff is collapsed.
......@@ -92,6 +92,7 @@ enum options_client
OPT_REPORT_PROGRESS,
OPT_SKIP_ANNOTATE_ROWS_EVENTS,
OPT_SSL_CRL, OPT_SSL_CRLPATH,
OPT_GALERA_SST_MODE,
OPT_MAX_CLIENT_OPTION /* should be always the last */
};
......
......@@ -523,7 +523,12 @@ static int run_query(const char *query, DYNAMIC_STRING *ds_res,
int ret;
File fd;
char query_file_path[FN_REFLEN];
#ifdef WITH_WSREP
/* Note: wsrep_on=ON implicitly enables binary logging. */
const uchar sql_log_bin[]= "SET SQL_LOG_BIN=0, WSREP_ON=OFF;";
#else
const uchar sql_log_bin[]= "SET SQL_LOG_BIN=0;";
#endif /* WITH_WSREP */
DBUG_ENTER("run_query");
DBUG_PRINT("enter", ("query: %s", query));
......
......@@ -731,9 +731,15 @@ static int use_db(char *database)
DBUG_RETURN(0);
} /* use_db */
/* Do not send commands to replication slaves. */
static int disable_binlog()
{
#ifdef WITH_WSREP
/* Additionally turn off @@wsrep_on to disable implicit binary logging. */
const char *stmt= "SET SQL_LOG_BIN=0, WSREP_ON=OFF";
#else
const char *stmt= "SET SQL_LOG_BIN=0";
#endif /* WITH_WSREP */
return run_query(stmt);
}
......
......@@ -111,6 +111,7 @@ static my_bool verbose= 0, opt_no_create_info= 0, opt_no_data= 0,
opt_slave_apply= 0,
opt_include_master_host_port= 0,
opt_events= 0, opt_comments_used= 0,
opt_galera_sst_mode= 0,
opt_alltspcs=0, opt_notspcs= 0;
static my_bool insert_pat_inited= 0, debug_info_flag= 0, debug_check_flag= 0;
static ulong opt_max_allowed_packet, opt_net_buffer_length;
......@@ -346,6 +347,14 @@ static struct my_option my_long_options[] =
{"force", 'f', "Continue even if we get an SQL error.",
&ignore_errors, &ignore_errors, 0, GET_BOOL, NO_ARG,
0, 0, 0, 0, 0, 0},
{"galera-sst-mode", OPT_GALERA_SST_MODE,
"This mode should normally be used in mysqldump snapshot state transfer "
"(SST) in a Galera cluster. If enabled, mysqldump additionally dumps "
"commands to turn off binary logging and SET global gtid_binlog_state "
"with the current value. Note: RESET MASTER needs to be executed on the "
"server receiving the resulting dump.",
&opt_galera_sst_mode, &opt_galera_sst_mode, 0, GET_BOOL, NO_ARG, 0, 0, 0,
0, 0, 0},
{"help", '?', "Display this help message and exit.", 0, 0, 0, GET_NO_ARG,
NO_ARG, 0, 0, 0, 0, 0, 0},
{"hex-blob", OPT_HEXBLOB, "Dump binary strings (BINARY, "
......@@ -4799,6 +4808,42 @@ static int dump_selected_tables(char *db, char **table_names, int tables)
} /* dump_selected_tables */
/**
Add the following statements to the generated dump:
a) SET @@session.sql_log_bin=OFF;
b) SET @@global.gtid_binlog_state='[N-N-N,...]'
*/
static int wsrep_set_sst_cmds(MYSQL *mysql) {
MYSQL_RES *res;
MYSQL_ROW row;
if (mysql_get_server_version(mysql) < 100005) {
/* @@gtid_binlog_state does not exist. */
return 0;
}
if (mysql_query_with_error_report(mysql, &res, "SELECT "
"@@global.gtid_binlog_state"))
return 1;
if (mysql_num_rows(res) != 1)
/* No entry for @@global.gtid_binlog_state, nothing needs to be done. */
return 0;
if (!(row= mysql_fetch_row(res)) || !(char *)row[0])
return 1;
/* first, add a command to turn off binary logging, */
fprintf(md_result_file, "SET @@session.sql_log_bin=OFF;\n");
/* followed by, a command to set global gtid_binlog_state. */
fprintf(md_result_file, "SET @@global.gtid_binlog_state='%s';\n",
(char*)row[0]);
mysql_free_result(res);
return 0;
}
static int do_show_master_status(MYSQL *mysql_con, int consistent_binlog_pos)
{
MYSQL_ROW row;
......@@ -5743,6 +5788,10 @@ int main(int argc, char **argv)
/* Add 'STOP SLAVE to beginning of dump */
if (opt_slave_apply && add_stop_slave())
goto err;
if (opt_galera_sst_mode && wsrep_set_sst_cmds(mysql))
goto err;
if (opt_master_data && do_show_master_status(mysql, consistent_binlog_pos))
goto err;
if (opt_slave_data && do_show_slave_status(mysql))
......
......@@ -148,8 +148,9 @@ SETA(CPACK_RPM_test_PACKAGE_PROVIDES
"MySQL-test")
SETA(CPACK_RPM_server_PACKAGE_REQUIRES
${CPACK_RPM_PACKAGE_REQUIRES}
"MariaDB-client")
"${CPACK_RPM_PACKAGE_REQUIRES}"
"MariaDB-client" "galera" "rsync" "lsof" "socat" "grep" "gawk" "iproute"
"coreutils" "findutils")
SET(CPACK_RPM_server_PRE_INSTALL_SCRIPT_FILE ${CMAKE_SOURCE_DIR}/support-files/rpm/server-prein.sh)
SET(CPACK_RPM_server_PRE_UNINSTALL_SCRIPT_FILE ${CMAKE_SOURCE_DIR}/support-files/rpm/server-preun.sh)
......
......@@ -154,6 +154,14 @@ MACRO(MYSQL_ADD_PLUGIN)
ENDIF()
ENDIF()
IF (WITH_WSREP)
# Set compile definitions for non-embedded plugins
LIST(APPEND wsrep_definitions "WITH_WSREP")
LIST(APPEND wsrep_definitions "WSREP_PROC_INFO")
SET_TARGET_PROPERTIES(${target} PROPERTIES
COMPILE_DEFINITIONS "${wsrep_definitions}")
ENDIF()
IF(ARG_STATIC_OUTPUT_NAME)
SET_TARGET_PROPERTIES(${target} PROPERTIES
OUTPUT_NAME ${ARG_STATIC_OUTPUT_NAME})
......@@ -185,8 +193,17 @@ MACRO(MYSQL_ADD_PLUGIN)
ADD_VERSION_INFO(${target} MODULE SOURCES)
ADD_LIBRARY(${target} MODULE ${SOURCES})
DTRACE_INSTRUMENT(${target})
LIST(APPEND dyn_compile_definitions "MYSQL_DYNAMIC_PLUGIN")
IF (WITH_WSREP)
LIST(APPEND dyn_compile_definitions "WITH_WSREP")
LIST(APPEND dyn_compile_definitions "WSREP_PROC_INFO")
ENDIF()
SET_TARGET_PROPERTIES (${target} PROPERTIES PREFIX ""
COMPILE_DEFINITIONS "MYSQL_DYNAMIC_PLUGIN")
COMPILE_DEFINITIONS "${dyn_compile_definitions}")
TARGET_LINK_LIBRARIES (${target} mysqlservices ${ARG_LINK_LIBRARIES})
# Plugin uses symbols defined in mysqld executable.
......@@ -207,7 +224,8 @@ MACRO(MYSQL_ADD_PLUGIN)
OUTPUT_NAME "${ARG_MODULE_OUTPUT_NAME}")
# Install dynamic library
IF(ARG_COMPONENT)
IF(CPACK_COMPONENTS_ALL AND NOT CPACK_COMPONENTS_ALL MATCHES ${ARG_COMPONENT})
IF(CPACK_COMPONENTS_ALL AND
NOT CPACK_COMPONENTS_ALL MATCHES ${ARG_COMPONENT})
SET(CPACK_COMPONENTS_ALL ${CPACK_COMPONENTS_ALL} ${ARG_COMPONENT} PARENT_SCOPE)
SET(CPACK_RPM_${ARG_COMPONENT}_PACKAGE_REQUIRES "MariaDB-server" PARENT_SCOPE)
......
# Copyright (c) 2011, Codership Oy <info@codership.com>.
# Copyright (c) 2013, Monty Program Ab.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; version 2 of the License.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
# We need to generate a proper spec file even without --with-wsrep flag,
# so WSREP_VERSION is produced regardless
# Set the patch version
SET(WSREP_PATCH_VERSION "10")
# MariaDB addition: Revision number of the last revision merged from
# codership branch visible in @@visible_comment.
# Branch : codership-mysql/5.6
SET(WSREP_PATCH_REVNO "4123") # Should be updated on every merge.
# MariaDB addition: Revision number of the last revision merged from
# Branch : lp:maria/maria-10.0-galera
SET(WSREP_PATCH_REVNO2 "3867") # Should be updated on every merge.
# MariaDB: Obtain patch revision number:
# Update WSREP_PATCH_REVNO if WSREP_REV environment variable is set.
IF (DEFINED ENV{WSREP_REV})
SET(WSREP_PATCH_REVNO $ENV{WSREP_REV})
ENDIF()
# Obtain wsrep API version
EXECUTE_PROCESS(
COMMAND sh -c "grep WSREP_INTERFACE_VERSION ${MySQL_SOURCE_DIR}/wsrep/wsrep_api.h | cut -d '\"' -f 2"
OUTPUT_VARIABLE WSREP_API_VERSION
RESULT_VARIABLE RESULT
)
#FILE(WRITE "wsrep_config" "Debug: WSREP_API_VERSION result: ${RESULT}\n")
STRING(REGEX REPLACE "(\r?\n)+$" "" WSREP_API_VERSION "${WSREP_API_VERSION}")
IF(NOT WSREP_PATCH_REVNO)
MESSAGE(WARNING "Could not determine bzr revision number, WSREP_VERSION will "
"not contain the revision number.")
SET(WSREP_VERSION
"${WSREP_API_VERSION}.${WSREP_PATCH_VERSION}"
)
ELSE()
SET(WSREP_VERSION
"${WSREP_API_VERSION}.${WSREP_PATCH_VERSION}.r${WSREP_PATCH_REVNO}"
)
ENDIF()
#
# Galera library does not compile with windows and solaris
#
IF(UNIX)
OPTION(WITH_WSREP "WSREP replication API (to use, e.g. Galera Replication library)" ON)
ELSE()
OPTION(WITH_WSREP "WSREP replication API (to use, e.g. Galera Replication library)" OFF)
ENDIF()
MACRO (BUILD_WITH_WSREP)
SET(WSREP_C_FLAGS "-DWITH_WSREP -DWSREP_PROC_INFO -DMYSQL_MAX_VARIABLE_VALUE_LEN=2048")
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${WSREP_C_FLAGS}")
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${WSREP_C_FLAGS}")
SET(COMPILATION_COMMENT "${COMPILATION_COMMENT}, wsrep_${WSREP_VERSION}")
#SET(WITH_EMBEDDED_SERVER OFF CACHE INTERNAL "" FORCE)
ENDMACRO()
#
......@@ -192,7 +192,7 @@ Architecture: any
Suggests: tinyca, mailx, mariadb-test
Recommends: libhtml-template-perl
Pre-Depends: mariadb-common, adduser (>= 3.40), debconf
Depends: mariadb-client-10.1 (>= ${source:Version}), libdbi-perl, perl (>= 5.6), ${shlibs:Depends}, ${misc:Depends}, psmisc, passwd, lsb-base (>= 3.0-10), mariadb-server-core-10.1 (>= ${binary:Version})
Depends: mariadb-client-10.1 (>= ${source:Version}), libdbi-perl, perl (>= 5.6), ${shlibs:Depends}, ${misc:Depends}, psmisc, passwd, lsb-base (>= 3.0-10), mariadb-server-core-10.1 (>= ${binary:Version}), galera (>=25.2) rsync, lsof, socat, grep, gawk, iproute, coreutils, findutils
Provides: mariadb-server, mysql-server, virtual-mysql-server
Conflicts: mariadb-server (<< ${source:Version}), mysql-server (<< ${source:Version}),
mysql-server-4.1, mysql-server-5.0, mysql-server-5.1, mysql-server-5.5,
......
......@@ -186,7 +186,7 @@ Architecture: any
Suggests: tinyca, mailx, mariadb-test
Recommends: libhtml-template-perl
Pre-Depends: mariadb-common, adduser (>= 3.40), debconf
Depends: mariadb-client-10.1 (>= ${source:Version}), libdbi-perl, perl (>= 5.6), ${shlibs:Depends}, ${misc:Depends}, psmisc, passwd, lsb-base (>= 3.0-10), mariadb-server-core-10.1 (>= ${binary:Version})
Depends: mariadb-client-10.1 (>= ${source:Version}), libdbi-perl, perl (>= 5.6), ${shlibs:Depends}, ${misc:Depends}, psmisc, passwd, lsb-base (>= 3.0-10), mariadb-server-core-10.1 (>= ${binary:Version}), galera (>=25.2) rsync, lsof, socat, grep, gawk, iproute, coreutils, findutils
Provides: mariadb-server, mysql-server, virtual-mysql-server
Conflicts: mariadb-server (<< ${source:Version}), mysql-server (<< ${source:Version}),
mysql-server-4.1, mysql-server-5.0, mysql-server-5.1, mysql-server-5.5,
......
......@@ -71,7 +71,7 @@ extern struct logger_service_st {
int (*rotate)(LOGGER_HANDLE *log);
} *logger_service;
#if MYSQL_DYNAMIC_PLUGIN
#ifdef MYSQL_DYNAMIC_PLUGIN
#define logger_init_mutexes logger_service->logger_init_mutexes
#define logger_open(path, size_limit, rotations) \
......
......@@ -5,4 +5,7 @@ const char *load_default_groups[]= {
"mysqld", "server", MYSQL_BASE_VERSION,
"mariadb", MARIADB_BASE_VERSION,
"client-server",
#ifdef WITH_WSREP
"galera",
#endif
0, 0};
......@@ -20,7 +20,6 @@
#ifdef __cplusplus
extern "C" {
#endif
#include <my_pthread.h>
#include <my_list.h>
......@@ -95,6 +94,7 @@ typedef struct st_thr_lock_info
{
pthread_t thread;
my_thread_id thread_id;
void *mysql_thd; // THD pointer
} THR_LOCK_INFO;
......@@ -164,6 +164,17 @@ my_bool thr_reschedule_write_lock(THR_LOCK_DATA *data,
ulong lock_wait_timeout);
void thr_set_lock_wait_callback(void (*before_wait)(void),
void (*after_wait)(void));
#ifdef WITH_WSREP
#include <my_sys.h>
typedef my_bool (* wsrep_thd_is_brute_force_fun)(void *, my_bool);
typedef int (* wsrep_abort_thd_fun)(void *, void *, my_bool);
typedef int (* wsrep_on_fun)(void *);
void wsrep_thr_lock_init(
wsrep_thd_is_brute_force_fun bf_fun, wsrep_abort_thd_fun abort_fun,
my_bool debug, my_bool convert_LOCK_to_trx, wsrep_on_fun on_fun);
#endif
#ifdef __cplusplus
}
#endif
......
/* Copyright 2014 Codership Oy <http://www.codership.com> & SkySQL Ab
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; version 2 of the License.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
#ifndef WSREP_INCLUDED
#define WSERP_INCLUDED
#ifdef WITH_WSREP
#define IF_WSREP(A,B) A
#define DBUG_ASSERT_IF_WSREP(A) DBUG_ASSERT(A)
#if !defined(EMBEDDED_LIBRARY)
#define WSREP_FORMAT(my_format) \
((wsrep_forced_binlog_format != BINLOG_FORMAT_UNSPEC) ? \
wsrep_forced_binlog_format : my_format)
#else
#define WSREP_FORMAT(my_format) my_format
#endif /* && !EMBEDDED_LIBRARY */
#define WSREP_MYSQL_DB (char *)"mysql"
#define WSREP_TO_ISOLATION_BEGIN(db_, table_, table_list_) \
if (WSREP_ON && WSREP(thd) && wsrep_to_isolation_begin(thd, db_, table_, table_list_)) \
goto error;
#define WSREP_TO_ISOLATION_END \
if (WSREP_ON && (WSREP(thd) || (thd && thd->wsrep_exec_mode==TOTAL_ORDER))) \
wsrep_to_isolation_end(thd);
#define WSREP_DEBUG(...) \
if (wsrep_debug) WSREP_LOG(sql_print_information, ##__VA_ARGS__)
#define WSREP_INFO(...) WSREP_LOG(sql_print_information, ##__VA_ARGS__)
#define WSREP_WARN(...) WSREP_LOG(sql_print_warning, ##__VA_ARGS__)
#define WSREP_ERROR(...) WSREP_LOG(sql_print_error, ##__VA_ARGS__)
#else
#define IF_WSREP(A,B) B
#define DBUG_ASSERT_IF_WSREP(A)
#define WSREP_DEBUG(...)
#define WSREP_INFO(...)
#define WSREP_WARN(...)
#define WSREP_ERROR(...)
#define WSREP_FORMAT(my_format) my_format
#define WSREP_TO_ISOLATION_BEGIN(db_, table_, table_list_)
#define WSREP_TO_ISOLATION_END
#endif
#endif /* WSERP_INCLUDED */
......@@ -372,7 +372,8 @@ dfLtTBcBAAAAIgAAAPkAAAAAABcAAAAAAAcAAf/+AQAAAA==
SELECT * FROM t1;
--echo # Their values should be ON
SHOW SESSION VARIABLES LIKE "%_checks";
SHOW SESSION VARIABLES LIKE "foreign_key_checks";
SHOW SESSION VARIABLES LIKE "unique_checks";
--echo
SET @@SESSION.foreign_key_checks= OFF;
......@@ -387,7 +388,8 @@ dfLtTBcBAAAAIgAAAM0BAAAAABcAAAAAAAEAAf/+AgAAAA==
SELECT * FROM t1;
--echo # Their values should be OFF
SHOW SESSION VARIABLES LIKE "%_checks";
SHOW SESSION VARIABLES LIKE "foreign_key_checks";
SHOW SESSION VARIABLES LIKE "unique_checks";
--echo # INSERT INTO t1 VALUES(2)
--echo # foreign_key_checks=1 and unique_checks=1
......@@ -401,7 +403,8 @@ dfLtTBcBAAAAIgAAAM0BAAAAABcAAAAAAAEAAf/+AgAAAA==
SELECT * FROM t1;
--echo # Their values should be OFF
SHOW SESSION VARIABLES LIKE "%_checks";
SHOW SESSION VARIABLES LIKE "foreign_key_checks";
SHOW SESSION VARIABLES LIKE "unique_checks";
DROP TABLE t1;
......
# galera_cluster.inc
# ==================
#
# Description
# -----------
# Configure galera cluster with 2 nodes.
#
--let $galera_cluster_size = 2
--source include/galera_init.inc
# galera_connect.inc
# ==================
#
# Description
# -----------
# Open a connection to the specified server number ($galera_server_number).
# The connection itself would be identified by $galera_connection_name.
#
# Parameters
# ----------
# $galera_connection_name
# Name of the resulting connection.
#
# $galera_server_number
# Sequence number of the node in the galera cluster.
#
# $galera_debug
# Print debug information.
#
if (!$galera_connection_name)
{
--die ERROR IN TEST: $galera_connection_name must be set before sourcing include/galera_connect.inc
}
if (!$galera_server_number)
{
--die ERROR IN TEST: $galera_server_number must be set before sourcing include/galera_connect.inc
}
--let $_galera_port= \$NODE_MYPORT_$galera_server_number
if (!$_galera_port)
{
--echo Bug in test case: '\$NODE_MYPORT_$galera_server_number' not initialized. Check the test's .cfg file.
--die Not all NODE_MYPORT_* environment variables are setup correctly.
}
if ($galera_debug)
{
--echo connect($galera_connection_name,127.0.0.1,root,,test,$_galera_port,)
}
# Open a connection
--connect($galera_connection_name,127.0.0.1,root,,test,$_galera_port,)
# galera_diff.inc
# ===============
#
# Description
# -----------
# Compare the output of the given statement on all the nodes of the cluster.
#
# Parameters
# ----------
# $galera_diff_statement
# Statement for which the output would be compared.
#
# $galera_diff_database
# Database against which the above statement would be executed.
# (Default : test)
#
# $galera_diff_servers
# Comma separated list of servers to executed the diff statement on. If not
# set, a list of servers will be generated based on $galera_cluster_size.
#
# $galerra_debug
# Print debug information.
#
if (!$galera_diff_statement)
{
--die ERROR IN TEST: $galera_diff_statement must be set before sourcing include/galera_diff.inc
}
--let $_galera_diff_database = $galera_diff_database
if (!$_galera_diff_database)
{
--let $_galera_diff_database = test
}
--let $_galera_diff_servers= $galera_diff_servers
if (!$_galera_diff_servers)
{
--let $_i= $galera_cluster_size
--let $_galera_diff_servers=
while ($_i)
{
--let $_galera_diff_servers= $_i,$_galera_diff_servers
--dec $_i
}
}
if ($galera_debug)
{
--echo \$galera_diff_servers= '$_galera_diff_servers'
}
if (!$galera_debug)
{
--disable_query_log
}
# Generate file containing $galera_diff_statement. We don't pass the
# statement on the command line, because it would be subject to shell
# substitutions.
--let $write_to_file= GENERATE
--let $write_var= $galera_diff_statement
--source include/write_var_to_file.inc
--let $_galera_diff_statement_file= $write_to_file
if (!$galera_debug)
{
--enable_query_log
}
# Compare all servers.
--let $_galera_diff_first= 1
while ($_galera_diff_servers)
{
# Set $_galera_diff_server_i to the first number in the list
--let $_galera_diff_server_i= `SELECT SUBSTRING_INDEX('$_galera_diff_servers', ',', 1)`
# Remove $_galera_diff_server_i from the list
--let $_galera_diff_servers= `SELECT SUBSTRING('$_galera_diff_servers', LENGTH('$_galera_diff_server_i') + 2)`
# Execute statement
--let $_galera_diff_file= $MYSQLTEST_VARDIR/tmp/_galera_diff_server-$_galera_diff_server_i.tmp
--exec $MYSQL --defaults-group-suffix=.$_galera_diff_server_i $_galera_diff_database < $_galera_diff_statement_file > $_galera_diff_file
# Compare
if (!$_galera_diff_first)
{
if ($galera_debug)
{
--echo diffing $_galera_diff_file and $_galera_diff_prev_file
}
--diff_files $_galera_diff_file $_galera_diff_prev_file
--remove_file $_galera_diff_prev_file
}
--let $_galera_diff_prev_file= $_galera_diff_file
--let $_galera_diff_first= 0
}
# Cleanup
--remove_file $_galera_diff_prev_file
--remove_file $_galera_diff_statement_file
# galera_end.inc
# ==============
#
# Description
# -----------
# Closes the connections opened via include/galera_init.inc
#
# Parameters
# ----------
# $galera_cluster_size
# Number of nodes in the cluster.
#
--let $_galera_node= $galera_cluster_size
while ($_galera_node)
{
if ($galera_debug)
{
--echo Disconnecting node_$_galera_node
}
--disconnect node_$_galera_node
--dec $_galera_node
}
# galera_init.inc
# ===============
#
# Description
# -----------
# Set up a Galera cluster with $wsrep_cluster_size nodes.
#
# Parameters
# ----------
# $galera_cluster_size
# Number of nodes in the cluster.
#
--source include/have_wsrep_enabled.inc
--let $_galera_node= $galera_cluster_size
while ($_galera_node)
{
--let $galera_connection_name= node_$_galera_node
--let $galera_server_number= $_galera_node
--source include/galera_connect.inc
--dec $_galera_node
}
--source include/have_innodb.inc
if (`SELECT COUNT(*) = 0 from INFORMATION_SCHEMA.GLOBAL_VARIABLES
WHERE VARIABLE_NAME = 'INNODB_DISALLOW_WRITES'`) {
--skip Test requires 'innodb_disallow_writes'
}
# To be used in a test which requires server to be compiled with wsrep support
# (-DWITH_WSREP=ON) and wsrep plugin is ACTIVE.
if (`SELECT COUNT(*)=0 FROM INFORMATION_SCHEMA.PLUGINS WHERE PLUGIN_NAME = 'wsrep' AND PLUGIN_STATUS='ACTIVE'`)
{
--skip Test requires wsrep plugin.
}
# To be used in a test which requires wsrep plugin to be ACTIVE and enabled
# (i.e. wsrep_on=ON). It includes have_wsrep.inc.
--source include/have_wsrep.inc
--require r/have_wsrep.require
disable_query_log;
SHOW VARIABLES LIKE 'wsrep_on';
enable_query_log;
......@@ -34,6 +34,7 @@ BEGIN
AND variable_name != 'INNODB_USE_NATIVE_AIO'
AND variable_name not like 'GTID%POS'
AND variable_name != 'GTID_BINLOG_STATE'
AND variable_name != 'WSREP_DATA_HOME_DIR'
ORDER BY variable_name;
-- Dump all databases, there should be none
......
......@@ -226,6 +226,14 @@ INSERT INTO global_suppressions VALUES
("Slave I/O: Notifying master by SET @master_binlog_checksum= @@global.binlog_checksum failed with error.*"),
("Slave I/O: Setting master-side filtering of @@skip_replication failed with error:.*"),
("Slave I/O: Setting @mariadb_slave_capability failed with error:.*"),
/*
Galera-related warnings.
*/
("WSREP: Could not open saved state file for reading: .*"),
("WSREP: last inactive check more than .* skipping check"),
("WSREP: Gap in state sequence. Need state transfer."),
("WSREP: Failed to prepare for incremental state transfer: .*"),
("THE_LAST_SUPPRESSION")||
......
# To be used in a test which should be skipped if server is compiled with wsrep
# support (-DWITH_WSREP=ON) and wsrep plugin is ACTIVE.
-- require r/not_wsrep.require
disable_query_log;
SELECT VERSION() LIKE '%wsrep%' AS 'HAVE_WSREP';
enable_query_log;
......@@ -33,7 +33,8 @@
--let _WRTF_SERVER_NUMBER= $server_number
if (!$server_number)
{
--let _WRTF_SERVER_NUMBER= `SELECT 1 + @@PORT - $MASTER_MYPORT`
# Note: 2 extra ports are reserved per server for galera use.
--let _WRTF_SERVER_NUMBER= `SELECT 1 + FLOOR((@@PORT - $MASTER_MYPORT) / 3)`
}
--let $_write_result_msg= [server=$_WRTF_SERVER_NUMBER]
......
......@@ -238,6 +238,9 @@ my @mysqld_rules=
{ 'pid-file' => \&fix_pidfile },
{ '#host' => \&fix_host },
{ 'port' => \&fix_port },
# galera base_port and port used during SST
{ '#galera_port' => \&fix_port },
{ '#sst_port' => \&fix_port },
{ 'socket' => \&fix_socket },
{ '#log-error' => \&fix_log_error },
{ 'general-log' => 1 },
......
......@@ -861,6 +861,8 @@ sub collect_one_test_case {
# Suite has no config, autodetect which one to use
if ($tinfo->{rpl_test}) {
$config= "suite/rpl/my.cnf";
} elsif ($tinfo->{galera_test}) {
$config= "suite/galera/my.cnf";
} else {
$config= "include/default_my.cnf";
}
......@@ -981,6 +983,7 @@ my $tags_map= {'big_test' => ['big_test', 1],
'master-slave' => ['rpl_test', 1],
'ndb_master-slave' => ['rpl_test', 1, 'ndb_test', 1],
'long_test' => ['long_test', 1],
'galera_init' => ['galera_test', 1],
};
my $tags_regex_string= join('|', keys %$tags_map);
my $tags_regex= qr:include/($tags_regex_string)\.inc:o;
......
......@@ -135,6 +135,7 @@ my $opt_start;
my $opt_start_dirty;
my $opt_start_exit;
my $start_only;
my $file_wsrep_provider;
END {
if ( defined $opt_tmpdir_pid and $opt_tmpdir_pid == $$ )
......@@ -412,6 +413,7 @@ sub main {
check_ndbcluster_support();
check_ssl_support();
check_debug_support();
check_wsrep_support();
if (!$opt_suites) {
$opt_suites= join ',', collect_default_suites(@DEFAULT_SUITES);
......@@ -2397,6 +2399,24 @@ sub environment_setup {
$ENV{'NDB_EXAMPLES_OUTPUT'}= $path_ndb_testrun_log;
}
# ----------------------------------------------------
# Setup env for wsrep
# ----------------------------------------------------
if (have_wsrep()) {
if (defined $ENV{'WSREP_PROVIDER'} ) {
# Nothing needs to be done! WSREP_PROVIDER env is already set & checked;
# will be used.
} else {
$ENV{'WSREP_PROVIDER'}= $file_wsrep_provider;
}
if ($ENV{'WSREP_PROVIDER'} ne "") {
mtr_verbose("WSREP_PROVIDER set to $ENV{'WSREP_PROVIDER'}");
} else {
mtr_verbose("WSREP_PROVIDER isn't available");
}
}
# ----------------------------------------------------
# mysql clients
# ----------------------------------------------------
......@@ -3174,6 +3194,40 @@ sub ndbcluster_start ($) {
return 0;
}
sub have_wsrep() {
my $wsrep_on= $mysqld_variables{'wsrep-on'};
return defined $wsrep_on
}
sub check_wsrep_provider_env {
if (defined $ENV{'WSREP_PROVIDER'}) {
if (mtr_file_exists($ENV{'WSREP_PROVIDER'}) eq "") {
mtr_error("WSREP_PROVIDER env set to an invalid path");
return 0; # error
}
# Ok, WSREP_PROVIDER set to a valid path.
return 1;
}
# Ok, WSREP_PROVIDER not defined.
return 2;
}
sub check_wsrep_support() {
if (have_wsrep())
{
mtr_report(" - binaries built with wsrep patch");
$file_wsrep_provider=
mtr_file_exists("/usr/lib/galera/libgalera_smm.so",
"/usr/lib64/galera/libgalera_smm.so");
if ((check_wsrep_provider_env() == 1) || ($file_wsrep_provider ne "")) {
# Add galera test suites
mtr_report(" - adding wsrep, galera to default test suites");
push @DEFAULT_SUITES, qw(wsrep galera);
}
}
}
sub mysql_server_start($) {
my ($mysqld, $tinfo) = @_;
......@@ -4837,6 +4891,10 @@ sub extract_warning_lines ($$) {
qr|Plugin 'FEEDBACK' registration as a INFORMATION SCHEMA failed|,
qr|'log-bin-use-v1-row-events' is MySQL 5.6 compatible option|,
qr|InnoDB: Setting thread \d+ nice to \d+ failed, current nice \d+, errno 13|, # setpriority() fails under valgrind
# Galera-related warnings.
qr|WSREP:.*down context.*|,
qr|WSREP: Failed to send state UUID:.*|,
qr|WSREP: wsrep_sst_receive_address.*|,
);
my $matched_lines= [];
......
Variable_name Value
wsrep_on ON
#
# MDEV-5226 mysql_tzinfo_to_sql errors with tzdata 2013f and above
#
SET SESSION wsrep_replicate_myisam=ON;
# Verbose run
TRUNCATE TABLE time_zone;
TRUNCATE TABLE time_zone_name;
......
......@@ -1065,6 +1065,93 @@ The following options may be given as the first argument:
-V, --version Output version information and exit.
--wait-timeout=# The number of seconds the server waits for activity on a
connection before closing it
--wsrep-OSU-method[=name]
Method for Online Schema Upgrade
--wsrep-auto-increment-control
To automatically control the assignment of autoincrement
variables
(Defaults to on; use --skip-wsrep-auto-increment-control to disable.)
--wsrep-causal-reads
(DEPRECATED) Setting this variable is equivalent to
setting wsrep_sync_wait READ flag
--wsrep-certify-nonPK
Certify tables with no primary key
(Defaults to on; use --skip-wsrep-certify-nonPK to disable.)
--wsrep-cluster-address=name
Address to initially connect to cluster
--wsrep-cluster-name=name
Name for the cluster
--wsrep-convert-LOCK-to-trx
To convert locking sessions into transactions
--wsrep-data-home-dir=name
home directory for wsrep provider
--wsrep-dbug-option=name
DBUG options to provider library
--wsrep-debug To enable debug level logging
--wsrep-desync To desynchronize the node from the cluster
--wsrep-drupal-282555-workaround
To use a workaround forbad autoincrement value
--wsrep-forced-binlog-format=name
binlog format to take effect over user's choice
--wsrep-load-data-splitting
To commit LOAD DATA transaction after every 10K rows
inserted
(Defaults to on; use --skip-wsrep-load-data-splitting to disable.)
--wsrep-log-conflicts
To log multi-master conflicts
--wsrep-max-ws-rows=#
Max number of rows in write set
--wsrep-max-ws-size=#
Max write set size (bytes)
--wsrep-mysql-replication-bundle=#
mysql replication group commit
--wsrep-node-address=name
Node address
--wsrep-node-incoming-address=name
Client connection address
--wsrep-node-name=name
Node name
--wsrep-notify-cmd=name
--wsrep-on To enable wsrep replication
(Defaults to on; use --skip-wsrep-on to disable.)
--wsrep-provider=name
Path to replication provider library
--wsrep-provider-options=name
provider specific options
--wsrep-recover Recover database state after crash and exit
--wsrep-replicate-myisam
To enable myisam replication
--wsrep-restart-slave
Should MySQL slave be restarted automatically, when node
joins back to cluster
--wsrep-retry-autocommit=#
Max number of times to retry a failed autocommit
statement
--wsrep-slave-FK-checks
Should slave thread do foreign key constraint checks
(Defaults to on; use --skip-wsrep-slave-FK-checks to disable.)
--wsrep-slave-UK-checks
Should slave thread do secondary index uniqueness checks
--wsrep-slave-threads=#
Number of slave appliers to launch
--wsrep-sst-auth=name
Authentication for SST connection
--wsrep-sst-donor=name
preferred donor node for the SST
--wsrep-sst-donor-rejects-queries
Reject client queries when donating state snapshot
transfer
--wsrep-sst-method=name
State snapshot transfer method
--wsrep-sst-receive-address=name
Address where node is waiting for SST contact
--wsrep-start-position=name
global transaction position to start from
--wsrep-sync-wait[=#]
Ensure "synchronous" read view before executing an
operation of the type specified by bitmask: 1 -
READ(includes SELECT, SHOW and BEGIN/START TRANSACTION);
2 - UPDATE and DELETE; 4 - INSERT and REPLACE
Variables (--variable-name=value)
allow-suspicious-udfs FALSE
......@@ -1364,6 +1451,44 @@ use-stat-tables NEVER
userstat FALSE
verbose TRUE
wait-timeout 28800
wsrep-OSU-method TOI
wsrep-auto-increment-control TRUE
wsrep-causal-reads FALSE
wsrep-certify-nonPK TRUE
wsrep-cluster-address
wsrep-cluster-name my_wsrep_cluster
wsrep-convert-LOCK-to-trx FALSE
wsrep-data-home-dir
wsrep-dbug-option
wsrep-debug FALSE
wsrep-desync FALSE
wsrep-drupal-282555-workaround FALSE
wsrep-forced-binlog-format NONE
wsrep-load-data-splitting TRUE
wsrep-log-conflicts FALSE
wsrep-max-ws-rows 131072
wsrep-max-ws-size 1073741824
wsrep-mysql-replication-bundle 0
wsrep-node-address
wsrep-node-incoming-address AUTO
wsrep-notify-cmd
wsrep-on FALSE
wsrep-provider none
wsrep-provider-options
wsrep-recover FALSE
wsrep-replicate-myisam FALSE
wsrep-restart-slave FALSE
wsrep-retry-autocommit 1
wsrep-slave-FK-checks TRUE
wsrep-slave-UK-checks FALSE
wsrep-slave-threads 1
wsrep-sst-auth (No default value)
wsrep-sst-donor
wsrep-sst-donor-rejects-queries FALSE
wsrep-sst-method rsync
wsrep-sst-receive-address AUTO
wsrep-start-position 00000000-0000-0000-0000-000000000000:-1
wsrep-sync-wait 0
To see what values a running MySQL server is using, type
'mysqladmin variables' instead of 'mysqld --verbose --help'.
......@@ -806,9 +806,11 @@ SELECT * FROM t1;
c1
1
# Their values should be ON
SHOW SESSION VARIABLES LIKE "%_checks";
SHOW SESSION VARIABLES LIKE "foreign_key_checks";
Variable_name Value
foreign_key_checks ON
SHOW SESSION VARIABLES LIKE "unique_checks";
Variable_name Value
unique_checks ON
SET @@SESSION.foreign_key_checks= OFF;
......@@ -824,9 +826,11 @@ c1
1
2
# Their values should be OFF
SHOW SESSION VARIABLES LIKE "%_checks";
SHOW SESSION VARIABLES LIKE "foreign_key_checks";
Variable_name Value
foreign_key_checks OFF
SHOW SESSION VARIABLES LIKE "unique_checks";
Variable_name Value
unique_checks OFF
# INSERT INTO t1 VALUES(2)
# foreign_key_checks=1 and unique_checks=1
......@@ -842,8 +846,10 @@ c1
1
2
# Their values should be OFF
SHOW SESSION VARIABLES LIKE "%_checks";
SHOW SESSION VARIABLES LIKE "foreign_key_checks";
Variable_name Value
foreign_key_checks OFF
SHOW SESSION VARIABLES LIKE "unique_checks";
Variable_name Value
unique_checks OFF
DROP TABLE t1;
......@@ -618,9 +618,11 @@ SELECT * FROM t1;
c1
1
# Their values should be ON
SHOW SESSION VARIABLES LIKE "%_checks";
SHOW SESSION VARIABLES LIKE "foreign_key_checks";
Variable_name Value
foreign_key_checks ON
SHOW SESSION VARIABLES LIKE "unique_checks";
Variable_name Value
unique_checks ON
SET @@SESSION.foreign_key_checks= OFF;
......@@ -636,9 +638,11 @@ c1
1
2
# Their values should be OFF
SHOW SESSION VARIABLES LIKE "%_checks";
SHOW SESSION VARIABLES LIKE "foreign_key_checks";
Variable_name Value
foreign_key_checks OFF
SHOW SESSION VARIABLES LIKE "unique_checks";
Variable_name Value
unique_checks OFF
# INSERT INTO t1 VALUES(2)
# foreign_key_checks=1 and unique_checks=1
......@@ -654,8 +658,10 @@ c1
1
2
# Their values should be OFF
SHOW SESSION VARIABLES LIKE "%_checks";
SHOW SESSION VARIABLES LIKE "foreign_key_checks";
Variable_name Value
foreign_key_checks OFF
SHOW SESSION VARIABLES LIKE "unique_checks";
Variable_name Value
unique_checks OFF
DROP TABLE t1;
# Use default setting for mysqld processes
!include include/default_mysqld.cnf
[mysqld.1]
binlog-format=row
wsrep_provider=@ENV.WSREP_PROVIDER
wsrep_cluster_address='gcomm://'
wsrep_provider_options='base_port=@mysqld.1.#galera_port'
wsrep_sst_receive_address='127.0.0.1:@mysqld.1.#sst_port'
[mysqld.2]
binlog-format=row
wsrep_provider=@ENV.WSREP_PROVIDER
wsrep_cluster_address='gcomm://127.0.0.1:@mysqld.1.#galera_port'
wsrep_provider_options='base_port=@mysqld.2.#galera_port'
wsrep_sst_receive_address='127.0.0.1:@mysqld.2.#sst_port'
[ENV]
NODE_MYPORT_1= @mysqld.1.port
NODE_MYSOCK_1= @mysqld.1.socket
NODE_MYPORT_2= @mysqld.2.port
NODE_MYSOCK_2= @mysqld.2.socket
!include galera_2nodes.cnf
USE test;
CREATE TABLE t1(c1 INT PRIMARY KEY) ENGINE=INNODB;
INSERT INTO t1 VALUES (1), (2), (3), (4), (5);
SELECT * FROM t1;
c1
1
2
3
4
5
# On node_1
SELECT * FROM test.t1;
c1
1
2
3
4
5
# On node_2
SELECT * FROM test.t1;
c1
1
2
3
4
5
DROP TABLE t1;
# End of test
#
# Test for mysqldump's galera-sst-mode option
#
#
# MDEV-6490: mysqldump unknown option --galera-sst-mode
#
CREATE DATABASE bug6490;
USE bug6490;
CREATE TABLE t1(c1 INT);
INSERT INTO t1 values (1);
INSERT INTO t1 values (2);
# Save the current gtid_binlog_state.
# Take a dump of bug6490 database
DROP TABLE t1;
# Load the dump
RESET MASTER;
SELECT * from t1;
c1
1
2
# Compare the two gtid_binlog_state's
# Cleanup
DROP DATABASE bug6490;
# End of test
#
# MDEV#6266: Changing password fails on galera cluster
#
# On node_1
GRANT SELECT ON *.* TO 'user_6266'@'localhost' IDENTIFIED BY 'pass';
# Now, try changing password for 'user_6266'. This command should also
# execute successfully on the other node.
SET PASSWORD FOR 'user_6266'@'localhost' = PASSWORD('newpass');
# On node_2
SELECT user FROM mysql.user WHERE user='user_6266';
user
user_6266
DROP USER 'user_6266'@'localhost';
# End of test
#
# MDEV#4953 Galera: DELETE from a partitioned table is not replicated
#
USE test;
CREATE TABLE t1 (pk INT PRIMARY KEY, i INT) ENGINE=INNODB PARTITION BY HASH(pk) PARTITIONS 2;
INSERT INTO t1 VALUES (1,100), (2,200);
SELECT * FROM t1;
pk i
2 200
1 100
DELETE FROM t1;
SELECT * FROM t1;
pk i
# On node_1
SELECT * FROM t1;
pk i
# On node_2
SELECT * FROM t1;
pk i
DROP TABLE t1;
# End of test
#
# MDEV#5552 Deadlock when inserting NULL column value in column with
# UNIQUE index
#
USE test;
# On node_1
CREATE TABLE t1(c1 INT DEFAULT NULL, UNIQUE KEY c1(c1)) ENGINE=INNODB;
INSERT INTO t1 VALUES (NULL);
INSERT INTO t1 VALUES (NULL);
SELECT * FROM test.t1;
c1
NULL
NULL
# On node_2
SELECT * FROM test.t1;
c1
NULL
NULL
# On node_1
INSERT INTO t1 VALUES (1);
UPDATE t1 SET c1=NULL WHERE c1=1;
SELECT * FROM test.t1;
c1
NULL
NULL
NULL
# On node_2
SELECT * FROM test.t1;
c1
NULL
NULL
NULL
# On node_1
DELETE FROM t1 WHERE c1<=>NULL;
SELECT * FROM test.t1;
c1
# On node_2
SELECT * FROM test.t1;
c1
DROP TABLE t1;
# End of test
--source include/galera_cluster.inc
--source include/have_innodb.inc
USE test;
CREATE TABLE t1(c1 INT PRIMARY KEY) ENGINE=INNODB;
INSERT INTO t1 VALUES (1), (2), (3), (4), (5);
SELECT * FROM t1;
--echo
--echo # On node_1
--connection node_1
SELECT * FROM test.t1;
--echo
--echo # On node_2
--connection node_2
SELECT * FROM test.t1;
--let $galera_diff_statement = SELECT * FROM t1
--source include/galera_diff.inc
# Cleanup
DROP TABLE t1;
--source include/galera_end.inc
--echo # End of test
# Embedded server doesn't support external clients
--source include/not_embedded.inc
# Binlog is required
--source include/have_log_bin.inc
--echo #
--echo # Test for mysqldump's galera-sst-mode option
--echo #
--echo #
--echo # MDEV-6490: mysqldump unknown option --galera-sst-mode
--echo #
CREATE DATABASE bug6490;
USE bug6490;
CREATE TABLE t1(c1 INT);
INSERT INTO t1 values (1);
INSERT INTO t1 values (2);
--echo # Save the current gtid_binlog_state.
--let $before= `SELECT @@global.gtid_binlog_state`
--echo # Take a dump of bug6490 database
--exec $MYSQL_DUMP --galera-sst-mode bug6490 > $MYSQLTEST_VARDIR/tmp/bug6490.sql
DROP TABLE t1;
--echo # Load the dump
RESET MASTER;
--exec $MYSQL -uroot bug6490 < $MYSQLTEST_VARDIR/tmp/bug6490.sql
SELECT * from t1;
--echo # Compare the two gtid_binlog_state's
--let $after= `SELECT @@global.gtid_binlog_state`
if (`SELECT STRCMP($before, $after)`)
{
--die ERROR: The two gtid_binlog_state's did not match.
}
--echo # Cleanup
--remove_file $MYSQLTEST_VARDIR/tmp/bug6490.sql
DROP DATABASE bug6490;
--echo # End of test
--source include/galera_cluster.inc
--source include/have_innodb.inc
--echo #
--echo # MDEV#6266: Changing password fails on galera cluster
--echo #
--echo
--echo # On node_1
--connection node_1
GRANT SELECT ON *.* TO 'user_6266'@'localhost' IDENTIFIED BY 'pass';
--echo
--echo # Now, try changing password for 'user_6266'. This command should also
--echo # execute successfully on the other node.
SET PASSWORD FOR 'user_6266'@'localhost' = PASSWORD('newpass');
--echo
--echo # On node_2
--connection node_2
SELECT user FROM mysql.user WHERE user='user_6266';
# cleanup
DROP USER 'user_6266'@'localhost';
--source include/galera_end.inc
--echo # End of test
--source include/galera_cluster.inc
--source include/have_innodb.inc
--source include/have_partition.inc
--echo #
--echo # MDEV#4953 Galera: DELETE from a partitioned table is not replicated
--echo #
USE test;
CREATE TABLE t1 (pk INT PRIMARY KEY, i INT) ENGINE=INNODB PARTITION BY HASH(pk) PARTITIONS 2;
INSERT INTO t1 VALUES (1,100), (2,200);
SELECT * FROM t1;
DELETE FROM t1;
SELECT * FROM t1;
--echo
--echo # On node_1
--connection node_1
SELECT * FROM t1;
--echo
--echo # On node_2
--connection node_2
SELECT * FROM t1;
# Cleanup
DROP TABLE t1;
--source include/galera_end.inc
--echo # End of test
--source include/galera_cluster.inc
--source include/have_innodb.inc
--echo #
--echo # MDEV#5552 Deadlock when inserting NULL column value in column with
--echo # UNIQUE index
--echo #
USE test;
--echo
--echo # On node_1
--connection node_1
CREATE TABLE t1(c1 INT DEFAULT NULL, UNIQUE KEY c1(c1)) ENGINE=INNODB;
INSERT INTO t1 VALUES (NULL);
INSERT INTO t1 VALUES (NULL);
SELECT * FROM test.t1;
--echo
--echo # On node_2
--connection node_2
SELECT * FROM test.t1;
--echo
--echo # On node_1
--connection node_1
INSERT INTO t1 VALUES (1);
UPDATE t1 SET c1=NULL WHERE c1=1;
SELECT * FROM test.t1;
--echo
--echo # On node_2
--connection node_2
SELECT * FROM test.t1;
--echo
--echo # On node_1
--connection node_1
DELETE FROM t1 WHERE c1<=>NULL;
SELECT * FROM test.t1;
--echo
--echo # On node_2
--connection node_2
SELECT * FROM test.t1;
--let $galera_diff_statement = SELECT * FROM t1
--source include/galera_diff.inc
# Cleanup
DROP TABLE t1;
--source include/galera_end.inc
--echo # End of test
......@@ -197,7 +197,7 @@ c1 c2
5 9
DROP TABLE t1;
SET @@SESSION.AUTO_INCREMENT_INCREMENT=100, @@SESSION.AUTO_INCREMENT_OFFSET=10;
SHOW VARIABLES LIKE "%auto_inc%";
SHOW VARIABLES LIKE "auto_inc%";
Variable_name Value
auto_increment_increment 100
auto_increment_offset 10
......@@ -230,7 +230,7 @@ c1
DROP TABLE t1;
SET @@SESSION.AUTO_INCREMENT_INCREMENT=1, @@SESSION.AUTO_INCREMENT_OFFSET=1;
SET @@INSERT_ID=1;
SHOW VARIABLES LIKE "%auto_inc%";
SHOW VARIABLES LIKE "auto_inc%";
Variable_name Value
auto_increment_increment 1
auto_increment_offset 1
......@@ -269,7 +269,7 @@ c1
DROP TABLE t1;
SET @@SESSION.AUTO_INCREMENT_INCREMENT=1, @@SESSION.AUTO_INCREMENT_OFFSET=1;
SET @@INSERT_ID=1;
SHOW VARIABLES LIKE "%auto_inc%";
SHOW VARIABLES LIKE "auto_inc%";
Variable_name Value
auto_increment_increment 1
auto_increment_offset 1
......@@ -282,7 +282,7 @@ SELECT * FROM t1;
c1
-1
SET @@SESSION.AUTO_INCREMENT_INCREMENT=100, @@SESSION.AUTO_INCREMENT_OFFSET=10;
SHOW VARIABLES LIKE "%auto_inc%";
SHOW VARIABLES LIKE "auto_inc%";
Variable_name Value
auto_increment_increment 100
auto_increment_offset 10
......@@ -315,7 +315,7 @@ c1
DROP TABLE t1;
SET @@SESSION.AUTO_INCREMENT_INCREMENT=1, @@SESSION.AUTO_INCREMENT_OFFSET=1;
SET @@INSERT_ID=1;
SHOW VARIABLES LIKE "%auto_inc%";
SHOW VARIABLES LIKE "auto_inc%";
Variable_name Value
auto_increment_increment 1
auto_increment_offset 1
......@@ -330,7 +330,7 @@ SELECT * FROM t1;
c1
1
SET @@SESSION.AUTO_INCREMENT_INCREMENT=100, @@SESSION.AUTO_INCREMENT_OFFSET=10;
SHOW VARIABLES LIKE "%auto_inc%";
SHOW VARIABLES LIKE "auto_inc%";
Variable_name Value
auto_increment_increment 100
auto_increment_offset 10
......@@ -370,7 +370,7 @@ c1
DROP TABLE t1;
SET @@SESSION.AUTO_INCREMENT_INCREMENT=1, @@SESSION.AUTO_INCREMENT_OFFSET=1;
SET @@INSERT_ID=1;
SHOW VARIABLES LIKE "%auto_inc%";
SHOW VARIABLES LIKE "auto_inc%";
Variable_name Value
auto_increment_increment 1
auto_increment_offset 1
......@@ -385,7 +385,7 @@ SELECT * FROM t1;
c1
1
SET @@SESSION.AUTO_INCREMENT_INCREMENT=100, @@SESSION.AUTO_INCREMENT_OFFSET=10;
SHOW VARIABLES LIKE "%auto_inc%";
SHOW VARIABLES LIKE "auto_inc%";
Variable_name Value
auto_increment_increment 100
auto_increment_offset 10
......@@ -419,7 +419,7 @@ c1
DROP TABLE t1;
SET @@SESSION.AUTO_INCREMENT_INCREMENT=1, @@SESSION.AUTO_INCREMENT_OFFSET=1;
SET @@INSERT_ID=1;
SHOW VARIABLES LIKE "%auto_inc%";
SHOW VARIABLES LIKE "auto_inc%";
Variable_name Value
auto_increment_increment 1
auto_increment_offset 1
......@@ -434,7 +434,7 @@ c1
1
9223372036854775794
SET @@SESSION.AUTO_INCREMENT_INCREMENT=2, @@SESSION.AUTO_INCREMENT_OFFSET=10;
SHOW VARIABLES LIKE "%auto_inc%";
SHOW VARIABLES LIKE "auto_inc%";
Variable_name Value
auto_increment_increment 2
auto_increment_offset 10
......@@ -452,7 +452,7 @@ c1
DROP TABLE t1;
SET @@SESSION.AUTO_INCREMENT_INCREMENT=1, @@SESSION.AUTO_INCREMENT_OFFSET=1;
SET @@INSERT_ID=1;
SHOW VARIABLES LIKE "%auto_inc%";
SHOW VARIABLES LIKE "auto_inc%";
Variable_name Value
auto_increment_increment 1
auto_increment_offset 1
......@@ -467,7 +467,7 @@ c1
1
18446744073709551603
SET @@SESSION.AUTO_INCREMENT_INCREMENT=2, @@SESSION.AUTO_INCREMENT_OFFSET=10;
SHOW VARIABLES LIKE "%auto_inc%";
SHOW VARIABLES LIKE "auto_inc%";
Variable_name Value
auto_increment_increment 2
auto_increment_offset 10
......@@ -480,7 +480,7 @@ c1
DROP TABLE t1;
SET @@SESSION.AUTO_INCREMENT_INCREMENT=1, @@SESSION.AUTO_INCREMENT_OFFSET=1;
SET @@INSERT_ID=1;
SHOW VARIABLES LIKE "%auto_inc%";
SHOW VARIABLES LIKE "auto_inc%";
Variable_name Value
auto_increment_increment 1
auto_increment_offset 1
......@@ -495,7 +495,7 @@ c1
1
18446744073709551603
SET @@SESSION.AUTO_INCREMENT_INCREMENT=5, @@SESSION.AUTO_INCREMENT_OFFSET=7;
SHOW VARIABLES LIKE "%auto_inc%";
SHOW VARIABLES LIKE "auto_inc%";
Variable_name Value
auto_increment_increment 5
auto_increment_offset 7
......@@ -508,7 +508,7 @@ c1
DROP TABLE t1;
SET @@SESSION.AUTO_INCREMENT_INCREMENT=1, @@SESSION.AUTO_INCREMENT_OFFSET=1;
SET @@INSERT_ID=1;
SHOW VARIABLES LIKE "%auto_inc%";
SHOW VARIABLES LIKE "auto_inc%";
Variable_name Value
auto_increment_increment 1
auto_increment_offset 1
......@@ -527,7 +527,7 @@ c1
-9223372036854775806
1
SET @@SESSION.AUTO_INCREMENT_INCREMENT=3, @@SESSION.AUTO_INCREMENT_OFFSET=3;
SHOW VARIABLES LIKE "%auto_inc%";
SHOW VARIABLES LIKE "auto_inc%";
Variable_name Value
auto_increment_increment 3
auto_increment_offset 3
......@@ -544,7 +544,7 @@ c1
DROP TABLE t1;
SET @@SESSION.AUTO_INCREMENT_INCREMENT=1, @@SESSION.AUTO_INCREMENT_OFFSET=1;
SET @@INSERT_ID=1;
SHOW VARIABLES LIKE "%auto_inc%";
SHOW VARIABLES LIKE "auto_inc%";
Variable_name Value
auto_increment_increment 1
auto_increment_offset 1
......@@ -562,7 +562,7 @@ SET @@SESSION.AUTO_INCREMENT_INCREMENT=1152921504606846976, @@SESSION.AUTO_INCRE
Warnings:
Warning 1292 Truncated incorrect auto_increment_increment value: '1152921504606846976'
Warning 1292 Truncated incorrect auto_increment_offset value: '1152921504606846976'
SHOW VARIABLES LIKE "%auto_inc%";
SHOW VARIABLES LIKE "auto_inc%";
Variable_name Value
auto_increment_increment 65535
auto_increment_offset 65535
......@@ -575,7 +575,7 @@ c1
DROP TABLE t1;
SET @@SESSION.AUTO_INCREMENT_INCREMENT=1, @@SESSION.AUTO_INCREMENT_OFFSET=1;
SET @@INSERT_ID=1;
SHOW VARIABLES LIKE "%auto_inc%";
SHOW VARIABLES LIKE "auto_inc%";
Variable_name Value
auto_increment_increment 1
auto_increment_offset 1
......@@ -862,7 +862,7 @@ ERROR 22003: Out of range value for column 'c1' at row 1
DROP TABLE t1;
DROP TABLE t2;
SET @@SESSION.AUTO_INCREMENT_INCREMENT=1, @@SESSION.AUTO_INCREMENT_OFFSET=1;
SHOW VARIABLES LIKE "%auto_inc%";
SHOW VARIABLES LIKE "auto_inc%";
Variable_name Value
auto_increment_increment 1
auto_increment_offset 1
......@@ -1252,7 +1252,7 @@ t1 CREATE TABLE `t1` (
) ENGINE=InnoDB AUTO_INCREMENT=18446744073709551615 DEFAULT CHARSET=latin1
DROP TABLE t1;
SET @@SESSION.AUTO_INCREMENT_INCREMENT=1, @@SESSION.AUTO_INCREMENT_OFFSET=256;
SHOW VARIABLES LIKE "%auto_inc%";
SHOW VARIABLES LIKE "auto_inc%";
Variable_name Value
auto_increment_increment 1
auto_increment_offset 256
......@@ -1270,7 +1270,7 @@ c1 c2
1 NULL
DROP TABLE t1;
SET @@SESSION.AUTO_INCREMENT_INCREMENT=1, @@SESSION.AUTO_INCREMENT_OFFSET=1;
SHOW VARIABLES LIKE "%auto_inc%";
SHOW VARIABLES LIKE "auto_inc%";
Variable_name Value
auto_increment_increment 1
auto_increment_offset 1
......
......@@ -161,7 +161,7 @@ DROP TABLE t1;
#
# Test changes to AUTOINC next value calculation
SET @@SESSION.AUTO_INCREMENT_INCREMENT=100, @@SESSION.AUTO_INCREMENT_OFFSET=10;
SHOW VARIABLES LIKE "%auto_inc%";
SHOW VARIABLES LIKE "auto_inc%";
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (c1 INT AUTO_INCREMENT, PRIMARY KEY(c1)) ENGINE=InnoDB;
INSERT INTO t1 VALUES (NULL),(5),(NULL);
......@@ -178,7 +178,7 @@ DROP TABLE t1;
# Reset the AUTOINC session variables
SET @@SESSION.AUTO_INCREMENT_INCREMENT=1, @@SESSION.AUTO_INCREMENT_OFFSET=1;
SET @@INSERT_ID=1;
SHOW VARIABLES LIKE "%auto_inc%";
SHOW VARIABLES LIKE "auto_inc%";
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (c1 INT AUTO_INCREMENT, PRIMARY KEY(c1)) ENGINE=InnoDB;
INSERT INTO t1 VALUES(0);
......@@ -198,13 +198,13 @@ DROP TABLE t1;
# Reset the AUTOINC session variables
SET @@SESSION.AUTO_INCREMENT_INCREMENT=1, @@SESSION.AUTO_INCREMENT_OFFSET=1;
SET @@INSERT_ID=1;
SHOW VARIABLES LIKE "%auto_inc%";
SHOW VARIABLES LIKE "auto_inc%";
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (c1 INT AUTO_INCREMENT, PRIMARY KEY(c1)) ENGINE=InnoDB;
INSERT INTO t1 VALUES(-1);
SELECT * FROM t1;
SET @@SESSION.AUTO_INCREMENT_INCREMENT=100, @@SESSION.AUTO_INCREMENT_OFFSET=10;
SHOW VARIABLES LIKE "%auto_inc%";
SHOW VARIABLES LIKE "auto_inc%";
INSERT INTO t1 VALUES (-2), (NULL),(2),(NULL);
INSERT INTO t1 VALUES (250),(NULL);
SELECT * FROM t1;
......@@ -219,13 +219,13 @@ DROP TABLE t1;
# Reset the AUTOINC session variables
SET @@SESSION.AUTO_INCREMENT_INCREMENT=1, @@SESSION.AUTO_INCREMENT_OFFSET=1;
SET @@INSERT_ID=1;
SHOW VARIABLES LIKE "%auto_inc%";
SHOW VARIABLES LIKE "auto_inc%";
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (c1 INT UNSIGNED AUTO_INCREMENT, PRIMARY KEY(c1)) ENGINE=InnoDB;
INSERT INTO t1 VALUES(-1);
SELECT * FROM t1;
SET @@SESSION.AUTO_INCREMENT_INCREMENT=100, @@SESSION.AUTO_INCREMENT_OFFSET=10;
SHOW VARIABLES LIKE "%auto_inc%";
SHOW VARIABLES LIKE "auto_inc%";
INSERT INTO t1 VALUES (-2);
INSERT INTO t1 VALUES (NULL);
INSERT INTO t1 VALUES (2);
......@@ -245,13 +245,13 @@ DROP TABLE t1;
# Reset the AUTOINC session variables
SET @@SESSION.AUTO_INCREMENT_INCREMENT=1, @@SESSION.AUTO_INCREMENT_OFFSET=1;
SET @@INSERT_ID=1;
SHOW VARIABLES LIKE "%auto_inc%";
SHOW VARIABLES LIKE "auto_inc%";
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (c1 INT UNSIGNED AUTO_INCREMENT, PRIMARY KEY(c1)) ENGINE=InnoDB;
INSERT INTO t1 VALUES(-1);
SELECT * FROM t1;
SET @@SESSION.AUTO_INCREMENT_INCREMENT=100, @@SESSION.AUTO_INCREMENT_OFFSET=10;
SHOW VARIABLES LIKE "%auto_inc%";
SHOW VARIABLES LIKE "auto_inc%";
INSERT INTO t1 VALUES (-2),(NULL),(2),(NULL);
INSERT INTO t1 VALUES (250),(NULL);
SELECT * FROM t1;
......@@ -267,7 +267,7 @@ DROP TABLE t1;
# Check for overflow handling when increment is > 1
SET @@SESSION.AUTO_INCREMENT_INCREMENT=1, @@SESSION.AUTO_INCREMENT_OFFSET=1;
SET @@INSERT_ID=1;
SHOW VARIABLES LIKE "%auto_inc%";
SHOW VARIABLES LIKE "auto_inc%";
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (c1 BIGINT AUTO_INCREMENT, PRIMARY KEY(c1)) ENGINE=InnoDB;
# TODO: Fix the autoinc init code
......@@ -276,7 +276,7 @@ INSERT INTO t1 VALUES(NULL);
INSERT INTO t1 VALUES (9223372036854775794); #-- 2^63 - 14
SELECT * FROM t1;
SET @@SESSION.AUTO_INCREMENT_INCREMENT=2, @@SESSION.AUTO_INCREMENT_OFFSET=10;
SHOW VARIABLES LIKE "%auto_inc%";
SHOW VARIABLES LIKE "auto_inc%";
# This should just fit
INSERT INTO t1 VALUES (NULL),(NULL),(NULL),(NULL),(NULL),(NULL);
SELECT * FROM t1;
......@@ -286,7 +286,7 @@ DROP TABLE t1;
# Check for overflow handling when increment and offser are > 1
SET @@SESSION.AUTO_INCREMENT_INCREMENT=1, @@SESSION.AUTO_INCREMENT_OFFSET=1;
SET @@INSERT_ID=1;
SHOW VARIABLES LIKE "%auto_inc%";
SHOW VARIABLES LIKE "auto_inc%";
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (c1 BIGINT UNSIGNED AUTO_INCREMENT, PRIMARY KEY(c1)) ENGINE=InnoDB;
# TODO: Fix the autoinc init code
......@@ -295,7 +295,7 @@ INSERT INTO t1 VALUES(NULL);
INSERT INTO t1 VALUES (18446744073709551603); #-- 2^64 - 13
SELECT * FROM t1;
SET @@SESSION.AUTO_INCREMENT_INCREMENT=2, @@SESSION.AUTO_INCREMENT_OFFSET=10;
SHOW VARIABLES LIKE "%auto_inc%";
SHOW VARIABLES LIKE "auto_inc%";
--error ER_AUTOINC_READ_FAILED
INSERT INTO t1 VALUES (NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL);
SELECT * FROM t1;
......@@ -305,7 +305,7 @@ DROP TABLE t1;
# Check for overflow handling when increment and offset are odd numbers
SET @@SESSION.AUTO_INCREMENT_INCREMENT=1, @@SESSION.AUTO_INCREMENT_OFFSET=1;
SET @@INSERT_ID=1;
SHOW VARIABLES LIKE "%auto_inc%";
SHOW VARIABLES LIKE "auto_inc%";
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (c1 BIGINT UNSIGNED AUTO_INCREMENT, PRIMARY KEY(c1)) ENGINE=InnoDB;
# TODO: Fix the autoinc init code
......@@ -314,7 +314,7 @@ INSERT INTO t1 VALUES(NULL);
INSERT INTO t1 VALUES (18446744073709551603); #-- 2^64 - 13
SELECT * FROM t1;
SET @@SESSION.AUTO_INCREMENT_INCREMENT=5, @@SESSION.AUTO_INCREMENT_OFFSET=7;
SHOW VARIABLES LIKE "%auto_inc%";
SHOW VARIABLES LIKE "auto_inc%";
--error ER_AUTOINC_READ_FAILED
INSERT INTO t1 VALUES (NULL),(NULL), (NULL);
SELECT * FROM t1;
......@@ -324,7 +324,7 @@ DROP TABLE t1;
# and check for large -ve numbers
SET @@SESSION.AUTO_INCREMENT_INCREMENT=1, @@SESSION.AUTO_INCREMENT_OFFSET=1;
SET @@INSERT_ID=1;
SHOW VARIABLES LIKE "%auto_inc%";
SHOW VARIABLES LIKE "auto_inc%";
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (c1 BIGINT AUTO_INCREMENT, PRIMARY KEY(c1)) ENGINE=InnoDB;
# TODO: Fix the autoinc init code
......@@ -335,7 +335,7 @@ INSERT INTO t1 VALUES(-9223372036854775807); #-- -2^63 + 1
INSERT INTO t1 VALUES(-9223372036854775808); #-- -2^63
SELECT * FROM t1;
SET @@SESSION.AUTO_INCREMENT_INCREMENT=3, @@SESSION.AUTO_INCREMENT_OFFSET=3;
SHOW VARIABLES LIKE "%auto_inc%";
SHOW VARIABLES LIKE "auto_inc%";
INSERT INTO t1 VALUES (NULL),(NULL), (NULL);
SELECT * FROM t1;
DROP TABLE t1;
......@@ -344,7 +344,7 @@ DROP TABLE t1;
# large numbers 2^60
SET @@SESSION.AUTO_INCREMENT_INCREMENT=1, @@SESSION.AUTO_INCREMENT_OFFSET=1;
SET @@INSERT_ID=1;
SHOW VARIABLES LIKE "%auto_inc%";
SHOW VARIABLES LIKE "auto_inc%";
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (c1 BIGINT UNSIGNED AUTO_INCREMENT, PRIMARY KEY(c1)) ENGINE=InnoDB;
# TODO: Fix the autoinc init code
......@@ -353,7 +353,7 @@ INSERT INTO t1 VALUES(NULL);
INSERT INTO t1 VALUES (18446744073709551610); #-- 2^64 - 2
SELECT * FROM t1;
SET @@SESSION.AUTO_INCREMENT_INCREMENT=1152921504606846976, @@SESSION.AUTO_INCREMENT_OFFSET=1152921504606846976;
SHOW VARIABLES LIKE "%auto_inc%";
SHOW VARIABLES LIKE "auto_inc%";
--error 167
INSERT INTO t1 VALUES (NULL),(NULL);
SELECT * FROM t1;
......@@ -364,7 +364,7 @@ DROP TABLE t1;
#
SET @@SESSION.AUTO_INCREMENT_INCREMENT=1, @@SESSION.AUTO_INCREMENT_OFFSET=1;
SET @@INSERT_ID=1;
SHOW VARIABLES LIKE "%auto_inc%";
SHOW VARIABLES LIKE "auto_inc%";
CREATE TABLE t1 (c1 DOUBLE NOT NULL AUTO_INCREMENT, c2 INT, PRIMARY KEY (c1)) ENGINE=InnoDB;
INSERT INTO t1 VALUES(NULL, 1);
INSERT INTO t1 VALUES(NULL, 2);
......@@ -450,7 +450,7 @@ DROP TABLE t2;
# If the user has specified negative values for an AUTOINC column then
# InnoDB should ignore those values when setting the table's max value.
SET @@SESSION.AUTO_INCREMENT_INCREMENT=1, @@SESSION.AUTO_INCREMENT_OFFSET=1;
SHOW VARIABLES LIKE "%auto_inc%";
SHOW VARIABLES LIKE "auto_inc%";
# TINYINT
CREATE TABLE t1 (c1 TINYINT PRIMARY KEY AUTO_INCREMENT, c2 VARCHAR(10)) ENGINE=InnoDB;
INSERT INTO t1 VALUES (1, NULL);
......@@ -646,7 +646,7 @@ DROP TABLE t1;
# Check if we handle offset > column max value properly
SET @@SESSION.AUTO_INCREMENT_INCREMENT=1, @@SESSION.AUTO_INCREMENT_OFFSET=256;
SHOW VARIABLES LIKE "%auto_inc%";
SHOW VARIABLES LIKE "auto_inc%";
# TINYINT
CREATE TABLE t1 (c1 TINYINT PRIMARY KEY AUTO_INCREMENT, c2 VARCHAR(10)) ENGINE=InnoDB;
INSERT INTO t1 VALUES (1, NULL);
......@@ -658,7 +658,7 @@ DROP TABLE t1;
# of the column. IMO, this should not be allowed and the assertion that fails
# is actually an invariant.
SET @@SESSION.AUTO_INCREMENT_INCREMENT=1, @@SESSION.AUTO_INCREMENT_OFFSET=1;
SHOW VARIABLES LIKE "%auto_inc%";
SHOW VARIABLES LIKE "auto_inc%";
# TINYINT
CREATE TABLE t1 (c1 INT UNSIGNED PRIMARY KEY AUTO_INCREMENT, c2 VARCHAR(10)) ENGINE=InnoDB;
INSERT INTO t1 VALUES (2147483648, 'a');
......
......@@ -23,7 +23,7 @@ a b
DROP PROCEDURE test_p1;
SET @save_autocommit= @@autocommit;
SET @@autocommit= OFF;
SHOW VARIABLES LIKE '%autocommit%';
SHOW VARIABLES LIKE 'autocommit%';
Variable_name Value
autocommit OFF
CREATE TRIGGER test_trg_1 BEFORE UPDATE ON tp FOR EACH ROW
......
......@@ -37,7 +37,7 @@ DROP PROCEDURE test_p1;
SET @save_autocommit= @@autocommit;
SET @@autocommit= OFF;
SHOW VARIABLES LIKE '%autocommit%';
SHOW VARIABLES LIKE 'autocommit%';
DELIMITER |;
--error ER_COMMIT_NOT_ALLOWED_IN_SF_OR_TRG
CREATE TRIGGER test_trg_1 BEFORE UPDATE ON tp FOR EACH ROW
......
......@@ -3,7 +3,7 @@ Warnings:
Note 1051 Unknown table 'test.t1'
select @@version_comment limit 1 ;
@@version_comment
Source distribution
Source distribution, wsrep_25.10.r3991
SELECT COUNT(*) FROM `information_schema`.`INNODB_SYS_INDEXES` ;
CREATE TABLE test.t1 ( `a` SERIAL NOT NULL , `b` VARCHAR( 255 ) NOT NULL , INDEX ( `b` ) ) ENGINE = InnoDB ;
SHOW TABLE STATUS FROM `information_schema` LIKE 'INNODB\_SYS\_INDEXES%' ;
......
......@@ -5,7 +5,8 @@ drop table if exists t1;
#
# test for bug LP#875797 "Using 'innodb_sys_indexes' causes core dump"
#
select @@version_comment limit 1 ;
# disable version_commit as it could contain wsrep
#select @@version_comment limit 1 ;
--disable_result_log
SELECT COUNT(*) FROM `information_schema`.`INNODB_SYS_INDEXES` ;
CREATE TABLE test.t1 ( `a` SERIAL NOT NULL , `b` VARCHAR( 255 ) NOT NULL , INDEX ( `b` ) ) ENGINE = InnoDB ;
......
......@@ -11,9 +11,10 @@ include/master-slave.inc
*** Create test tables
show variables like '%binlog_format%';
show variables like 'binlog_format%';
Variable_name Value
binlog_format MIXED
wsrep_forced_binlog_format NONE
drop table if exists test.marker;
select thread_id into @my_thread_id
from performance_schema.threads
......@@ -55,9 +56,10 @@ Expect 1
*** MASTER ***
**************
show variables like '%binlog_format%';
show variables like 'binlog_format%';
Variable_name Value
binlog_format MIXED
wsrep_forced_binlog_format NONE
*** Clear statement events
*** Create/drop table, create/drop database
......
......@@ -64,7 +64,7 @@ connection master;
--echo *** Create test tables
--echo
show variables like '%binlog_format%';
show variables like 'binlog_format%';
--disable_warnings
drop table if exists test.marker;
......@@ -129,7 +129,7 @@ connection master;
--echo *** MASTER ***
--echo **************
--echo
show variables like '%binlog_format%';
show variables like 'binlog_format%';
--echo *** Clear statement events
--source ../include/rpl_statements_truncate.inc
......
#
# innodb_disallow_writes
#
# save the initial value
SET @innodb_disallow_writes_global_saved = @@global.innodb_disallow_writes;
# default
SELECT @@global.innodb_disallow_writes;
@@global.innodb_disallow_writes
0
# scope
SELECT @@session.innodb_disallow_writes;
ERROR HY000: Variable 'innodb_disallow_writes' is a GLOBAL variable
SET @@global.innodb_disallow_writes=OFF;
SELECT @@global.innodb_disallow_writes;
@@global.innodb_disallow_writes
0
SET @@global.innodb_disallow_writes=ON;
SELECT @@global.innodb_disallow_writes;
@@global.innodb_disallow_writes
1
# valid values
SET @@global.innodb_disallow_writes='OFF';
SELECT @@global.innodb_disallow_writes;
@@global.innodb_disallow_writes
0
SET @@global.innodb_disallow_writes=ON;
SELECT @@global.innodb_disallow_writes;
@@global.innodb_disallow_writes
1
SET @@global.innodb_disallow_writes=default;
SELECT @@global.innodb_disallow_writes;
@@global.innodb_disallow_writes
0
# invalid values
SET @@global.innodb_disallow_writes=NULL;
ERROR 42000: Variable 'innodb_disallow_writes' can't be set to the value of 'NULL'
SET @@global.innodb_disallow_writes='junk';
ERROR 42000: Variable 'innodb_disallow_writes' can't be set to the value of 'junk'
# restore the initial value
SET @@global.innodb_disallow_writes = @innodb_disallow_writes_global_saved;
# End of test
set @start_value = @@wsrep_auto_increment_control;
set @@global.wsrep_auto_increment_control=ON;
set @@global.wsrep_auto_increment_control=OFF;
set @@global.wsrep_auto_increment_control=1;
set @@global.wsrep_auto_increment_control=0;
SET @@global.wsrep_auto_increment_control = -1;
ERROR 42000: Variable 'wsrep_auto_increment_control' can't be set to the value of '-1'
set @@global.wsrep_auto_increment_control = @start_value;
set @start_value = @@wsrep_causal_reads;
set @@global.wsrep_causal_reads=ON;
set @@global.wsrep_causal_reads=OFF;
set @@global.wsrep_causal_reads=1;
set @@global.wsrep_causal_reads=0;
SET @@global.wsrep_causal_reads = -1;
ERROR 42000: Variable 'wsrep_causal_reads' can't be set to the value of '-1'
set @@global.wsrep_causal_reads = @start_value;
set @start_value = @@wsrep_certify_nonpk;
set @@global.wsrep_certify_nonpk=ON;
set @@global.wsrep_certify_nonpk=OFF;
set @@global.wsrep_certify_nonpk=1;
set @@global.wsrep_certify_nonpk=0;
SET @@global.wsrep_certify_nonpk = -1;
ERROR 42000: Variable 'wsrep_certify_nonPK' can't be set to the value of '-1'
set @@global.wsrep_certify_nonpk = @start_value;
SELECT COUNT(@@GLOBAL.wsrep_cluster_address);
COUNT(@@GLOBAL.wsrep_cluster_address)
1
1 Expected
SELECT COUNT(@@GLOBAL.wsrep_cluster_address);
COUNT(@@GLOBAL.wsrep_cluster_address)
1
1 Expected
SELECT @@GLOBAL.wsrep_cluster_address = VARIABLE_VALUE
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
WHERE VARIABLE_NAME='wsrep_cluster_address';
@@GLOBAL.wsrep_cluster_address = VARIABLE_VALUE
1
1 Expected
SELECT COUNT(@@GLOBAL.wsrep_cluster_address);
COUNT(@@GLOBAL.wsrep_cluster_address)
1
1 Expected
SELECT COUNT(VARIABLE_VALUE)
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
WHERE VARIABLE_NAME='wsrep_cluster_address';
COUNT(VARIABLE_VALUE)
1
1 Expected
SELECT @@wsrep_cluster_address = @@GLOBAL.wsrep_cluster_address;
@@wsrep_cluster_address = @@GLOBAL.wsrep_cluster_address
1
1 Expected
SELECT COUNT(@@wsrep_cluster_address);
COUNT(@@wsrep_cluster_address)
1
1 Expected
SELECT COUNT(@@local.wsrep_cluster_address);
ERROR HY000: Variable 'wsrep_cluster_address' is a GLOBAL variable
Expected error 'Variable is a GLOBAL variable'
SELECT COUNT(@@SESSION.wsrep_cluster_address);
ERROR HY000: Variable 'wsrep_cluster_address' is a GLOBAL variable
Expected error 'Variable is a GLOBAL variable'
SELECT COUNT(@@GLOBAL.wsrep_cluster_address);
COUNT(@@GLOBAL.wsrep_cluster_address)
1
1 Expected
SELECT wsrep_cluster_address = @@SESSION.wsrep_cluster_address;
ERROR 42S22: Unknown column 'wsrep_cluster_address' in 'field list'
Expected error 'Readonly variable'
set @start_value = @@wsrep_cluster_name;
set @@global.wsrep_cluster_name='test';
set @@global.wsrep_cluster_name=NULL;
ERROR 42000: Variable 'wsrep_cluster_name' can't be set to the value of 'NULL'
SET @@global.wsrep_cluster_name = 1;
ERROR 42000: Incorrect argument type to variable 'wsrep_cluster_name'
set @@global.wsrep_cluster_name = @start_value;
set @start_value = @@wsrep_convert_lock_to_trx;
set @@global.wsrep_convert_lock_to_trx=ON;
set @@global.wsrep_convert_lock_to_trx=OFF;
set @@global.wsrep_convert_lock_to_trx=1;
set @@global.wsrep_convert_lock_to_trx=0;
SET @@global.wsrep_convert_lock_to_trx = -1;
ERROR 42000: Variable 'wsrep_convert_LOCK_to_trx' can't be set to the value of '-1'
set @@global.wsrep_convert_lock_to_trx = @start_value;
SELECT COUNT(@@GLOBAL.wsrep_data_home_dir);
COUNT(@@GLOBAL.wsrep_data_home_dir)
1
1 Expected
SET @@GLOBAL.wsrep_data_home_dir=1;
ERROR HY000: Variable 'wsrep_data_home_dir' is a read only variable
Expected error 'Read only variable'
SELECT COUNT(@@GLOBAL.wsrep_data_home_dir);
COUNT(@@GLOBAL.wsrep_data_home_dir)
1
1 Expected
SELECT @@GLOBAL.wsrep_data_home_dir = VARIABLE_VALUE
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
WHERE VARIABLE_NAME='wsrep_data_home_dir';
@@GLOBAL.wsrep_data_home_dir = VARIABLE_VALUE
1
1 Expected
SELECT COUNT(@@GLOBAL.wsrep_data_home_dir);
COUNT(@@GLOBAL.wsrep_data_home_dir)
1
1 Expected
SELECT COUNT(VARIABLE_VALUE)
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
WHERE VARIABLE_NAME='wsrep_data_home_dir';
COUNT(VARIABLE_VALUE)
1
1 Expected
SELECT @@wsrep_data_home_dir = @@GLOBAL.wsrep_data_home_dir;
@@wsrep_data_home_dir = @@GLOBAL.wsrep_data_home_dir
1
1 Expected
SELECT COUNT(@@wsrep_data_home_dir);
COUNT(@@wsrep_data_home_dir)
1
1 Expected
SELECT COUNT(@@local.wsrep_data_home_dir);
ERROR HY000: Variable 'wsrep_data_home_dir' is a GLOBAL variable
Expected error 'Variable is a GLOBAL variable'
SELECT COUNT(@@SESSION.wsrep_data_home_dir);
ERROR HY000: Variable 'wsrep_data_home_dir' is a GLOBAL variable
Expected error 'Variable is a GLOBAL variable'
SELECT COUNT(@@GLOBAL.wsrep_data_home_dir);
COUNT(@@GLOBAL.wsrep_data_home_dir)
1
1 Expected
SELECT wsrep_data_home_dir = @@SESSION.wsrep_data_home_dir;
ERROR 42S22: Unknown column 'wsrep_data_home_dir' in 'field list'
Expected error 'Readonly variable'
set @start_value = @@wsrep_dbug_option;
set @@global.wsrep_dbug_option='foo:bar';
set @@global.wsrep_dbug_option=NULL;
SET @@global.wsrep_dbug_option = -1;
ERROR 42000: Incorrect argument type to variable 'wsrep_dbug_option'
set @@global.wsrep_dbug_option = @start_value;
set @start_value = @@wsrep_debug;
set @@global.wsrep_debug=ON;
set @@global.wsrep_debug=OFF;
set @@global.wsrep_debug=1;
set @@global.wsrep_debug=0;
SET @@global.wsrep_debug = -1;
ERROR 42000: Variable 'wsrep_debug' can't be set to the value of '-1'
set @@global.wsrep_debug = @start_value;
select @@global.wsrep_desync;
@@global.wsrep_desync
0
set @start_value = @@wsrep_drupal_282555_workaround;
set @@global.wsrep_drupal_282555_workaround=ON;
set @@global.wsrep_drupal_282555_workaround=OFF;
set @@global.wsrep_drupal_282555_workaround=1;
set @@global.wsrep_drupal_282555_workaround=0;
SET @@global.wsrep_drupal_282555_workaround = -1;
ERROR 42000: Variable 'wsrep_drupal_282555_workaround' can't be set to the value of '-1'
set @@global.wsrep_drupal_282555_workaround = @start_value;
set @start_value = @@wsrep_forced_binlog_format;
set @@global.wsrep_forced_binlog_format = ROW;
set @@global.wsrep_forced_binlog_format = MIXED;
set @@global.wsrep_forced_binlog_format = STATEMENT;
set @@global.wsrep_forced_binlog_format = NONE;
set @@global.wsrep_forced_binlog_format = FOO;
ERROR 42000: Variable 'wsrep_forced_binlog_format' can't be set to the value of 'FOO'
set @@global.wsrep_forced_binlog_format = @start_value;
set @start_value = @@wsrep_load_data_splitting;
set @@global.wsrep_load_data_splitting=ON;
set @@global.wsrep_load_data_splitting=OFF;
set @@global.wsrep_load_data_splitting=1;
set @@global.wsrep_load_data_splitting=0;
SET @@global.wsrep_load_data_splitting = -1;
ERROR 42000: Variable 'wsrep_load_data_splitting' can't be set to the value of '-1'
set @@global.wsrep_load_data_splitting = @start_value;
set @start_value = @@wsrep_log_conflicts;
set @@global.wsrep_log_conflicts=ON;
set @@global.wsrep_log_conflicts=OFF;
set @@global.wsrep_log_conflicts=1;
set @@global.wsrep_log_conflicts=0;
SET @@global.wsrep_log_conflicts = -1;
ERROR 42000: Variable 'wsrep_log_conflicts' can't be set to the value of '-1'
set @@global.wsrep_log_conflicts = @start_value;
set @start_value = @@wsrep_max_ws_rows;
set @@global.wsrep_max_ws_rows=256000;
set @@global.wsrep_max_ws_rows=0;
Warnings:
Warning 1292 Truncated incorrect wsrep_max_ws_rows value: '0'
show warnings;
Level Code Message
Warning 1292 Truncated incorrect wsrep_max_ws_rows value: '0'
set @@global.wsrep_max_ws_rows=-1;
Warnings:
Warning 1292 Truncated incorrect wsrep_max_ws_rows value: '-1'
show warnings;
Level Code Message
Warning 1292 Truncated incorrect wsrep_max_ws_rows value: '-1'
SET @@global.wsrep_max_ws_rows = r;
ERROR 42000: Incorrect argument type to variable 'wsrep_max_ws_rows'
set @@global.wsrep_max_ws_rows = @start_value;
set @start_value = @@wsrep_max_ws_size;
set @@global.wsrep_max_ws_size=256000;
set @@global.wsrep_max_ws_size=0;
Warnings:
Warning 1292 Truncated incorrect wsrep_max_ws_size value: '0'
show warnings;
Level Code Message
Warning 1292 Truncated incorrect wsrep_max_ws_size value: '0'
set @@global.wsrep_max_ws_size=-1;
Warnings:
Warning 1292 Truncated incorrect wsrep_max_ws_size value: '-1'
show warnings;
Level Code Message
Warning 1292 Truncated incorrect wsrep_max_ws_size value: '-1'
SET @@global.wsrep_max_ws_size = r;
ERROR 42000: Incorrect argument type to variable 'wsrep_max_ws_size'
set @@global.wsrep_max_ws_size = @start_value;
set @start_value = @@wsrep_mysql_replication_bundle;
set @@global.wsrep_mysql_replication_bundle=0;
set @@global.wsrep_mysql_replication_bundle=1000;
set @@global.wsrep_mysql_replication_bundle=-1;
Warnings:
Warning 1292 Truncated incorrect wsrep_mysql_replication_bundle value: '-1'
show warnings;
Level Code Message
Warning 1292 Truncated incorrect wsrep_mysql_replication_bundle value: '-1'
set @@global.wsrep_mysql_replication_bundle=1001;
Warnings:
Warning 1292 Truncated incorrect wsrep_mysql_replication_bundle value: '1001'
show warnings;
Level Code Message
Warning 1292 Truncated incorrect wsrep_mysql_replication_bundle value: '1001'
SET @@global.wsrep_mysql_replication_bundle = r;
ERROR 42000: Incorrect argument type to variable 'wsrep_mysql_replication_bundle'
set @@global.wsrep_mysql_replication_bundle = @start_value;
SELECT COUNT(@@GLOBAL.wsrep_node_address);
COUNT(@@GLOBAL.wsrep_node_address)
1
1 Expected
SET @@GLOBAL.wsrep_node_address=1;
ERROR 42000: Incorrect argument type to variable 'wsrep_node_address'
Expected error 'Read only variable'
SELECT COUNT(@@GLOBAL.wsrep_node_address);
COUNT(@@GLOBAL.wsrep_node_address)
1
1 Expected
SELECT @@GLOBAL.wsrep_node_address = VARIABLE_VALUE
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
WHERE VARIABLE_NAME='wsrep_node_address';
@@GLOBAL.wsrep_node_address = VARIABLE_VALUE
1
1 Expected
SELECT COUNT(@@GLOBAL.wsrep_node_address);
COUNT(@@GLOBAL.wsrep_node_address)
1
1 Expected
SELECT COUNT(VARIABLE_VALUE)
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
WHERE VARIABLE_NAME='wsrep_node_address';
COUNT(VARIABLE_VALUE)
1
1 Expected
SELECT @@wsrep_node_address = @@GLOBAL.wsrep_node_address;
@@wsrep_node_address = @@GLOBAL.wsrep_node_address
1
1 Expected
SELECT COUNT(@@wsrep_node_address);
COUNT(@@wsrep_node_address)
1
1 Expected
SELECT COUNT(@@local.wsrep_node_address);
ERROR HY000: Variable 'wsrep_node_address' is a GLOBAL variable
Expected error 'Variable is a GLOBAL variable'
SELECT COUNT(@@SESSION.wsrep_node_address);
ERROR HY000: Variable 'wsrep_node_address' is a GLOBAL variable
Expected error 'Variable is a GLOBAL variable'
SELECT COUNT(@@GLOBAL.wsrep_node_address);
COUNT(@@GLOBAL.wsrep_node_address)
1
1 Expected
SELECT COUNT(@@GLOBAL.wsrep_node_incoming_address);
COUNT(@@GLOBAL.wsrep_node_incoming_address)
1
1 Expected
SET @@GLOBAL.wsrep_node_incoming_address=1;
ERROR 42000: Incorrect argument type to variable 'wsrep_node_incoming_address'
Expected error 'Read only variable'
SELECT COUNT(@@GLOBAL.wsrep_node_incoming_address);
COUNT(@@GLOBAL.wsrep_node_incoming_address)
1
1 Expected
SELECT @@GLOBAL.wsrep_node_incoming_address = VARIABLE_VALUE
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
WHERE VARIABLE_NAME='wsrep_node_incoming_address';
@@GLOBAL.wsrep_node_incoming_address = VARIABLE_VALUE
1
1 Expected
SELECT COUNT(@@GLOBAL.wsrep_node_incoming_address);
COUNT(@@GLOBAL.wsrep_node_incoming_address)
1
1 Expected
SELECT COUNT(VARIABLE_VALUE)
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
WHERE VARIABLE_NAME='wsrep_node_incoming_address';
COUNT(VARIABLE_VALUE)
1
1 Expected
SELECT @@wsrep_node_incoming_address = @@GLOBAL.wsrep_node_incoming_address;
@@wsrep_node_incoming_address = @@GLOBAL.wsrep_node_incoming_address
1
1 Expected
SELECT COUNT(@@wsrep_node_incoming_address);
COUNT(@@wsrep_node_incoming_address)
1
1 Expected
SELECT COUNT(@@local.wsrep_node_incoming_address);
ERROR HY000: Variable 'wsrep_node_incoming_address' is a GLOBAL variable
Expected error 'Variable is a GLOBAL variable'
SELECT COUNT(@@SESSION.wsrep_node_incoming_address);
ERROR HY000: Variable 'wsrep_node_incoming_address' is a GLOBAL variable
Expected error 'Variable is a GLOBAL variable'
SELECT COUNT(@@GLOBAL.wsrep_node_incoming_address);
COUNT(@@GLOBAL.wsrep_node_incoming_address)
1
1 Expected
set @start_value = @@wsrep_node_name;
set @@global.wsrep_node_name='test';
set @@global.wsrep_node_name=NULL;
SET @@global.wsrep_node_name = 1;
ERROR 42000: Incorrect argument type to variable 'wsrep_node_name'
set @@global.wsrep_node_name = @start_value;
set @start_value = @@wsrep_notify_cmd;
set @@global.wsrep_notify_cmd='test';
set @@global.wsrep_notify_cmd=NULL;
SET @@global.wsrep_notify_cmd = 1;
ERROR 42000: Incorrect argument type to variable 'wsrep_notify_cmd'
set @@global.wsrep_notify_cmd = @start_value;
set @start_value = @@wsrep_on;
set @@global.wsrep_on=ON;
set @@global.wsrep_on=OFF;
set @@global.wsrep_on=1;
set @@global.wsrep_on=0;
SET @@global.wsrep_on = -1;
ERROR 42000: Variable 'wsrep_on' can't be set to the value of '-1'
set @@global.wsrep_on = @start_value;
set @start_value = @@wsrep_osu_method;
set @@global.wsrep_osu_method='TOI';
set @@global.wsrep_osu_method='RSU';
set @@global.wsrep_osu_method=TOI;
set @@global.wsrep_osu_method=RSU;
set @@global.wsrep_osu_method=TSU;
ERROR 42000: Variable 'wsrep_OSU_method' can't be set to the value of 'TSU'
set @@global.wsrep_osu_method='TSU';
ERROR 42000: Variable 'wsrep_OSU_method' can't be set to the value of 'TSU'
SET @@global.wsrep_on = -1;
ERROR 42000: Variable 'wsrep_on' can't be set to the value of '-1'
set @@global.wsrep_osu_method = @start_value;
SELECT COUNT(@@GLOBAL.wsrep_provider);
COUNT(@@GLOBAL.wsrep_provider)
1
1 Expected
SELECT COUNT(@@GLOBAL.wsrep_provider_options);
COUNT(@@GLOBAL.wsrep_provider_options)
1
1 Expected
SELECT COUNT(@@GLOBAL.wsrep_recover);
COUNT(@@GLOBAL.wsrep_recover)
1
1 Expected
set @@global.wsrep_recover=ON;
ERROR HY000: Variable 'wsrep_recover' is a read only variable
Expected error 'Readonly variable'
set @@global.wsrep_recover=OFF;
ERROR HY000: Variable 'wsrep_recover' is a read only variable
Expected error 'Readonly variable'
SELECT @@GLOBAL.wsrep_recover = VARIABLE_VALUE
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
WHERE VARIABLE_NAME='wsrep_recover';
@@GLOBAL.wsrep_recover = VARIABLE_VALUE
1
Warnings:
Warning 1292 Truncated incorrect DOUBLE value: 'OFF'
1 Expected
SELECT COUNT(@@GLOBAL.wsrep_recover);
COUNT(@@GLOBAL.wsrep_recover)
1
1 Expected
SELECT COUNT(VARIABLE_VALUE)
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
WHERE VARIABLE_NAME='wsrep_recover';
COUNT(VARIABLE_VALUE)
1
1 Expected
SELECT @@wsrep_recover = @@GLOBAL.wsrep_recover;
@@wsrep_recover = @@GLOBAL.wsrep_recover
1
1 Expected
SELECT COUNT(@@wsrep_recover);
COUNT(@@wsrep_recover)
1
1 Expected
SELECT COUNT(@@local.wsrep_recover);
ERROR HY000: Variable 'wsrep_recover' is a GLOBAL variable
Expected error 'Variable is a GLOBAL variable'
SELECT COUNT(@@SESSION.wsrep_recover);
ERROR HY000: Variable 'wsrep_recover' is a GLOBAL variable
Expected error 'Variable is a GLOBAL variable'
SELECT COUNT(@@GLOBAL.wsrep_recover);
COUNT(@@GLOBAL.wsrep_recover)
1
1 Expected
SELECT wsrep_recover = @@SESSION.wsrep_recover;
ERROR 42S22: Unknown column 'wsrep_recover' in 'field list'
Expected error 'Readonly variable'
set @start_value = @@wsrep_replicate_myisam;
set @@global.wsrep_replicate_myisam=ON;
set @@global.wsrep_replicate_myisam=OFF;
set @@global.wsrep_replicate_myisam=1;
set @@global.wsrep_replicate_myisam=0;
SET @@global.wsrep_replicate_myisam = -1;
ERROR 42000: Variable 'wsrep_replicate_myisam' can't be set to the value of '-1'
set @@global.wsrep_replicate_myisam = @start_value;
set @start_value = @@wsrep_restart_slave;
set @@global.wsrep_restart_slave=ON;
set @@global.wsrep_restart_slave=OFF;
set @@global.wsrep_restart_slave=1;
set @@global.wsrep_restart_slave=0;
SET @@global.wsrep_restart_slave = -1;
ERROR 42000: Variable 'wsrep_restart_slave' can't be set to the value of '-1'
set @@global.wsrep_restart_slave = @start_value;
set @start_value = @@wsrep_restart_slave;
set @@global.wsrep_restart_slave=ON;
set @@global.wsrep_restart_slave=OFF;
set @@global.wsrep_restart_slave=1;
set @@global.wsrep_restart_slave=0;
SET @@global.wsrep_restart_slave = -1;
ERROR 42000: Variable 'wsrep_restart_slave' can't be set to the value of '-1'
set @@global.wsrep_restart_slave = @start_value;
#
# wsrep_slave_fk_checks
#
# save the initial value
SET @wsrep_slave_fk_checks_global_saved = @@global.wsrep_slave_fk_checks;
# default
SELECT @@global.wsrep_slave_fk_checks;
@@global.wsrep_slave_fk_checks
1
# scope
SELECT @@session.wsrep_slave_fk_checks;
ERROR HY000: Variable 'wsrep_slave_FK_checks' is a GLOBAL variable
SET @@global.wsrep_slave_fk_checks=OFF;
SELECT @@global.wsrep_slave_fk_checks;
@@global.wsrep_slave_fk_checks
0
SET @@global.wsrep_slave_fk_checks=ON;
SELECT @@global.wsrep_slave_fk_checks;
@@global.wsrep_slave_fk_checks
1
# valid values
SET @@global.wsrep_slave_fk_checks='OFF';
SELECT @@global.wsrep_slave_fk_checks;
@@global.wsrep_slave_fk_checks
0
SET @@global.wsrep_slave_fk_checks=ON;
SELECT @@global.wsrep_slave_fk_checks;
@@global.wsrep_slave_fk_checks
1
SET @@global.wsrep_slave_fk_checks=default;
SELECT @@global.wsrep_slave_fk_checks;
@@global.wsrep_slave_fk_checks
1
# invalid values
SET @@global.wsrep_slave_fk_checks=NULL;
ERROR 42000: Variable 'wsrep_slave_FK_checks' can't be set to the value of 'NULL'
SET @@global.wsrep_slave_fk_checks='junk';
ERROR 42000: Variable 'wsrep_slave_FK_checks' can't be set to the value of 'junk'
# restore the initial value
SET @@global.wsrep_slave_fk_checks = @wsrep_slave_fk_checks_global_saved;
# End of test
set @start_value = @@wsrep_slave_threads;
set @@global.wsrep_slave_threads=1;
set @@global.wsrep_slave_threads=4;
show warnings;
Level Code Message
set @@global.wsrep_slave_threads=0;
Warnings:
Warning 1292 Truncated incorrect wsrep_slave_threads value: '0'
show warnings;
Level Code Message
Warning 1292 Truncated incorrect wsrep_slave_threads value: '0'
set @@global.wsrep_slave_threads=-1;
Warnings:
Warning 1292 Truncated incorrect wsrep_slave_threads value: '-1'
show warnings;
Level Code Message
Warning 1292 Truncated incorrect wsrep_slave_threads value: '-1'
SET @@global.wsrep_slave_threads = r;
ERROR 42000: Incorrect argument type to variable 'wsrep_slave_threads'
set @@global.wsrep_slave_threads = @start_value;
#
# wsrep_slave_uk_checks
#
# save the initial value
SET @wsrep_slave_uk_checks_global_saved = @@global.wsrep_slave_uk_checks;
# default
SELECT @@global.wsrep_slave_uk_checks;
@@global.wsrep_slave_uk_checks
0
# scope
SELECT @@session.wsrep_slave_uk_checks;
ERROR HY000: Variable 'wsrep_slave_UK_checks' is a GLOBAL variable
SET @@global.wsrep_slave_uk_checks=OFF;
SELECT @@global.wsrep_slave_uk_checks;
@@global.wsrep_slave_uk_checks
0
SET @@global.wsrep_slave_uk_checks=ON;
SELECT @@global.wsrep_slave_uk_checks;
@@global.wsrep_slave_uk_checks
1
# valid values
SET @@global.wsrep_slave_uk_checks='OFF';
SELECT @@global.wsrep_slave_uk_checks;
@@global.wsrep_slave_uk_checks
0
SET @@global.wsrep_slave_uk_checks=ON;
SELECT @@global.wsrep_slave_uk_checks;
@@global.wsrep_slave_uk_checks
1
SET @@global.wsrep_slave_uk_checks=default;
SELECT @@global.wsrep_slave_uk_checks;
@@global.wsrep_slave_uk_checks
0
# invalid values
SET @@global.wsrep_slave_uk_checks=NULL;
ERROR 42000: Variable 'wsrep_slave_UK_checks' can't be set to the value of 'NULL'
SET @@global.wsrep_slave_uk_checks='junk';
ERROR 42000: Variable 'wsrep_slave_UK_checks' can't be set to the value of 'junk'
# restore the initial value
SET @@global.wsrep_slave_uk_checks = @wsrep_slave_uk_checks_global_saved;
# End of test
SELECT COUNT(@@wsrep_sst_auth);
COUNT(@@wsrep_sst_auth)
0
SELECT COUNT(@@wsrep_sst_donor);
COUNT(@@wsrep_sst_donor)
1
set @start_value = @@wsrep_sst_donor;
set @@global.wsrep_sst_donor='foo';
set @@global.wsrep_sst_donor=NULL;
set @@global.wsrep_sst_donor=r;
set @@global.wsrep_sst_donor=1;
ERROR 42000: Incorrect argument type to variable 'wsrep_sst_donor'
set @@global.wsrep_sst_donor = @start_value;
set @start_value = @@wsrep_sst_donor_rejects_queries;
set @@global.wsrep_sst_donor_rejects_queries=ON;
set @@global.wsrep_sst_donor_rejects_queries=OFF;
set @@global.wsrep_sst_donor_rejects_queries=1;
set @@global.wsrep_sst_donor_rejects_queries=0;
SET @@global.wsrep_sst_donor_rejects_queries = -1;
ERROR 42000: Variable 'wsrep_sst_donor_rejects_queries' can't be set to the value of '-1'
set @@global.wsrep_sst_donor_rejects_queries = @start_value;
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment