Merge branch '10.2' into 10.3
This commit is contained in:
commit
b1818dccf7
@ -1174,11 +1174,7 @@ int main(int argc,char *argv[])
|
||||
close(stdout_fileno_copy); /* Clean up dup(). */
|
||||
}
|
||||
|
||||
if (load_defaults("my",load_default_groups,&argc,&argv))
|
||||
{
|
||||
my_end(0);
|
||||
exit(1);
|
||||
}
|
||||
load_defaults_or_exit("my", load_default_groups, &argc, &argv);
|
||||
defaults_argv=argv;
|
||||
if ((status.exit_status= get_options(argc, (char **) argv)))
|
||||
{
|
||||
@ -1231,15 +1227,17 @@ int main(int argc,char *argv[])
|
||||
window_resize(0);
|
||||
#endif
|
||||
|
||||
put_info("Welcome to the MariaDB monitor. Commands end with ; or \\g.",
|
||||
INFO_INFO);
|
||||
my_snprintf((char*) glob_buffer.ptr(), glob_buffer.alloced_length(),
|
||||
"Your %s connection id is %lu\nServer version: %s\n",
|
||||
mysql_get_server_name(&mysql),
|
||||
mysql_thread_id(&mysql), server_version_string(&mysql));
|
||||
put_info((char*) glob_buffer.ptr(),INFO_INFO);
|
||||
|
||||
put_info(ORACLE_WELCOME_COPYRIGHT_NOTICE("2000"), INFO_INFO);
|
||||
if (!status.batch)
|
||||
{
|
||||
put_info("Welcome to the MariaDB monitor. Commands end with ; or \\g.",
|
||||
INFO_INFO);
|
||||
my_snprintf((char*) glob_buffer.ptr(), glob_buffer.alloced_length(),
|
||||
"Your %s connection id is %lu\nServer version: %s\n",
|
||||
mysql_get_server_name(&mysql),
|
||||
mysql_thread_id(&mysql), server_version_string(&mysql));
|
||||
put_info((char*) glob_buffer.ptr(),INFO_INFO);
|
||||
put_info(ORACLE_WELCOME_COPYRIGHT_NOTICE("2000"), INFO_INFO);
|
||||
}
|
||||
|
||||
#ifdef HAVE_READLINE
|
||||
initialize_readline((char*) my_progname);
|
||||
|
@ -1141,6 +1141,8 @@ int main(int argc, char **argv)
|
||||
char self_name[FN_REFLEN + 1];
|
||||
|
||||
MY_INIT(argv[0]);
|
||||
load_defaults_or_exit("my", load_default_groups, &argc, &argv);
|
||||
defaults_argv= argv; /* Must be freed by 'free_defaults' */
|
||||
|
||||
#if __WIN__
|
||||
if (GetModuleFileName(NULL, self_name, FN_REFLEN) == 0)
|
||||
@ -1153,10 +1155,6 @@ int main(int argc, char **argv)
|
||||
init_dynamic_string(&conn_args, "", 512, 256))
|
||||
die("Out of memory");
|
||||
|
||||
if (load_defaults("my", load_default_groups, &argc, &argv))
|
||||
die(NULL);
|
||||
defaults_argv= argv; /* Must be freed by 'free_defaults' */
|
||||
|
||||
if (handle_options(&argc, &argv, my_long_options, get_one_option))
|
||||
die(NULL);
|
||||
if (debug_info_flag)
|
||||
|
@ -320,8 +320,7 @@ int main(int argc,char *argv[])
|
||||
MY_INIT(argv[0]);
|
||||
mysql_init(&mysql);
|
||||
sf_leaking_memory=1; /* don't report memory leaks on early exits */
|
||||
if ((error= load_defaults("my",load_default_groups,&argc,&argv)))
|
||||
goto err1;
|
||||
load_defaults_or_exit("my", load_default_groups, &argc, &argv);
|
||||
save_argv = argv; /* Save for free_defaults */
|
||||
|
||||
if ((error=handle_options(&argc, &argv, my_long_options, get_one_option)))
|
||||
@ -501,10 +500,8 @@ err2:
|
||||
my_free(shared_memory_base_name);
|
||||
#endif
|
||||
free_defaults(save_argv);
|
||||
err1:
|
||||
my_end(my_end_arg);
|
||||
exit(error);
|
||||
return 0;
|
||||
return error;
|
||||
}
|
||||
|
||||
|
||||
|
@ -3008,9 +3008,7 @@ int main(int argc, char** argv)
|
||||
my_init_time(); // for time functions
|
||||
tzset(); // set tzname
|
||||
|
||||
if (load_defaults("my", load_groups, &argc, &argv))
|
||||
exit(1);
|
||||
|
||||
load_defaults_or_exit("my", load_groups, &argc, &argv);
|
||||
defaults_argv= argv;
|
||||
|
||||
if (!(binlog_filter= new Rpl_filter))
|
||||
|
@ -1181,9 +1181,7 @@ int main(int argc, char **argv)
|
||||
/*
|
||||
** Check out the args
|
||||
*/
|
||||
if (load_defaults("my", load_default_groups, &argc, &argv))
|
||||
goto end2;
|
||||
|
||||
load_defaults_or_exit("my", load_default_groups, &argc, &argv);
|
||||
defaults_argv= argv;
|
||||
if (get_options(&argc, &argv))
|
||||
goto end1;
|
||||
@ -1259,7 +1257,6 @@ int main(int argc, char **argv)
|
||||
my_free(shared_memory_base_name);
|
||||
mysql_library_end();
|
||||
free_defaults(defaults_argv);
|
||||
end2:
|
||||
my_end(my_end_arg);
|
||||
return ret;
|
||||
} /* main */
|
||||
|
@ -981,8 +981,7 @@ static int get_options(int *argc, char ***argv)
|
||||
opt_net_buffer_length= *mysql_params->p_net_buffer_length;
|
||||
|
||||
md_result_file= stdout;
|
||||
if (load_defaults("my",load_default_groups,argc,argv))
|
||||
return 1;
|
||||
load_defaults_or_exit("my", load_default_groups, argc, argv);
|
||||
defaults_argv= *argv;
|
||||
|
||||
if (my_hash_init(&ignore_table, charset_info, 16, 0, 0,
|
||||
|
@ -643,8 +643,7 @@ int main(int argc, char **argv)
|
||||
MY_INIT(argv[0]);
|
||||
sf_leaking_memory=1; /* don't report memory leaks on early exits */
|
||||
|
||||
if (load_defaults("my",load_default_groups,&argc,&argv))
|
||||
return 1;
|
||||
load_defaults_or_exit("my", load_default_groups, &argc, &argv);
|
||||
/* argv is changed in the program */
|
||||
argv_to_free= argv;
|
||||
if (get_options(&argc, &argv))
|
||||
|
@ -72,8 +72,7 @@ int main(int argc, char **argv)
|
||||
static char **defaults_argv;
|
||||
MY_INIT(argv[0]);
|
||||
sf_leaking_memory=1; /* don't report memory leaks on early exits */
|
||||
if (load_defaults("my",load_default_groups,&argc,&argv))
|
||||
exit(1);
|
||||
load_defaults_or_exit("my", load_default_groups, &argc, &argv);
|
||||
defaults_argv=argv;
|
||||
|
||||
get_options(&argc,&argv);
|
||||
|
@ -325,11 +325,7 @@ int main(int argc, char **argv)
|
||||
MY_INIT(argv[0]);
|
||||
sf_leaking_memory=1; /* don't report memory leaks on early exits */
|
||||
|
||||
if (load_defaults("my",load_default_groups,&argc,&argv))
|
||||
{
|
||||
my_end(0);
|
||||
exit(1);
|
||||
}
|
||||
load_defaults_or_exit("my", load_default_groups, &argc, &argv);
|
||||
defaults_argv=argv;
|
||||
if (get_options(&argc,&argv))
|
||||
{
|
||||
|
@ -2723,7 +2723,8 @@ void var_query_set(VAR *var, const char *query, const char** query_end)
|
||||
init_dynamic_string(&ds_query, 0, (end - query) + 32, 256);
|
||||
do_eval(&ds_query, query, end, FALSE);
|
||||
|
||||
if (mysql_real_query(mysql, ds_query.str, (ulong)ds_query.length))
|
||||
if (mysql_real_query(mysql, ds_query.str, (ulong)ds_query.length) ||
|
||||
!(res= mysql_store_result(mysql)))
|
||||
{
|
||||
handle_error(curr_command, mysql_errno(mysql), mysql_error(mysql),
|
||||
mysql_sqlstate(mysql), &ds_res);
|
||||
@ -2733,13 +2734,6 @@ void var_query_set(VAR *var, const char *query, const char** query_end)
|
||||
DBUG_VOID_RETURN;
|
||||
}
|
||||
|
||||
if (!(res= mysql_store_result(mysql)))
|
||||
{
|
||||
report_or_die("Query '%s' didn't return a result set", ds_query.str);
|
||||
dynstr_free(&ds_query);
|
||||
eval_expr(var, "", 0);
|
||||
DBUG_VOID_RETURN;
|
||||
}
|
||||
dynstr_free(&ds_query);
|
||||
|
||||
if ((row= mysql_fetch_row(res)) && row[0])
|
||||
@ -7335,9 +7329,7 @@ get_one_option(int optid, const struct my_option *opt, char *argument)
|
||||
|
||||
int parse_args(int argc, char **argv)
|
||||
{
|
||||
if (load_defaults("my",load_default_groups,&argc,&argv))
|
||||
exit(1);
|
||||
|
||||
load_defaults_or_exit("my", load_default_groups, &argc, &argv);
|
||||
default_argv= argv;
|
||||
|
||||
if ((handle_options(&argc, &argv, my_long_options, get_one_option)))
|
||||
|
@ -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 "21")
|
||||
SET(WSREP_PATCH_VERSION "23")
|
||||
|
||||
# Obtain wsrep API version
|
||||
FILE(STRINGS "${MySQL_SOURCE_DIR}/wsrep/wsrep_api.h" WSREP_API_VERSION
|
||||
|
@ -1010,6 +1010,9 @@ CHECK_INCLUDE_FILE(ucontext.h HAVE_UCONTEXT_H)
|
||||
IF(NOT HAVE_UCONTEXT_H)
|
||||
CHECK_INCLUDE_FILE(sys/ucontext.h HAVE_UCONTEXT_H)
|
||||
ENDIF()
|
||||
IF(HAVE_UCONTEXT_H)
|
||||
CHECK_FUNCTION_EXISTS(makecontext HAVE_UCONTEXT_H)
|
||||
ENDIF()
|
||||
|
||||
CHECK_STRUCT_HAS_MEMBER("struct timespec" tv_sec "time.h" STRUCT_TIMESPEC_HAS_TV_SEC)
|
||||
CHECK_STRUCT_HAS_MEMBER("struct timespec" tv_nsec "time.h" STRUCT_TIMESPEC_HAS_TV_NSEC)
|
||||
|
2
debian/control
vendored
2
debian/control
vendored
@ -35,8 +35,8 @@ Build-Depends: bison,
|
||||
zlib1g-dev (>= 1:1.1.3-5~)
|
||||
Standards-Version: 3.8.2
|
||||
Homepage: http://mariadb.org/
|
||||
Vcs-Git: https://github.com/MariaDB/server.git
|
||||
Vcs-Browser: https://github.com/MariaDB/server/
|
||||
Vcs-Git: https://github.com/MariaDB/server.git
|
||||
|
||||
Package: libmariadb-dev
|
||||
Architecture: any
|
||||
|
@ -64,7 +64,7 @@ MYSQL_ADD_EXECUTABLE(mariabackup
|
||||
datasink.c
|
||||
ds_buffer.c
|
||||
ds_compress.c
|
||||
ds_local.c
|
||||
ds_local.cc
|
||||
ds_stdout.c
|
||||
ds_tmpfile.c
|
||||
ds_xbstream.c
|
||||
@ -101,7 +101,7 @@ ENDIF()
|
||||
########################################################################
|
||||
MYSQL_ADD_EXECUTABLE(mbstream
|
||||
ds_buffer.c
|
||||
ds_local.c
|
||||
ds_local.cc
|
||||
ds_stdout.c
|
||||
datasink.c
|
||||
xbstream.c
|
||||
@ -115,6 +115,7 @@ TARGET_LINK_LIBRARIES(mbstream
|
||||
mysys
|
||||
crc
|
||||
)
|
||||
ADD_DEPENDENCIES(mbstream GenError)
|
||||
|
||||
IF(MSVC)
|
||||
SET_TARGET_PROPERTIES(mbstream PROPERTIES LINK_FLAGS setargv.obj)
|
||||
|
@ -28,7 +28,9 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
#include <my_sys.h>
|
||||
|
||||
|
||||
# define fil_is_user_tablespace_id(i) ((i) > srv_undo_tablespaces_open)
|
||||
/** Determine if (i) is a user tablespace id or not. */
|
||||
# define fil_is_user_tablespace_id(i) (i != 0 \
|
||||
&& !srv_is_undo_tablespace(i))
|
||||
|
||||
#ifdef _MSC_VER
|
||||
#define stat _stati64
|
||||
|
@ -109,7 +109,7 @@ Write to a datasink file.
|
||||
int
|
||||
ds_write(ds_file_t *file, const void *buf, size_t len)
|
||||
{
|
||||
return file->datasink->write(file, buf, len);
|
||||
return file->datasink->write(file, (const uchar *)buf, len);
|
||||
}
|
||||
|
||||
/************************************************************************
|
||||
|
@ -48,7 +48,7 @@ typedef struct {
|
||||
struct datasink_struct {
|
||||
ds_ctxt_t *(*init)(const char *root);
|
||||
ds_file_t *(*open)(ds_ctxt_t *ctxt, const char *path, MY_STAT *stat);
|
||||
int (*write)(ds_file_t *file, const void *buf, size_t len);
|
||||
int (*write)(ds_file_t *file, const unsigned char *buf, size_t len);
|
||||
int (*close)(ds_file_t *file);
|
||||
void (*deinit)(ds_ctxt_t *ctxt);
|
||||
};
|
||||
|
@ -45,7 +45,7 @@ typedef struct {
|
||||
static ds_ctxt_t *buffer_init(const char *root);
|
||||
static ds_file_t *buffer_open(ds_ctxt_t *ctxt, const char *path,
|
||||
MY_STAT *mystat);
|
||||
static int buffer_write(ds_file_t *file, const void *buf, size_t len);
|
||||
static int buffer_write(ds_file_t *file, const uchar *buf, size_t len);
|
||||
static int buffer_close(ds_file_t *file);
|
||||
static void buffer_deinit(ds_ctxt_t *ctxt);
|
||||
|
||||
@ -119,7 +119,7 @@ buffer_open(ds_ctxt_t *ctxt, const char *path, MY_STAT *mystat)
|
||||
}
|
||||
|
||||
static int
|
||||
buffer_write(ds_file_t *file, const void *buf, size_t len)
|
||||
buffer_write(ds_file_t *file, const uchar *buf, size_t len)
|
||||
{
|
||||
ds_buffer_file_t *buffer_file;
|
||||
|
||||
@ -142,7 +142,7 @@ buffer_write(ds_file_t *file, const void *buf, size_t len)
|
||||
|
||||
buffer_file->pos = 0;
|
||||
|
||||
buf = (const char *) buf + bytes;
|
||||
buf += bytes;
|
||||
len -= bytes;
|
||||
} else {
|
||||
/* We don't have any buffered bytes, just write
|
||||
|
@ -66,7 +66,7 @@ extern ulonglong xtrabackup_compress_chunk_size;
|
||||
static ds_ctxt_t *compress_init(const char *root);
|
||||
static ds_file_t *compress_open(ds_ctxt_t *ctxt, const char *path,
|
||||
MY_STAT *mystat);
|
||||
static int compress_write(ds_file_t *file, const void *buf, size_t len);
|
||||
static int compress_write(ds_file_t *file, const uchar *buf, size_t len);
|
||||
static int compress_close(ds_file_t *file);
|
||||
static void compress_deinit(ds_ctxt_t *ctxt);
|
||||
|
||||
@ -179,7 +179,7 @@ err:
|
||||
|
||||
static
|
||||
int
|
||||
compress_write(ds_file_t *file, const void *buf, size_t len)
|
||||
compress_write(ds_file_t *file, const uchar *buf, size_t len)
|
||||
{
|
||||
ds_compress_file_t *comp_file;
|
||||
ds_compress_ctxt_t *comp_ctxt;
|
||||
|
@ -1,151 +0,0 @@
|
||||
/******************************************************
|
||||
Copyright (c) 2011-2013 Percona LLC and/or its affiliates.
|
||||
|
||||
Local datasink implementation for XtraBackup.
|
||||
|
||||
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 Street, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
|
||||
*******************************************************/
|
||||
|
||||
#include <my_global.h>
|
||||
#include <my_base.h>
|
||||
#include <mysys_err.h>
|
||||
#include "common.h"
|
||||
#include "datasink.h"
|
||||
|
||||
typedef struct {
|
||||
File fd;
|
||||
} ds_local_file_t;
|
||||
|
||||
static ds_ctxt_t *local_init(const char *root);
|
||||
static ds_file_t *local_open(ds_ctxt_t *ctxt, const char *path,
|
||||
MY_STAT *mystat);
|
||||
static int local_write(ds_file_t *file, const void *buf, size_t len);
|
||||
static int local_close(ds_file_t *file);
|
||||
static void local_deinit(ds_ctxt_t *ctxt);
|
||||
|
||||
datasink_t datasink_local = {
|
||||
&local_init,
|
||||
&local_open,
|
||||
&local_write,
|
||||
&local_close,
|
||||
&local_deinit
|
||||
};
|
||||
|
||||
static
|
||||
ds_ctxt_t *
|
||||
local_init(const char *root)
|
||||
{
|
||||
ds_ctxt_t *ctxt;
|
||||
|
||||
if (my_mkdir(root, 0777, MYF(0)) < 0
|
||||
&& my_errno != EEXIST && my_errno != EISDIR)
|
||||
{
|
||||
char errbuf[MYSYS_STRERROR_SIZE];
|
||||
my_strerror(errbuf, sizeof(errbuf),my_errno);
|
||||
my_error(EE_CANT_MKDIR, MYF(ME_BELL | ME_WAITTANG),
|
||||
root, my_errno,errbuf, my_errno);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
ctxt = my_malloc(sizeof(ds_ctxt_t), MYF(MY_FAE));
|
||||
|
||||
ctxt->root = my_strdup(root, MYF(MY_FAE));
|
||||
|
||||
return ctxt;
|
||||
}
|
||||
|
||||
static
|
||||
ds_file_t *
|
||||
local_open(ds_ctxt_t *ctxt, const char *path,
|
||||
MY_STAT *mystat __attribute__((unused)))
|
||||
{
|
||||
char fullpath[FN_REFLEN];
|
||||
char dirpath[FN_REFLEN];
|
||||
size_t dirpath_len;
|
||||
size_t path_len;
|
||||
ds_local_file_t *local_file;
|
||||
ds_file_t *file;
|
||||
File fd;
|
||||
|
||||
fn_format(fullpath, path, ctxt->root, "", MYF(MY_RELATIVE_PATH));
|
||||
|
||||
/* Create the directory if needed */
|
||||
dirname_part(dirpath, fullpath, &dirpath_len);
|
||||
if (my_mkdir(dirpath, 0777, MYF(0)) < 0 && my_errno != EEXIST) {
|
||||
char errbuf[MYSYS_STRERROR_SIZE];
|
||||
my_strerror(errbuf, sizeof(errbuf), my_errno);
|
||||
my_error(EE_CANT_MKDIR, MYF(ME_BELL | ME_WAITTANG),
|
||||
dirpath, my_errno, errbuf);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
fd = my_create(fullpath, 0, O_WRONLY | O_BINARY | O_EXCL | O_NOFOLLOW,
|
||||
MYF(MY_WME));
|
||||
if (fd < 0) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
path_len = strlen(fullpath) + 1; /* terminating '\0' */
|
||||
|
||||
file = (ds_file_t *) my_malloc(sizeof(ds_file_t) +
|
||||
sizeof(ds_local_file_t) +
|
||||
path_len,
|
||||
MYF(MY_FAE));
|
||||
local_file = (ds_local_file_t *) (file + 1);
|
||||
|
||||
local_file->fd = fd;
|
||||
|
||||
file->path = (char *) local_file + sizeof(ds_local_file_t);
|
||||
memcpy(file->path, fullpath, path_len);
|
||||
|
||||
file->ptr = local_file;
|
||||
|
||||
return file;
|
||||
}
|
||||
|
||||
static
|
||||
int
|
||||
local_write(ds_file_t *file, const void *buf, size_t len)
|
||||
{
|
||||
File fd = ((ds_local_file_t *) file->ptr)->fd;
|
||||
|
||||
if (!my_write(fd, buf, len, MYF(MY_WME | MY_NABP))) {
|
||||
posix_fadvise(fd, 0, 0, POSIX_FADV_DONTNEED);
|
||||
return 0;
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
static
|
||||
int
|
||||
local_close(ds_file_t *file)
|
||||
{
|
||||
File fd = ((ds_local_file_t *) file->ptr)->fd;
|
||||
|
||||
my_free(file);
|
||||
|
||||
my_sync(fd, MYF(MY_WME));
|
||||
|
||||
return my_close(fd, MYF(MY_WME));
|
||||
}
|
||||
|
||||
static
|
||||
void
|
||||
local_deinit(ds_ctxt_t *ctxt)
|
||||
{
|
||||
my_free(ctxt->root);
|
||||
my_free(ctxt);
|
||||
}
|
258
extra/mariabackup/ds_local.cc
Normal file
258
extra/mariabackup/ds_local.cc
Normal file
@ -0,0 +1,258 @@
|
||||
/******************************************************
|
||||
Copyright (c) 2011-2013 Percona LLC and/or its affiliates.
|
||||
|
||||
Local datasink implementation for XtraBackup.
|
||||
|
||||
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 Street, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
|
||||
*******************************************************/
|
||||
|
||||
#include <my_global.h>
|
||||
#include <my_base.h>
|
||||
#include <mysys_err.h>
|
||||
#include "common.h"
|
||||
#include "datasink.h"
|
||||
#include "univ.i"
|
||||
#include "fsp0fsp.h"
|
||||
#ifdef _WIN32
|
||||
#include <winioctl.h>
|
||||
#endif
|
||||
|
||||
typedef struct {
|
||||
File fd;
|
||||
my_bool init_ibd_done;
|
||||
my_bool is_ibd;
|
||||
my_bool compressed;
|
||||
size_t pagesize;
|
||||
} ds_local_file_t;
|
||||
|
||||
static ds_ctxt_t *local_init(const char *root);
|
||||
static ds_file_t *local_open(ds_ctxt_t *ctxt, const char *path,
|
||||
MY_STAT *mystat);
|
||||
static int local_write(ds_file_t *file, const uchar *buf, size_t len);
|
||||
static int local_close(ds_file_t *file);
|
||||
static void local_deinit(ds_ctxt_t *ctxt);
|
||||
|
||||
extern "C" {
|
||||
datasink_t datasink_local = {
|
||||
&local_init,
|
||||
&local_open,
|
||||
&local_write,
|
||||
&local_close,
|
||||
&local_deinit
|
||||
};
|
||||
}
|
||||
|
||||
static
|
||||
ds_ctxt_t *
|
||||
local_init(const char *root)
|
||||
{
|
||||
ds_ctxt_t *ctxt;
|
||||
|
||||
if (my_mkdir(root, 0777, MYF(0)) < 0
|
||||
&& my_errno != EEXIST && my_errno != EISDIR)
|
||||
{
|
||||
char errbuf[MYSYS_STRERROR_SIZE];
|
||||
my_strerror(errbuf, sizeof(errbuf),my_errno);
|
||||
my_error(EE_CANT_MKDIR, MYF(ME_BELL | ME_WAITTANG),
|
||||
root, my_errno,errbuf, my_errno);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
ctxt = (ds_ctxt_t *)my_malloc(sizeof(ds_ctxt_t), MYF(MY_FAE));
|
||||
|
||||
ctxt->root = my_strdup(root, MYF(MY_FAE));
|
||||
|
||||
return ctxt;
|
||||
}
|
||||
|
||||
static
|
||||
ds_file_t *
|
||||
local_open(ds_ctxt_t *ctxt, const char *path,
|
||||
MY_STAT *mystat __attribute__((unused)))
|
||||
{
|
||||
char fullpath[FN_REFLEN];
|
||||
char dirpath[FN_REFLEN];
|
||||
size_t dirpath_len;
|
||||
size_t path_len;
|
||||
ds_local_file_t *local_file;
|
||||
ds_file_t *file;
|
||||
File fd;
|
||||
|
||||
fn_format(fullpath, path, ctxt->root, "", MYF(MY_RELATIVE_PATH));
|
||||
|
||||
/* Create the directory if needed */
|
||||
dirname_part(dirpath, fullpath, &dirpath_len);
|
||||
if (my_mkdir(dirpath, 0777, MYF(0)) < 0 && my_errno != EEXIST) {
|
||||
char errbuf[MYSYS_STRERROR_SIZE];
|
||||
my_strerror(errbuf, sizeof(errbuf), my_errno);
|
||||
my_error(EE_CANT_MKDIR, MYF(ME_BELL | ME_WAITTANG),
|
||||
dirpath, my_errno, errbuf);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
fd = my_create(fullpath, 0, O_WRONLY | O_BINARY | O_EXCL | O_NOFOLLOW,
|
||||
MYF(MY_WME));
|
||||
if (fd < 0) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
path_len = strlen(fullpath) + 1; /* terminating '\0' */
|
||||
|
||||
file = (ds_file_t *) my_malloc(sizeof(ds_file_t) +
|
||||
sizeof(ds_local_file_t) +
|
||||
path_len,
|
||||
MYF(MY_FAE));
|
||||
local_file = (ds_local_file_t *) (file + 1);
|
||||
|
||||
local_file->fd = fd;
|
||||
local_file->init_ibd_done = 0;
|
||||
local_file->is_ibd = (path_len > 5) && !strcmp(fullpath + path_len - 5, ".ibd");
|
||||
local_file->compressed = 0;
|
||||
local_file->pagesize = 0;
|
||||
file->path = (char *) local_file + sizeof(ds_local_file_t);
|
||||
memcpy(file->path, fullpath, path_len);
|
||||
|
||||
file->ptr = local_file;
|
||||
|
||||
return file;
|
||||
}
|
||||
|
||||
/* Calculate size of data without trailing zero bytes. */
|
||||
static size_t trim_binary_zeros(uchar *buf, size_t pagesize)
|
||||
{
|
||||
size_t i;
|
||||
for (i = pagesize; (i > 0) && (buf[i - 1] == 0); i--) {};
|
||||
return i;
|
||||
}
|
||||
|
||||
|
||||
/* Write data to the output file, and punch "holes" if needed. */
|
||||
static int write_compressed(File fd, uchar *data, size_t len, size_t pagesize)
|
||||
{
|
||||
uchar *ptr = data;
|
||||
for (size_t written= 0; written < len;)
|
||||
{
|
||||
size_t n_bytes = MY_MIN(pagesize, len - written);
|
||||
size_t datasize= trim_binary_zeros(ptr,n_bytes);
|
||||
if (datasize > 0) {
|
||||
if (!my_write(fd, ptr, datasize, MYF(MY_WME | MY_NABP)))
|
||||
posix_fadvise(fd, 0, 0, POSIX_FADV_DONTNEED);
|
||||
else
|
||||
return 1;
|
||||
}
|
||||
if (datasize < n_bytes) {
|
||||
/* This punches a "hole" in the file. */
|
||||
size_t hole_bytes = n_bytes - datasize;
|
||||
if (my_seek(fd, hole_bytes, MY_SEEK_CUR, MYF(MY_WME | MY_NABP))
|
||||
== MY_FILEPOS_ERROR)
|
||||
return 1;
|
||||
}
|
||||
written += n_bytes;
|
||||
ptr += n_bytes;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
/* Calculate Innodb tablespace specific data, when first page is written.
|
||||
We're interested in page compression and page size.
|
||||
*/
|
||||
static void init_ibd_data(ds_local_file_t *local_file, const uchar *buf, size_t len)
|
||||
{
|
||||
if (len < FIL_PAGE_DATA + FSP_SPACE_FLAGS) {
|
||||
/* Weird, bail out.*/
|
||||
return;
|
||||
}
|
||||
|
||||
ulint flags = mach_read_from_4(&buf[FIL_PAGE_DATA + FSP_SPACE_FLAGS]);
|
||||
ulint ssize = FSP_FLAGS_GET_PAGE_SSIZE(flags);
|
||||
local_file->pagesize= ssize == 0 ? UNIV_PAGE_SIZE_ORIG : ((UNIV_ZIP_SIZE_MIN >> 1) << ssize);
|
||||
local_file->compressed = (my_bool)FSP_FLAGS_HAS_PAGE_COMPRESSION(flags);
|
||||
|
||||
#if defined(_WIN32) && (MYSQL_VERSION_ID > 100200)
|
||||
/* Make compressed file sparse, on Windows.
|
||||
In 10.1, we do not use sparse files. */
|
||||
if (local_file->compressed) {
|
||||
HANDLE handle= my_get_osfhandle(local_file->fd);
|
||||
if (!DeviceIoControl(handle, FSCTL_SET_SPARSE, NULL, 0, NULL, 0, NULL, 0)) {
|
||||
fprintf(stderr, "Warning: cannot make file sparse");
|
||||
local_file->compressed = 0;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
static
|
||||
int
|
||||
local_write(ds_file_t *file, const uchar *buf, size_t len)
|
||||
{
|
||||
uchar *b = (uchar*)buf;
|
||||
ds_local_file_t *local_file= (ds_local_file_t *)file->ptr;
|
||||
File fd = local_file->fd;
|
||||
|
||||
if (local_file->is_ibd && !local_file->init_ibd_done) {
|
||||
init_ibd_data(local_file, b , len);
|
||||
local_file->init_ibd_done= 1;
|
||||
}
|
||||
|
||||
if (local_file->compressed) {
|
||||
return write_compressed(fd, b, len, local_file->pagesize);
|
||||
}
|
||||
|
||||
if (!my_write(fd, b , len, MYF(MY_WME | MY_NABP))) {
|
||||
posix_fadvise(fd, 0, 0, POSIX_FADV_DONTNEED);
|
||||
return 0;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* Set EOF at file's current position.*/
|
||||
static int set_eof(File fd)
|
||||
{
|
||||
#ifdef _WIN32
|
||||
return !SetEndOfFile(my_get_osfhandle(fd));
|
||||
#elif defined(HAVE_FTRUNCATE)
|
||||
return ftruncate(fd, my_tell(fd, MYF(MY_WME)));
|
||||
#else
|
||||
#error no ftruncate
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
static
|
||||
int
|
||||
local_close(ds_file_t *file)
|
||||
{
|
||||
ds_local_file_t *local_file= (ds_local_file_t *)file->ptr;
|
||||
File fd = local_file->fd;
|
||||
int ret= 0;
|
||||
|
||||
if (local_file->compressed) {
|
||||
ret = set_eof(fd);
|
||||
}
|
||||
|
||||
my_close(fd, MYF(MY_WME));
|
||||
my_free(file);
|
||||
return ret;
|
||||
}
|
||||
|
||||
static
|
||||
void
|
||||
local_deinit(ds_ctxt_t *ctxt)
|
||||
{
|
||||
my_free(ctxt->root);
|
||||
my_free(ctxt);
|
||||
}
|
@ -23,6 +23,12 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
|
||||
#include "datasink.h"
|
||||
|
||||
extern datasink_t datasink_local;
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
#else
|
||||
extern
|
||||
#endif
|
||||
|
||||
datasink_t datasink_local;
|
||||
|
||||
#endif
|
||||
|
@ -31,7 +31,7 @@ typedef struct {
|
||||
static ds_ctxt_t *stdout_init(const char *root);
|
||||
static ds_file_t *stdout_open(ds_ctxt_t *ctxt, const char *path,
|
||||
MY_STAT *mystat);
|
||||
static int stdout_write(ds_file_t *file, const void *buf, size_t len);
|
||||
static int stdout_write(ds_file_t *file, const uchar *buf, size_t len);
|
||||
static int stdout_close(ds_file_t *file);
|
||||
static void stdout_deinit(ds_ctxt_t *ctxt);
|
||||
|
||||
@ -92,7 +92,7 @@ stdout_open(ds_ctxt_t *ctxt __attribute__((unused)),
|
||||
|
||||
static
|
||||
int
|
||||
stdout_write(ds_file_t *file, const void *buf, size_t len)
|
||||
stdout_write(ds_file_t *file, const uchar *buf, size_t len)
|
||||
{
|
||||
File fd = ((ds_stdout_file_t *) file->ptr)->fd;
|
||||
|
||||
|
@ -42,7 +42,7 @@ typedef struct {
|
||||
static ds_ctxt_t *tmpfile_init(const char *root);
|
||||
static ds_file_t *tmpfile_open(ds_ctxt_t *ctxt, const char *path,
|
||||
MY_STAT *mystat);
|
||||
static int tmpfile_write(ds_file_t *file, const void *buf, size_t len);
|
||||
static int tmpfile_write(ds_file_t *file, const uchar *buf, size_t len);
|
||||
static int tmpfile_close(ds_file_t *file);
|
||||
static void tmpfile_deinit(ds_ctxt_t *ctxt);
|
||||
|
||||
@ -144,7 +144,7 @@ tmpfile_open(ds_ctxt_t *ctxt, const char *path,
|
||||
}
|
||||
|
||||
static int
|
||||
tmpfile_write(ds_file_t *file, const void *buf, size_t len)
|
||||
tmpfile_write(ds_file_t *file, const uchar *buf, size_t len)
|
||||
{
|
||||
File fd = ((ds_tmp_file_t *) file->ptr)->fd;
|
||||
|
||||
|
@ -41,7 +41,7 @@ General streaming interface */
|
||||
static ds_ctxt_t *xbstream_init(const char *root);
|
||||
static ds_file_t *xbstream_open(ds_ctxt_t *ctxt, const char *path,
|
||||
MY_STAT *mystat);
|
||||
static int xbstream_write(ds_file_t *file, const void *buf, size_t len);
|
||||
static int xbstream_write(ds_file_t *file, const uchar *buf, size_t len);
|
||||
static int xbstream_close(ds_file_t *file);
|
||||
static void xbstream_deinit(ds_ctxt_t *ctxt);
|
||||
|
||||
@ -166,7 +166,7 @@ err:
|
||||
|
||||
static
|
||||
int
|
||||
xbstream_write(ds_file_t *file, const void *buf, size_t len)
|
||||
xbstream_write(ds_file_t *file, const uchar *buf, size_t len)
|
||||
{
|
||||
ds_stream_file_t *stream_file;
|
||||
xb_wstream_file_t *xbstream_file;
|
||||
|
@ -443,9 +443,7 @@ int parse_args(int argc, char **argv)
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
if (load_defaults("my", load_default_groups, &argc, &argv)) {
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
load_defaults_or_exit("my", load_default_groups, &argc, &argv);
|
||||
|
||||
if (handle_options(&argc, &argv, my_long_options, get_one_option)) {
|
||||
exit(EXIT_FAILURE);
|
||||
|
@ -70,6 +70,7 @@ Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
#include <row0mysql.h>
|
||||
#include <row0quiesce.h>
|
||||
#include <srv0start.h>
|
||||
#include "trx0sys.h"
|
||||
#include <buf0dblwr.h>
|
||||
|
||||
#include <list>
|
||||
@ -451,6 +452,45 @@ void mdl_lock_all()
|
||||
}
|
||||
datafiles_iter_free(it);
|
||||
}
|
||||
|
||||
/** Check if the space id belongs to the table which name should
|
||||
be skipped based on the --tables, --tables-file and --table-exclude
|
||||
options.
|
||||
@param[in] space_id space id to check
|
||||
@return true if the space id belongs to skip table/database list. */
|
||||
static bool backup_includes(space_id_t space_id)
|
||||
{
|
||||
datafiles_iter_t *it = datafiles_iter_new(fil_system);
|
||||
if (!it)
|
||||
return true;
|
||||
|
||||
while (fil_node_t *node = datafiles_iter_next(it)){
|
||||
if (space_id == 0
|
||||
|| (node->space->id == space_id
|
||||
&& !check_if_skip_table(node->space->name))) {
|
||||
|
||||
msg("mariabackup: Unsupported redo log detected "
|
||||
"and it belongs to %s\n",
|
||||
space_id ? node->name: "the InnoDB system tablespace");
|
||||
|
||||
msg("mariabackup: ALTER TABLE or OPTIMIZE TABLE "
|
||||
"was being executed during the backup.\n");
|
||||
|
||||
if (!opt_lock_ddl_per_table) {
|
||||
msg("mariabackup: Use --lock-ddl-per-table "
|
||||
"parameter to lock all the table before "
|
||||
"backup operation.\n");
|
||||
}
|
||||
|
||||
datafiles_iter_free(it);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
datafiles_iter_free(it);
|
||||
return true;
|
||||
}
|
||||
|
||||
/* ======== Date copying thread context ======== */
|
||||
|
||||
typedef struct {
|
||||
@ -2343,8 +2383,8 @@ lsn_t
|
||||
xtrabackup_copy_log(copy_logfile copy, lsn_t start_lsn, lsn_t end_lsn)
|
||||
{
|
||||
lsn_t scanned_lsn = start_lsn;
|
||||
|
||||
const byte* log_block = log_sys->buf;
|
||||
bool more_data = false;
|
||||
|
||||
for (ulint scanned_checkpoint = 0;
|
||||
scanned_lsn < end_lsn;
|
||||
@ -2359,8 +2399,15 @@ xtrabackup_copy_log(copy_logfile copy, lsn_t start_lsn, lsn_t end_lsn)
|
||||
}
|
||||
|
||||
scanned_checkpoint = checkpoint;
|
||||
|
||||
ulint data_len = log_block_get_data_len(log_block);
|
||||
|
||||
more_data = recv_sys_add_to_parsing_buf(
|
||||
log_block,
|
||||
scanned_lsn + data_len);
|
||||
|
||||
recv_sys->scanned_lsn = scanned_lsn + data_len;
|
||||
|
||||
if (data_len == OS_FILE_LOG_BLOCK_SIZE) {
|
||||
/* We got a full log block. */
|
||||
scanned_lsn += data_len;
|
||||
@ -2376,6 +2423,15 @@ xtrabackup_copy_log(copy_logfile copy, lsn_t start_lsn, lsn_t end_lsn)
|
||||
}
|
||||
}
|
||||
|
||||
if (more_data && recv_parse_log_recs(0, STORE_NO, false)) {
|
||||
|
||||
msg("mariabackup: copying the log failed \n");
|
||||
|
||||
return(0);
|
||||
}
|
||||
|
||||
recv_sys_justify_left_parsing_buf();
|
||||
|
||||
log_sys->log.scanned_lsn = scanned_lsn;
|
||||
|
||||
end_lsn = copy == COPY_LAST
|
||||
@ -2409,9 +2465,12 @@ xtrabackup_copy_logfile(copy_logfile copy)
|
||||
lsn_t start_lsn;
|
||||
lsn_t end_lsn;
|
||||
|
||||
recv_sys->parse_start_lsn = log_copy_scanned_lsn;
|
||||
recv_sys->scanned_lsn = log_copy_scanned_lsn;
|
||||
recv_sys->recovered_lsn = log_copy_scanned_lsn;
|
||||
|
||||
start_lsn = ut_uint64_align_down(log_copy_scanned_lsn,
|
||||
OS_FILE_LOG_BLOCK_SIZE);
|
||||
|
||||
/* When copying the first or last part of the log, retry a few
|
||||
times to ensure that all log up to the last checkpoint will be
|
||||
read. */
|
||||
@ -2882,6 +2941,83 @@ next_datadir_item:
|
||||
return(err);
|
||||
}
|
||||
|
||||
/** Assign srv_undo_space_id_start variable if there are undo tablespace present.
|
||||
Read the TRX_SYS page from ibdata1 file and get the minimum space id from
|
||||
the first slot rollback segments of TRX_SYS_PAGE_NO.
|
||||
@retval DB_ERROR if file open or page read failed.
|
||||
@retval DB_SUCCESS if srv_undo_space_id assigned successfully. */
|
||||
static dberr_t xb_assign_undo_space_start()
|
||||
{
|
||||
ulint dirnamelen;
|
||||
char name[1000];
|
||||
pfs_os_file_t file;
|
||||
byte* buf;
|
||||
byte* page;
|
||||
bool ret;
|
||||
dberr_t error = DB_SUCCESS;
|
||||
ulint space, page_no;
|
||||
|
||||
if (srv_undo_tablespaces == 0) {
|
||||
return error;
|
||||
}
|
||||
|
||||
os_normalize_path(srv_data_home);
|
||||
dirnamelen = strlen(srv_data_home);
|
||||
memcpy(name, srv_data_home, dirnamelen);
|
||||
|
||||
if (dirnamelen && name[dirnamelen - 1] != OS_PATH_SEPARATOR) {
|
||||
name[dirnamelen++] = OS_PATH_SEPARATOR;
|
||||
}
|
||||
|
||||
snprintf(name + dirnamelen, strlen(name) + strlen("ibdata1"),
|
||||
"%s", "ibdata1");
|
||||
|
||||
file = os_file_create(0, name, OS_FILE_OPEN,
|
||||
OS_FILE_NORMAL, OS_DATA_FILE, true, &ret);
|
||||
|
||||
if (!ret) {
|
||||
msg("mariabackup: Error in opening %s\n", name);
|
||||
return DB_ERROR;
|
||||
}
|
||||
|
||||
buf = static_cast<byte*>(ut_malloc_nokey(2 * UNIV_PAGE_SIZE));
|
||||
page = static_cast<byte*>(ut_align(buf, UNIV_PAGE_SIZE));
|
||||
|
||||
retry:
|
||||
if (!os_file_read(IORequestRead, file, page, TRX_SYS_PAGE_NO * UNIV_PAGE_SIZE,
|
||||
UNIV_PAGE_SIZE)) {
|
||||
msg("mariabackup: Reading TRX_SYS page failed.\n");
|
||||
error = DB_ERROR;
|
||||
goto func_exit;
|
||||
}
|
||||
|
||||
/* TRX_SYS page can't be compressed or encrypted. */
|
||||
if (buf_page_is_corrupted(false, page, univ_page_size)) {
|
||||
goto retry;
|
||||
}
|
||||
|
||||
/* 0th slot always points to system tablespace.
|
||||
1st slot should point to first undotablespace which is minimum. */
|
||||
|
||||
page_no = mach_read_ulint(TRX_SYS + TRX_SYS_RSEGS
|
||||
+ TRX_SYS_RSEG_SLOT_SIZE
|
||||
+ TRX_SYS_RSEG_PAGE_NO + page, MLOG_4BYTES);
|
||||
ut_ad(page_no != FIL_NULL);
|
||||
|
||||
space = mach_read_ulint(TRX_SYS + TRX_SYS_RSEGS
|
||||
+ TRX_SYS_RSEG_SLOT_SIZE
|
||||
+ TRX_SYS_RSEG_SPACE + page, MLOG_4BYTES);
|
||||
|
||||
srv_undo_space_id_start = space;
|
||||
|
||||
func_exit:
|
||||
ut_free(buf);
|
||||
ret = os_file_close(file);
|
||||
ut_a(ret);
|
||||
|
||||
return error;
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
Populates the tablespace memory cache by scanning for and opening data files.
|
||||
@returns DB_SUCCESS or error code.*/
|
||||
@ -2916,6 +3052,12 @@ xb_load_tablespaces()
|
||||
|
||||
/* Add separate undo tablespaces to fil_system */
|
||||
|
||||
err = xb_assign_undo_space_start();
|
||||
|
||||
if (err != DB_SUCCESS) {
|
||||
return err;
|
||||
}
|
||||
|
||||
err = srv_undo_tablespaces_init(false);
|
||||
|
||||
if (err != DB_SUCCESS) {
|
||||
@ -3571,8 +3713,6 @@ xtrabackup_backup_func()
|
||||
"or RENAME TABLE during the backup, inconsistent backup will be "
|
||||
"produced.\n");
|
||||
|
||||
|
||||
|
||||
/* initialize components */
|
||||
if(innodb_init_param()) {
|
||||
fail:
|
||||
@ -3842,6 +3982,14 @@ reread_log_header:
|
||||
&io_watching_thread_id);
|
||||
}
|
||||
|
||||
/* Populate fil_system with tablespaces to copy */
|
||||
err = xb_load_tablespaces();
|
||||
if (err != DB_SUCCESS) {
|
||||
msg("mariabackup: error: xb_load_tablespaces() failed with"
|
||||
" error %s.\n", ut_strerr(err));
|
||||
goto fail;
|
||||
}
|
||||
|
||||
/* copy log file by current position */
|
||||
log_copy_scanned_lsn = checkpoint_lsn_start;
|
||||
if (xtrabackup_copy_logfile(COPY_FIRST))
|
||||
@ -3851,14 +3999,6 @@ reread_log_header:
|
||||
log_copying_running = true;
|
||||
os_thread_create(log_copying_thread, NULL, &log_copying_thread_id);
|
||||
|
||||
/* Populate fil_system with tablespaces to copy */
|
||||
err = xb_load_tablespaces();
|
||||
if (err != DB_SUCCESS) {
|
||||
msg("mariabackup: error: xb_load_tablespaces() failed with"
|
||||
" error code %u\n", err);
|
||||
goto fail;
|
||||
}
|
||||
|
||||
/* FLUSH CHANGED_PAGE_BITMAPS call */
|
||||
if (!flush_changed_page_bitmaps()) {
|
||||
goto fail;
|
||||
@ -5058,6 +5198,7 @@ handle_options(int argc, char **argv, char ***argv_client, char ***argv_server)
|
||||
srv_operation = SRV_OPERATION_RESTORE;
|
||||
|
||||
files_charset_info = &my_charset_utf8_general_ci;
|
||||
check_if_backup_includes = backup_includes;
|
||||
|
||||
setup_error_messages();
|
||||
sys_var_init();
|
||||
@ -5140,10 +5281,8 @@ handle_options(int argc, char **argv, char ***argv_client, char ***argv_server)
|
||||
|
||||
*argv_client = argv;
|
||||
*argv_server = argv;
|
||||
if (load_defaults(conf_file, xb_server_default_groups,
|
||||
&argc_server, argv_server)) {
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
load_defaults_or_exit(conf_file, xb_server_default_groups,
|
||||
&argc_server, argv_server);
|
||||
|
||||
int n;
|
||||
for (n = 0; (*argv_server)[n]; n++) {};
|
||||
@ -5193,10 +5332,8 @@ handle_options(int argc, char **argv, char ***argv_client, char ***argv_server)
|
||||
xb_server_options, xb_get_one_option)))
|
||||
exit(ho_error);
|
||||
|
||||
if (load_defaults(conf_file, xb_client_default_groups,
|
||||
&argc_client, argv_client)) {
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
load_defaults_or_exit(conf_file, xb_client_default_groups,
|
||||
&argc_client, argv_client);
|
||||
|
||||
for (n = 0; (*argv_client)[n]; n++) {};
|
||||
argc_client = n;
|
||||
|
@ -206,6 +206,9 @@ int main(int argc, char **argv)
|
||||
if ((error= load_defaults(config_file, (const char **) load_default_groups,
|
||||
&count, &arguments)))
|
||||
{
|
||||
my_end(0);
|
||||
if (error == 4)
|
||||
return 0;
|
||||
if (verbose && opt_defaults_file_used)
|
||||
{
|
||||
if (error == 1)
|
||||
@ -216,8 +219,7 @@ int main(int argc, char **argv)
|
||||
fprintf(stderr, "WARNING: Defaults file '%s' is not a regular file!\n",
|
||||
config_file);
|
||||
}
|
||||
error= 2;
|
||||
exit(error);
|
||||
return 2;
|
||||
}
|
||||
|
||||
for (argument= arguments+1 ; *argument ; argument++)
|
||||
|
@ -45,6 +45,13 @@ extern void free_defaults(char **argv);
|
||||
extern void my_print_default_files(const char *conf_file);
|
||||
extern void print_defaults(const char *conf_file, const char **groups);
|
||||
|
||||
|
||||
/** Simplify load_defaults() common use */
|
||||
#define load_defaults_or_exit(A, B, C, D) switch (load_defaults(A, B, C, D)) { \
|
||||
case 0: break; \
|
||||
case 4: my_end(0); exit(0); \
|
||||
default: my_end(0); exit(1); }
|
||||
|
||||
C_MODE_END
|
||||
|
||||
#endif /* MY_DEFAULT_INCLUDED */
|
||||
|
@ -35,6 +35,8 @@
|
||||
# define MEM_CHECK_DEFINED(a,len) VALGRIND_CHECK_MEM_IS_DEFINED(a,len)
|
||||
#elif defined(__SANITIZE_ADDRESS__)
|
||||
# include <sanitizer/asan_interface.h>
|
||||
/* How to do manual poisoning:
|
||||
https://github.com/google/sanitizers/wiki/AddressSanitizerManualPoisoning */
|
||||
# define MEM_UNDEFINED(a,len) ASAN_UNPOISON_MEMORY_REGION(a,len)
|
||||
# define MEM_NOACCESS(a,len) ASAN_POISON_MEMORY_REGION(a,len)
|
||||
# define MEM_CHECK_ADDRESSABLE(a,len) ((void) 0)
|
||||
|
@ -1 +1 @@
|
||||
Subproject commit 67cc3438a84df9fa3cc0cfbf9ed81242502702da
|
||||
Subproject commit 668757aaa9a55d2bcd806908cb5a8e806cd6dc31
|
5
mysql-test/include/maybe_debug.combinations
Normal file
5
mysql-test/include/maybe_debug.combinations
Normal file
@ -0,0 +1,5 @@
|
||||
[debug]
|
||||
--enable-gdb
|
||||
|
||||
[release]
|
||||
--disable-gdb
|
3
mysql-test/include/maybe_debug.inc
Normal file
3
mysql-test/include/maybe_debug.inc
Normal file
@ -0,0 +1,3 @@
|
||||
# include file for test files that can be run with and without debug
|
||||
# having debug and non-debug tests.
|
||||
let $have_debug=`select version() like '%debug%'`;
|
@ -39,7 +39,7 @@ let $wait_timeout= 0;
|
||||
let $wait_condition_reps= 0;
|
||||
while ($wait_counter)
|
||||
{
|
||||
--error 0,ER_NO_SUCH_TABLE,ER_LOCK_WAIT_TIMEOUT,ER_UNKNOWN_COM_ERROR
|
||||
--error 0,ER_NO_SUCH_TABLE,ER_LOCK_WAIT_TIMEOUT,ER_UNKNOWN_COM_ERROR,ER_LOCK_DEADLOCK
|
||||
let $success= `$wait_condition`;
|
||||
inc $wait_condition_reps;
|
||||
if ($success)
|
||||
|
@ -331,7 +331,7 @@ my %mysqld_logs;
|
||||
my $opt_debug_sync_timeout= 300; # Default timeout for WAIT_FOR actions.
|
||||
my $warn_seconds = 60;
|
||||
|
||||
my $rebootstrap_re= '--innodb[-_](?:page[-_]size|checksum[-_]algorithm|undo[-_]tablespaces|log[-_]group[-_]home[-_]dir|data[-_]home[-_]dir)|data[-_]file[-_]path';
|
||||
my $rebootstrap_re= '--innodb[-_](?:page[-_]size|checksum[-_]algorithm|undo[-_]tablespaces|log[-_]group[-_]home[-_]dir|data[-_]home[-_]dir)|data[-_]file[-_]path|force_rebootstrap';
|
||||
|
||||
sub testcase_timeout ($) {
|
||||
my ($tinfo)= @_;
|
||||
|
@ -403,8 +403,38 @@ DROP TABLE t1;
|
||||
#
|
||||
# End of 10.1 test
|
||||
#
|
||||
select case 'foo' when time'10:00:00' then 'never' when '0' then 'bug' else 'ok' end;
|
||||
case 'foo' when time'10:00:00' then 'never' when '0' then 'bug' else 'ok' end
|
||||
ok
|
||||
Warnings:
|
||||
Warning 1292 Truncated incorrect time value: 'foo'
|
||||
select 'foo' in (time'10:00:00','0');
|
||||
'foo' in (time'10:00:00','0')
|
||||
0
|
||||
Warnings:
|
||||
Warning 1292 Truncated incorrect time value: 'foo'
|
||||
create table t1 (a time);
|
||||
insert t1 values (100000), (102030), (203040);
|
||||
select case 'foo' when a then 'never' when '0' then 'bug' else 'ok' end from t1;
|
||||
case 'foo' when a then 'never' when '0' then 'bug' else 'ok' end
|
||||
ok
|
||||
ok
|
||||
ok
|
||||
Warnings:
|
||||
Warning 1292 Truncated incorrect time value: 'foo'
|
||||
select 'foo' in (a,'0') from t1;
|
||||
'foo' in (a,'0')
|
||||
0
|
||||
0
|
||||
0
|
||||
Warnings:
|
||||
Warning 1292 Truncated incorrect time value: 'foo'
|
||||
drop table t1;
|
||||
select case '20:10:05' when date'2020-10-10' then 'never' when time'20:10:5' then 'ok' else 'bug' end;
|
||||
case '20:10:05' when date'2020-10-10' then 'never' when time'20:10:5' then 'ok' else 'bug' end
|
||||
ok
|
||||
#
|
||||
# Start of 10.3 tests
|
||||
# End of 10.2 test
|
||||
#
|
||||
#
|
||||
# MDEV-11554 Wrong result for CASE on a mixture of signed and unsigned expressions
|
||||
@ -511,3 +541,6 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
|
||||
Warnings:
|
||||
Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = 'a'
|
||||
DROP TABLE t1;
|
||||
#
|
||||
# End of 10.3 test
|
||||
#
|
||||
|
@ -152,3 +152,7 @@ a
|
||||
1
|
||||
NULL
|
||||
drop table t1;
|
||||
create table t1 (id int auto_increment primary key, datecol datetime, check (datecol>'0001-01-01 00:00:00'));
|
||||
insert into t1 (datecol) values (now());
|
||||
insert into t1 (datecol) values (now());
|
||||
drop table t1;
|
||||
|
@ -1425,3 +1425,40 @@ a
|
||||
DEALLOCATE PREPARE stmt;
|
||||
DROP TABLE t1;
|
||||
DROP VIEW v1,v2;
|
||||
#
|
||||
# MDEV-15478: Lost name of a explicitly named CTE column used in
|
||||
# the non-recursive CTE defined with UNION
|
||||
#
|
||||
CREATE TABLE t1 (x int, y int);
|
||||
INSERT INTO t1 VALUES (1,2),(2,7),(3,3);
|
||||
WITH cte(a) AS (SELECT 1 UNION SELECT 2) SELECT * FROM cte;
|
||||
a
|
||||
1
|
||||
2
|
||||
WITH cte(a) AS (SELECT 1 UNION SELECT 2) SELECT a FROM cte;
|
||||
a
|
||||
1
|
||||
2
|
||||
WITH cte(a) AS (SELECT 1 UNION ALL SELECT 1) SELECT a FROM cte;
|
||||
a
|
||||
1
|
||||
1
|
||||
WITH cte(a) AS (SELECT x from t1 UNION SELECT 4) SELECT a FROM cte;
|
||||
a
|
||||
1
|
||||
2
|
||||
3
|
||||
4
|
||||
WITH cte(a) AS (SELECT 4 UNION SELECT x FROM t1 UNION SELECT 5)
|
||||
SELECT a FROM cte;
|
||||
a
|
||||
4
|
||||
1
|
||||
2
|
||||
3
|
||||
5
|
||||
WITH cte(a,b) AS (SELECT 4,5 UNION SELECT 4,3) SELECT a,b FROM cte;
|
||||
a b
|
||||
4 5
|
||||
4 3
|
||||
DROP TABLE t1;
|
||||
|
@ -8241,6 +8241,19 @@ Warnings:
|
||||
Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t1`.`c` AS `c`,`test`.`t1`.`d` AS `d` from `test`.`t1` where coalesce(`test`.`t1`.`c`,0) = '3 ' and coalesce(`test`.`t1`.`d`,0) = '3 '
|
||||
DROP TABLE t1;
|
||||
#
|
||||
# MDEV-15005 ASAN: stack-buffer-overflow in my_strnncollsp_simple
|
||||
#
|
||||
SET NAMES latin1;
|
||||
SELECT CONVERT(1, CHAR) IN ('100', 10, '101');
|
||||
CONVERT(1, CHAR) IN ('100', 10, '101')
|
||||
0
|
||||
SELECT CONVERT(1, CHAR) IN ('100', 10, '1');
|
||||
CONVERT(1, CHAR) IN ('100', 10, '1')
|
||||
1
|
||||
SELECT CONVERT(1, CHAR) IN ('100', '10', '1');
|
||||
CONVERT(1, CHAR) IN ('100', '10', '1')
|
||||
1
|
||||
#
|
||||
# End of 10.1 tests
|
||||
#
|
||||
#
|
||||
|
@ -10543,6 +10543,19 @@ CAST(_utf8 0xC499 AS CHAR CHARACTER SET latin1)
|
||||
Warnings:
|
||||
Warning 1977 Cannot convert 'utf8' character 0xC499 to 'latin1'
|
||||
#
|
||||
# MDEV-15005 ASAN: stack-buffer-overflow in my_strnncollsp_simple
|
||||
#
|
||||
SET NAMES utf8;
|
||||
SELECT CONVERT(1, CHAR) IN ('100', 10, '101');
|
||||
CONVERT(1, CHAR) IN ('100', 10, '101')
|
||||
0
|
||||
SELECT CONVERT(1, CHAR) IN ('100', 10, '1');
|
||||
CONVERT(1, CHAR) IN ('100', 10, '1')
|
||||
1
|
||||
SELECT CONVERT(1, CHAR) IN ('100', '10', '1');
|
||||
CONVERT(1, CHAR) IN ('100', '10', '1')
|
||||
1
|
||||
#
|
||||
# End of 10.1 tests
|
||||
#
|
||||
#
|
||||
|
@ -30,73 +30,372 @@ id fake_id bigfield
|
||||
33 1033 yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy
|
||||
128 1128 zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz
|
||||
# Baseline sanity check: 0, 0.
|
||||
select "no-op query";
|
||||
no-op query
|
||||
no-op query
|
||||
cluster_lookups_matched
|
||||
1
|
||||
cluster_lookups_avoided_matched
|
||||
1
|
||||
select @cluster_lookups;
|
||||
@cluster_lookups
|
||||
0
|
||||
select @cluster_lookups_avoided;
|
||||
@cluster_lookups_avoided
|
||||
0
|
||||
# Eligible for optimization.
|
||||
select id, bigfield from prefixinno where bigfield = repeat('d', 31);
|
||||
id bigfield
|
||||
31 ddddddddddddddddddddddddddddddd
|
||||
cluster_lookups_matched
|
||||
1
|
||||
cluster_lookups_avoided_matched
|
||||
select @cluster_lookups;
|
||||
@cluster_lookups
|
||||
0
|
||||
select @cluster_lookups_avoided;
|
||||
@cluster_lookups_avoided
|
||||
1
|
||||
# Eligible for optimization, access via fake_id only.
|
||||
select id, bigfield from prefixinno where fake_id = 1031;
|
||||
id bigfield
|
||||
31 ddddddddddddddddddddddddddddddd
|
||||
cluster_lookups_matched
|
||||
1
|
||||
cluster_lookups_avoided_matched
|
||||
select @cluster_lookups;
|
||||
@cluster_lookups
|
||||
0
|
||||
select @cluster_lookups_avoided;
|
||||
@cluster_lookups_avoided
|
||||
1
|
||||
# Not eligible for optimization, access via fake_id of big row.
|
||||
select id, bigfield from prefixinno where fake_id = 1033;
|
||||
id bigfield
|
||||
33 yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy
|
||||
cluster_lookups_matched
|
||||
1
|
||||
cluster_lookups_avoided_matched
|
||||
select @cluster_lookups;
|
||||
@cluster_lookups
|
||||
1
|
||||
select @cluster_lookups_avoided;
|
||||
@cluster_lookups_avoided
|
||||
0
|
||||
# Not eligible for optimization.
|
||||
select id, bigfield from prefixinno where bigfield = repeat('x', 32);
|
||||
id bigfield
|
||||
32 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
|
||||
cluster_lookups_matched
|
||||
1
|
||||
cluster_lookups_avoided_matched
|
||||
select @cluster_lookups;
|
||||
@cluster_lookups
|
||||
1
|
||||
select @cluster_lookups_avoided;
|
||||
@cluster_lookups_avoided
|
||||
0
|
||||
# Not eligible for optimization.
|
||||
select id, bigfield from prefixinno where bigfield = repeat('y', 33);
|
||||
id bigfield
|
||||
33 yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy
|
||||
cluster_lookups_matched
|
||||
1
|
||||
cluster_lookups_avoided_matched
|
||||
select @cluster_lookups;
|
||||
@cluster_lookups
|
||||
1
|
||||
select @cluster_lookups_avoided;
|
||||
@cluster_lookups_avoided
|
||||
0
|
||||
# Eligible, should not increment lookup counter.
|
||||
select id, bigfield from prefixinno where bigfield = repeat('b', 8);
|
||||
id bigfield
|
||||
8 bbbbbbbb
|
||||
cluster_lookups_matched
|
||||
1
|
||||
cluster_lookups_avoided_matched
|
||||
select @cluster_lookups;
|
||||
@cluster_lookups
|
||||
0
|
||||
select @cluster_lookups_avoided;
|
||||
@cluster_lookups_avoided
|
||||
1
|
||||
# Eligible, should not increment lookup counter.
|
||||
select id, bigfield from prefixinno where bigfield = repeat('c', 24);
|
||||
id bigfield
|
||||
24 cccccccccccccccccccccccc
|
||||
cluster_lookups_matched
|
||||
1
|
||||
cluster_lookups_avoided_matched
|
||||
select @cluster_lookups;
|
||||
@cluster_lookups
|
||||
0
|
||||
select @cluster_lookups_avoided;
|
||||
@cluster_lookups_avoided
|
||||
1
|
||||
# Should increment lookup counter.
|
||||
select id, bigfield from prefixinno where bigfield = repeat('z', 128);
|
||||
id bigfield
|
||||
128 zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz
|
||||
cluster_lookups_matched
|
||||
1
|
||||
cluster_lookups_avoided_matched
|
||||
select @cluster_lookups;
|
||||
@cluster_lookups
|
||||
1
|
||||
select @cluster_lookups_avoided;
|
||||
@cluster_lookups_avoided
|
||||
0
|
||||
# Disable optimization, confirm we still increment counter.
|
||||
set global innodb_prefix_index_cluster_optimization = OFF;
|
||||
select id, bigfield from prefixinno where fake_id = 1033;
|
||||
id bigfield
|
||||
33 yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy
|
||||
cluster_lookups_matched
|
||||
select @cluster_lookups;
|
||||
@cluster_lookups
|
||||
1
|
||||
cluster_lookups_avoided_matched
|
||||
select @cluster_lookups_avoided;
|
||||
@cluster_lookups_avoided
|
||||
0
|
||||
drop table prefixinno;
|
||||
# Multi-byte handling case
|
||||
set global innodb_prefix_index_cluster_optimization = ON;
|
||||
SET NAMES utf8mb4;
|
||||
CREATE TABLE t1(
|
||||
f1 varchar(10) CHARACTER SET UTF8MB4 COLLATE UTF8MB4_BIN,
|
||||
INDEX (f1(3)))ENGINE=INNODB;
|
||||
INSERT INTO t1 VALUES('a'), ('cccc'), ('až'), ('cčc'), ('ggᵷg'), ('¢¢');
|
||||
INSERT INTO t1 VALUES('தமிழ்'), ('🐱🌑'), ('🌒'), ('🌑');
|
||||
INSERT INTO t1 VALUES('😊me'), ('eu€'), ('ls¢');
|
||||
# Eligible - record length is shorter than prefix
|
||||
SELECT f1 FROM t1 FORCE INDEX (`f1`) WHERE f1 = 'a';
|
||||
f1
|
||||
a
|
||||
select @cluster_lookups;
|
||||
@cluster_lookups
|
||||
0
|
||||
select @cluster_lookups_avoided;
|
||||
@cluster_lookups_avoided
|
||||
1
|
||||
# make test suite happy by cleaning up our mess
|
||||
# Not eligible - record length longer than prefix length
|
||||
SELECT f1 FROM t1 FORCE INDEX (`f1`) WHERE f1 like 'c%';
|
||||
f1
|
||||
cccc
|
||||
cčc
|
||||
select @cluster_lookups;
|
||||
@cluster_lookups
|
||||
3
|
||||
select @cluster_lookups_avoided;
|
||||
@cluster_lookups_avoided
|
||||
0
|
||||
# Eligible - record length shorter than prefix length
|
||||
SELECT f1 FROM t1 FORCE INDEX (`f1`) WHERE f1 = 'až';
|
||||
f1
|
||||
až
|
||||
select @cluster_lookups;
|
||||
@cluster_lookups
|
||||
0
|
||||
select @cluster_lookups_avoided;
|
||||
@cluster_lookups_avoided
|
||||
1
|
||||
# Not eligible - record length longer than prefix length
|
||||
SELECT f1 FROM t1 FORCE INDEX (`f1`) WHERE f1 = 'தமிழ்';
|
||||
f1
|
||||
தமிழ்
|
||||
select @cluster_lookups;
|
||||
@cluster_lookups
|
||||
1
|
||||
select @cluster_lookups_avoided;
|
||||
@cluster_lookups_avoided
|
||||
0
|
||||
# Not eligible - record length longer than prefix length
|
||||
SELECT f1 FROM t1 FORCE INDEX (`f1`) WHERE f1 like 'ggᵷ%';
|
||||
f1
|
||||
ggᵷg
|
||||
select @cluster_lookups;
|
||||
@cluster_lookups
|
||||
1
|
||||
select @cluster_lookups_avoided;
|
||||
@cluster_lookups_avoided
|
||||
0
|
||||
# Not eligible - record length longer than prefix length
|
||||
SELECT f1 FROM t1 FORCE INDEX (`f1`) WHERE f1 like '😊%';
|
||||
f1
|
||||
😊me
|
||||
select @cluster_lookups;
|
||||
@cluster_lookups
|
||||
1
|
||||
select @cluster_lookups_avoided;
|
||||
@cluster_lookups_avoided
|
||||
0
|
||||
# Not eligible - record length longer than prefix length
|
||||
SELECT f1 FROM t1 FORCE INDEX (`f1`) WHERE f1 = 'ls¢';
|
||||
f1
|
||||
ls¢
|
||||
select @cluster_lookups;
|
||||
@cluster_lookups
|
||||
1
|
||||
select @cluster_lookups_avoided;
|
||||
@cluster_lookups_avoided
|
||||
0
|
||||
# Eligible - record length shorter than prefix length
|
||||
SELECT f1 FROM t1 FORCE INDEX (`f1`) WHERE f1 like '¢¢%';
|
||||
f1
|
||||
¢¢
|
||||
select @cluster_lookups;
|
||||
@cluster_lookups
|
||||
1
|
||||
select @cluster_lookups_avoided;
|
||||
@cluster_lookups_avoided
|
||||
1
|
||||
# Eligible - record length shorter than prefix length
|
||||
SELECT f1 FROM t1 FORCE INDEX (`f1`) WHERE f1 like '🐱🌑%';
|
||||
f1
|
||||
🐱🌑
|
||||
select @cluster_lookups;
|
||||
@cluster_lookups
|
||||
1
|
||||
select @cluster_lookups_avoided;
|
||||
@cluster_lookups_avoided
|
||||
1
|
||||
# Not eligible - record length longer than prefix length
|
||||
SELECT f1 FROM t1 FORCE INDEX (`f1`) WHERE f1 like '🌑%';
|
||||
f1
|
||||
🌑
|
||||
select @cluster_lookups;
|
||||
@cluster_lookups
|
||||
0
|
||||
select @cluster_lookups_avoided;
|
||||
@cluster_lookups_avoided
|
||||
2
|
||||
# Not eligible - record length longer than prefix length
|
||||
SELECT f1 FROM t1 FORCE INDEX (`f1`) WHERE f1 like '🌒%';
|
||||
f1
|
||||
🌒
|
||||
select @cluster_lookups;
|
||||
@cluster_lookups
|
||||
0
|
||||
select @cluster_lookups_avoided;
|
||||
@cluster_lookups_avoided
|
||||
2
|
||||
DROP TABLE t1;
|
||||
# Multi-byte with minimum character length > 1 bytes
|
||||
CREATE TABLE t1(
|
||||
f1 varchar(10) CHARACTER SET UTF16 COLLATE UTF16_BIN,
|
||||
INDEX (f1(3)))ENGINE=INNODB;
|
||||
INSERT INTO t1 VALUES('a'), ('cccc'), ('až'), ('cčc'), ('ggᵷg'), ('¢¢');
|
||||
INSERT INTO t1 VALUES('தமிழ்'), ('🐱🌑'), ('🌒'), ('🌑');
|
||||
INSERT INTO t1 VALUES('😊me'), ('eu€'), ('ls¢');
|
||||
# Eligible - record length is shorter than prefix
|
||||
SELECT f1 FROM t1 FORCE INDEX (`f1`) WHERE f1 = 'a';
|
||||
f1
|
||||
a
|
||||
select @cluster_lookups;
|
||||
@cluster_lookups
|
||||
0
|
||||
select @cluster_lookups_avoided;
|
||||
@cluster_lookups_avoided
|
||||
1
|
||||
# Not eligible - record length longer than prefix length
|
||||
SELECT f1 FROM t1 FORCE INDEX (`f1`) WHERE f1 like 'c%';
|
||||
f1
|
||||
cccc
|
||||
cčc
|
||||
select @cluster_lookups;
|
||||
@cluster_lookups
|
||||
3
|
||||
select @cluster_lookups_avoided;
|
||||
@cluster_lookups_avoided
|
||||
0
|
||||
# Eligible - record length shorter than prefix length
|
||||
SELECT f1 FROM t1 FORCE INDEX (`f1`) WHERE f1 = 'až';
|
||||
f1
|
||||
až
|
||||
select @cluster_lookups;
|
||||
@cluster_lookups
|
||||
0
|
||||
select @cluster_lookups_avoided;
|
||||
@cluster_lookups_avoided
|
||||
1
|
||||
# Not eligible - record length longer than prefix length
|
||||
SELECT f1 FROM t1 FORCE INDEX (`f1`) WHERE f1 = 'தமிழ்';
|
||||
f1
|
||||
தமிழ்
|
||||
select @cluster_lookups;
|
||||
@cluster_lookups
|
||||
1
|
||||
select @cluster_lookups_avoided;
|
||||
@cluster_lookups_avoided
|
||||
0
|
||||
# Not eligible - record length longer than prefix length
|
||||
SELECT f1 FROM t1 FORCE INDEX (`f1`) WHERE f1 like 'ggᵷ%';
|
||||
f1
|
||||
ggᵷg
|
||||
select @cluster_lookups;
|
||||
@cluster_lookups
|
||||
2
|
||||
select @cluster_lookups_avoided;
|
||||
@cluster_lookups_avoided
|
||||
0
|
||||
# Not eligible - record length longer than prefix length
|
||||
SELECT f1 FROM t1 FORCE INDEX (`f1`) WHERE f1 like '😊%';
|
||||
f1
|
||||
😊me
|
||||
select @cluster_lookups;
|
||||
@cluster_lookups
|
||||
1
|
||||
select @cluster_lookups_avoided;
|
||||
@cluster_lookups_avoided
|
||||
0
|
||||
# Not eligible - record length longer than prefix length
|
||||
SELECT f1 FROM t1 FORCE INDEX (`f1`) WHERE f1 = 'ls¢';
|
||||
f1
|
||||
ls¢
|
||||
select @cluster_lookups;
|
||||
@cluster_lookups
|
||||
1
|
||||
select @cluster_lookups_avoided;
|
||||
@cluster_lookups_avoided
|
||||
0
|
||||
# Eligible - record length shorter than prefix length
|
||||
SELECT f1 FROM t1 FORCE INDEX(`f1`) WHERE f1 like '¢¢%';
|
||||
f1
|
||||
¢¢
|
||||
select @cluster_lookups;
|
||||
@cluster_lookups
|
||||
1
|
||||
select @cluster_lookups_avoided;
|
||||
@cluster_lookups_avoided
|
||||
1
|
||||
# Eligible - record length shorter than prefix length
|
||||
SELECT f1 FROM t1 FORCE INDEX (`f1`) WHERE f1 like '🐱🌑%';
|
||||
f1
|
||||
🐱🌑
|
||||
select @cluster_lookups;
|
||||
@cluster_lookups
|
||||
2
|
||||
select @cluster_lookups_avoided;
|
||||
@cluster_lookups_avoided
|
||||
0
|
||||
# Eligible - record length is shorter than prefix length
|
||||
SELECT f1 FROM t1 FORCE INDEX (`f1`) WHERE f1 like '🌑%';
|
||||
f1
|
||||
🌑
|
||||
select @cluster_lookups;
|
||||
@cluster_lookups
|
||||
0
|
||||
select @cluster_lookups_avoided;
|
||||
@cluster_lookups_avoided
|
||||
2
|
||||
# Eligible - record length is shorter than prefix length
|
||||
SELECT f1 FROM t1 FORCE INDEX (`f1`) WHERE f1 like '🌒%';
|
||||
f1
|
||||
🌒
|
||||
select @cluster_lookups;
|
||||
@cluster_lookups
|
||||
1
|
||||
select @cluster_lookups_avoided;
|
||||
@cluster_lookups_avoided
|
||||
1
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t1(
|
||||
col1 INT,
|
||||
col2 BLOB DEFAULT NULL,
|
||||
INDEX `idx1`(col2(4), col1))ENGINE=INNODB;
|
||||
INSERT INTO t1 VALUES (2, 'test'), (3, repeat('test1', 2000));
|
||||
INSERT INTO t1(col1) VALUES(1);
|
||||
# Eligible - record length is shorter than prefix length
|
||||
SELECT col1 FROM t1 FORCE INDEX (`idx1`) WHERE col2 is NULL;
|
||||
col1
|
||||
1
|
||||
select @cluster_lookups;
|
||||
@cluster_lookups
|
||||
0
|
||||
select @cluster_lookups_avoided;
|
||||
@cluster_lookups_avoided
|
||||
1
|
||||
# Not eligible - record length longer than prefix index
|
||||
SELECT col1 FROM t1 FORCE INDEX (`idx1`) WHERE col2 like 'test1%';
|
||||
col1
|
||||
3
|
||||
select @cluster_lookups;
|
||||
@cluster_lookups
|
||||
2
|
||||
select @cluster_lookups_avoided;
|
||||
@cluster_lookups_avoided
|
||||
0
|
||||
DROP TABLE t1;
|
||||
set global innodb_prefix_index_cluster_optimization = OFF;
|
||||
|
@ -102,6 +102,57 @@ select * from t1 where case a when adddate( '2012-12-12', 7 ) then true end;
|
||||
a
|
||||
drop table t1;
|
||||
End of 5.5 tests
|
||||
#
|
||||
# Start of 10.1 tests
|
||||
#
|
||||
#
|
||||
# MDEV-14452 Precision in INTERVAL xxx DAY_MICROSECOND parsed wrong?
|
||||
#
|
||||
SELECT
|
||||
DATE_ADD('1000-01-01 00:00:00', INTERVAL '0 00:00:01.5' DAY_MICROSECOND) c1,
|
||||
DATE_ADD('1000-01-01 00:00:00', INTERVAL '0 00:00:01.50' DAY_MICROSECOND) c2,
|
||||
DATE_ADD('1000-01-01 00:00:00', INTERVAL '0 00:00:01.500' DAY_MICROSECOND) c3,
|
||||
DATE_ADD('1000-01-01 00:00:00', INTERVAL '0 00:00:01.5000' DAY_MICROSECOND) c4,
|
||||
DATE_ADD('1000-01-01 00:00:00', INTERVAL '0 00:00:01.50000' DAY_MICROSECOND) c5,
|
||||
DATE_ADD('1000-01-01 00:00:00', INTERVAL '0 00:00:01.500000' DAY_MICROSECOND) c6,
|
||||
DATE_ADD('1000-01-01 00:00:00', INTERVAL '0 00:00:01.5000000' DAY_MICROSECOND) c7,
|
||||
DATE_ADD('1000-01-01 00:00:00', INTERVAL '0 00:00:01.50000000' DAY_MICROSECOND) c8,
|
||||
DATE_ADD('1000-01-01 00:00:00', INTERVAL '0 00:00:01.500000000' DAY_MICROSECOND) c9,
|
||||
DATE_ADD('1000-01-01 00:00:00', INTERVAL '0 00:00:01.5000000000' DAY_MICROSECOND) c10,
|
||||
DATE_ADD('1000-01-01 00:00:00', INTERVAL '0 00:00:01.50000000000' DAY_MICROSECOND) c11,
|
||||
DATE_ADD('1000-01-01 00:00:00', INTERVAL '0 00:00:01.500000000000' DAY_MICROSECOND) c12,
|
||||
DATE_ADD('1000-01-01 00:00:00', INTERVAL '0 00:00:01.5000000000000' DAY_MICROSECOND) c13,
|
||||
DATE_ADD('1000-01-01 00:00:00', INTERVAL '0 00:00:01.50000000000000' DAY_MICROSECOND) c14,
|
||||
DATE_ADD('1000-01-01 00:00:00', INTERVAL '0 00:00:01.500000000000000' DAY_MICROSECOND) c15,
|
||||
DATE_ADD('1000-01-01 00:00:00', INTERVAL '0 00:00:01.5000000000000000' DAY_MICROSECOND) c16,
|
||||
DATE_ADD('1000-01-01 00:00:00', INTERVAL '0 00:00:01.50000000000000000' DAY_MICROSECOND) c17,
|
||||
DATE_ADD('1000-01-01 00:00:00', INTERVAL '0 00:00:01.500000000000000000' DAY_MICROSECOND) c18,
|
||||
DATE_ADD('1000-01-01 00:00:00', INTERVAL '0 00:00:01.5000000000000000000' DAY_MICROSECOND) c19,
|
||||
DATE_ADD('1000-01-01 00:00:00', INTERVAL '0 00:00:01.50000000000000000000' DAY_MICROSECOND) c20
|
||||
;
|
||||
c1 1000-01-01 00:00:01.500000
|
||||
c2 1000-01-01 00:00:01.500000
|
||||
c3 1000-01-01 00:00:01.500000
|
||||
c4 1000-01-01 00:00:01.500000
|
||||
c5 1000-01-01 00:00:01.500000
|
||||
c6 1000-01-01 00:00:01.500000
|
||||
c7 1000-01-01 00:00:01.500000
|
||||
c8 1000-01-01 00:00:01.500000
|
||||
c9 1000-01-01 00:00:01.500000
|
||||
c10 1000-01-01 00:00:01.500000
|
||||
c11 1000-01-01 00:00:01.500000
|
||||
c12 1000-01-01 00:00:01.500000
|
||||
c13 1000-01-01 00:00:01.500000
|
||||
c14 1000-01-01 00:00:01.500000
|
||||
c15 1000-01-01 00:00:01.500000
|
||||
c16 1000-01-01 00:00:01.500000
|
||||
c17 1000-01-01 00:00:01.500000
|
||||
c18 1000-01-01 00:00:01.500000
|
||||
c19 1000-01-01 00:00:01.500000
|
||||
c20 NULL
|
||||
#
|
||||
# End of 10.1 tests
|
||||
#
|
||||
create or replace view v1 as select 3 & 20010101 + interval 2 day as x;
|
||||
show create view v1;
|
||||
View Create View character_set_client collation_connection
|
||||
|
@ -740,7 +740,7 @@ select json_extract('{"test":8.437e-5}','$.test');
|
||||
json_extract('{"test":8.437e-5}','$.test')
|
||||
8.437e-5
|
||||
#
|
||||
# Start of 10.3 tests
|
||||
# End of 10.2 tests
|
||||
#
|
||||
#
|
||||
# MDEV-12854 Synchronize CREATE..SELECT data type and result set metadata data type for INT functions
|
||||
@ -765,3 +765,6 @@ def json_length 3 10 1 Y 32896 0 63
|
||||
def json_depnth 3 10 1 N 32897 0 63
|
||||
json_length json_depnth
|
||||
2 3
|
||||
#
|
||||
# End of 10.3 tests
|
||||
#
|
||||
|
@ -2905,6 +2905,30 @@ NULL
|
||||
Warnings:
|
||||
Warning 1441 Datetime function: datetime field overflow
|
||||
#
|
||||
# MDEV-13202 Assertion `ltime->neg == 0' failed in date_to_datetime
|
||||
#
|
||||
CREATE TABLE t1 (i INT, d DATE);
|
||||
INSERT INTO t1 VALUES (1, '1970-01-01');
|
||||
SELECT MAX(NULLIF(i,1)) FROM t1 ORDER BY DATE_SUB(d,INTERVAL 17300000 HOUR);
|
||||
MAX(NULLIF(i,1))
|
||||
NULL
|
||||
Warnings:
|
||||
Warning 1441 Datetime function: datetime field overflow
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t1 (i INT, d DATE);
|
||||
INSERT INTO t1 VALUES (1, '1970-01-01');
|
||||
SELECT CONCAT(DATE_SUB(d, INTERVAL 17300000 HOUR)) FROM t1;
|
||||
CONCAT(DATE_SUB(d, INTERVAL 17300000 HOUR))
|
||||
NULL
|
||||
Warnings:
|
||||
Warning 1441 Datetime function: datetime field overflow
|
||||
DROP TABLE t1;
|
||||
SELECT CONCAT(DATE_SUB(TIMESTAMP'1970-01-01 00:00:00', INTERVAL 17300000 HOUR));
|
||||
CONCAT(DATE_SUB(TIMESTAMP'1970-01-01 00:00:00', INTERVAL 17300000 HOUR))
|
||||
NULL
|
||||
Warnings:
|
||||
Warning 1441 Datetime function: datetime field overflow
|
||||
#
|
||||
# End of 10.0 tests
|
||||
#
|
||||
#
|
||||
|
@ -721,6 +721,20 @@ SELECT * FROM t1 JOIN t2 ON c1 = c2 HAVING c2 > 'a' ORDER BY c2 LIMIT 1;
|
||||
c1 c2
|
||||
x x
|
||||
DROP TABLE t1,t2;
|
||||
#
|
||||
# MDEV-6736: Valgrind warnings 'Invalid read' in subselect_engine::calc_const_tables with SQ
|
||||
# in WHERE and HAVING, ORDER BY, materialization+semijoin
|
||||
#
|
||||
CREATE TABLE t1 (a INT) ENGINE=MyISAM;
|
||||
INSERT INTO t1 VALUES (3),(8);
|
||||
CREATE TABLE t2 (b INT) ENGINE=MyISAM;
|
||||
INSERT INTO t2 VALUES (2),(1);
|
||||
SELECT a FROM t1
|
||||
WHERE 9 IN ( SELECT MIN( a ) FROM t1 )
|
||||
HAVING a <> ( SELECT COUNT(*) FROM t2 )
|
||||
ORDER BY a;
|
||||
a
|
||||
DROP TABLE t1,t2;
|
||||
End of 10.0 tests
|
||||
#
|
||||
# MDEV-10716: Assertion `real_type() != FIELD_ITEM' failed in
|
||||
|
@ -2438,11 +2438,27 @@ CREATE TABLE t1 (b1 BIT NOT NULL);
|
||||
INSERT INTO t1 VALUES (0),(1);
|
||||
CREATE TABLE t2 (b2 BIT NOT NULL);
|
||||
INSERT INTO t2 VALUES (0),(1);
|
||||
SET SESSION JOIN_CACHE_LEVEL = 3;
|
||||
set @save_join_cache_level= @@join_cache_level;
|
||||
SET @@join_cache_level = 3;
|
||||
SELECT t1.b1+'0' , t2.b2 + '0' FROM t1 LEFT JOIN t2 ON b1 = b2;
|
||||
t1.b1+'0' t2.b2 + '0'
|
||||
0 0
|
||||
1 1
|
||||
DROP TABLE t1, t2;
|
||||
set @join_cache_level= @save_join_cache_level;
|
||||
#
|
||||
# MDEV-14779: using left join causes incorrect results with materialization and derived tables
|
||||
#
|
||||
create table t1(id int);
|
||||
insert into t1 values (1),(2);
|
||||
create table t2(sid int, id int);
|
||||
insert into t2 values (1,1),(2,2);
|
||||
select * from t1 t
|
||||
left join (select * from t2 where sid in (select max(sid) from t2 where 0=1 group by id)) r
|
||||
on t.id=r.id ;
|
||||
id sid id
|
||||
1 NULL NULL
|
||||
2 NULL NULL
|
||||
drop table t1, t2;
|
||||
# end of 5.5 tests
|
||||
SET optimizer_switch=@save_optimizer_switch;
|
||||
|
@ -2449,12 +2449,28 @@ CREATE TABLE t1 (b1 BIT NOT NULL);
|
||||
INSERT INTO t1 VALUES (0),(1);
|
||||
CREATE TABLE t2 (b2 BIT NOT NULL);
|
||||
INSERT INTO t2 VALUES (0),(1);
|
||||
SET SESSION JOIN_CACHE_LEVEL = 3;
|
||||
set @save_join_cache_level= @@join_cache_level;
|
||||
SET @@join_cache_level = 3;
|
||||
SELECT t1.b1+'0' , t2.b2 + '0' FROM t1 LEFT JOIN t2 ON b1 = b2;
|
||||
t1.b1+'0' t2.b2 + '0'
|
||||
0 0
|
||||
1 1
|
||||
DROP TABLE t1, t2;
|
||||
set @join_cache_level= @save_join_cache_level;
|
||||
#
|
||||
# MDEV-14779: using left join causes incorrect results with materialization and derived tables
|
||||
#
|
||||
create table t1(id int);
|
||||
insert into t1 values (1),(2);
|
||||
create table t2(sid int, id int);
|
||||
insert into t2 values (1,1),(2,2);
|
||||
select * from t1 t
|
||||
left join (select * from t2 where sid in (select max(sid) from t2 where 0=1 group by id)) r
|
||||
on t.id=r.id ;
|
||||
id sid id
|
||||
1 NULL NULL
|
||||
2 NULL NULL
|
||||
drop table t1, t2;
|
||||
# end of 5.5 tests
|
||||
SET optimizer_switch=@save_optimizer_switch;
|
||||
set join_cache_level=default;
|
||||
|
29
mysql-test/r/ps_qc_innodb.result
Normal file
29
mysql-test/r/ps_qc_innodb.result
Normal file
@ -0,0 +1,29 @@
|
||||
#
|
||||
# MDEV-15492: Subquery crash similar to MDEV-10050
|
||||
#
|
||||
SET @qcs.save= @@global.query_cache_size, @qct.save= @@global.query_cache_type;
|
||||
SET GLOBAL query_cache_size= 512*1024*1024, query_cache_type= ON;
|
||||
connect con1,localhost,root,,test;
|
||||
CREATE TABLE t1 (a INT) ENGINE=InnoDB;
|
||||
CREATE TABLE t2 (b INT) ENGINE=InnoDB;
|
||||
CREATE VIEW v AS select a from t1 join t2;
|
||||
PREPARE stmt1 FROM "SELECT * FROM t1 WHERE a in (SELECT a FROM v)";
|
||||
connect con2,localhost,root,,test;
|
||||
PREPARE stmt2 FROM "SELECT * FROM t1 WHERE a in (SELECT a FROM v)";
|
||||
EXECUTE stmt2;
|
||||
a
|
||||
connection con1;
|
||||
EXECUTE stmt1;
|
||||
a
|
||||
INSERT INTO t2 VALUES (0);
|
||||
EXECUTE stmt1;
|
||||
a
|
||||
START TRANSACTION;
|
||||
EXECUTE stmt1;
|
||||
a
|
||||
disconnect con1;
|
||||
disconnect con2;
|
||||
connection default;
|
||||
DROP VIEW v;
|
||||
DROP TABLE t1, t2;
|
||||
SET GLOBAL query_cache_size= @qcs.save, query_cache_type= @qct.save;
|
@ -13,4 +13,4 @@ drop user user1@localhost;
|
||||
#
|
||||
# MDEV-8491 - On shutdown, report the user and the host executed that.
|
||||
#
|
||||
FOUND 2 /mysqld(\.exe)? \(root\[root\] @ localhost \[(::1)?\]\): Normal shutdown/ in mysqld.1.err
|
||||
FOUND 2 /mysqld(\.exe)? \(initiated by: root\[root\] @ localhost \[(::1)?\]\): Normal shutdown/ in mysqld.1.err
|
||||
|
@ -2489,6 +2489,17 @@ FROM t2 WHERE b <= 'quux' GROUP BY field;
|
||||
field COUNT(DISTINCT c)
|
||||
0 1
|
||||
drop table t1,t2;
|
||||
#
|
||||
# MDEV-15555: select from DUAL where false yielding wrong result when in a IN
|
||||
#
|
||||
explain
|
||||
SELECT 2 IN (SELECT 2 from DUAL WHERE 1 != 1);
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 PRIMARY NULL NULL NULL NULL NULL NULL NULL No tables used
|
||||
2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE
|
||||
SELECT 2 IN (SELECT 2 from DUAL WHERE 1 != 1);
|
||||
2 IN (SELECT 2 from DUAL WHERE 1 != 1)
|
||||
0
|
||||
SET optimizer_switch= @@global.optimizer_switch;
|
||||
set @@tmp_table_size= @@global.tmp_table_size;
|
||||
#
|
||||
|
@ -2757,6 +2757,21 @@ a b sq
|
||||
4 2 1
|
||||
drop table t1, t2;
|
||||
#
|
||||
# MDEV-15235: Assertion `length > 0' failed in create_ref_for_key
|
||||
#
|
||||
CREATE TABLE t1 (i INT);
|
||||
INSERT INTO t1 VALUES (1),(2);
|
||||
CREATE TABLE t2 (f CHAR(1));
|
||||
INSERT INTO t2 VALUES ('a'),('b');
|
||||
explain
|
||||
SELECT * FROM t2 WHERE f IN ( SELECT LEFT('foo',0) FROM t1 ORDER BY 1 );
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 PRIMARY t2 ALL NULL NULL NULL NULL 2 Using where
|
||||
2 DEPENDENT SUBQUERY t1 ALL NULL NULL NULL NULL 2
|
||||
SELECT * FROM t2 WHERE f IN ( SELECT LEFT('foo',0) FROM t1 ORDER BY 1 );
|
||||
f
|
||||
DROP TABLE t1, t2;
|
||||
#
|
||||
# MDEV-9489: Assertion `0' failed in Protocol::end_statement() on
|
||||
# UNION ALL
|
||||
#
|
||||
|
@ -154,3 +154,9 @@ SELECT 1 FROM t1 WHERE (SELECT a FROM t1 group by c) = b;
|
||||
Warnings:
|
||||
Warning 1292 Incorrect datetime value: ''
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t1 (d DATE) ENGINE=InnoDB;
|
||||
INSERT INTO t1 VALUES ('2012-12-21');
|
||||
SELECT * FROM t1 WHERE LEAST( UTC_TIME(), d );
|
||||
d
|
||||
2012-12-21
|
||||
DROP TABLE t1;
|
||||
|
@ -822,7 +822,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
|
||||
1 SIMPLE t1 ALL NULL NULL NULL NULL 8 100.00 Using where
|
||||
Warnings:
|
||||
Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = TIME'10:20:30' and <cache>(octet_length(TIME'10:20:30')) = 30 + rand()
|
||||
# Old mode, TIMESTAMP literal, zon-zero YYYYMMDD, no propagation
|
||||
# Old mode, TIMESTAMP literal, non-zero YYYYMMDD, no propagation
|
||||
SELECT * FROM t1 WHERE a=TIMESTAMP'0000-00-01 10:20:30';
|
||||
a
|
||||
34:20:30
|
||||
@ -860,7 +860,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
|
||||
1 SIMPLE t1 ALL NULL NULL NULL NULL 8 100.00 Using where
|
||||
Warnings:
|
||||
Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = TIME'10:20:30' and <cache>(octet_length(TIME'10:20:30')) = 30 + rand()
|
||||
# Old mode, TIMESTAMP-alike literal, zon-zero YYYYMMDD, no propagation
|
||||
# Old mode, TIMESTAMP-alike literal, non-zero YYYYMMDD, no propagation
|
||||
SELECT * FROM t1 WHERE a='0000-00-01 10:20:30';
|
||||
a
|
||||
34:20:30
|
||||
@ -1215,6 +1215,37 @@ MAX(a) MAX(COALESCE(a))
|
||||
10:20:30 10:20:30
|
||||
DROP TABLE t1;
|
||||
#
|
||||
# MDEV-15321: different results when using value of optimizer_use_condition_selectivity=4 and =1
|
||||
#
|
||||
SET @save_old_mode=@@old_mode;
|
||||
SET @@old_mode=zero_date_time_cast;
|
||||
CREATE TABLE t1 (a TIME);
|
||||
INSERT INTO t1 VALUES ('0000-00-00 10:20:30'),('0000-00-00 10:20:31');
|
||||
INSERT INTO t1 VALUES ('0000-00-01 10:20:30'),('0000-00-01 10:20:31');
|
||||
INSERT INTO t1 VALUES ('31 10:20:30'),('32 10:20:30'),('33 10:20:30'),('34 10:20:30');
|
||||
SET @save_optimizer_use_condition_selectivity= @@optimizer_use_condition_selectivity;
|
||||
SET @@optimizer_use_condition_selectivity=1;
|
||||
SELECT * FROM t1 WHERE a='0000-00-01 10:20:30' AND LENGTH(a)=8;
|
||||
a
|
||||
34:20:30
|
||||
EXPLAIN EXTENDED SELECT * FROM t1 WHERE a='0000-00-01 10:20:30' AND LENGTH(a)=8;
|
||||
id select_type table type possible_keys key key_len ref rows filtered Extra
|
||||
1 SIMPLE t1 ALL NULL NULL NULL NULL 8 100.00 Using where
|
||||
Warnings:
|
||||
Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = '0000-00-01 10:20:30' and octet_length(`test`.`t1`.`a`) = 8
|
||||
SET @@optimizer_use_condition_selectivity=4;
|
||||
SELECT * FROM t1 WHERE a='0000-00-01 10:20:30' AND LENGTH(a)=8;
|
||||
a
|
||||
34:20:30
|
||||
EXPLAIN EXTENDED SELECT * FROM t1 WHERE a='0000-00-01 10:20:30' AND LENGTH(a)=8;
|
||||
id select_type table type possible_keys key key_len ref rows filtered Extra
|
||||
1 SIMPLE t1 ALL NULL NULL NULL NULL 8 100.00 Using where
|
||||
Warnings:
|
||||
Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = '0000-00-01 10:20:30' and octet_length(`test`.`t1`.`a`) = 8
|
||||
drop table t1;
|
||||
SET @@optimizer_use_condition_selectivity= @save_optimizer_use_condition_selectivity;
|
||||
set @@old_mode= @save_old_mode;
|
||||
#
|
||||
# End of 10.1 tests
|
||||
#
|
||||
#
|
||||
|
@ -26,6 +26,9 @@ sub skip_combinations {
|
||||
die "unknown value max-binlog-stmt-cache-size=$longsysvar" unless $val_map{$longsysvar};
|
||||
$skip{'include/word_size.combinations'} = [ $val_map{$longsysvar} ];
|
||||
|
||||
$skip{'include/maybe_debug.combinations'} =
|
||||
[ defined $::mysqld_variables{'debug-dbug'} ? 'release' : 'debug' ];
|
||||
|
||||
# as a special case, disable certain include files as a whole
|
||||
$skip{'include/not_embedded.inc'} = 'Not run for embedded server'
|
||||
if $::opt_embedded_server;
|
||||
|
@ -13,12 +13,12 @@ NAME
|
||||
test/t3
|
||||
SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION <> 0;
|
||||
NAME
|
||||
mysql/innodb_table_stats
|
||||
innodb_system
|
||||
mysql/innodb_index_stats
|
||||
mysql/innodb_table_stats
|
||||
mysql/transaction_registry
|
||||
test/t1
|
||||
test/t2
|
||||
innodb_system
|
||||
# t1 yes on expecting NOT FOUND
|
||||
NOT FOUND /foobarsecret/ in t1.ibd
|
||||
# t2 ... on expecting NOT FOUND
|
||||
@ -32,12 +32,12 @@ SET GLOBAL innodb_encrypt_tables = off;
|
||||
# Wait max 10 min for key encryption threads to decrypt all spaces
|
||||
SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION = 0;
|
||||
NAME
|
||||
mysql/innodb_table_stats
|
||||
innodb_system
|
||||
mysql/innodb_index_stats
|
||||
mysql/innodb_table_stats
|
||||
mysql/transaction_registry
|
||||
test/t2
|
||||
test/t3
|
||||
innodb_system
|
||||
SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION <> 0;
|
||||
NAME
|
||||
test/t1
|
||||
@ -57,12 +57,12 @@ NAME
|
||||
test/t3
|
||||
SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION <> 0;
|
||||
NAME
|
||||
mysql/innodb_table_stats
|
||||
innodb_system
|
||||
mysql/innodb_index_stats
|
||||
mysql/innodb_table_stats
|
||||
mysql/transaction_registry
|
||||
test/t1
|
||||
test/t2
|
||||
innodb_system
|
||||
# t1 yes on expecting NOT FOUND
|
||||
NOT FOUND /foobarsecret/ in t1.ibd
|
||||
# t2 ... on expecting NOT FOUND
|
||||
|
@ -129,6 +129,6 @@ NOT FOUND /barfoo/ in t2.ibd
|
||||
# t3 yes on expecting NOT FOUND
|
||||
NOT FOUND /tmpres/ in t3.ibd
|
||||
# t4 yes on expecting NOT FOUND
|
||||
# MDEV-15527 FIXME: Enable this test!
|
||||
NOT FOUND /mysql/ in t4.ibd
|
||||
DROP PROCEDURE innodb_insert_proc;
|
||||
DROP TABLE t1,t2,t3,t4;
|
||||
|
@ -36,12 +36,12 @@ INSERT INTO t2 values(1, 'secret', ST_GeomFromText('POINT(903994614 180726515)')
|
||||
# Success!
|
||||
SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION > 0;
|
||||
NAME
|
||||
mysql/innodb_table_stats
|
||||
innodb_system
|
||||
mysql/innodb_index_stats
|
||||
mysql/innodb_table_stats
|
||||
mysql/transaction_registry
|
||||
test/t1
|
||||
test/t2
|
||||
innodb_system
|
||||
SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION = 0;
|
||||
NAME
|
||||
DROP TABLE t1, t2;
|
||||
|
@ -8,25 +8,23 @@ innodb_encryption_rotation_iops 100
|
||||
innodb_encryption_threads 4
|
||||
SET GLOBAL innodb_encrypt_tables = ON;
|
||||
# Wait max 10 min for key encryption threads to encrypt all spaces
|
||||
SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION = 0;
|
||||
SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION = 0
|
||||
AND NAME NOT LIKE 'innodb_undo%' AND NAME NOT LIKE 'mysql/innodb_%_stats' AND NAME NOT LIKE 'mysql/transaction_registry';
|
||||
NAME
|
||||
SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION <> 0;
|
||||
SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION <> 0
|
||||
AND NAME NOT LIKE 'innodb_undo%' AND NAME NOT LIKE 'mysql/innodb_%_stats' AND NAME NOT LIKE 'mysql/transaction_registry';
|
||||
NAME
|
||||
mysql/innodb_table_stats
|
||||
mysql/innodb_index_stats
|
||||
mysql/transaction_registry
|
||||
innodb_system
|
||||
# Success!
|
||||
# Now turn off encryption and wait for threads to decrypt everything
|
||||
SET GLOBAL innodb_encrypt_tables = off;
|
||||
# Wait max 10 min for key encryption threads to encrypt all spaces
|
||||
SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION = 0;
|
||||
SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION = 0
|
||||
AND NAME NOT LIKE 'innodb_undo%' AND NAME NOT LIKE 'mysql/innodb_%_stats' AND NAME NOT LIKE 'mysql/transaction_registry';
|
||||
NAME
|
||||
mysql/innodb_table_stats
|
||||
mysql/innodb_index_stats
|
||||
mysql/transaction_registry
|
||||
innodb_system
|
||||
SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION <> 0;
|
||||
SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION <> 0
|
||||
AND NAME NOT LIKE 'innodb_undo%' AND NAME NOT LIKE 'mysql/innodb_%_stats' AND NAME NOT LIKE 'mysql/transaction_registry';
|
||||
NAME
|
||||
# Success!
|
||||
# Shutdown innodb_encryption_threads
|
||||
@ -35,25 +33,23 @@ SET GLOBAL innodb_encryption_threads=0;
|
||||
# since threads are off tables should remain unencrypted
|
||||
SET GLOBAL innodb_encrypt_tables = on;
|
||||
# Wait 15s to check that nothing gets encrypted
|
||||
SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION = 0;
|
||||
SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION = 0
|
||||
AND NAME NOT LIKE 'innodb_undo%' AND NAME NOT LIKE 'mysql/innodb_%_stats' AND NAME NOT LIKE 'mysql/transaction_registry';
|
||||
NAME
|
||||
mysql/innodb_table_stats
|
||||
mysql/innodb_index_stats
|
||||
mysql/transaction_registry
|
||||
innodb_system
|
||||
SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION <> 0;
|
||||
SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION <> 0
|
||||
AND NAME NOT LIKE 'innodb_undo%' AND NAME NOT LIKE 'mysql/innodb_%_stats' AND NAME NOT LIKE 'mysql/transaction_registry';
|
||||
NAME
|
||||
# Success!
|
||||
# Startup innodb_encryption_threads
|
||||
SET GLOBAL innodb_encryption_threads=@start_global_value;
|
||||
# Wait max 10 min for key encryption threads to encrypt all spaces
|
||||
SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION = 0;
|
||||
SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION = 0
|
||||
AND NAME NOT LIKE 'innodb_undo%' AND NAME NOT LIKE 'mysql/innodb_%_stats' AND NAME NOT LIKE 'mysql/transaction_registry';
|
||||
NAME
|
||||
SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION <> 0;
|
||||
SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION <> 0
|
||||
AND NAME NOT LIKE 'innodb_undo%' AND NAME NOT LIKE 'mysql/innodb_%_stats' AND NAME NOT LIKE 'mysql/transaction_registry';
|
||||
NAME
|
||||
mysql/innodb_table_stats
|
||||
mysql/innodb_index_stats
|
||||
mysql/transaction_registry
|
||||
innodb_system
|
||||
# Success!
|
||||
# Restart mysqld --innodb_encrypt_tables=0 --innodb_encryption_threads=0
|
||||
@ -64,11 +60,10 @@ innodb_encrypt_tables OFF
|
||||
innodb_encryption_rotate_key_age 15
|
||||
innodb_encryption_rotation_iops 100
|
||||
innodb_encryption_threads 0
|
||||
SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION <> 0;
|
||||
SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION <> 0
|
||||
AND NAME NOT LIKE 'innodb_undo%' AND NAME NOT LIKE 'mysql/innodb_%_stats' AND NAME NOT LIKE 'mysql/transaction_registry';
|
||||
NAME
|
||||
mysql/innodb_table_stats
|
||||
mysql/innodb_index_stats
|
||||
mysql/transaction_registry
|
||||
innodb_system
|
||||
SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION = 0;
|
||||
SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION = 0
|
||||
AND NAME NOT LIKE 'innodb_undo%' AND NAME NOT LIKE 'mysql/innodb_%_stats' AND NAME NOT LIKE 'mysql/transaction_registry';
|
||||
NAME
|
||||
|
@ -30,7 +30,9 @@ insert t3 values (repeat('dummysecret', 12));
|
||||
--let $wait_condition=SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION = 0
|
||||
--source include/wait_condition.inc
|
||||
|
||||
--sorted_result
|
||||
SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION = 0;
|
||||
--sorted_result
|
||||
SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION <> 0;
|
||||
|
||||
--source include/shutdown_mysqld.inc
|
||||
@ -64,7 +66,9 @@ SET GLOBAL innodb_encrypt_tables = off;
|
||||
--let $wait_condition=SELECT COUNT(*) = $tables_count FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION = 0 AND CURRENT_KEY_VERSION = 0;
|
||||
--source include/wait_condition.inc
|
||||
|
||||
--sorted_result
|
||||
SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION = 0;
|
||||
--sorted_result
|
||||
SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION <> 0;
|
||||
|
||||
--source include/shutdown_mysqld.inc
|
||||
@ -97,7 +101,9 @@ SET GLOBAL innodb_encrypt_tables = on;
|
||||
--let $wait_condition=SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION = 0;
|
||||
--source include/wait_condition.inc
|
||||
|
||||
--sorted_result
|
||||
SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION = 0;
|
||||
--sorted_result
|
||||
SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION <> 0;
|
||||
|
||||
--source include/shutdown_mysqld.inc
|
||||
|
@ -111,8 +111,7 @@ SELECT COUNT(*) FROM t4;
|
||||
--let SEARCH_PATTERN=mysql
|
||||
--echo # t4 yes on expecting NOT FOUND
|
||||
-- let SEARCH_FILE=$t4_IBD
|
||||
--echo # MDEV-15527 FIXME: Enable this test!
|
||||
#-- source include/search_pattern_in_file.inc
|
||||
-- source include/search_pattern_in_file.inc
|
||||
|
||||
DROP PROCEDURE innodb_insert_proc;
|
||||
DROP TABLE t1,t2,t3,t4;
|
||||
|
@ -69,7 +69,9 @@ INSERT INTO t2 values(1, 'secret', ST_GeomFromText('POINT(903994614 180726515)')
|
||||
|
||||
--echo # Success!
|
||||
|
||||
--sorted_result
|
||||
SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION > 0;
|
||||
--sorted_result
|
||||
SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION = 0;
|
||||
|
||||
DROP TABLE t1, t2;
|
||||
|
@ -21,8 +21,12 @@ SET GLOBAL innodb_encrypt_tables = ON;
|
||||
--let $wait_condition=SELECT COUNT(*) >= $tables_count FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION <> 0;
|
||||
--source include/wait_condition.inc
|
||||
|
||||
SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION = 0;
|
||||
SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION <> 0;
|
||||
--sorted_result
|
||||
SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION = 0
|
||||
AND NAME NOT LIKE 'innodb_undo%' AND NAME NOT LIKE 'mysql/innodb_%_stats' AND NAME NOT LIKE 'mysql/transaction_registry';
|
||||
--sorted_result
|
||||
SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION <> 0
|
||||
AND NAME NOT LIKE 'innodb_undo%' AND NAME NOT LIKE 'mysql/innodb_%_stats' AND NAME NOT LIKE 'mysql/transaction_registry';
|
||||
|
||||
--echo # Success!
|
||||
|
||||
@ -34,8 +38,12 @@ SET GLOBAL innodb_encrypt_tables = off;
|
||||
--let $wait_condition=SELECT COUNT(*) = 0 FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION <> 0;
|
||||
--source include/wait_condition.inc
|
||||
|
||||
SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION = 0;
|
||||
SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION <> 0;
|
||||
--sorted_result
|
||||
SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION = 0
|
||||
AND NAME NOT LIKE 'innodb_undo%' AND NAME NOT LIKE 'mysql/innodb_%_stats' AND NAME NOT LIKE 'mysql/transaction_registry';
|
||||
--sorted_result
|
||||
SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION <> 0
|
||||
AND NAME NOT LIKE 'innodb_undo%' AND NAME NOT LIKE 'mysql/innodb_%_stats' AND NAME NOT LIKE 'mysql/transaction_registry';
|
||||
|
||||
--echo # Success!
|
||||
|
||||
@ -51,8 +59,12 @@ SET GLOBAL innodb_encrypt_tables = on;
|
||||
--let $wait_condition=SELECT COUNT(*) = 0 FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION <> 0;
|
||||
--source include/wait_condition.inc
|
||||
|
||||
SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION = 0;
|
||||
SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION <> 0;
|
||||
--sorted_result
|
||||
SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION = 0
|
||||
AND NAME NOT LIKE 'innodb_undo%' AND NAME NOT LIKE 'mysql/innodb_%_stats' AND NAME NOT LIKE 'mysql/transaction_registry';
|
||||
--sorted_result
|
||||
SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION <> 0
|
||||
AND NAME NOT LIKE 'innodb_undo%' AND NAME NOT LIKE 'mysql/innodb_%_stats' AND NAME NOT LIKE 'mysql/transaction_registry';
|
||||
|
||||
--echo # Success!
|
||||
|
||||
@ -64,8 +76,12 @@ SET GLOBAL innodb_encryption_threads=@start_global_value;
|
||||
--let $wait_condition=SELECT COUNT(*) >= $tables_count FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION <> 0;
|
||||
--source include/wait_condition.inc
|
||||
|
||||
SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION = 0;
|
||||
SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION <> 0;
|
||||
--sorted_result
|
||||
SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION = 0
|
||||
AND NAME NOT LIKE 'innodb_undo%' AND NAME NOT LIKE 'mysql/innodb_%_stats' AND NAME NOT LIKE 'mysql/transaction_registry';
|
||||
--sorted_result
|
||||
SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION <> 0
|
||||
AND NAME NOT LIKE 'innodb_undo%' AND NAME NOT LIKE 'mysql/innodb_%_stats' AND NAME NOT LIKE 'mysql/transaction_registry';
|
||||
|
||||
--echo # Success!
|
||||
--echo # Restart mysqld --innodb_encrypt_tables=0 --innodb_encryption_threads=0
|
||||
@ -74,5 +90,9 @@ SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_
|
||||
|
||||
SHOW VARIABLES LIKE 'innodb_encrypt%';
|
||||
|
||||
SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION <> 0;
|
||||
SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION = 0;
|
||||
--sorted_result
|
||||
SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION <> 0
|
||||
AND NAME NOT LIKE 'innodb_undo%' AND NAME NOT LIKE 'mysql/innodb_%_stats' AND NAME NOT LIKE 'mysql/transaction_registry';
|
||||
--sorted_result
|
||||
SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION = 0
|
||||
AND NAME NOT LIKE 'innodb_undo%' AND NAME NOT LIKE 'mysql/innodb_%_stats' AND NAME NOT LIKE 'mysql/transaction_registry';
|
||||
|
@ -96,7 +96,7 @@ SET GLOBAL innodb_encryption_threads=5;
|
||||
let $cnt=600;
|
||||
while ($cnt)
|
||||
{
|
||||
let $success=`SELECT COUNT(*) = 0 FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_SCRUBBING WHERE LAST_SCRUB_COMPLETED IS NULL AND ( NAME in ('test/t1', 'test/t2', 'test/t3') OR SPACE = 0 )`;
|
||||
let $success=`SELECT COUNT(*) = 0 FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_SCRUBBING WHERE LAST_SCRUB_COMPLETED IS NULL AND (NAME LIKE 'test/%' OR SPACE = 0)`;
|
||||
if ($success)
|
||||
{
|
||||
let $cnt=0;
|
||||
|
@ -1215,7 +1215,7 @@ c1 c2
|
||||
838:59:59 838:59:59
|
||||
UPDATE IGNORE t1 SET t1.c2='99999.99999' WHERE c1 BETWEEN 080000 AND 100000;
|
||||
Warnings:
|
||||
Warning 1265 Data truncated for column 'c2' at row 1
|
||||
Warning 1265 Data truncated for column 'c2' at row N
|
||||
SELECT * FROM t1;
|
||||
c1 c2
|
||||
-12:12:12 12:12:12
|
||||
|
@ -172,6 +172,7 @@ SELECT * FROM t1;
|
||||
|
||||
# Update using range
|
||||
# EXPLAIN SELECT * FROM t1 WHERE c1 BETWEEN 080000 AND 100000;
|
||||
--replace_regex /(Data truncated for column 'c2' at row) [1-9][0-9]*/\1 N/
|
||||
UPDATE IGNORE t1 SET t1.c2='99999.99999' WHERE c1 BETWEEN 080000 AND 100000;
|
||||
--sorted_result
|
||||
SELECT * FROM t1;
|
||||
|
@ -9,18 +9,14 @@
|
||||
# Do not use any TAB characters for whitespace.
|
||||
#
|
||||
##############################################################################
|
||||
MW-336 : MDEV-13549 Galera test failures
|
||||
galera_gra_log : MDEV-13549 Galera test failures
|
||||
galera_flush_local : MDEV-13549 Galera test failures
|
||||
galera_flush : MDEV-13549 Galera test failures
|
||||
MW-329 : MDEV-13549 Galera test failures
|
||||
galera_account_management : MariaDB 10.0 does not support ALTER USER
|
||||
galera_binlog_row_image : MariaDB 10.0 does not support binlog_row_image
|
||||
galera_binlog_rows_query_log_events: MariaDB does not support binlog_rows_query_log_events
|
||||
GAL-419 : MDEV-13549 Galera test failures
|
||||
galera_toi_ddl_fk_insert : MDEV-13549 Galera test failures
|
||||
galera_var_notify_cmd : MDEV-13549 Galera test failures
|
||||
galera_var_slave_threads : MDEV-13549 Galera test failures
|
||||
mysql-wsrep#90 : MDEV-13549 Galera test failures
|
||||
galera_as_master_gtid : Requires MySQL GTID
|
||||
galera_as_master_gtid_change_master : Requires MySQL GTID
|
||||
@ -34,7 +30,6 @@ galera_ist_mysqldump : MDEV-13549 Galera test failures
|
||||
mysql-wsrep#31 : MDEV-13549 Galera test failures
|
||||
galera_migrate : MariaDB 10.0 does not support START SLAVE USER
|
||||
galera_concurrent_ctas : MDEV-13549 Galera test failures
|
||||
galera_bf_abort_for_update : MDEV-13549 Galera test failures
|
||||
galera_wsrep_desync_wsrep_on : MDEV-13549 Galera test failures
|
||||
galera_ssl_upgrade : MDEV-13549 Galera test failures
|
||||
mysql-wsrep#33 : MDEV-13549 Galera test failures
|
||||
@ -47,7 +42,6 @@ lp1376747 : MDEV-13549 Galera test failures
|
||||
galera_toi_ddl_nonconflicting : MDEV-13549 Galera test failures
|
||||
galera_parallel_simple : MDEV-13549 Galera test failures
|
||||
galera_admin : MDEV-13549 Galera test failures
|
||||
galera_var_max_ws_rows : MDEV-13549 Galera test failures 10.1
|
||||
MW-286 : MDEV-13549 Galera test failures 10.1
|
||||
galera_as_master: MDEV-13549 Galera test failures 10.1
|
||||
galera_pc_ignore_sb : MDEV-13549 Galera test failures 10.1
|
||||
@ -65,3 +59,4 @@ galera_ist_progress: MDEV-15236 galera_ist_progress fails when trying to read tr
|
||||
galera_gtid : MDEV-13549 Galera test failures 10.1
|
||||
galera_gtid_slave : MDEV-13549 Galera test failures 10.1
|
||||
galera_unicode_identifiers : MDEV-13549 Galera test failures 10.1
|
||||
galera.galera_gcs_fc_limit : MDEV-13549 Galera test failures 10.1
|
||||
|
@ -4,6 +4,9 @@
|
||||
|
||||
--echo Setting SST method to mysqldump ...
|
||||
|
||||
call mtr.add_suppression("WSREP: wsrep_sst_method is set to 'mysqldump' yet mysqld bind_address is set to '127.0.0.1'");
|
||||
call mtr.add_suppression("Failed to load slave replication state from table mysql.gtid_slave_pos");
|
||||
|
||||
--connection node_1
|
||||
# We need a user with a password to perform SST, otherwise we hit LP #1378253
|
||||
CREATE USER 'sst';
|
||||
@ -19,6 +22,6 @@ SET GLOBAL wsrep_sst_auth = 'sst:';
|
||||
|
||||
--disable_query_log
|
||||
# Set wsrep_sst_receive_address to the SQL port
|
||||
--eval SET GLOBAL wsrep_sst_receive_address = '127.0.0.2:$NODE_MYPORT_2';
|
||||
--eval SET GLOBAL wsrep_sst_receive_address = '127.0.0.1:$NODE_MYPORT_2';
|
||||
--enable_query_log
|
||||
SET GLOBAL wsrep_sst_method = 'mysqldump';
|
||||
|
@ -1,3 +1,5 @@
|
||||
source include/maybe_debug.inc;
|
||||
if ($have_debug) {
|
||||
--echo Performing State Transfer on a server that has been killed and restarted
|
||||
--echo while a DDL was in progress on it
|
||||
|
||||
@ -121,3 +123,4 @@ COMMIT;
|
||||
SET AUTOCOMMIT=ON;
|
||||
|
||||
SET GLOBAL debug_dbug = $debug_orig;
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
--echo Performing --wsrep-recover ...
|
||||
--exec $MYSQLD --defaults-group-suffix=.$galera_wsrep_recover_server_id --defaults-file=$MYSQLTEST_VARDIR/my.cnf --innodb --wsrep-recover > $MYSQL_TMP_DIR/galera_wsrep_recover.log 2>&1
|
||||
--exec $MYSQLD --defaults-group-suffix=.$galera_wsrep_recover_server_id --defaults-file=$MYSQLTEST_VARDIR/my.cnf --log-error=$MYSQL_TMP_DIR/galera_wsrep_recover.log --innodb --wsrep-recover > $MYSQL_TMP_DIR/galera_wsrep_recover.log 2>&1
|
||||
|
||||
--perl
|
||||
use strict;
|
||||
|
4
mysql-test/suite/galera/include/have_mariabackup.inc
Normal file
4
mysql-test/suite/galera/include/have_mariabackup.inc
Normal file
@ -0,0 +1,4 @@
|
||||
#
|
||||
# suite.pm will make sure that all tests including this file
|
||||
# will be skipped as needed
|
||||
#
|
@ -0,0 +1,4 @@
|
||||
--require suite/galera/r/have_wsrep_replicate_myisam.require
|
||||
disable_query_log;
|
||||
SHOW VARIABLES LIKE 'wsrep_replicate_myisam';
|
||||
enable_query_log;
|
4
mysql-test/suite/galera/include/have_xtrabackup.inc
Normal file
4
mysql-test/suite/galera/include/have_xtrabackup.inc
Normal file
@ -0,0 +1,4 @@
|
||||
#
|
||||
# suite.pm will make sure that all tests including this file
|
||||
# will be skipped as needed
|
||||
#
|
@ -27,3 +27,4 @@ connection node_1;
|
||||
DROP PROCEDURE proc_insert;
|
||||
DROP TABLE t1;
|
||||
CALL mtr.add_suppression("conflict state 3 after post commit");
|
||||
set global innodb_status_output=Default;
|
||||
|
@ -1,16 +1,14 @@
|
||||
CREATE TABLE t1 (f1 INTEGER) Engine=InnoDB;
|
||||
connection node_1;
|
||||
SET GLOBAL wsrep_slave_threads = 10;
|
||||
SET GLOBAL wsrep_slave_threads = 1;
|
||||
connection node_2;
|
||||
INSERT INTO t1 VALUES (1);
|
||||
connection node_1;
|
||||
SET GLOBAL wsrep_slave_threads = 10;
|
||||
SELECT COUNT(*) = 11 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = 'system user';
|
||||
COUNT(*) = 11
|
||||
1
|
||||
SET GLOBAL wsrep_slave_threads = 20;
|
||||
SELECT COUNT(*) = 21 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = 'system user';
|
||||
COUNT(*) = 21
|
||||
1
|
||||
SET GLOBAL wsrep_slave_threads = 1;
|
||||
connection node_2;
|
||||
INSERT INTO t1 VALUES (1);
|
||||
INSERT INTO t1 VALUES (2);
|
||||
INSERT INTO t1 VALUES (3);
|
||||
@ -20,10 +18,12 @@ INSERT INTO t1 VALUES (6);
|
||||
INSERT INTO t1 VALUES (7);
|
||||
INSERT INTO t1 VALUES (8);
|
||||
INSERT INTO t1 VALUES (9);
|
||||
connection node_1;
|
||||
SET GLOBAL wsrep_slave_threads = 10;
|
||||
SET GLOBAL wsrep_slave_threads = 0;
|
||||
Warnings:
|
||||
Warning 1292 Truncated incorrect wsrep_slave_threads value: '0'
|
||||
connection node_2;
|
||||
INSERT INTO t1 VALUES (10);
|
||||
INSERT INTO t1 VALUES (11);
|
||||
INSERT INTO t1 VALUES (12);
|
||||
@ -35,8 +35,6 @@ INSERT INTO t1 VALUES (17);
|
||||
INSERT INTO t1 VALUES (18);
|
||||
INSERT INTO t1 VALUES (19);
|
||||
INSERT INTO t1 VALUES (20);
|
||||
SELECT COUNT(*) = 2 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = 'system user';
|
||||
COUNT(*) = 2
|
||||
1
|
||||
connection node_1;
|
||||
SET GLOBAL wsrep_slave_threads = 1;
|
||||
DROP TABLE t1;
|
||||
|
@ -1,10 +1,29 @@
|
||||
CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB;
|
||||
SET AUTOCOMMIT=OFF;
|
||||
START TRANSACTION;
|
||||
INSERT INTO t1 VALUES (1);
|
||||
INSERT INTO t1 VALUES (1);
|
||||
CREATE TABLE t1 (f1 INTEGER PRIMARY KEY, f2 INT) ENGINE=InnoDB;
|
||||
INSERT INTO t1 VALUES (1, 10);
|
||||
connection node_1;
|
||||
BEGIN;
|
||||
SELECT * FROM t1 FOR UPDATE;
|
||||
ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
|
||||
wsrep_local_aborts_increment
|
||||
f1 f2
|
||||
1 10
|
||||
connection node_2;
|
||||
UPDATE t1 SET f1 = 2;
|
||||
connect node_1a, 127.0.0.1, root, , test, $NODE_MYPORT_1;
|
||||
connection node_1;
|
||||
COMMIT;
|
||||
ERROR 40001: Deadlock: wsrep aborted transaction
|
||||
wsrep_local_bf_aborts_diff
|
||||
1
|
||||
connection node_1;
|
||||
BEGIN;
|
||||
SELECT * FROM t1 FOR UPDATE;
|
||||
f1 f2
|
||||
2 10
|
||||
connection node_2;
|
||||
UPDATE t1 SET f2 = 20;
|
||||
connection node_1a;
|
||||
connection node_1;
|
||||
COMMIT;
|
||||
ERROR 40001: Deadlock: wsrep aborted transaction
|
||||
wsrep_local_bf_aborts_diff
|
||||
1
|
||||
DROP TABLE t1;
|
||||
|
@ -1,6 +1,6 @@
|
||||
SELECT COUNT(*) = 43 FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE VARIABLE_NAME LIKE 'wsrep_%';
|
||||
COUNT(*) = 43
|
||||
1
|
||||
0
|
||||
SELECT VARIABLE_NAME, VARIABLE_VALUE
|
||||
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
|
||||
WHERE VARIABLE_NAME LIKE 'wsrep_%'
|
||||
@ -40,6 +40,7 @@ WSREP_NOTIFY_CMD
|
||||
WSREP_ON ON
|
||||
WSREP_OSU_METHOD TOI
|
||||
WSREP_RECOVER OFF
|
||||
WSREP_REJECT_QUERIES NONE
|
||||
WSREP_REPLICATE_MYISAM OFF
|
||||
WSREP_RESTART_SLAVE OFF
|
||||
WSREP_RETRY_AUTOCOMMIT 1
|
||||
|
@ -1,4 +1,5 @@
|
||||
DROP TABLE IF EXISTS t1, t2, x1, x2;
|
||||
connection node_1;
|
||||
CREATE TABLE t1 (f1 INTEGER);
|
||||
CREATE TABLE t2 (f1 INT PRIMARY KEY AUTO_INCREMENT, f2 INTEGER);
|
||||
CREATE TABLE x1 (f1 INTEGER) ENGINE=MyISAM;
|
||||
@ -7,6 +8,8 @@ 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);
|
||||
connection node_2;
|
||||
connection node_1;
|
||||
FLUSH LOCAL DES_KEY_FILE;
|
||||
FLUSH LOCAL HOSTS;
|
||||
FLUSH LOCAL QUERY CACHE;
|
||||
@ -54,6 +57,7 @@ REPAIR LOCAL TABLE x1, x2;
|
||||
Table Op Msg_type Msg_text
|
||||
test.x1 repair status OK
|
||||
test.x2 repair status OK
|
||||
connection node_2;
|
||||
wsrep_last_committed_diff
|
||||
1
|
||||
SELECT COUNT(*) = 10 FROM t1;
|
||||
@ -68,6 +72,7 @@ COUNT(*) = 10000
|
||||
SELECT COUNT(*) = 10 FROM x2;
|
||||
COUNT(*) = 10
|
||||
1
|
||||
connection node_1;
|
||||
DROP TABLE t1, t2, x1, x2;
|
||||
CREATE TABLE t1 (f1 INTEGER);
|
||||
CREATE TABLE t2 (f1 INT PRIMARY KEY AUTO_INCREMENT, f2 INTEGER);
|
||||
@ -77,6 +82,8 @@ 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);
|
||||
connection node_2;
|
||||
connection node_1;
|
||||
set wsrep_on=0;
|
||||
FLUSH DES_KEY_FILE;
|
||||
FLUSH HOSTS;
|
||||
@ -125,6 +132,7 @@ REPAIR TABLE x1, x2;
|
||||
Table Op Msg_type Msg_text
|
||||
test.x1 repair status OK
|
||||
test.x2 repair status OK
|
||||
connection node_2;
|
||||
wsrep_last_committed_diff
|
||||
1
|
||||
wsrep_last_committed_diff2
|
||||
@ -141,5 +149,6 @@ COUNT(*) = 10000
|
||||
SELECT COUNT(*) = 10 FROM x2;
|
||||
COUNT(*) = 10
|
||||
1
|
||||
connection node_1;
|
||||
set wsrep_on=1;
|
||||
DROP TABLE t1, t2, x1, x2;
|
||||
|
13
mysql-test/suite/galera/r/galera_schema_dirty_reads.result
Normal file
13
mysql-test/suite/galera/r/galera_schema_dirty_reads.result
Normal file
@ -0,0 +1,13 @@
|
||||
USE information_schema;
|
||||
SELECT * FROM SESSION_VARIABLES WHERE VARIABLE_NAME LIKE "wsrep_dirty_reads";
|
||||
VARIABLE_NAME VARIABLE_VALUE
|
||||
WSREP_DIRTY_READS OFF
|
||||
SET GLOBAL wsrep_reject_queries=ALL;
|
||||
SELECT * FROM SESSION_VARIABLES WHERE VARIABLE_NAME LIKE "wsrep_dirty_reads";
|
||||
VARIABLE_NAME VARIABLE_VALUE
|
||||
WSREP_DIRTY_READS OFF
|
||||
SET GLOBAL wsrep_reject_queries=NONE;
|
||||
SET SESSION wsrep_dirty_reads=TRUE;
|
||||
SELECT * FROM SESSION_VARIABLES WHERE VARIABLE_NAME LIKE "wsrep_dirty_reads";
|
||||
VARIABLE_NAME VARIABLE_VALUE
|
||||
WSREP_DIRTY_READS ON
|
116
mysql-test/suite/galera/r/galera_sst_mariabackup,debug.rdiff
Normal file
116
mysql-test/suite/galera/r/galera_sst_mariabackup,debug.rdiff
Normal file
@ -0,0 +1,116 @@
|
||||
--- galera_sst_mariabackup.result
|
||||
+++ galera_sst_mariabackup,debug.reject
|
||||
@@ -286,5 +286,113 @@
|
||||
DROP TABLE t1;
|
||||
COMMIT;
|
||||
SET AUTOCOMMIT=ON;
|
||||
+Performing State Transfer on a server that has been killed and restarted
|
||||
+while a DDL was in progress on it
|
||||
+connection node_1;
|
||||
+CREATE TABLE t1 (f1 CHAR(255)) ENGINE=InnoDB;
|
||||
+SET AUTOCOMMIT=OFF;
|
||||
+START TRANSACTION;
|
||||
+INSERT INTO t1 VALUES ('node1_committed_before');
|
||||
+INSERT INTO t1 VALUES ('node1_committed_before');
|
||||
+INSERT INTO t1 VALUES ('node1_committed_before');
|
||||
+INSERT INTO t1 VALUES ('node1_committed_before');
|
||||
+INSERT INTO t1 VALUES ('node1_committed_before');
|
||||
+connection node_2;
|
||||
+START TRANSACTION;
|
||||
+INSERT INTO t1 VALUES ('node2_committed_before');
|
||||
+INSERT INTO t1 VALUES ('node2_committed_before');
|
||||
+INSERT INTO t1 VALUES ('node2_committed_before');
|
||||
+INSERT INTO t1 VALUES ('node2_committed_before');
|
||||
+INSERT INTO t1 VALUES ('node2_committed_before');
|
||||
+COMMIT;
|
||||
+SET GLOBAL debug_dbug = 'd,sync.alter_opened_table';
|
||||
+connection node_1;
|
||||
+ALTER TABLE t1 ADD COLUMN f2 INTEGER;
|
||||
+connection node_2;
|
||||
+SET wsrep_sync_wait = 0;
|
||||
+Killing server ...
|
||||
+connection node_1;
|
||||
+SET AUTOCOMMIT=OFF;
|
||||
+START TRANSACTION;
|
||||
+INSERT INTO t1 (f1) VALUES ('node1_committed_during');
|
||||
+INSERT INTO t1 (f1) VALUES ('node1_committed_during');
|
||||
+INSERT INTO t1 (f1) VALUES ('node1_committed_during');
|
||||
+INSERT INTO t1 (f1) VALUES ('node1_committed_during');
|
||||
+INSERT INTO t1 (f1) VALUES ('node1_committed_during');
|
||||
+COMMIT;
|
||||
+START TRANSACTION;
|
||||
+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
|
||||
+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
|
||||
+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
|
||||
+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
|
||||
+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
|
||||
+connect node_1a_galera_st_kill_slave_ddl, 127.0.0.1, root, , test, $NODE_MYPORT_1;
|
||||
+SET AUTOCOMMIT=OFF;
|
||||
+START TRANSACTION;
|
||||
+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
|
||||
+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
|
||||
+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
|
||||
+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
|
||||
+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
|
||||
+connection node_2;
|
||||
+Performing --wsrep-recover ...
|
||||
+connection node_2;
|
||||
+Starting server ...
|
||||
+Using --wsrep-start-position when starting mysqld ...
|
||||
+SET AUTOCOMMIT=OFF;
|
||||
+START TRANSACTION;
|
||||
+INSERT INTO t1 (f1) VALUES ('node2_committed_after');
|
||||
+INSERT INTO t1 (f1) VALUES ('node2_committed_after');
|
||||
+INSERT INTO t1 (f1) VALUES ('node2_committed_after');
|
||||
+INSERT INTO t1 (f1) VALUES ('node2_committed_after');
|
||||
+INSERT INTO t1 (f1) VALUES ('node2_committed_after');
|
||||
+COMMIT;
|
||||
+connection node_1;
|
||||
+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
|
||||
+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
|
||||
+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
|
||||
+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
|
||||
+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
|
||||
+COMMIT;
|
||||
+SET AUTOCOMMIT=OFF;
|
||||
+START TRANSACTION;
|
||||
+INSERT INTO t1 (f1) VALUES ('node1_committed_after');
|
||||
+INSERT INTO t1 (f1) VALUES ('node1_committed_after');
|
||||
+INSERT INTO t1 (f1) VALUES ('node1_committed_after');
|
||||
+INSERT INTO t1 (f1) VALUES ('node1_committed_after');
|
||||
+INSERT INTO t1 (f1) VALUES ('node1_committed_after');
|
||||
+COMMIT;
|
||||
+connection node_1a_galera_st_kill_slave_ddl;
|
||||
+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
|
||||
+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
|
||||
+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
|
||||
+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
|
||||
+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
|
||||
+ROLLBACK;
|
||||
+SELECT COUNT(*) = 2 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 't1';
|
||||
+COUNT(*) = 2
|
||||
+1
|
||||
+SELECT COUNT(*) = 35 FROM t1;
|
||||
+COUNT(*) = 35
|
||||
+1
|
||||
+SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1;
|
||||
+COUNT(*) = 0
|
||||
+1
|
||||
+COMMIT;
|
||||
+SET AUTOCOMMIT=ON;
|
||||
+connection node_1;
|
||||
+SELECT COUNT(*) = 2 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 't1';
|
||||
+COUNT(*) = 2
|
||||
+1
|
||||
+SELECT COUNT(*) = 35 FROM t1;
|
||||
+COUNT(*) = 35
|
||||
+1
|
||||
+SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1;
|
||||
+COUNT(*) = 0
|
||||
+1
|
||||
+DROP TABLE t1;
|
||||
+COMMIT;
|
||||
+SET AUTOCOMMIT=ON;
|
||||
+SET GLOBAL debug_dbug = $debug_orig;
|
||||
disconnect node_2;
|
||||
disconnect node_1;
|
290
mysql-test/suite/galera/r/galera_sst_mariabackup.result
Normal file
290
mysql-test/suite/galera/r/galera_sst_mariabackup.result
Normal file
@ -0,0 +1,290 @@
|
||||
connection node_1;
|
||||
connection node_2;
|
||||
Performing State Transfer on a server that has been shut down cleanly and restarted
|
||||
connection node_1;
|
||||
CREATE TABLE t1 (f1 CHAR(255)) ENGINE=InnoDB;
|
||||
SET AUTOCOMMIT=OFF;
|
||||
START TRANSACTION;
|
||||
INSERT INTO t1 VALUES ('node1_committed_before');
|
||||
INSERT INTO t1 VALUES ('node1_committed_before');
|
||||
INSERT INTO t1 VALUES ('node1_committed_before');
|
||||
INSERT INTO t1 VALUES ('node1_committed_before');
|
||||
INSERT INTO t1 VALUES ('node1_committed_before');
|
||||
COMMIT;
|
||||
connection node_2;
|
||||
SET AUTOCOMMIT=OFF;
|
||||
START TRANSACTION;
|
||||
INSERT INTO t1 VALUES ('node2_committed_before');
|
||||
INSERT INTO t1 VALUES ('node2_committed_before');
|
||||
INSERT INTO t1 VALUES ('node2_committed_before');
|
||||
INSERT INTO t1 VALUES ('node2_committed_before');
|
||||
INSERT INTO t1 VALUES ('node2_committed_before');
|
||||
COMMIT;
|
||||
Shutting down server ...
|
||||
connection node_1;
|
||||
SET AUTOCOMMIT=OFF;
|
||||
START TRANSACTION;
|
||||
INSERT INTO t1 VALUES ('node1_committed_during');
|
||||
INSERT INTO t1 VALUES ('node1_committed_during');
|
||||
INSERT INTO t1 VALUES ('node1_committed_during');
|
||||
INSERT INTO t1 VALUES ('node1_committed_during');
|
||||
INSERT INTO t1 VALUES ('node1_committed_during');
|
||||
COMMIT;
|
||||
START TRANSACTION;
|
||||
INSERT INTO t1 VALUES ('node1_to_be_committed_after');
|
||||
INSERT INTO t1 VALUES ('node1_to_be_committed_after');
|
||||
INSERT INTO t1 VALUES ('node1_to_be_committed_after');
|
||||
INSERT INTO t1 VALUES ('node1_to_be_committed_after');
|
||||
INSERT INTO t1 VALUES ('node1_to_be_committed_after');
|
||||
connect node_1a_galera_st_shutdown_slave, 127.0.0.1, root, , test, $NODE_MYPORT_1;
|
||||
SET AUTOCOMMIT=OFF;
|
||||
START TRANSACTION;
|
||||
INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
|
||||
INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
|
||||
INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
|
||||
INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
|
||||
INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
|
||||
connection node_2;
|
||||
Starting server ...
|
||||
SET AUTOCOMMIT=OFF;
|
||||
START TRANSACTION;
|
||||
INSERT INTO t1 VALUES ('node2_committed_after');
|
||||
INSERT INTO t1 VALUES ('node2_committed_after');
|
||||
INSERT INTO t1 VALUES ('node2_committed_after');
|
||||
INSERT INTO t1 VALUES ('node2_committed_after');
|
||||
INSERT INTO t1 VALUES ('node2_committed_after');
|
||||
COMMIT;
|
||||
connection node_1;
|
||||
INSERT INTO t1 VALUES ('node1_to_be_committed_after');
|
||||
INSERT INTO t1 VALUES ('node1_to_be_committed_after');
|
||||
INSERT INTO t1 VALUES ('node1_to_be_committed_after');
|
||||
INSERT INTO t1 VALUES ('node1_to_be_committed_after');
|
||||
INSERT INTO t1 VALUES ('node1_to_be_committed_after');
|
||||
COMMIT;
|
||||
SET AUTOCOMMIT=OFF;
|
||||
START TRANSACTION;
|
||||
INSERT INTO t1 VALUES ('node1_committed_after');
|
||||
INSERT INTO t1 VALUES ('node1_committed_after');
|
||||
INSERT INTO t1 VALUES ('node1_committed_after');
|
||||
INSERT INTO t1 VALUES ('node1_committed_after');
|
||||
INSERT INTO t1 VALUES ('node1_committed_after');
|
||||
COMMIT;
|
||||
connection node_1a_galera_st_shutdown_slave;
|
||||
INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
|
||||
INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
|
||||
INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
|
||||
INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
|
||||
INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
|
||||
ROLLBACK;
|
||||
SELECT COUNT(*) = 35 FROM t1;
|
||||
COUNT(*) = 35
|
||||
1
|
||||
SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1;
|
||||
COUNT(*) = 0
|
||||
1
|
||||
COMMIT;
|
||||
SET AUTOCOMMIT=ON;
|
||||
connection node_1;
|
||||
SELECT COUNT(*) = 35 FROM t1;
|
||||
COUNT(*) = 35
|
||||
1
|
||||
SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1;
|
||||
COUNT(*) = 0
|
||||
1
|
||||
DROP TABLE t1;
|
||||
COMMIT;
|
||||
SET AUTOCOMMIT=ON;
|
||||
Performing State Transfer on a server that starts from a clean var directory
|
||||
This is accomplished by shutting down node #2 and removing its var directory before restarting it
|
||||
connection node_1;
|
||||
CREATE TABLE t1 (f1 CHAR(255)) ENGINE=InnoDB;
|
||||
SET AUTOCOMMIT=OFF;
|
||||
START TRANSACTION;
|
||||
INSERT INTO t1 VALUES ('node1_committed_before');
|
||||
INSERT INTO t1 VALUES ('node1_committed_before');
|
||||
INSERT INTO t1 VALUES ('node1_committed_before');
|
||||
INSERT INTO t1 VALUES ('node1_committed_before');
|
||||
INSERT INTO t1 VALUES ('node1_committed_before');
|
||||
COMMIT;
|
||||
connection node_2;
|
||||
SET AUTOCOMMIT=OFF;
|
||||
START TRANSACTION;
|
||||
INSERT INTO t1 VALUES ('node2_committed_before');
|
||||
INSERT INTO t1 VALUES ('node2_committed_before');
|
||||
INSERT INTO t1 VALUES ('node2_committed_before');
|
||||
INSERT INTO t1 VALUES ('node2_committed_before');
|
||||
INSERT INTO t1 VALUES ('node2_committed_before');
|
||||
COMMIT;
|
||||
Shutting down server ...
|
||||
connection node_1;
|
||||
Cleaning var directory ...
|
||||
SET AUTOCOMMIT=OFF;
|
||||
START TRANSACTION;
|
||||
INSERT INTO t1 VALUES ('node1_committed_during');
|
||||
INSERT INTO t1 VALUES ('node1_committed_during');
|
||||
INSERT INTO t1 VALUES ('node1_committed_during');
|
||||
INSERT INTO t1 VALUES ('node1_committed_during');
|
||||
INSERT INTO t1 VALUES ('node1_committed_during');
|
||||
COMMIT;
|
||||
START TRANSACTION;
|
||||
INSERT INTO t1 VALUES ('node1_to_be_committed_after');
|
||||
INSERT INTO t1 VALUES ('node1_to_be_committed_after');
|
||||
INSERT INTO t1 VALUES ('node1_to_be_committed_after');
|
||||
INSERT INTO t1 VALUES ('node1_to_be_committed_after');
|
||||
INSERT INTO t1 VALUES ('node1_to_be_committed_after');
|
||||
connect node_1a_galera_st_clean_slave, 127.0.0.1, root, , test, $NODE_MYPORT_1;
|
||||
SET AUTOCOMMIT=OFF;
|
||||
START TRANSACTION;
|
||||
INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
|
||||
INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
|
||||
INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
|
||||
INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
|
||||
INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
|
||||
connection node_2;
|
||||
Starting server ...
|
||||
SET AUTOCOMMIT=OFF;
|
||||
START TRANSACTION;
|
||||
INSERT INTO t1 VALUES ('node2_committed_after');
|
||||
INSERT INTO t1 VALUES ('node2_committed_after');
|
||||
INSERT INTO t1 VALUES ('node2_committed_after');
|
||||
INSERT INTO t1 VALUES ('node2_committed_after');
|
||||
INSERT INTO t1 VALUES ('node2_committed_after');
|
||||
COMMIT;
|
||||
connection node_1;
|
||||
INSERT INTO t1 VALUES ('node1_to_be_committed_after');
|
||||
INSERT INTO t1 VALUES ('node1_to_be_committed_after');
|
||||
INSERT INTO t1 VALUES ('node1_to_be_committed_after');
|
||||
INSERT INTO t1 VALUES ('node1_to_be_committed_after');
|
||||
INSERT INTO t1 VALUES ('node1_to_be_committed_after');
|
||||
COMMIT;
|
||||
SET AUTOCOMMIT=OFF;
|
||||
START TRANSACTION;
|
||||
INSERT INTO t1 VALUES ('node1_committed_after');
|
||||
INSERT INTO t1 VALUES ('node1_committed_after');
|
||||
INSERT INTO t1 VALUES ('node1_committed_after');
|
||||
INSERT INTO t1 VALUES ('node1_committed_after');
|
||||
INSERT INTO t1 VALUES ('node1_committed_after');
|
||||
COMMIT;
|
||||
connection node_1a_galera_st_clean_slave;
|
||||
INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
|
||||
INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
|
||||
INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
|
||||
INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
|
||||
INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
|
||||
ROLLBACK;
|
||||
SELECT COUNT(*) = 35 FROM t1;
|
||||
COUNT(*) = 35
|
||||
1
|
||||
SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1;
|
||||
COUNT(*) = 0
|
||||
1
|
||||
COMMIT;
|
||||
SET AUTOCOMMIT=ON;
|
||||
connection node_1;
|
||||
SELECT COUNT(*) = 35 FROM t1;
|
||||
COUNT(*) = 35
|
||||
1
|
||||
SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1;
|
||||
COUNT(*) = 0
|
||||
1
|
||||
DROP TABLE t1;
|
||||
COMMIT;
|
||||
SET AUTOCOMMIT=ON;
|
||||
Performing State Transfer on a server that has been killed and restarted
|
||||
connection node_1;
|
||||
CREATE TABLE t1 (f1 CHAR(255)) ENGINE=InnoDB;
|
||||
SET AUTOCOMMIT=OFF;
|
||||
START TRANSACTION;
|
||||
INSERT INTO t1 VALUES ('node1_committed_before');
|
||||
INSERT INTO t1 VALUES ('node1_committed_before');
|
||||
INSERT INTO t1 VALUES ('node1_committed_before');
|
||||
INSERT INTO t1 VALUES ('node1_committed_before');
|
||||
INSERT INTO t1 VALUES ('node1_committed_before');
|
||||
COMMIT;
|
||||
connection node_2;
|
||||
SET AUTOCOMMIT=OFF;
|
||||
START TRANSACTION;
|
||||
INSERT INTO t1 VALUES ('node2_committed_before');
|
||||
INSERT INTO t1 VALUES ('node2_committed_before');
|
||||
INSERT INTO t1 VALUES ('node2_committed_before');
|
||||
INSERT INTO t1 VALUES ('node2_committed_before');
|
||||
INSERT INTO t1 VALUES ('node2_committed_before');
|
||||
COMMIT;
|
||||
Killing server ...
|
||||
connection node_1;
|
||||
SET AUTOCOMMIT=OFF;
|
||||
START TRANSACTION;
|
||||
INSERT INTO t1 VALUES ('node1_committed_during');
|
||||
INSERT INTO t1 VALUES ('node1_committed_during');
|
||||
INSERT INTO t1 VALUES ('node1_committed_during');
|
||||
INSERT INTO t1 VALUES ('node1_committed_during');
|
||||
INSERT INTO t1 VALUES ('node1_committed_during');
|
||||
COMMIT;
|
||||
START TRANSACTION;
|
||||
INSERT INTO t1 VALUES ('node1_to_be_committed_after');
|
||||
INSERT INTO t1 VALUES ('node1_to_be_committed_after');
|
||||
INSERT INTO t1 VALUES ('node1_to_be_committed_after');
|
||||
INSERT INTO t1 VALUES ('node1_to_be_committed_after');
|
||||
INSERT INTO t1 VALUES ('node1_to_be_committed_after');
|
||||
connect node_1a_galera_st_kill_slave, 127.0.0.1, root, , test, $NODE_MYPORT_1;
|
||||
SET AUTOCOMMIT=OFF;
|
||||
START TRANSACTION;
|
||||
INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
|
||||
INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
|
||||
INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
|
||||
INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
|
||||
INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
|
||||
connection node_2;
|
||||
Performing --wsrep-recover ...
|
||||
Starting server ...
|
||||
Using --wsrep-start-position when starting mysqld ...
|
||||
SET AUTOCOMMIT=OFF;
|
||||
START TRANSACTION;
|
||||
INSERT INTO t1 VALUES ('node2_committed_after');
|
||||
INSERT INTO t1 VALUES ('node2_committed_after');
|
||||
INSERT INTO t1 VALUES ('node2_committed_after');
|
||||
INSERT INTO t1 VALUES ('node2_committed_after');
|
||||
INSERT INTO t1 VALUES ('node2_committed_after');
|
||||
COMMIT;
|
||||
connection node_1;
|
||||
INSERT INTO t1 VALUES ('node1_to_be_committed_after');
|
||||
INSERT INTO t1 VALUES ('node1_to_be_committed_after');
|
||||
INSERT INTO t1 VALUES ('node1_to_be_committed_after');
|
||||
INSERT INTO t1 VALUES ('node1_to_be_committed_after');
|
||||
INSERT INTO t1 VALUES ('node1_to_be_committed_after');
|
||||
COMMIT;
|
||||
SET AUTOCOMMIT=OFF;
|
||||
START TRANSACTION;
|
||||
INSERT INTO t1 VALUES ('node1_committed_after');
|
||||
INSERT INTO t1 VALUES ('node1_committed_after');
|
||||
INSERT INTO t1 VALUES ('node1_committed_after');
|
||||
INSERT INTO t1 VALUES ('node1_committed_after');
|
||||
INSERT INTO t1 VALUES ('node1_committed_after');
|
||||
COMMIT;
|
||||
connection node_1a_galera_st_kill_slave;
|
||||
INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
|
||||
INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
|
||||
INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
|
||||
INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
|
||||
INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
|
||||
ROLLBACK;
|
||||
SELECT COUNT(*) = 35 FROM t1;
|
||||
COUNT(*) = 35
|
||||
1
|
||||
SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1;
|
||||
COUNT(*) = 0
|
||||
1
|
||||
COMMIT;
|
||||
SET AUTOCOMMIT=ON;
|
||||
connection node_1;
|
||||
SELECT COUNT(*) = 35 FROM t1;
|
||||
COUNT(*) = 35
|
||||
1
|
||||
SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1;
|
||||
COUNT(*) = 0
|
||||
1
|
||||
DROP TABLE t1;
|
||||
COMMIT;
|
||||
SET AUTOCOMMIT=ON;
|
||||
disconnect node_2;
|
||||
disconnect node_1;
|
117
mysql-test/suite/galera/r/galera_sst_mysqldump,debug.rdiff
Normal file
117
mysql-test/suite/galera/r/galera_sst_mysqldump,debug.rdiff
Normal file
@ -0,0 +1,117 @@
|
||||
--- galera_sst_mysqldump.result
|
||||
+++ galera_sst_mysqldump,debug.reject
|
||||
@@ -388,6 +388,114 @@
|
||||
DROP TABLE t1;
|
||||
COMMIT;
|
||||
SET AUTOCOMMIT=ON;
|
||||
+Performing State Transfer on a server that has been killed and restarted
|
||||
+while a DDL was in progress on it
|
||||
+connection node_1;
|
||||
+CREATE TABLE t1 (f1 CHAR(255)) ENGINE=InnoDB;
|
||||
+SET AUTOCOMMIT=OFF;
|
||||
+START TRANSACTION;
|
||||
+INSERT INTO t1 VALUES ('node1_committed_before');
|
||||
+INSERT INTO t1 VALUES ('node1_committed_before');
|
||||
+INSERT INTO t1 VALUES ('node1_committed_before');
|
||||
+INSERT INTO t1 VALUES ('node1_committed_before');
|
||||
+INSERT INTO t1 VALUES ('node1_committed_before');
|
||||
+connection node_2;
|
||||
+START TRANSACTION;
|
||||
+INSERT INTO t1 VALUES ('node2_committed_before');
|
||||
+INSERT INTO t1 VALUES ('node2_committed_before');
|
||||
+INSERT INTO t1 VALUES ('node2_committed_before');
|
||||
+INSERT INTO t1 VALUES ('node2_committed_before');
|
||||
+INSERT INTO t1 VALUES ('node2_committed_before');
|
||||
+COMMIT;
|
||||
+SET GLOBAL debug_dbug = 'd,sync.alter_opened_table';
|
||||
+connection node_1;
|
||||
+ALTER TABLE t1 ADD COLUMN f2 INTEGER;
|
||||
+connection node_2;
|
||||
+SET wsrep_sync_wait = 0;
|
||||
+Killing server ...
|
||||
+connection node_1;
|
||||
+SET AUTOCOMMIT=OFF;
|
||||
+START TRANSACTION;
|
||||
+INSERT INTO t1 (f1) VALUES ('node1_committed_during');
|
||||
+INSERT INTO t1 (f1) VALUES ('node1_committed_during');
|
||||
+INSERT INTO t1 (f1) VALUES ('node1_committed_during');
|
||||
+INSERT INTO t1 (f1) VALUES ('node1_committed_during');
|
||||
+INSERT INTO t1 (f1) VALUES ('node1_committed_during');
|
||||
+COMMIT;
|
||||
+START TRANSACTION;
|
||||
+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
|
||||
+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
|
||||
+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
|
||||
+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
|
||||
+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
|
||||
+connect node_1a_galera_st_kill_slave_ddl, 127.0.0.1, root, , test, $NODE_MYPORT_1;
|
||||
+SET AUTOCOMMIT=OFF;
|
||||
+START TRANSACTION;
|
||||
+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
|
||||
+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
|
||||
+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
|
||||
+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
|
||||
+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
|
||||
+connection node_2;
|
||||
+Performing --wsrep-recover ...
|
||||
+connection node_2;
|
||||
+Starting server ...
|
||||
+Using --wsrep-start-position when starting mysqld ...
|
||||
+SET AUTOCOMMIT=OFF;
|
||||
+START TRANSACTION;
|
||||
+INSERT INTO t1 (f1) VALUES ('node2_committed_after');
|
||||
+INSERT INTO t1 (f1) VALUES ('node2_committed_after');
|
||||
+INSERT INTO t1 (f1) VALUES ('node2_committed_after');
|
||||
+INSERT INTO t1 (f1) VALUES ('node2_committed_after');
|
||||
+INSERT INTO t1 (f1) VALUES ('node2_committed_after');
|
||||
+COMMIT;
|
||||
+connection node_1;
|
||||
+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
|
||||
+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
|
||||
+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
|
||||
+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
|
||||
+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
|
||||
+COMMIT;
|
||||
+SET AUTOCOMMIT=OFF;
|
||||
+START TRANSACTION;
|
||||
+INSERT INTO t1 (f1) VALUES ('node1_committed_after');
|
||||
+INSERT INTO t1 (f1) VALUES ('node1_committed_after');
|
||||
+INSERT INTO t1 (f1) VALUES ('node1_committed_after');
|
||||
+INSERT INTO t1 (f1) VALUES ('node1_committed_after');
|
||||
+INSERT INTO t1 (f1) VALUES ('node1_committed_after');
|
||||
+COMMIT;
|
||||
+connection node_1a_galera_st_kill_slave_ddl;
|
||||
+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
|
||||
+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
|
||||
+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
|
||||
+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
|
||||
+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
|
||||
+ROLLBACK;
|
||||
+SELECT COUNT(*) = 2 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 't1';
|
||||
+COUNT(*) = 2
|
||||
+1
|
||||
+SELECT COUNT(*) = 35 FROM t1;
|
||||
+COUNT(*) = 35
|
||||
+1
|
||||
+SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1;
|
||||
+COUNT(*) = 0
|
||||
+1
|
||||
+COMMIT;
|
||||
+SET AUTOCOMMIT=ON;
|
||||
+connection node_1;
|
||||
+SELECT COUNT(*) = 2 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 't1';
|
||||
+COUNT(*) = 2
|
||||
+1
|
||||
+SELECT COUNT(*) = 35 FROM t1;
|
||||
+COUNT(*) = 35
|
||||
+1
|
||||
+SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1;
|
||||
+COUNT(*) = 0
|
||||
+1
|
||||
+DROP TABLE t1;
|
||||
+COMMIT;
|
||||
+SET AUTOCOMMIT=ON;
|
||||
+SET GLOBAL debug_dbug = $debug_orig;
|
||||
connection node_1;
|
||||
CALL mtr.add_suppression("Slave SQL: Error 'The MySQL server is running with the --skip-grant-tables option so it cannot execute this statement' on query");
|
||||
DROP USER sst;
|
@ -1,9 +1,16 @@
|
||||
Setting SST method to mysqldump ...
|
||||
call mtr.add_suppression("WSREP: wsrep_sst_method is set to 'mysqldump' yet mysqld bind_address is set to '127.0.0.1'");
|
||||
call mtr.add_suppression("Failed to load slave replication state from table mysql.gtid_slave_pos");
|
||||
connection node_1;
|
||||
CREATE USER 'sst';
|
||||
GRANT ALL PRIVILEGES ON *.* TO 'sst';
|
||||
SET GLOBAL wsrep_sst_auth = 'sst:';
|
||||
connection node_2;
|
||||
SET GLOBAL wsrep_sst_method = 'mysqldump';
|
||||
connection node_1;
|
||||
connection node_2;
|
||||
Performing State Transfer on a server that has been temporarily disconnected
|
||||
connection node_1;
|
||||
CREATE TABLE t1 (f1 CHAR(255)) ENGINE=InnoDB;
|
||||
SET AUTOCOMMIT=OFF;
|
||||
START TRANSACTION;
|
||||
@ -13,6 +20,7 @@ INSERT INTO t1 VALUES ('node1_committed_before');
|
||||
INSERT INTO t1 VALUES ('node1_committed_before');
|
||||
INSERT INTO t1 VALUES ('node1_committed_before');
|
||||
COMMIT;
|
||||
connection node_2;
|
||||
SET AUTOCOMMIT=OFF;
|
||||
START TRANSACTION;
|
||||
INSERT INTO t1 VALUES ('node2_committed_before');
|
||||
@ -23,6 +31,7 @@ INSERT INTO t1 VALUES ('node2_committed_before');
|
||||
COMMIT;
|
||||
Unloading wsrep provider ...
|
||||
SET GLOBAL wsrep_provider = 'none';
|
||||
connection node_1;
|
||||
SET AUTOCOMMIT=OFF;
|
||||
START TRANSACTION;
|
||||
INSERT INTO t1 VALUES ('node1_committed_during');
|
||||
@ -37,6 +46,7 @@ INSERT INTO t1 VALUES ('node1_to_be_committed_after');
|
||||
INSERT INTO t1 VALUES ('node1_to_be_committed_after');
|
||||
INSERT INTO t1 VALUES ('node1_to_be_committed_after');
|
||||
INSERT INTO t1 VALUES ('node1_to_be_committed_after');
|
||||
connect node_1a_galera_st_disconnect_slave, 127.0.0.1, root, , test, $NODE_MYPORT_1;
|
||||
SET AUTOCOMMIT=OFF;
|
||||
START TRANSACTION;
|
||||
INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
|
||||
@ -44,6 +54,7 @@ INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
|
||||
INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
|
||||
INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
|
||||
INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
|
||||
connection node_2;
|
||||
Loading wsrep provider ...
|
||||
SET AUTOCOMMIT=OFF;
|
||||
START TRANSACTION;
|
||||
@ -53,6 +64,7 @@ INSERT INTO t1 VALUES ('node2_committed_after');
|
||||
INSERT INTO t1 VALUES ('node2_committed_after');
|
||||
INSERT INTO t1 VALUES ('node2_committed_after');
|
||||
COMMIT;
|
||||
connection node_1;
|
||||
INSERT INTO t1 VALUES ('node1_to_be_committed_after');
|
||||
INSERT INTO t1 VALUES ('node1_to_be_committed_after');
|
||||
INSERT INTO t1 VALUES ('node1_to_be_committed_after');
|
||||
@ -67,6 +79,7 @@ INSERT INTO t1 VALUES ('node1_committed_after');
|
||||
INSERT INTO t1 VALUES ('node1_committed_after');
|
||||
INSERT INTO t1 VALUES ('node1_committed_after');
|
||||
COMMIT;
|
||||
connection node_1a_galera_st_disconnect_slave;
|
||||
INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
|
||||
INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
|
||||
INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
|
||||
@ -81,6 +94,7 @@ COUNT(*) = 0
|
||||
1
|
||||
COMMIT;
|
||||
SET AUTOCOMMIT=ON;
|
||||
connection node_1;
|
||||
SELECT COUNT(*) = 35 FROM t1;
|
||||
COUNT(*) = 35
|
||||
1
|
||||
@ -91,6 +105,7 @@ DROP TABLE t1;
|
||||
COMMIT;
|
||||
SET AUTOCOMMIT=ON;
|
||||
Performing State Transfer on a server that has been shut down cleanly and restarted
|
||||
connection node_1;
|
||||
CREATE TABLE t1 (f1 CHAR(255)) ENGINE=InnoDB;
|
||||
SET AUTOCOMMIT=OFF;
|
||||
START TRANSACTION;
|
||||
@ -100,6 +115,7 @@ INSERT INTO t1 VALUES ('node1_committed_before');
|
||||
INSERT INTO t1 VALUES ('node1_committed_before');
|
||||
INSERT INTO t1 VALUES ('node1_committed_before');
|
||||
COMMIT;
|
||||
connection node_2;
|
||||
SET AUTOCOMMIT=OFF;
|
||||
START TRANSACTION;
|
||||
INSERT INTO t1 VALUES ('node2_committed_before');
|
||||
@ -109,6 +125,7 @@ INSERT INTO t1 VALUES ('node2_committed_before');
|
||||
INSERT INTO t1 VALUES ('node2_committed_before');
|
||||
COMMIT;
|
||||
Shutting down server ...
|
||||
connection node_1;
|
||||
SET AUTOCOMMIT=OFF;
|
||||
START TRANSACTION;
|
||||
INSERT INTO t1 VALUES ('node1_committed_during');
|
||||
@ -123,6 +140,7 @@ INSERT INTO t1 VALUES ('node1_to_be_committed_after');
|
||||
INSERT INTO t1 VALUES ('node1_to_be_committed_after');
|
||||
INSERT INTO t1 VALUES ('node1_to_be_committed_after');
|
||||
INSERT INTO t1 VALUES ('node1_to_be_committed_after');
|
||||
connect node_1a_galera_st_shutdown_slave, 127.0.0.1, root, , test, $NODE_MYPORT_1;
|
||||
SET AUTOCOMMIT=OFF;
|
||||
START TRANSACTION;
|
||||
INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
|
||||
@ -130,6 +148,7 @@ INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
|
||||
INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
|
||||
INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
|
||||
INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
|
||||
connection node_2;
|
||||
Starting server ...
|
||||
SET AUTOCOMMIT=OFF;
|
||||
START TRANSACTION;
|
||||
@ -139,6 +158,7 @@ INSERT INTO t1 VALUES ('node2_committed_after');
|
||||
INSERT INTO t1 VALUES ('node2_committed_after');
|
||||
INSERT INTO t1 VALUES ('node2_committed_after');
|
||||
COMMIT;
|
||||
connection node_1;
|
||||
INSERT INTO t1 VALUES ('node1_to_be_committed_after');
|
||||
INSERT INTO t1 VALUES ('node1_to_be_committed_after');
|
||||
INSERT INTO t1 VALUES ('node1_to_be_committed_after');
|
||||
@ -153,6 +173,7 @@ INSERT INTO t1 VALUES ('node1_committed_after');
|
||||
INSERT INTO t1 VALUES ('node1_committed_after');
|
||||
INSERT INTO t1 VALUES ('node1_committed_after');
|
||||
COMMIT;
|
||||
connection node_1a_galera_st_shutdown_slave;
|
||||
INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
|
||||
INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
|
||||
INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
|
||||
@ -167,6 +188,7 @@ COUNT(*) = 0
|
||||
1
|
||||
COMMIT;
|
||||
SET AUTOCOMMIT=ON;
|
||||
connection node_1;
|
||||
SELECT COUNT(*) = 35 FROM t1;
|
||||
COUNT(*) = 35
|
||||
1
|
||||
@ -178,6 +200,7 @@ COMMIT;
|
||||
SET AUTOCOMMIT=ON;
|
||||
Performing State Transfer on a server that starts from a clean var directory
|
||||
This is accomplished by shutting down node #2 and removing its var directory before restarting it
|
||||
connection node_1;
|
||||
CREATE TABLE t1 (f1 CHAR(255)) ENGINE=InnoDB;
|
||||
SET AUTOCOMMIT=OFF;
|
||||
START TRANSACTION;
|
||||
@ -187,6 +210,7 @@ INSERT INTO t1 VALUES ('node1_committed_before');
|
||||
INSERT INTO t1 VALUES ('node1_committed_before');
|
||||
INSERT INTO t1 VALUES ('node1_committed_before');
|
||||
COMMIT;
|
||||
connection node_2;
|
||||
SET AUTOCOMMIT=OFF;
|
||||
START TRANSACTION;
|
||||
INSERT INTO t1 VALUES ('node2_committed_before');
|
||||
@ -196,6 +220,7 @@ INSERT INTO t1 VALUES ('node2_committed_before');
|
||||
INSERT INTO t1 VALUES ('node2_committed_before');
|
||||
COMMIT;
|
||||
Shutting down server ...
|
||||
connection node_1;
|
||||
Cleaning var directory ...
|
||||
SET AUTOCOMMIT=OFF;
|
||||
START TRANSACTION;
|
||||
@ -211,6 +236,7 @@ INSERT INTO t1 VALUES ('node1_to_be_committed_after');
|
||||
INSERT INTO t1 VALUES ('node1_to_be_committed_after');
|
||||
INSERT INTO t1 VALUES ('node1_to_be_committed_after');
|
||||
INSERT INTO t1 VALUES ('node1_to_be_committed_after');
|
||||
connect node_1a_galera_st_clean_slave, 127.0.0.1, root, , test, $NODE_MYPORT_1;
|
||||
SET AUTOCOMMIT=OFF;
|
||||
START TRANSACTION;
|
||||
INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
|
||||
@ -218,6 +244,7 @@ INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
|
||||
INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
|
||||
INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
|
||||
INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
|
||||
connection node_2;
|
||||
Starting server ...
|
||||
SET AUTOCOMMIT=OFF;
|
||||
START TRANSACTION;
|
||||
@ -227,6 +254,7 @@ INSERT INTO t1 VALUES ('node2_committed_after');
|
||||
INSERT INTO t1 VALUES ('node2_committed_after');
|
||||
INSERT INTO t1 VALUES ('node2_committed_after');
|
||||
COMMIT;
|
||||
connection node_1;
|
||||
INSERT INTO t1 VALUES ('node1_to_be_committed_after');
|
||||
INSERT INTO t1 VALUES ('node1_to_be_committed_after');
|
||||
INSERT INTO t1 VALUES ('node1_to_be_committed_after');
|
||||
@ -241,6 +269,7 @@ INSERT INTO t1 VALUES ('node1_committed_after');
|
||||
INSERT INTO t1 VALUES ('node1_committed_after');
|
||||
INSERT INTO t1 VALUES ('node1_committed_after');
|
||||
COMMIT;
|
||||
connection node_1a_galera_st_clean_slave;
|
||||
INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
|
||||
INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
|
||||
INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
|
||||
@ -255,6 +284,7 @@ COUNT(*) = 0
|
||||
1
|
||||
COMMIT;
|
||||
SET AUTOCOMMIT=ON;
|
||||
connection node_1;
|
||||
SELECT COUNT(*) = 35 FROM t1;
|
||||
COUNT(*) = 35
|
||||
1
|
||||
@ -265,6 +295,7 @@ DROP TABLE t1;
|
||||
COMMIT;
|
||||
SET AUTOCOMMIT=ON;
|
||||
Performing State Transfer on a server that has been killed and restarted
|
||||
connection node_1;
|
||||
CREATE TABLE t1 (f1 CHAR(255)) ENGINE=InnoDB;
|
||||
SET AUTOCOMMIT=OFF;
|
||||
START TRANSACTION;
|
||||
@ -274,6 +305,7 @@ INSERT INTO t1 VALUES ('node1_committed_before');
|
||||
INSERT INTO t1 VALUES ('node1_committed_before');
|
||||
INSERT INTO t1 VALUES ('node1_committed_before');
|
||||
COMMIT;
|
||||
connection node_2;
|
||||
SET AUTOCOMMIT=OFF;
|
||||
START TRANSACTION;
|
||||
INSERT INTO t1 VALUES ('node2_committed_before');
|
||||
@ -283,6 +315,7 @@ INSERT INTO t1 VALUES ('node2_committed_before');
|
||||
INSERT INTO t1 VALUES ('node2_committed_before');
|
||||
COMMIT;
|
||||
Killing server ...
|
||||
connection node_1;
|
||||
SET AUTOCOMMIT=OFF;
|
||||
START TRANSACTION;
|
||||
INSERT INTO t1 VALUES ('node1_committed_during');
|
||||
@ -297,6 +330,7 @@ INSERT INTO t1 VALUES ('node1_to_be_committed_after');
|
||||
INSERT INTO t1 VALUES ('node1_to_be_committed_after');
|
||||
INSERT INTO t1 VALUES ('node1_to_be_committed_after');
|
||||
INSERT INTO t1 VALUES ('node1_to_be_committed_after');
|
||||
connect node_1a_galera_st_kill_slave, 127.0.0.1, root, , test, $NODE_MYPORT_1;
|
||||
SET AUTOCOMMIT=OFF;
|
||||
START TRANSACTION;
|
||||
INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
|
||||
@ -304,6 +338,7 @@ INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
|
||||
INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
|
||||
INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
|
||||
INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
|
||||
connection node_2;
|
||||
Performing --wsrep-recover ...
|
||||
Starting server ...
|
||||
Using --wsrep-start-position when starting mysqld ...
|
||||
@ -315,6 +350,7 @@ INSERT INTO t1 VALUES ('node2_committed_after');
|
||||
INSERT INTO t1 VALUES ('node2_committed_after');
|
||||
INSERT INTO t1 VALUES ('node2_committed_after');
|
||||
COMMIT;
|
||||
connection node_1;
|
||||
INSERT INTO t1 VALUES ('node1_to_be_committed_after');
|
||||
INSERT INTO t1 VALUES ('node1_to_be_committed_after');
|
||||
INSERT INTO t1 VALUES ('node1_to_be_committed_after');
|
||||
@ -329,6 +365,7 @@ INSERT INTO t1 VALUES ('node1_committed_after');
|
||||
INSERT INTO t1 VALUES ('node1_committed_after');
|
||||
INSERT INTO t1 VALUES ('node1_committed_after');
|
||||
COMMIT;
|
||||
connection node_1a_galera_st_kill_slave;
|
||||
INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
|
||||
INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
|
||||
INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
|
||||
@ -343,6 +380,7 @@ COUNT(*) = 0
|
||||
1
|
||||
COMMIT;
|
||||
SET AUTOCOMMIT=ON;
|
||||
connection node_1;
|
||||
SELECT COUNT(*) = 35 FROM t1;
|
||||
COUNT(*) = 35
|
||||
1
|
||||
@ -352,104 +390,10 @@ COUNT(*) = 0
|
||||
DROP TABLE t1;
|
||||
COMMIT;
|
||||
SET AUTOCOMMIT=ON;
|
||||
Performing State Transfer on a server that has been killed and restarted
|
||||
while a DDL was in progress on it
|
||||
CREATE TABLE t1 (f1 CHAR(255)) ENGINE=InnoDB;
|
||||
SET AUTOCOMMIT=OFF;
|
||||
START TRANSACTION;
|
||||
INSERT INTO t1 VALUES ('node1_committed_before');
|
||||
INSERT INTO t1 VALUES ('node1_committed_before');
|
||||
INSERT INTO t1 VALUES ('node1_committed_before');
|
||||
INSERT INTO t1 VALUES ('node1_committed_before');
|
||||
INSERT INTO t1 VALUES ('node1_committed_before');
|
||||
START TRANSACTION;
|
||||
INSERT INTO t1 VALUES ('node2_committed_before');
|
||||
INSERT INTO t1 VALUES ('node2_committed_before');
|
||||
INSERT INTO t1 VALUES ('node2_committed_before');
|
||||
INSERT INTO t1 VALUES ('node2_committed_before');
|
||||
INSERT INTO t1 VALUES ('node2_committed_before');
|
||||
COMMIT;
|
||||
SET GLOBAL debug = 'd,sync.alter_opened_table';
|
||||
ALTER TABLE t1 ADD COLUMN f2 INTEGER;
|
||||
SET wsrep_sync_wait = 0;
|
||||
Killing server ...
|
||||
SET AUTOCOMMIT=OFF;
|
||||
START TRANSACTION;
|
||||
INSERT INTO t1 (f1) VALUES ('node1_committed_during');
|
||||
INSERT INTO t1 (f1) VALUES ('node1_committed_during');
|
||||
INSERT INTO t1 (f1) VALUES ('node1_committed_during');
|
||||
INSERT INTO t1 (f1) VALUES ('node1_committed_during');
|
||||
INSERT INTO t1 (f1) VALUES ('node1_committed_during');
|
||||
COMMIT;
|
||||
START TRANSACTION;
|
||||
INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
|
||||
INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
|
||||
INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
|
||||
INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
|
||||
INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
|
||||
SET AUTOCOMMIT=OFF;
|
||||
START TRANSACTION;
|
||||
INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
|
||||
INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
|
||||
INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
|
||||
INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
|
||||
INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
|
||||
Performing --wsrep-recover ...
|
||||
Starting server ...
|
||||
Using --wsrep-start-position when starting mysqld ...
|
||||
SET AUTOCOMMIT=OFF;
|
||||
START TRANSACTION;
|
||||
INSERT INTO t1 (f1) VALUES ('node2_committed_after');
|
||||
INSERT INTO t1 (f1) VALUES ('node2_committed_after');
|
||||
INSERT INTO t1 (f1) VALUES ('node2_committed_after');
|
||||
INSERT INTO t1 (f1) VALUES ('node2_committed_after');
|
||||
INSERT INTO t1 (f1) VALUES ('node2_committed_after');
|
||||
COMMIT;
|
||||
INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
|
||||
INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
|
||||
INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
|
||||
INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
|
||||
INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
|
||||
COMMIT;
|
||||
SET AUTOCOMMIT=OFF;
|
||||
START TRANSACTION;
|
||||
INSERT INTO t1 (f1) VALUES ('node1_committed_after');
|
||||
INSERT INTO t1 (f1) VALUES ('node1_committed_after');
|
||||
INSERT INTO t1 (f1) VALUES ('node1_committed_after');
|
||||
INSERT INTO t1 (f1) VALUES ('node1_committed_after');
|
||||
INSERT INTO t1 (f1) VALUES ('node1_committed_after');
|
||||
COMMIT;
|
||||
INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
|
||||
INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
|
||||
INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
|
||||
INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
|
||||
INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
|
||||
ROLLBACK;
|
||||
SELECT COUNT(*) = 2 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 't1';
|
||||
COUNT(*) = 2
|
||||
1
|
||||
SELECT COUNT(*) = 35 FROM t1;
|
||||
COUNT(*) = 35
|
||||
1
|
||||
SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1;
|
||||
COUNT(*) = 0
|
||||
1
|
||||
COMMIT;
|
||||
SET AUTOCOMMIT=ON;
|
||||
SELECT COUNT(*) = 2 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 't1';
|
||||
COUNT(*) = 2
|
||||
1
|
||||
SELECT COUNT(*) = 35 FROM t1;
|
||||
COUNT(*) = 35
|
||||
1
|
||||
SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1;
|
||||
COUNT(*) = 0
|
||||
1
|
||||
DROP TABLE t1;
|
||||
COMMIT;
|
||||
SET AUTOCOMMIT=ON;
|
||||
connection node_1;
|
||||
CALL mtr.add_suppression("Slave SQL: Error 'The MySQL server is running with the --skip-grant-tables option so it cannot execute this statement' on query");
|
||||
DROP USER sst;
|
||||
connection node_2;
|
||||
CALL mtr.add_suppression("Slave SQL: Error 'The MySQL server is running with the --skip-grant-tables option so it cannot execute this statement' on query");
|
||||
CALL mtr.add_suppression("InnoDB: Error: Table \"mysql\"\\.\"innodb_index_stats\" not found");
|
||||
CALL mtr.add_suppression("Can't open and lock time zone table");
|
||||
|
114
mysql-test/suite/galera/r/galera_sst_rsync,debug.rdiff
Normal file
114
mysql-test/suite/galera/r/galera_sst_rsync,debug.rdiff
Normal file
@ -0,0 +1,114 @@
|
||||
--- galera_sst_rsync.result
|
||||
+++ galera_sst_rsync,debug.reject
|
||||
@@ -284,3 +284,111 @@
|
||||
DROP TABLE t1;
|
||||
COMMIT;
|
||||
SET AUTOCOMMIT=ON;
|
||||
+Performing State Transfer on a server that has been killed and restarted
|
||||
+while a DDL was in progress on it
|
||||
+connection node_1;
|
||||
+CREATE TABLE t1 (f1 CHAR(255)) ENGINE=InnoDB;
|
||||
+SET AUTOCOMMIT=OFF;
|
||||
+START TRANSACTION;
|
||||
+INSERT INTO t1 VALUES ('node1_committed_before');
|
||||
+INSERT INTO t1 VALUES ('node1_committed_before');
|
||||
+INSERT INTO t1 VALUES ('node1_committed_before');
|
||||
+INSERT INTO t1 VALUES ('node1_committed_before');
|
||||
+INSERT INTO t1 VALUES ('node1_committed_before');
|
||||
+connection node_2;
|
||||
+START TRANSACTION;
|
||||
+INSERT INTO t1 VALUES ('node2_committed_before');
|
||||
+INSERT INTO t1 VALUES ('node2_committed_before');
|
||||
+INSERT INTO t1 VALUES ('node2_committed_before');
|
||||
+INSERT INTO t1 VALUES ('node2_committed_before');
|
||||
+INSERT INTO t1 VALUES ('node2_committed_before');
|
||||
+COMMIT;
|
||||
+SET GLOBAL debug_dbug = 'd,sync.alter_opened_table';
|
||||
+connection node_1;
|
||||
+ALTER TABLE t1 ADD COLUMN f2 INTEGER;
|
||||
+connection node_2;
|
||||
+SET wsrep_sync_wait = 0;
|
||||
+Killing server ...
|
||||
+connection node_1;
|
||||
+SET AUTOCOMMIT=OFF;
|
||||
+START TRANSACTION;
|
||||
+INSERT INTO t1 (f1) VALUES ('node1_committed_during');
|
||||
+INSERT INTO t1 (f1) VALUES ('node1_committed_during');
|
||||
+INSERT INTO t1 (f1) VALUES ('node1_committed_during');
|
||||
+INSERT INTO t1 (f1) VALUES ('node1_committed_during');
|
||||
+INSERT INTO t1 (f1) VALUES ('node1_committed_during');
|
||||
+COMMIT;
|
||||
+START TRANSACTION;
|
||||
+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
|
||||
+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
|
||||
+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
|
||||
+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
|
||||
+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
|
||||
+connect node_1a_galera_st_kill_slave_ddl, 127.0.0.1, root, , test, $NODE_MYPORT_1;
|
||||
+SET AUTOCOMMIT=OFF;
|
||||
+START TRANSACTION;
|
||||
+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
|
||||
+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
|
||||
+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
|
||||
+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
|
||||
+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
|
||||
+connection node_2;
|
||||
+Performing --wsrep-recover ...
|
||||
+connection node_2;
|
||||
+Starting server ...
|
||||
+Using --wsrep-start-position when starting mysqld ...
|
||||
+SET AUTOCOMMIT=OFF;
|
||||
+START TRANSACTION;
|
||||
+INSERT INTO t1 (f1) VALUES ('node2_committed_after');
|
||||
+INSERT INTO t1 (f1) VALUES ('node2_committed_after');
|
||||
+INSERT INTO t1 (f1) VALUES ('node2_committed_after');
|
||||
+INSERT INTO t1 (f1) VALUES ('node2_committed_after');
|
||||
+INSERT INTO t1 (f1) VALUES ('node2_committed_after');
|
||||
+COMMIT;
|
||||
+connection node_1;
|
||||
+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
|
||||
+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
|
||||
+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
|
||||
+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
|
||||
+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
|
||||
+COMMIT;
|
||||
+SET AUTOCOMMIT=OFF;
|
||||
+START TRANSACTION;
|
||||
+INSERT INTO t1 (f1) VALUES ('node1_committed_after');
|
||||
+INSERT INTO t1 (f1) VALUES ('node1_committed_after');
|
||||
+INSERT INTO t1 (f1) VALUES ('node1_committed_after');
|
||||
+INSERT INTO t1 (f1) VALUES ('node1_committed_after');
|
||||
+INSERT INTO t1 (f1) VALUES ('node1_committed_after');
|
||||
+COMMIT;
|
||||
+connection node_1a_galera_st_kill_slave_ddl;
|
||||
+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
|
||||
+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
|
||||
+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
|
||||
+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
|
||||
+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
|
||||
+ROLLBACK;
|
||||
+SELECT COUNT(*) = 2 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 't1';
|
||||
+COUNT(*) = 2
|
||||
+1
|
||||
+SELECT COUNT(*) = 35 FROM t1;
|
||||
+COUNT(*) = 35
|
||||
+1
|
||||
+SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1;
|
||||
+COUNT(*) = 0
|
||||
+1
|
||||
+COMMIT;
|
||||
+SET AUTOCOMMIT=ON;
|
||||
+connection node_1;
|
||||
+SELECT COUNT(*) = 2 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 't1';
|
||||
+COUNT(*) = 2
|
||||
+1
|
||||
+SELECT COUNT(*) = 35 FROM t1;
|
||||
+COUNT(*) = 35
|
||||
+1
|
||||
+SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1;
|
||||
+COUNT(*) = 0
|
||||
+1
|
||||
+DROP TABLE t1;
|
||||
+COMMIT;
|
||||
+SET AUTOCOMMIT=ON;
|
||||
+SET GLOBAL debug_dbug = $debug_orig;
|
@ -1,3 +1,5 @@
|
||||
connection node_1;
|
||||
connection node_2;
|
||||
Performing State Transfer on a server that has been shut down cleanly and restarted
|
||||
connection node_1;
|
||||
CREATE TABLE t1 (f1 CHAR(255)) ENGINE=InnoDB;
|
||||
@ -284,111 +286,3 @@ COUNT(*) = 0
|
||||
DROP TABLE t1;
|
||||
COMMIT;
|
||||
SET AUTOCOMMIT=ON;
|
||||
Performing State Transfer on a server that has been killed and restarted
|
||||
while a DDL was in progress on it
|
||||
connection node_1;
|
||||
CREATE TABLE t1 (f1 CHAR(255)) ENGINE=InnoDB;
|
||||
SET AUTOCOMMIT=OFF;
|
||||
START TRANSACTION;
|
||||
INSERT INTO t1 VALUES ('node1_committed_before');
|
||||
INSERT INTO t1 VALUES ('node1_committed_before');
|
||||
INSERT INTO t1 VALUES ('node1_committed_before');
|
||||
INSERT INTO t1 VALUES ('node1_committed_before');
|
||||
INSERT INTO t1 VALUES ('node1_committed_before');
|
||||
connection node_2;
|
||||
START TRANSACTION;
|
||||
INSERT INTO t1 VALUES ('node2_committed_before');
|
||||
INSERT INTO t1 VALUES ('node2_committed_before');
|
||||
INSERT INTO t1 VALUES ('node2_committed_before');
|
||||
INSERT INTO t1 VALUES ('node2_committed_before');
|
||||
INSERT INTO t1 VALUES ('node2_committed_before');
|
||||
COMMIT;
|
||||
SET GLOBAL debug_dbug = 'd,sync.alter_opened_table';
|
||||
connection node_1;
|
||||
ALTER TABLE t1 ADD COLUMN f2 INTEGER;
|
||||
connection node_2;
|
||||
SET wsrep_sync_wait = 0;
|
||||
Killing server ...
|
||||
connection node_1;
|
||||
SET AUTOCOMMIT=OFF;
|
||||
START TRANSACTION;
|
||||
INSERT INTO t1 (f1) VALUES ('node1_committed_during');
|
||||
INSERT INTO t1 (f1) VALUES ('node1_committed_during');
|
||||
INSERT INTO t1 (f1) VALUES ('node1_committed_during');
|
||||
INSERT INTO t1 (f1) VALUES ('node1_committed_during');
|
||||
INSERT INTO t1 (f1) VALUES ('node1_committed_during');
|
||||
COMMIT;
|
||||
START TRANSACTION;
|
||||
INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
|
||||
INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
|
||||
INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
|
||||
INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
|
||||
INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
|
||||
connect node_1a_galera_st_kill_slave_ddl, 127.0.0.1, root, , test, $NODE_MYPORT_1;
|
||||
SET AUTOCOMMIT=OFF;
|
||||
START TRANSACTION;
|
||||
INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
|
||||
INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
|
||||
INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
|
||||
INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
|
||||
INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
|
||||
connection node_2;
|
||||
Performing --wsrep-recover ...
|
||||
connection node_2;
|
||||
Starting server ...
|
||||
Using --wsrep-start-position when starting mysqld ...
|
||||
SET AUTOCOMMIT=OFF;
|
||||
START TRANSACTION;
|
||||
INSERT INTO t1 (f1) VALUES ('node2_committed_after');
|
||||
INSERT INTO t1 (f1) VALUES ('node2_committed_after');
|
||||
INSERT INTO t1 (f1) VALUES ('node2_committed_after');
|
||||
INSERT INTO t1 (f1) VALUES ('node2_committed_after');
|
||||
INSERT INTO t1 (f1) VALUES ('node2_committed_after');
|
||||
COMMIT;
|
||||
connection node_1;
|
||||
INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
|
||||
INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
|
||||
INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
|
||||
INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
|
||||
INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
|
||||
COMMIT;
|
||||
SET AUTOCOMMIT=OFF;
|
||||
START TRANSACTION;
|
||||
INSERT INTO t1 (f1) VALUES ('node1_committed_after');
|
||||
INSERT INTO t1 (f1) VALUES ('node1_committed_after');
|
||||
INSERT INTO t1 (f1) VALUES ('node1_committed_after');
|
||||
INSERT INTO t1 (f1) VALUES ('node1_committed_after');
|
||||
INSERT INTO t1 (f1) VALUES ('node1_committed_after');
|
||||
COMMIT;
|
||||
connection node_1a_galera_st_kill_slave_ddl;
|
||||
INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
|
||||
INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
|
||||
INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
|
||||
INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
|
||||
INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
|
||||
ROLLBACK;
|
||||
SELECT COUNT(*) = 2 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 't1';
|
||||
COUNT(*) = 2
|
||||
1
|
||||
SELECT COUNT(*) = 35 FROM t1;
|
||||
COUNT(*) = 35
|
||||
1
|
||||
SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1;
|
||||
COUNT(*) = 0
|
||||
1
|
||||
COMMIT;
|
||||
SET AUTOCOMMIT=ON;
|
||||
connection node_1;
|
||||
SELECT COUNT(*) = 2 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 't1';
|
||||
COUNT(*) = 2
|
||||
1
|
||||
SELECT COUNT(*) = 35 FROM t1;
|
||||
COUNT(*) = 35
|
||||
1
|
||||
SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1;
|
||||
COUNT(*) = 0
|
||||
1
|
||||
DROP TABLE t1;
|
||||
COMMIT;
|
||||
SET AUTOCOMMIT=ON;
|
||||
SET GLOBAL debug_dbug = $debug_orig;
|
||||
|
116
mysql-test/suite/galera/r/galera_sst_xtrabackup-v2,debug.rdiff
Normal file
116
mysql-test/suite/galera/r/galera_sst_xtrabackup-v2,debug.rdiff
Normal file
@ -0,0 +1,116 @@
|
||||
--- galera_sst_mariabackup.result
|
||||
+++ galera_sst_mariabackup,debug.reject
|
||||
@@ -286,5 +286,113 @@
|
||||
DROP TABLE t1;
|
||||
COMMIT;
|
||||
SET AUTOCOMMIT=ON;
|
||||
+Performing State Transfer on a server that has been killed and restarted
|
||||
+while a DDL was in progress on it
|
||||
+connection node_1;
|
||||
+CREATE TABLE t1 (f1 CHAR(255)) ENGINE=InnoDB;
|
||||
+SET AUTOCOMMIT=OFF;
|
||||
+START TRANSACTION;
|
||||
+INSERT INTO t1 VALUES ('node1_committed_before');
|
||||
+INSERT INTO t1 VALUES ('node1_committed_before');
|
||||
+INSERT INTO t1 VALUES ('node1_committed_before');
|
||||
+INSERT INTO t1 VALUES ('node1_committed_before');
|
||||
+INSERT INTO t1 VALUES ('node1_committed_before');
|
||||
+connection node_2;
|
||||
+START TRANSACTION;
|
||||
+INSERT INTO t1 VALUES ('node2_committed_before');
|
||||
+INSERT INTO t1 VALUES ('node2_committed_before');
|
||||
+INSERT INTO t1 VALUES ('node2_committed_before');
|
||||
+INSERT INTO t1 VALUES ('node2_committed_before');
|
||||
+INSERT INTO t1 VALUES ('node2_committed_before');
|
||||
+COMMIT;
|
||||
+SET GLOBAL debug_dbug = 'd,sync.alter_opened_table';
|
||||
+connection node_1;
|
||||
+ALTER TABLE t1 ADD COLUMN f2 INTEGER;
|
||||
+connection node_2;
|
||||
+SET wsrep_sync_wait = 0;
|
||||
+Killing server ...
|
||||
+connection node_1;
|
||||
+SET AUTOCOMMIT=OFF;
|
||||
+START TRANSACTION;
|
||||
+INSERT INTO t1 (f1) VALUES ('node1_committed_during');
|
||||
+INSERT INTO t1 (f1) VALUES ('node1_committed_during');
|
||||
+INSERT INTO t1 (f1) VALUES ('node1_committed_during');
|
||||
+INSERT INTO t1 (f1) VALUES ('node1_committed_during');
|
||||
+INSERT INTO t1 (f1) VALUES ('node1_committed_during');
|
||||
+COMMIT;
|
||||
+START TRANSACTION;
|
||||
+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
|
||||
+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
|
||||
+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
|
||||
+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
|
||||
+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
|
||||
+connect node_1a_galera_st_kill_slave_ddl, 127.0.0.1, root, , test, $NODE_MYPORT_1;
|
||||
+SET AUTOCOMMIT=OFF;
|
||||
+START TRANSACTION;
|
||||
+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
|
||||
+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
|
||||
+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
|
||||
+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
|
||||
+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
|
||||
+connection node_2;
|
||||
+Performing --wsrep-recover ...
|
||||
+connection node_2;
|
||||
+Starting server ...
|
||||
+Using --wsrep-start-position when starting mysqld ...
|
||||
+SET AUTOCOMMIT=OFF;
|
||||
+START TRANSACTION;
|
||||
+INSERT INTO t1 (f1) VALUES ('node2_committed_after');
|
||||
+INSERT INTO t1 (f1) VALUES ('node2_committed_after');
|
||||
+INSERT INTO t1 (f1) VALUES ('node2_committed_after');
|
||||
+INSERT INTO t1 (f1) VALUES ('node2_committed_after');
|
||||
+INSERT INTO t1 (f1) VALUES ('node2_committed_after');
|
||||
+COMMIT;
|
||||
+connection node_1;
|
||||
+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
|
||||
+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
|
||||
+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
|
||||
+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
|
||||
+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
|
||||
+COMMIT;
|
||||
+SET AUTOCOMMIT=OFF;
|
||||
+START TRANSACTION;
|
||||
+INSERT INTO t1 (f1) VALUES ('node1_committed_after');
|
||||
+INSERT INTO t1 (f1) VALUES ('node1_committed_after');
|
||||
+INSERT INTO t1 (f1) VALUES ('node1_committed_after');
|
||||
+INSERT INTO t1 (f1) VALUES ('node1_committed_after');
|
||||
+INSERT INTO t1 (f1) VALUES ('node1_committed_after');
|
||||
+COMMIT;
|
||||
+connection node_1a_galera_st_kill_slave_ddl;
|
||||
+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
|
||||
+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
|
||||
+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
|
||||
+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
|
||||
+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
|
||||
+ROLLBACK;
|
||||
+SELECT COUNT(*) = 2 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 't1';
|
||||
+COUNT(*) = 2
|
||||
+1
|
||||
+SELECT COUNT(*) = 35 FROM t1;
|
||||
+COUNT(*) = 35
|
||||
+1
|
||||
+SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1;
|
||||
+COUNT(*) = 0
|
||||
+1
|
||||
+COMMIT;
|
||||
+SET AUTOCOMMIT=ON;
|
||||
+connection node_1;
|
||||
+SELECT COUNT(*) = 2 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 't1';
|
||||
+COUNT(*) = 2
|
||||
+1
|
||||
+SELECT COUNT(*) = 35 FROM t1;
|
||||
+COUNT(*) = 35
|
||||
+1
|
||||
+SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1;
|
||||
+COUNT(*) = 0
|
||||
+1
|
||||
+DROP TABLE t1;
|
||||
+COMMIT;
|
||||
+SET AUTOCOMMIT=ON;
|
||||
+SET GLOBAL debug_dbug = $debug_orig;
|
||||
disconnect node_2;
|
||||
disconnect node_1;
|
@ -1,4 +1,7 @@
|
||||
connection node_1;
|
||||
connection node_2;
|
||||
Performing State Transfer on a server that has been shut down cleanly and restarted
|
||||
connection node_1;
|
||||
CREATE TABLE t1 (f1 CHAR(255)) ENGINE=InnoDB;
|
||||
SET AUTOCOMMIT=OFF;
|
||||
START TRANSACTION;
|
||||
@ -8,6 +11,7 @@ INSERT INTO t1 VALUES ('node1_committed_before');
|
||||
INSERT INTO t1 VALUES ('node1_committed_before');
|
||||
INSERT INTO t1 VALUES ('node1_committed_before');
|
||||
COMMIT;
|
||||
connection node_2;
|
||||
SET AUTOCOMMIT=OFF;
|
||||
START TRANSACTION;
|
||||
INSERT INTO t1 VALUES ('node2_committed_before');
|
||||
@ -17,6 +21,7 @@ INSERT INTO t1 VALUES ('node2_committed_before');
|
||||
INSERT INTO t1 VALUES ('node2_committed_before');
|
||||
COMMIT;
|
||||
Shutting down server ...
|
||||
connection node_1;
|
||||
SET AUTOCOMMIT=OFF;
|
||||
START TRANSACTION;
|
||||
INSERT INTO t1 VALUES ('node1_committed_during');
|
||||
@ -31,6 +36,7 @@ INSERT INTO t1 VALUES ('node1_to_be_committed_after');
|
||||
INSERT INTO t1 VALUES ('node1_to_be_committed_after');
|
||||
INSERT INTO t1 VALUES ('node1_to_be_committed_after');
|
||||
INSERT INTO t1 VALUES ('node1_to_be_committed_after');
|
||||
connect node_1a_galera_st_shutdown_slave, 127.0.0.1, root, , test, $NODE_MYPORT_1;
|
||||
SET AUTOCOMMIT=OFF;
|
||||
START TRANSACTION;
|
||||
INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
|
||||
@ -38,6 +44,7 @@ INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
|
||||
INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
|
||||
INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
|
||||
INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
|
||||
connection node_2;
|
||||
Starting server ...
|
||||
SET AUTOCOMMIT=OFF;
|
||||
START TRANSACTION;
|
||||
@ -47,6 +54,7 @@ INSERT INTO t1 VALUES ('node2_committed_after');
|
||||
INSERT INTO t1 VALUES ('node2_committed_after');
|
||||
INSERT INTO t1 VALUES ('node2_committed_after');
|
||||
COMMIT;
|
||||
connection node_1;
|
||||
INSERT INTO t1 VALUES ('node1_to_be_committed_after');
|
||||
INSERT INTO t1 VALUES ('node1_to_be_committed_after');
|
||||
INSERT INTO t1 VALUES ('node1_to_be_committed_after');
|
||||
@ -61,6 +69,7 @@ INSERT INTO t1 VALUES ('node1_committed_after');
|
||||
INSERT INTO t1 VALUES ('node1_committed_after');
|
||||
INSERT INTO t1 VALUES ('node1_committed_after');
|
||||
COMMIT;
|
||||
connection node_1a_galera_st_shutdown_slave;
|
||||
INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
|
||||
INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
|
||||
INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
|
||||
@ -75,6 +84,7 @@ COUNT(*) = 0
|
||||
1
|
||||
COMMIT;
|
||||
SET AUTOCOMMIT=ON;
|
||||
connection node_1;
|
||||
SELECT COUNT(*) = 35 FROM t1;
|
||||
COUNT(*) = 35
|
||||
1
|
||||
@ -86,6 +96,7 @@ COMMIT;
|
||||
SET AUTOCOMMIT=ON;
|
||||
Performing State Transfer on a server that starts from a clean var directory
|
||||
This is accomplished by shutting down node #2 and removing its var directory before restarting it
|
||||
connection node_1;
|
||||
CREATE TABLE t1 (f1 CHAR(255)) ENGINE=InnoDB;
|
||||
SET AUTOCOMMIT=OFF;
|
||||
START TRANSACTION;
|
||||
@ -95,6 +106,7 @@ INSERT INTO t1 VALUES ('node1_committed_before');
|
||||
INSERT INTO t1 VALUES ('node1_committed_before');
|
||||
INSERT INTO t1 VALUES ('node1_committed_before');
|
||||
COMMIT;
|
||||
connection node_2;
|
||||
SET AUTOCOMMIT=OFF;
|
||||
START TRANSACTION;
|
||||
INSERT INTO t1 VALUES ('node2_committed_before');
|
||||
@ -104,6 +116,7 @@ INSERT INTO t1 VALUES ('node2_committed_before');
|
||||
INSERT INTO t1 VALUES ('node2_committed_before');
|
||||
COMMIT;
|
||||
Shutting down server ...
|
||||
connection node_1;
|
||||
Cleaning var directory ...
|
||||
SET AUTOCOMMIT=OFF;
|
||||
START TRANSACTION;
|
||||
@ -119,6 +132,7 @@ INSERT INTO t1 VALUES ('node1_to_be_committed_after');
|
||||
INSERT INTO t1 VALUES ('node1_to_be_committed_after');
|
||||
INSERT INTO t1 VALUES ('node1_to_be_committed_after');
|
||||
INSERT INTO t1 VALUES ('node1_to_be_committed_after');
|
||||
connect node_1a_galera_st_clean_slave, 127.0.0.1, root, , test, $NODE_MYPORT_1;
|
||||
SET AUTOCOMMIT=OFF;
|
||||
START TRANSACTION;
|
||||
INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
|
||||
@ -126,6 +140,7 @@ INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
|
||||
INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
|
||||
INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
|
||||
INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
|
||||
connection node_2;
|
||||
Starting server ...
|
||||
SET AUTOCOMMIT=OFF;
|
||||
START TRANSACTION;
|
||||
@ -135,6 +150,7 @@ INSERT INTO t1 VALUES ('node2_committed_after');
|
||||
INSERT INTO t1 VALUES ('node2_committed_after');
|
||||
INSERT INTO t1 VALUES ('node2_committed_after');
|
||||
COMMIT;
|
||||
connection node_1;
|
||||
INSERT INTO t1 VALUES ('node1_to_be_committed_after');
|
||||
INSERT INTO t1 VALUES ('node1_to_be_committed_after');
|
||||
INSERT INTO t1 VALUES ('node1_to_be_committed_after');
|
||||
@ -149,6 +165,7 @@ INSERT INTO t1 VALUES ('node1_committed_after');
|
||||
INSERT INTO t1 VALUES ('node1_committed_after');
|
||||
INSERT INTO t1 VALUES ('node1_committed_after');
|
||||
COMMIT;
|
||||
connection node_1a_galera_st_clean_slave;
|
||||
INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
|
||||
INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
|
||||
INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
|
||||
@ -163,6 +180,7 @@ COUNT(*) = 0
|
||||
1
|
||||
COMMIT;
|
||||
SET AUTOCOMMIT=ON;
|
||||
connection node_1;
|
||||
SELECT COUNT(*) = 35 FROM t1;
|
||||
COUNT(*) = 35
|
||||
1
|
||||
@ -173,6 +191,7 @@ DROP TABLE t1;
|
||||
COMMIT;
|
||||
SET AUTOCOMMIT=ON;
|
||||
Performing State Transfer on a server that has been killed and restarted
|
||||
connection node_1;
|
||||
CREATE TABLE t1 (f1 CHAR(255)) ENGINE=InnoDB;
|
||||
SET AUTOCOMMIT=OFF;
|
||||
START TRANSACTION;
|
||||
@ -182,6 +201,7 @@ INSERT INTO t1 VALUES ('node1_committed_before');
|
||||
INSERT INTO t1 VALUES ('node1_committed_before');
|
||||
INSERT INTO t1 VALUES ('node1_committed_before');
|
||||
COMMIT;
|
||||
connection node_2;
|
||||
SET AUTOCOMMIT=OFF;
|
||||
START TRANSACTION;
|
||||
INSERT INTO t1 VALUES ('node2_committed_before');
|
||||
@ -191,6 +211,7 @@ INSERT INTO t1 VALUES ('node2_committed_before');
|
||||
INSERT INTO t1 VALUES ('node2_committed_before');
|
||||
COMMIT;
|
||||
Killing server ...
|
||||
connection node_1;
|
||||
SET AUTOCOMMIT=OFF;
|
||||
START TRANSACTION;
|
||||
INSERT INTO t1 VALUES ('node1_committed_during');
|
||||
@ -205,6 +226,7 @@ INSERT INTO t1 VALUES ('node1_to_be_committed_after');
|
||||
INSERT INTO t1 VALUES ('node1_to_be_committed_after');
|
||||
INSERT INTO t1 VALUES ('node1_to_be_committed_after');
|
||||
INSERT INTO t1 VALUES ('node1_to_be_committed_after');
|
||||
connect node_1a_galera_st_kill_slave, 127.0.0.1, root, , test, $NODE_MYPORT_1;
|
||||
SET AUTOCOMMIT=OFF;
|
||||
START TRANSACTION;
|
||||
INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
|
||||
@ -212,6 +234,7 @@ INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
|
||||
INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
|
||||
INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
|
||||
INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
|
||||
connection node_2;
|
||||
Performing --wsrep-recover ...
|
||||
Starting server ...
|
||||
Using --wsrep-start-position when starting mysqld ...
|
||||
@ -223,6 +246,7 @@ INSERT INTO t1 VALUES ('node2_committed_after');
|
||||
INSERT INTO t1 VALUES ('node2_committed_after');
|
||||
INSERT INTO t1 VALUES ('node2_committed_after');
|
||||
COMMIT;
|
||||
connection node_1;
|
||||
INSERT INTO t1 VALUES ('node1_to_be_committed_after');
|
||||
INSERT INTO t1 VALUES ('node1_to_be_committed_after');
|
||||
INSERT INTO t1 VALUES ('node1_to_be_committed_after');
|
||||
@ -237,6 +261,7 @@ INSERT INTO t1 VALUES ('node1_committed_after');
|
||||
INSERT INTO t1 VALUES ('node1_committed_after');
|
||||
INSERT INTO t1 VALUES ('node1_committed_after');
|
||||
COMMIT;
|
||||
connection node_1a_galera_st_kill_slave;
|
||||
INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
|
||||
INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
|
||||
INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after');
|
||||
@ -251,6 +276,7 @@ COUNT(*) = 0
|
||||
1
|
||||
COMMIT;
|
||||
SET AUTOCOMMIT=ON;
|
||||
connection node_1;
|
||||
SELECT COUNT(*) = 35 FROM t1;
|
||||
COUNT(*) = 35
|
||||
1
|
||||
@ -260,100 +286,5 @@ COUNT(*) = 0
|
||||
DROP TABLE t1;
|
||||
COMMIT;
|
||||
SET AUTOCOMMIT=ON;
|
||||
Performing State Transfer on a server that has been killed and restarted
|
||||
while a DDL was in progress on it
|
||||
CREATE TABLE t1 (f1 CHAR(255)) ENGINE=InnoDB;
|
||||
SET AUTOCOMMIT=OFF;
|
||||
START TRANSACTION;
|
||||
INSERT INTO t1 VALUES ('node1_committed_before');
|
||||
INSERT INTO t1 VALUES ('node1_committed_before');
|
||||
INSERT INTO t1 VALUES ('node1_committed_before');
|
||||
INSERT INTO t1 VALUES ('node1_committed_before');
|
||||
INSERT INTO t1 VALUES ('node1_committed_before');
|
||||
START TRANSACTION;
|
||||
INSERT INTO t1 VALUES ('node2_committed_before');
|
||||
INSERT INTO t1 VALUES ('node2_committed_before');
|
||||
INSERT INTO t1 VALUES ('node2_committed_before');
|
||||
INSERT INTO t1 VALUES ('node2_committed_before');
|
||||
INSERT INTO t1 VALUES ('node2_committed_before');
|
||||
COMMIT;
|
||||
SET GLOBAL debug_dbug = 'd,sync.alter_opened_table';
|
||||
ALTER TABLE t1 ADD COLUMN f2 INTEGER;
|
||||
SET wsrep_sync_wait = 0;
|
||||
Killing server ...
|
||||
SET AUTOCOMMIT=OFF;
|
||||
START TRANSACTION;
|
||||
INSERT INTO t1 (f1) VALUES ('node1_committed_during');
|
||||
INSERT INTO t1 (f1) VALUES ('node1_committed_during');
|
||||
INSERT INTO t1 (f1) VALUES ('node1_committed_during');
|
||||
INSERT INTO t1 (f1) VALUES ('node1_committed_during');
|
||||
INSERT INTO t1 (f1) VALUES ('node1_committed_during');
|
||||
COMMIT;
|
||||
START TRANSACTION;
|
||||
INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
|
||||
INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
|
||||
INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
|
||||
INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
|
||||
INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
|
||||
SET AUTOCOMMIT=OFF;
|
||||
START TRANSACTION;
|
||||
INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
|
||||
INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
|
||||
INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
|
||||
INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
|
||||
INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
|
||||
Performing --wsrep-recover ...
|
||||
Starting server ...
|
||||
Using --wsrep-start-position when starting mysqld ...
|
||||
SET AUTOCOMMIT=OFF;
|
||||
START TRANSACTION;
|
||||
INSERT INTO t1 (f1) VALUES ('node2_committed_after');
|
||||
INSERT INTO t1 (f1) VALUES ('node2_committed_after');
|
||||
INSERT INTO t1 (f1) VALUES ('node2_committed_after');
|
||||
INSERT INTO t1 (f1) VALUES ('node2_committed_after');
|
||||
INSERT INTO t1 (f1) VALUES ('node2_committed_after');
|
||||
COMMIT;
|
||||
INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
|
||||
INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
|
||||
INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
|
||||
INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
|
||||
INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
|
||||
COMMIT;
|
||||
SET AUTOCOMMIT=OFF;
|
||||
START TRANSACTION;
|
||||
INSERT INTO t1 (f1) VALUES ('node1_committed_after');
|
||||
INSERT INTO t1 (f1) VALUES ('node1_committed_after');
|
||||
INSERT INTO t1 (f1) VALUES ('node1_committed_after');
|
||||
INSERT INTO t1 (f1) VALUES ('node1_committed_after');
|
||||
INSERT INTO t1 (f1) VALUES ('node1_committed_after');
|
||||
COMMIT;
|
||||
INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
|
||||
INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
|
||||
INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
|
||||
INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
|
||||
INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
|
||||
ROLLBACK;
|
||||
SELECT COUNT(*) = 2 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 't1';
|
||||
COUNT(*) = 2
|
||||
1
|
||||
SELECT COUNT(*) = 35 FROM t1;
|
||||
COUNT(*) = 35
|
||||
1
|
||||
SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1;
|
||||
COUNT(*) = 0
|
||||
1
|
||||
COMMIT;
|
||||
SET AUTOCOMMIT=ON;
|
||||
SELECT COUNT(*) = 2 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 't1';
|
||||
COUNT(*) = 2
|
||||
1
|
||||
SELECT COUNT(*) = 35 FROM t1;
|
||||
COUNT(*) = 35
|
||||
1
|
||||
SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1;
|
||||
COUNT(*) = 0
|
||||
1
|
||||
DROP TABLE t1;
|
||||
COMMIT;
|
||||
SET AUTOCOMMIT=ON;
|
||||
SET GLOBAL debug_dbug = $debug_orig;
|
||||
disconnect node_2;
|
||||
disconnect node_1;
|
||||
|
@ -4,7 +4,8 @@ connection node_2;
|
||||
SET GLOBAL wsrep_cluster_address = 'foo://';
|
||||
SET SESSION wsrep_sync_wait=0;
|
||||
SELECT COUNT(*) > 0 FROM INFORMATION_SCHEMA.GLOBAL_STATUS;
|
||||
ERROR 08S01: WSREP has not yet prepared node for application use
|
||||
COUNT(*) > 0
|
||||
1
|
||||
SHOW STATUS LIKE 'wsrep_ready';
|
||||
Variable_name Value
|
||||
wsrep_ready OFF
|
||||
|
@ -36,11 +36,12 @@ SELECT 1;
|
||||
1
|
||||
1
|
||||
USE information_schema;
|
||||
ERROR 08S01: WSREP has not yet prepared node for application use
|
||||
SELECT * FROM information_schema.session_variables WHERE variable_name LIKE "wsrep_dirty_reads";
|
||||
ERROR 08S01: WSREP has not yet prepared node for application use
|
||||
VARIABLE_NAME VARIABLE_VALUE
|
||||
WSREP_DIRTY_READS OFF
|
||||
SELECT COUNT(*) >= 10 FROM performance_schema.events_statements_history;
|
||||
ERROR 08S01: WSREP has not yet prepared node for application use
|
||||
COUNT(*) >= 10
|
||||
1
|
||||
connection node_1;
|
||||
USE test;
|
||||
SELECT * FROM t1;
|
||||
|
27
mysql-test/suite/galera/r/galera_var_reject_queries.result
Normal file
27
mysql-test/suite/galera/r/galera_var_reject_queries.result
Normal file
@ -0,0 +1,27 @@
|
||||
CREATE TABLE t1 (f1 INTEGER);
|
||||
connect node_1a, 127.0.0.1, root, , test, $NODE_MYPORT_1;
|
||||
connection node_1;
|
||||
SET SESSION wsrep_reject_queries = ALL;
|
||||
ERROR HY000: Variable 'wsrep_reject_queries' is a GLOBAL variable and should be set with SET GLOBAL
|
||||
SET GLOBAL wsrep_reject_queries = ALL;
|
||||
SELECT * FROM t1;
|
||||
ERROR 08S01: WSREP has not yet prepared node for application use
|
||||
SET GLOBAL wsrep_reject_queries = ALL_KILL;
|
||||
ERROR HY000: Lost connection to MySQL server during query
|
||||
connection node_1a;
|
||||
SELECT * FROM t1;
|
||||
Got one of the listed errors
|
||||
connect node_1b, 127.0.0.1, root, , test, $NODE_MYPORT_1;
|
||||
SELECT * FROM t1;
|
||||
ERROR 08S01: WSREP has not yet prepared node for application use
|
||||
connection node_2;
|
||||
SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
|
||||
VARIABLE_VALUE = 2
|
||||
1
|
||||
INSERT INTO t1 VALUES (1);
|
||||
connect node_1c, 127.0.0.1, root, , test, $NODE_MYPORT_1;
|
||||
SET GLOBAL wsrep_reject_queries = NONE;
|
||||
SELECT COUNT(*) = 1 FROM t1;
|
||||
COUNT(*) = 1
|
||||
1
|
||||
DROP TABLE t1;
|
@ -1,8 +1,8 @@
|
||||
CALL mtr.add_suppression("WSREP: Refusing exit for the last slave thread.");
|
||||
connection node_1;
|
||||
CREATE TABLE t1 (f1 INT PRIMARY KEY) Engine=InnoDB;
|
||||
CREATE TABLE t2 (f1 INT AUTO_INCREMENT PRIMARY KEY) Engine=InnoDB;
|
||||
connection node_2;
|
||||
CALL mtr.add_suppression("WSREP: Refusing exit for the last slave thread.");
|
||||
SET GLOBAL wsrep_slave_threads = 0;
|
||||
Warnings:
|
||||
Warning 1292 Truncated incorrect wsrep_slave_threads value: '0'
|
||||
@ -13,10 +13,6 @@ SELECT @@wsrep_slave_threads = 1;
|
||||
@@wsrep_slave_threads = 1
|
||||
1
|
||||
SET GLOBAL wsrep_slave_threads = 1;
|
||||
SELECT COUNT(*) FROM INFORMATION_SCHEMA.PROCESSLIST
|
||||
WHERE USER = 'system user' AND STATE NOT LIKE 'InnoDB%';
|
||||
COUNT(*)
|
||||
2
|
||||
SELECT COUNT(*) FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = 'system user' AND STATE LIKE '%wsrep aborter%';
|
||||
COUNT(*)
|
||||
1
|
||||
@ -24,16 +20,6 @@ SET GLOBAL wsrep_slave_threads = 64;
|
||||
connection node_1;
|
||||
INSERT INTO t1 VALUES (1);
|
||||
connection node_2;
|
||||
SELECT COUNT(*) FROM t1;
|
||||
COUNT(*)
|
||||
1
|
||||
SELECT COUNT(*) - @@wsrep_slave_threads FROM INFORMATION_SCHEMA.PROCESSLIST
|
||||
WHERE USER = 'system user' AND STATE NOT LIKE 'InnoDB%';
|
||||
COUNT(*) - @@wsrep_slave_threads
|
||||
1
|
||||
SELECT COUNT(*) FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = 'system user' AND STATE LIKE '%wsrep aborter%';
|
||||
COUNT(*)
|
||||
1
|
||||
SET GLOBAL wsrep_slave_threads = 1;
|
||||
connection node_1;
|
||||
INSERT INTO t2 VALUES (DEFAULT);
|
||||
@ -104,10 +90,6 @@ connection node_2;
|
||||
SELECT COUNT(*) FROM t2;
|
||||
COUNT(*)
|
||||
64
|
||||
SELECT COUNT(*) - @@wsrep_slave_threads FROM INFORMATION_SCHEMA.PROCESSLIST
|
||||
WHERE USER = 'system user' AND STATE NOT LIKE 'InnoDB%';
|
||||
COUNT(*) - @@wsrep_slave_threads
|
||||
1
|
||||
SELECT COUNT(*) FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = 'system user' AND STATE LIKE '%wsrep aborter%';
|
||||
COUNT(*)
|
||||
1
|
||||
@ -122,5 +104,13 @@ CREATE TABLE t1 (i INT AUTO_INCREMENT PRIMARY KEY) ENGINE=INNODB;
|
||||
connection node_2;
|
||||
SET GLOBAL wsrep_slave_threads = 4;
|
||||
SET GLOBAL wsrep_slave_threads = 1;
|
||||
connection node_1;
|
||||
INSERT INTO t1 VALUES (DEFAULT);
|
||||
INSERT INTO t1 VALUES (DEFAULT);
|
||||
INSERT INTO t1 VALUES (DEFAULT);
|
||||
DROP TABLE t1;
|
||||
connection node_2;
|
||||
SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = 'system user' AND STATE LIKE '%wsrep aborter%';
|
||||
COUNT(*) = 1
|
||||
1
|
||||
# End of tests
|
||||
|
@ -0,0 +1,2 @@
|
||||
Variable_name Value
|
||||
wsrep_replicate_myisam ON
|
@ -1,4 +1,4 @@
|
||||
package My::Suite::GALERA;
|
||||
package My::Suite::Galera;
|
||||
use File::Basename;
|
||||
use My::Find;
|
||||
|
||||
@ -27,6 +27,10 @@ return "No scritps" unless $cpath;
|
||||
my ($epath) = grep { -f "$_/my_print_defaults"; } "$::bindir/extra", $::path_client_bindir;
|
||||
return "No my_print_defaults" unless $epath;
|
||||
|
||||
my ($bpath) = grep { -f "$_/mariabackup"; } "$::bindir/extra/mariabackup", $::path_client_bindir;
|
||||
|
||||
sub which($) { return `sh -c "command -v $_[0]"` }
|
||||
|
||||
push @::global_suppressions,
|
||||
(
|
||||
qr(WSREP: wsrep_sst_receive_address is set to '127.0.0.1),
|
||||
@ -79,10 +83,30 @@ push @::global_suppressions,
|
||||
qr|WSREP: JOIN message from member .* in non-primary configuration. Ignored.|,
|
||||
);
|
||||
|
||||
|
||||
$ENV{PATH}="$epath:$ENV{PATH}";
|
||||
$ENV{PATH}="$spath:$ENV{PATH}" unless $epath eq $spath;
|
||||
$ENV{PATH}="$cpath:$ENV{PATH}" unless $cpath eq $spath;
|
||||
$ENV{PATH}="$bpath:$ENV{PATH}" unless $bpath eq $spath;
|
||||
|
||||
if (which(socat)) {
|
||||
$ENV{MTR_GALERA_TFMT}='socat';
|
||||
} elsif (which(nc)) {
|
||||
$ENV{MTR_GALERA_TFMT}='nc';
|
||||
}
|
||||
|
||||
sub skip_combinations {
|
||||
my %skip = ();
|
||||
$skip{'include/have_xtrabackup.inc'} = 'Need innobackupex'
|
||||
unless which(innobackupex);
|
||||
$skip{'include/have_xtrabackup.inc'} = 'Need socat or nc'
|
||||
unless $ENV{MTR_GALERA_TFMT};
|
||||
$skip{'include/have_mariabackup.inc'} = 'Need mariabackup'
|
||||
unless which(mariabackup);
|
||||
$skip{'include/have_mariabackup.inc'} = 'Need ss'
|
||||
unless which(ss);
|
||||
$skip{'include/have_mariabackup.inc'} = 'Need socat or nc'
|
||||
unless $ENV{MTR_GALERA_TFMT};
|
||||
%skip;
|
||||
}
|
||||
|
||||
bless { };
|
||||
|
||||
|
@ -25,7 +25,6 @@ SET wsrep_on = FALSE;
|
||||
--error ER_QUERY_INTERRUPTED
|
||||
ALTER TABLE t1 ADD PRIMARY KEY (f1);
|
||||
|
||||
SET SESSION wsrep_sync_wait = 0;
|
||||
SET wsrep_on = TRUE;
|
||||
SET GLOBAL wsrep_desync = FALSE;
|
||||
|
||||
|
@ -85,3 +85,5 @@ DROP TABLE t1;
|
||||
|
||||
# Due to MW-330, Multiple "conflict state 3 after post commit" warnings if table is dropped while SP is running
|
||||
CALL mtr.add_suppression("conflict state 3 after post commit");
|
||||
|
||||
set global innodb_status_output=Default;
|
@ -10,20 +10,20 @@ CREATE TABLE t1 (f1 INTEGER) Engine=InnoDB;
|
||||
--connection node_1
|
||||
SET GLOBAL wsrep_slave_threads = 10;
|
||||
SET GLOBAL wsrep_slave_threads = 1;
|
||||
--let $wait_condition = SELECT COUNT(*) = 11 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = 'system user' AND (STATE IS NULL OR STATE NOT LIKE 'InnoDB%');
|
||||
--source include/wait_condition.inc
|
||||
|
||||
--connection node_2
|
||||
INSERT INTO t1 VALUES (1);
|
||||
|
||||
--connection node_1
|
||||
--sleep 0.5
|
||||
SET GLOBAL wsrep_slave_threads = 10;
|
||||
--sleep 0.5
|
||||
SELECT COUNT(*) = 11 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = 'system user';
|
||||
--let $wait_condition = SELECT COUNT(*) = 11 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = 'system user' AND (STATE IS NULL OR STATE NOT LIKE 'InnoDB%');
|
||||
--source include/wait_condition.inc
|
||||
|
||||
SET GLOBAL wsrep_slave_threads = 20;
|
||||
--sleep 0.5
|
||||
SELECT COUNT(*) = 21 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = 'system user';
|
||||
|
||||
--let $wait_condition = SELECT COUNT(*) = 21 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = 'system user' AND (STATE IS NULL OR STATE NOT LIKE 'InnoDB%');
|
||||
--source include/wait_condition.inc
|
||||
|
||||
SET GLOBAL wsrep_slave_threads = 1;
|
||||
|
||||
@ -40,6 +40,9 @@ INSERT INTO t1 VALUES (9);
|
||||
|
||||
|
||||
--connection node_1
|
||||
--let $wait_condition = SELECT COUNT(*) = 12 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = 'system user' AND (STATE IS NULL OR STATE NOT LIKE 'InnoDB%');
|
||||
--source include/wait_condition.inc
|
||||
|
||||
SET GLOBAL wsrep_slave_threads = 10;
|
||||
SET GLOBAL wsrep_slave_threads = 0;
|
||||
|
||||
@ -57,8 +60,8 @@ INSERT INTO t1 VALUES (19);
|
||||
INSERT INTO t1 VALUES (20);
|
||||
|
||||
--connection node_1
|
||||
--sleep 0.5
|
||||
SELECT COUNT(*) = 2 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = 'system user';
|
||||
--let $wait_condition = SELECT COUNT(*) = 2 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = 'system user' AND (STATE IS NULL OR STATE NOT LIKE 'InnoDB%');
|
||||
--source include/wait_condition.inc
|
||||
|
||||
SET GLOBAL wsrep_slave_threads = 1;
|
||||
DROP TABLE t1;
|
||||
|
@ -6,6 +6,7 @@
|
||||
--source include/big_test.inc
|
||||
--source include/galera_cluster.inc
|
||||
--source include/have_innodb.inc
|
||||
--source include/have_xtrabackup.inc
|
||||
|
||||
--connection node_1
|
||||
--let $connection_id = `SELECT CONNECTION_ID()`
|
||||
|
@ -5,25 +5,52 @@
|
||||
# Test a local transaction being aborted by a slave one while it is running a SELECT FOR UPDATE
|
||||
#
|
||||
|
||||
CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB;
|
||||
CREATE TABLE t1 (f1 INTEGER PRIMARY KEY, f2 INT) ENGINE=InnoDB;
|
||||
|
||||
--connection node_2
|
||||
--let $wsrep_local_bf_aborts_before = `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_bf_aborts'`
|
||||
SET AUTOCOMMIT=OFF;
|
||||
START TRANSACTION;
|
||||
INSERT INTO t1 VALUES (1);
|
||||
INSERT INTO t1 VALUES (1, 10);
|
||||
|
||||
# Test updating the PK
|
||||
|
||||
--connection node_1
|
||||
INSERT INTO t1 VALUES (1);
|
||||
|
||||
--connection node_2
|
||||
--error ER_LOCK_DEADLOCK
|
||||
--let $wsrep_local_bf_aborts_before = `SELECT variable_value FROM information_schema.global_status WHERE variable_name = 'wsrep_local_bf_aborts'`
|
||||
BEGIN;
|
||||
SELECT * FROM t1 FOR UPDATE;
|
||||
|
||||
--let $wsrep_local_bf_aborts_after = `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_bf_aborts'`
|
||||
--connection node_2
|
||||
UPDATE t1 SET f1 = 2;
|
||||
|
||||
--connect node_1a, 127.0.0.1, root, , test, $NODE_MYPORT_1
|
||||
--let $wait_condition = SELECT COUNT(*) FROM t1 WHERE f1 = 2
|
||||
--source include/wait_condition.inc
|
||||
|
||||
--connection node_1
|
||||
--error ER_LOCK_DEADLOCK
|
||||
COMMIT;
|
||||
|
||||
--disable_query_log
|
||||
--eval SELECT $wsrep_local_bf_aborts_after - $wsrep_local_bf_aborts_before = 1 AS wsrep_local_aborts_increment;
|
||||
--eval SELECT variable_value - $wsrep_local_bf_aborts_before AS wsrep_local_bf_aborts_diff FROM information_schema.global_status WHERE variable_name = 'wsrep_local_bf_aborts'
|
||||
--enable_query_log
|
||||
|
||||
# Test updating non-indexed column
|
||||
|
||||
--connection node_1
|
||||
--let $wsrep_local_bf_aborts_before = `SELECT variable_value FROM information_schema.global_status WHERE variable_name = 'wsrep_local_bf_aborts'`
|
||||
BEGIN;
|
||||
SELECT * FROM t1 FOR UPDATE;
|
||||
|
||||
--connection node_2
|
||||
UPDATE t1 SET f2 = 20;
|
||||
|
||||
--connection node_1a
|
||||
--let $wait_condition = SELECT COUNT(*) FROM t1 WHERE f2 = 20
|
||||
--source include/wait_condition.inc
|
||||
|
||||
--connection node_1
|
||||
--error ER_LOCK_DEADLOCK
|
||||
COMMIT;
|
||||
|
||||
--disable_query_log
|
||||
--eval SELECT variable_value - $wsrep_local_bf_aborts_before AS wsrep_local_bf_aborts_diff FROM information_schema.global_status WHERE variable_name = 'wsrep_local_bf_aborts'
|
||||
--enable_query_log
|
||||
|
||||
DROP TABLE t1;
|
||||
|
@ -43,9 +43,9 @@ let $run=10;
|
||||
while($run)
|
||||
{
|
||||
--error 0,1
|
||||
exec $MYSQL --user=root --host=127.0.0.1 --port=$NODE_MYPORT_1 test
|
||||
< $MYSQLTEST_VARDIR/tmp/galera_concurrent.sql &
|
||||
$MYSQL --user=root --host=127.0.0.1 --port=$NODE_MYPORT_2 test
|
||||
exec $MYSQL --user=root --host=127.0.0.1 --port=$NODE_MYPORT_1 test \
|
||||
< $MYSQLTEST_VARDIR/tmp/galera_concurrent.sql & \
|
||||
$MYSQL --user=root --host=127.0.0.1 --port=$NODE_MYPORT_2 test \
|
||||
< $MYSQLTEST_VARDIR/tmp/galera_concurrent.sql;
|
||||
dec $run;
|
||||
}
|
||||
|
@ -1 +1,3 @@
|
||||
--query_cache_type=1 --query_cache_size=1000000
|
||||
--query_cache_type=1
|
||||
--query_cache_size=1000000
|
||||
--wsrep_replicate_myisam=ON
|
||||
|
@ -5,6 +5,7 @@
|
||||
--source include/galera_cluster.inc
|
||||
--source include/have_innodb.inc
|
||||
--source include/have_query_cache.inc
|
||||
--source include/have_wsrep_replicate_myisam.inc
|
||||
|
||||
--disable_warnings
|
||||
DROP TABLE IF EXISTS t1, t2, x1, x2;
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user