mirror of
https://github.com/MariaDB/server.git
synced 2025-01-16 03:52:35 +01:00
Merge dl145h.mysql.com:/data0/mkindahl/mysql-5.1-rpl
into dl145h.mysql.com:/data0/mkindahl/mysql-5.1-rpl-merge mysql-test/include/have_multi_ndb.inc: Auto merged mysql-test/lib/mtr_cases.pl: Auto merged mysql-test/lib/mtr_report.pl: Auto merged mysql-test/suite/binlog/r/binlog_stm_blackhole.result: Auto merged mysql-test/suite/rpl_ndb/r/rpl_row_basic_7ndb.result: Auto merged mysql-test/suite/rpl_ndb/t/disabled.def: Auto merged sql/ha_ndbcluster_binlog.cc: Auto merged sql/log.cc: Auto merged sql/log_event_old.cc: Auto merged sql/mysql_priv.h: Auto merged sql/mysqld.cc: Auto merged sql/rpl_rli.cc: Auto merged sql/set_var.cc: Auto merged sql/set_var.h: Auto merged sql/slave.cc: Auto merged sql/sql_binlog.cc: Auto merged sql/sql_class.h: Auto merged sql/sql_string.cc: Auto merged mysql-test/Makefile.am: SCCS merged mysql-test/mysql-test-run.pl: Manual merge. mysql-test/suite/binlog/t/disabled.def: Manual merge. mysql-test/suite/rpl/r/rpl_row_tabledefs_2myisam.result: Manual merge. mysql-test/suite/rpl/r/rpl_row_tabledefs_3innodb.result: Manual merge. sql/log_event.cc: Manual merge. ,
This commit is contained in:
commit
047ec78f2c
129 changed files with 6417 additions and 885 deletions
10
BUILD/compile-solaris-amd64-debug
Normal file
10
BUILD/compile-solaris-amd64-debug
Normal file
|
@ -0,0 +1,10 @@
|
|||
#! /bin/sh
|
||||
path=`dirname $0`
|
||||
. "$path/SETUP.sh"
|
||||
amd64_cflags="-m64 -mtune=athlon64"
|
||||
extra_flags="$amd64_cflags $debug_cflags $max_cflags"
|
||||
c_warnings="$c_warnings $debug_extra_warnings"
|
||||
cxx_warnings="$cxx_warnings $debug_extra_warnings"
|
||||
extra_configs="$amd64_configs $debug_configs $max_configs --enable-thread-safe-client"
|
||||
|
||||
. "$path/FINISH.sh"
|
52
BUILD/compile-solaris-amd64-forte
Normal file
52
BUILD/compile-solaris-amd64-forte
Normal file
|
@ -0,0 +1,52 @@
|
|||
#! /bin/sh
|
||||
|
||||
gmake -k clean || true
|
||||
/bin/rm -f */.deps/*.P config.cache
|
||||
|
||||
path=`dirname $0`
|
||||
. "$path/autorun.sh"
|
||||
|
||||
# For "optimal" code for this computer add -fast to EXTRA
|
||||
# To compile 64 bit, add -xarch=v9 to EXTRA_64_BIT
|
||||
|
||||
EXTRA_64_BIT="-xarch=amd64"
|
||||
EXTRA="-fast"
|
||||
|
||||
#
|
||||
# The following should not need to be touched
|
||||
#
|
||||
|
||||
export CC CXX CFLAGS CXXFLAGS
|
||||
STD="-g -mt -D_FORTEC_ $EXTRA $EXTRA_64_BIT"
|
||||
ASFLAGS="$EXTRA_64_BIT"
|
||||
CC=cc-5.0
|
||||
CFLAGS="-Xa -xstrconst $STD"
|
||||
CXX=CC
|
||||
CXXFLAGS="-noex $STD"
|
||||
./configure \
|
||||
--prefix=/usr/local/mysql \
|
||||
--localstatedir=/usr/local/mysql/data \
|
||||
--libexecdir=/usr/local/mysql/bin \
|
||||
--with-extra-charsets=complex \
|
||||
--enable-thread-safe-client \
|
||||
--enable-local-infile \
|
||||
--with-zlib-dir=bundled \
|
||||
--with-big-tables \
|
||||
--with-readline \
|
||||
--with-archive-storage-engine \
|
||||
--with-named-curses=-lcurses \
|
||||
--with-big-tables \
|
||||
--with-innodb \
|
||||
--with-example-storage-engine \
|
||||
--with-blackhole-storage-engine \
|
||||
--with-federated-storage-engine \
|
||||
--with-csv-storage-engine \
|
||||
--with-ssl \
|
||||
--enable-assembler
|
||||
|
||||
# Not including:
|
||||
# --with-ndbcluster
|
||||
# --with-berkeley-db
|
||||
|
||||
gmake -j4
|
||||
test $? = 0 && make test
|
54
BUILD/compile-solaris-amd64-forte-debug
Normal file
54
BUILD/compile-solaris-amd64-forte-debug
Normal file
|
@ -0,0 +1,54 @@
|
|||
#! /bin/sh
|
||||
|
||||
gmake -k clean || true
|
||||
/bin/rm -f */.deps/*.P config.cache
|
||||
|
||||
path=`dirname $0`
|
||||
. "$path/autorun.sh"
|
||||
|
||||
# To compile 64 bit, add -xarch=amd64 to EXTRA_64_BIT
|
||||
EXTRA_64_BIT="-xarch=amd64"
|
||||
|
||||
# For "optimal" code for this computer add -fast to EXTRA. Note that
|
||||
# this causes problem with debugging the program since -fast implies
|
||||
# -xO5.
|
||||
EXTRA=""
|
||||
|
||||
#
|
||||
# The following should not need to be touched
|
||||
#
|
||||
|
||||
export CC CXX CFLAGS CXXFLAGS
|
||||
STD="-g -mt -D_FORTEC_ $EXTRA $EXTRA_64_BIT $debug_cflags"
|
||||
ASFLAGS="$EXTRA_64_BIT"
|
||||
CC=cc-5.0
|
||||
CFLAGS="-Xa -xstrconst $STD"
|
||||
CXX=CC
|
||||
CXXFLAGS="-noex $STD"
|
||||
./configure \
|
||||
--prefix=/usr/local/mysql \
|
||||
--localstatedir=/usr/local/mysql/data \
|
||||
--libexecdir=/usr/local/mysql/bin \
|
||||
--with-extra-charsets=complex \
|
||||
--enable-thread-safe-client \
|
||||
--enable-local-infile \
|
||||
--with-zlib-dir=bundled \
|
||||
--with-big-tables \
|
||||
--with-readline \
|
||||
--with-archive-storage-engine \
|
||||
--with-named-curses=-lcurses \
|
||||
--with-big-tables \
|
||||
--with-innodb \
|
||||
--with-example-storage-engine \
|
||||
--with-blackhole-storage-engine \
|
||||
--with-federated-storage-engine \
|
||||
--with-csv-storage-engine \
|
||||
--with-ssl \
|
||||
--with-debug \
|
||||
--enable-assembler
|
||||
|
||||
# Not including:
|
||||
# --with-ndbcluster
|
||||
# --with-berkeley-db
|
||||
|
||||
gmake -j4
|
|
@ -77,7 +77,7 @@ enum options_client
|
|||
OPT_SLAP_POST_SYSTEM,
|
||||
OPT_SLAP_COMMIT,
|
||||
OPT_SLAP_DETACH,
|
||||
OPT_MYSQL_REPLACE_INTO, OPT_BASE64_OUTPUT, OPT_SERVER_ID,
|
||||
OPT_MYSQL_REPLACE_INTO, OPT_BASE64_OUTPUT_MODE, OPT_SERVER_ID,
|
||||
OPT_FIX_TABLE_NAMES, OPT_FIX_DB_NAMES, OPT_SSL_VERIFY_SERVER_CERT,
|
||||
OPT_DEBUG_INFO, OPT_DEBUG_CHECK, OPT_COLUMN_TYPES, OPT_ERROR_LOG_FILE,
|
||||
OPT_WRITE_BINLOG, OPT_DUMP_DATE,
|
||||
|
|
|
@ -63,7 +63,12 @@ void sql_print_error(const char *format, ...);
|
|||
|
||||
static bool one_database=0, to_last_remote_log= 0, disable_log_bin= 0;
|
||||
static bool opt_hexdump= 0;
|
||||
static bool opt_base64_output= 0;
|
||||
const char *base64_output_mode_names[]= {"NEVER", "AUTO", "ALWAYS", NullS};
|
||||
TYPELIB base64_output_mode_typelib=
|
||||
{ array_elements(base64_output_mode_names) - 1, "",
|
||||
base64_output_mode_names, NULL };
|
||||
static enum_base64_output_mode opt_base64_output_mode= BASE64_OUTPUT_UNSPEC;
|
||||
static const char *opt_base64_output_mode_str= NullS;
|
||||
static const char* database= 0;
|
||||
static my_bool force_opt= 0, short_form= 0, remote_opt= 0;
|
||||
static my_bool debug_info_flag, debug_check_flag;
|
||||
|
@ -96,7 +101,7 @@ static my_bool file_not_closed_error= 0;
|
|||
This is because the event will be created (alloced) in read_log_event()
|
||||
(which returns a pointer) in check_header().
|
||||
*/
|
||||
Format_description_log_event* glob_description_event;
|
||||
static Format_description_log_event* glob_description_event;
|
||||
|
||||
static int dump_local_log_entries(PRINT_EVENT_INFO *print_event_info,
|
||||
const char* logname);
|
||||
|
@ -557,7 +562,7 @@ int process_event(PRINT_EVENT_INFO *print_event_info, Log_event *ev,
|
|||
else
|
||||
print_event_info->hexdump_from= pos;
|
||||
|
||||
print_event_info->base64_output= opt_base64_output;
|
||||
print_event_info->base64_output_mode= opt_base64_output_mode;
|
||||
|
||||
DBUG_PRINT("debug", ("event_type: %s", ev->get_type_str()));
|
||||
|
||||
|
@ -565,7 +570,7 @@ int process_event(PRINT_EVENT_INFO *print_event_info, Log_event *ev,
|
|||
case QUERY_EVENT:
|
||||
if (check_database(((Query_log_event*)ev)->db))
|
||||
goto end;
|
||||
if (opt_base64_output)
|
||||
if (opt_base64_output_mode == BASE64_OUTPUT_ALWAYS)
|
||||
write_event_header_and_base64(ev, result_file, print_event_info);
|
||||
else
|
||||
ev->print(result_file, print_event_info);
|
||||
|
@ -589,7 +594,7 @@ int process_event(PRINT_EVENT_INFO *print_event_info, Log_event *ev,
|
|||
filename and use LOCAL), prepared in the 'case EXEC_LOAD_EVENT'
|
||||
below.
|
||||
*/
|
||||
if (opt_base64_output)
|
||||
if (opt_base64_output_mode == BASE64_OUTPUT_ALWAYS)
|
||||
{
|
||||
write_event_header_and_base64(ce, result_file, print_event_info);
|
||||
}
|
||||
|
@ -678,6 +683,38 @@ Create_file event for file_id: %u\n",exv->file_id);
|
|||
Begin_load_query event for file_id: %u\n", exlq->file_id);
|
||||
break;
|
||||
}
|
||||
case TABLE_MAP_EVENT:
|
||||
case WRITE_ROWS_EVENT:
|
||||
case DELETE_ROWS_EVENT:
|
||||
case UPDATE_ROWS_EVENT:
|
||||
case PRE_GA_WRITE_ROWS_EVENT:
|
||||
case PRE_GA_DELETE_ROWS_EVENT:
|
||||
case PRE_GA_UPDATE_ROWS_EVENT:
|
||||
/*
|
||||
These events must be printed in base64 format, if printed.
|
||||
base64 format requires a FD event to be safe, so if no FD
|
||||
event has been printed, we give an error. Except if user
|
||||
passed --short-form, because --short-form disables printing
|
||||
row events.
|
||||
*/
|
||||
if (!print_event_info->printed_fd_event && !short_form)
|
||||
{
|
||||
/*
|
||||
todo: a lot to clean up here
|
||||
*/
|
||||
const char* type_str= ev->get_type_str();
|
||||
delete ev;
|
||||
if (opt_base64_output_mode == BASE64_OUTPUT_NEVER)
|
||||
die("--base64-output=never specified, but binlog contains a "
|
||||
"%s event which must be printed in base64.",
|
||||
type_str);
|
||||
else
|
||||
die("malformed binlog: it does not contain any "
|
||||
"Format_description_log_event. I now found a %s event, which is "
|
||||
"not safe to process without a Format_description_log_event.",
|
||||
type_str);
|
||||
}
|
||||
/* FALL THROUGH */
|
||||
default:
|
||||
ev->print(result_file, print_event_info);
|
||||
}
|
||||
|
@ -707,12 +744,17 @@ static struct my_option my_long_options[] =
|
|||
{"autoclose", OPT_AUTO_CLOSE, "Auto close the screen on exit for Netware.",
|
||||
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
|
||||
#endif
|
||||
{"base64-output", OPT_BASE64_OUTPUT,
|
||||
"Print all binlog entries using base64 encoding. "
|
||||
"This is for debugging only. Logs produced using this option "
|
||||
"should not be applied on production systems.",
|
||||
(uchar**) &opt_base64_output, (uchar**) &opt_base64_output, 0, GET_BOOL,
|
||||
NO_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"base64-output", OPT_BASE64_OUTPUT_MODE,
|
||||
"Determine when the output statements should be base64-encoded BINLOG "
|
||||
"statements: 'never' disables it and works only for binlogs without "
|
||||
"row-based events; 'auto' is the default and prints base64 only when "
|
||||
"necessary (i.e., for row-based events and format description events); "
|
||||
"'always' prints base64 whenever possible. 'always' is for debugging "
|
||||
"only and should not be used in a production system. The default is "
|
||||
"'auto'. --base64-output is a short form for --base64-output=always."
|
||||
,(uchar**) &opt_base64_output_mode_str,
|
||||
(uchar**) &opt_base64_output_mode_str,
|
||||
0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0},
|
||||
/*
|
||||
mysqlbinlog needs charsets knowledge, to be able to convert a charset
|
||||
number found in binlog to a charset name (to be able to print things
|
||||
|
@ -788,7 +830,10 @@ static struct my_option my_long_options[] =
|
|||
{"set-charset", OPT_SET_CHARSET,
|
||||
"Add 'SET NAMES character_set' to the output.", (uchar**) &charset,
|
||||
(uchar**) &charset, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"short-form", 's', "Just show the queries, no extra info.",
|
||||
{"short-form", 's', "Just show regular queries: no extra info and no "
|
||||
"row-based events. This is for testing only, and should not be used in "
|
||||
"production systems. If you want to suppress base64-output, consider "
|
||||
"using --base64-output=never instead.",
|
||||
(uchar**) &short_form, (uchar**) &short_form, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0,
|
||||
0, 0},
|
||||
{"socket", 'S', "Socket file to use for connection.",
|
||||
|
@ -973,6 +1018,15 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
|
|||
case OPT_STOP_DATETIME:
|
||||
stop_datetime= convert_str_to_timestamp(stop_datetime_str);
|
||||
break;
|
||||
case OPT_BASE64_OUTPUT_MODE:
|
||||
if (argument == NULL)
|
||||
opt_base64_output_mode= BASE64_OUTPUT_ALWAYS;
|
||||
else
|
||||
{
|
||||
opt_base64_output_mode= (enum_base64_output_mode)
|
||||
(find_type_or_exit(argument, &base64_output_mode_typelib, opt->name)-1);
|
||||
}
|
||||
break;
|
||||
case 'V':
|
||||
print_version();
|
||||
exit(0);
|
||||
|
@ -1305,8 +1359,31 @@ err:
|
|||
}
|
||||
|
||||
|
||||
/**
|
||||
Reads the @c Format_description_log_event from the beginning of the
|
||||
input file.
|
||||
|
||||
The @c Format_description_log_event is only read if it is outside
|
||||
the range specified with @c --start-position; otherwise, it will be
|
||||
seen later. If this is an old binlog, a fake @c
|
||||
Format_description_event is created. This also prints a @c
|
||||
Format_description_log_event to the output, unless we reach the
|
||||
--start-position range. In this case, it is assumed that a @c
|
||||
Format_description_log_event will be found when reading events the
|
||||
usual way.
|
||||
|
||||
@param file The file to which a @c Format_description_log_event will
|
||||
be printed.
|
||||
|
||||
@param description_event Pointer to the global @c
|
||||
Format_description_log_event pointer. This will be updated if a new
|
||||
Format_description_log_event is found.
|
||||
|
||||
@param print_event_info Context state needed to print events.
|
||||
*/
|
||||
static void check_header(IO_CACHE* file,
|
||||
Format_description_log_event **description_event)
|
||||
Format_description_log_event **description_event,
|
||||
PRINT_EVENT_INFO *print_event_info)
|
||||
{
|
||||
uchar header[BIN_LOG_HEADER_SIZE];
|
||||
uchar buf[PROBE_HEADER_LEN];
|
||||
|
@ -1369,10 +1446,12 @@ Could not read entry at offset %lu : Error in log format or read error",
|
|||
}
|
||||
else
|
||||
{
|
||||
DBUG_PRINT("info",("buf[4]=%d", buf[4]));
|
||||
DBUG_PRINT("info",("buf[EVENT_TYPE_OFFSET=%d]=%d",
|
||||
EVENT_TYPE_OFFSET, buf[EVENT_TYPE_OFFSET]));
|
||||
/* always test for a Start_v3, even if no --start-position */
|
||||
if (buf[4] == START_EVENT_V3) /* This is 3.23 or 4.x */
|
||||
if (buf[EVENT_TYPE_OFFSET] == START_EVENT_V3)
|
||||
{
|
||||
/* This is 3.23 or 4.x */
|
||||
if (uint4korr(buf + EVENT_LEN_OFFSET) <
|
||||
(LOG_EVENT_MINIMAL_HEADER_LEN + START_V3_HEADER_LEN))
|
||||
{
|
||||
|
@ -1384,8 +1463,9 @@ Could not read entry at offset %lu : Error in log format or read error",
|
|||
}
|
||||
else if (tmp_pos >= start_position)
|
||||
break;
|
||||
else if (buf[4] == FORMAT_DESCRIPTION_EVENT) /* This is 5.0 */
|
||||
else if (buf[EVENT_TYPE_OFFSET] == FORMAT_DESCRIPTION_EVENT)
|
||||
{
|
||||
/* This is 5.0 */
|
||||
Format_description_log_event *new_description_event;
|
||||
my_b_seek(file, tmp_pos); /* seek back to event's start */
|
||||
if (!(new_description_event= (Format_description_log_event*)
|
||||
|
@ -1397,11 +1477,22 @@ Could not read entry at offset %lu : Error in log format or read error",
|
|||
at offset %lu ; this could be a log format error or read error",
|
||||
tmp_pos);
|
||||
}
|
||||
delete *description_event;
|
||||
*description_event= new_description_event;
|
||||
if (opt_base64_output_mode == BASE64_OUTPUT_AUTO
|
||||
|| opt_base64_output_mode == BASE64_OUTPUT_ALWAYS)
|
||||
/*
|
||||
process_event will delete *description_event and set it to
|
||||
the new one, so we should not do it ourselves in this
|
||||
case.
|
||||
*/
|
||||
process_event(print_event_info, new_description_event, tmp_pos);
|
||||
else
|
||||
{
|
||||
delete *description_event;
|
||||
*description_event= new_description_event;
|
||||
}
|
||||
DBUG_PRINT("info",("Setting description_event"));
|
||||
}
|
||||
else if (buf[4] == ROTATE_EVENT)
|
||||
else if (buf[EVENT_TYPE_OFFSET] == ROTATE_EVENT)
|
||||
{
|
||||
Log_event *ev;
|
||||
my_b_seek(file, tmp_pos); /* seek back to event's start */
|
||||
|
@ -1430,7 +1521,7 @@ static int dump_local_log_entries(PRINT_EVENT_INFO *print_event_info,
|
|||
uchar tmp_buff[BIN_LOG_HEADER_SIZE];
|
||||
int error= 0;
|
||||
|
||||
if (logname && logname[0] != '-')
|
||||
if (logname && strcmp(logname, "-") != 0)
|
||||
{
|
||||
if ((fd = my_open(logname, O_RDONLY | O_BINARY, MYF(MY_WME))) < 0)
|
||||
return 1;
|
||||
|
@ -1440,7 +1531,7 @@ static int dump_local_log_entries(PRINT_EVENT_INFO *print_event_info,
|
|||
my_close(fd, MYF(MY_WME));
|
||||
return 1;
|
||||
}
|
||||
check_header(file, &glob_description_event);
|
||||
check_header(file, &glob_description_event, print_event_info);
|
||||
}
|
||||
else // reading from stdin;
|
||||
{
|
||||
|
@ -1462,7 +1553,7 @@ static int dump_local_log_entries(PRINT_EVENT_INFO *print_event_info,
|
|||
if (init_io_cache(file, fileno(stdin), 0, READ_CACHE, (my_off_t) 0,
|
||||
0, MYF(MY_WME | MY_NABP | MY_DONT_CHECK_FILESIZE)))
|
||||
return 1;
|
||||
check_header(file, &glob_description_event);
|
||||
check_header(file, &glob_description_event, print_event_info);
|
||||
if (start_position)
|
||||
{
|
||||
/* skip 'start_position' characters from stdin */
|
||||
|
@ -1554,6 +1645,9 @@ int main(int argc, char** argv)
|
|||
exit(1);
|
||||
}
|
||||
|
||||
if (opt_base64_output_mode == BASE64_OUTPUT_UNSPEC)
|
||||
opt_base64_output_mode= BASE64_OUTPUT_AUTO;
|
||||
|
||||
my_set_max_open_files(open_files_limit);
|
||||
|
||||
MY_TMPDIR tmpdir;
|
||||
|
|
|
@ -159,6 +159,22 @@ static inline my_bool bitmap_cmp(const MY_BITMAP *map1, const MY_BITMAP *map2)
|
|||
#define bitmap_set_all(MAP) \
|
||||
(memset((MAP)->bitmap, 0xFF, 4*no_words_in_map((MAP))))
|
||||
|
||||
/**
|
||||
check, set and clear a bit of interest of an integer.
|
||||
|
||||
If the bit is out of range @retval -1. Otherwise
|
||||
bit_is_set @return 0 or 1 reflecting the bit is set or not;
|
||||
bit_do_set @return 1 (bit is set 1)
|
||||
bit_do_clear @return 0 (bit is cleared to 0)
|
||||
*/
|
||||
|
||||
#define bit_is_set(I,B) (sizeof(I) * CHAR_BIT > (B) ? \
|
||||
(((I) & (ULL(1) << (B))) == 0 ? 0 : 1) : -1)
|
||||
#define bit_do_set(I,B) (sizeof(I) * CHAR_BIT > (B) ? \
|
||||
((I) |= (ULL(1) << (B)), 1) : -1)
|
||||
#define bit_do_clear(I,B) (sizeof(I) * CHAR_BIT > (B) ? \
|
||||
((I) &= ~(ULL(1) << (B)), 0) : -1)
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -45,7 +45,8 @@ dist-hook:
|
|||
$(distdir)/std_data/ndb_backup51_data_be \
|
||||
$(distdir)/std_data/ndb_backup51_data_le \
|
||||
$(distdir)/std_data/parts \
|
||||
$(distdir)/lib
|
||||
$(distdir)/lib \
|
||||
$(distdir)/lib/My
|
||||
-$(INSTALL_DATA) $(srcdir)/t/*.def $(distdir)/t
|
||||
$(INSTALL_DATA) $(srcdir)/t/*.test $(distdir)/t
|
||||
-$(INSTALL_DATA) $(srcdir)/t/*.imtest $(distdir)/t
|
||||
|
@ -58,6 +59,7 @@ dist-hook:
|
|||
-$(INSTALL_DATA) $(srcdir)/extra/binlog_tests/*.opt $(distdir)/extra/binlog_tests
|
||||
-$(INSTALL_DATA) $(srcdir)/extra/rpl_tests/*.opt $(distdir)/extra/rpl_tests
|
||||
$(INSTALL_DATA) $(srcdir)/include/*.inc $(distdir)/include
|
||||
$(INSTALL_DATA) $(srcdir)/include/*.sql $(distdir)/include
|
||||
$(INSTALL_DATA) $(srcdir)/include/*.test $(distdir)/include
|
||||
$(INSTALL_DATA) $(srcdir)/r/*.result $(srcdir)/r/*.require $(distdir)/r
|
||||
$(INSTALL_DATA) $(srcdir)/std_data/Moscow_leap $(distdir)/std_data
|
||||
|
@ -74,6 +76,7 @@ dist-hook:
|
|||
$(INSTALL_DATA) $(srcdir)/std_data/ndb_backup51_data_le/BACKUP* $(distdir)/std_data/ndb_backup51_data_le
|
||||
$(INSTALL_DATA) $(srcdir)/std_data/parts/part_* $(distdir)/std_data/parts
|
||||
$(INSTALL_DATA) $(srcdir)/lib/*.pl $(distdir)/lib
|
||||
$(INSTALL_DATA) $(srcdir)/lib/My/*.pm $(distdir)/lib/My
|
||||
-rm -rf `find $(distdir)/suite -type d -name SCCS` $(distdir)/suite/row_lock
|
||||
|
||||
install-data-local:
|
||||
|
@ -89,7 +92,8 @@ install-data-local:
|
|||
$(DESTDIR)$(testdir)/std_data/ndb_backup51_data_be \
|
||||
$(DESTDIR)$(testdir)/std_data/ndb_backup51_data_le \
|
||||
$(DESTDIR)$(testdir)/std_data/parts \
|
||||
$(DESTDIR)$(testdir)/lib
|
||||
$(DESTDIR)$(testdir)/lib \
|
||||
$(DESTDIR)$(testdir)/lib/My
|
||||
$(INSTALL_DATA) $(srcdir)/README $(DESTDIR)$(testdir)
|
||||
-$(INSTALL_DATA) $(srcdir)/t/*.def $(DESTDIR)$(testdir)/t
|
||||
$(INSTALL_DATA) $(srcdir)/t/*.test $(DESTDIR)$(testdir)/t
|
||||
|
@ -106,6 +110,7 @@ install-data-local:
|
|||
-$(INSTALL_DATA) $(srcdir)/extra/binlog_tests/*.opt $(DESTDIR)$(testdir)/extra/binlog_tests
|
||||
-$(INSTALL_DATA) $(srcdir)/extra/rpl_tests/*.opt $(DESTDIR)$(testdir)/extra/rpl_tests
|
||||
$(INSTALL_DATA) $(srcdir)/include/*.inc $(DESTDIR)$(testdir)/include
|
||||
$(INSTALL_DATA) $(srcdir)/include/*.sql $(DESTDIR)$(testdir)/include
|
||||
$(INSTALL_DATA) $(srcdir)/include/*.test $(DESTDIR)$(testdir)/include
|
||||
$(INSTALL_DATA) $(srcdir)/std_data/*.dat $(DESTDIR)$(testdir)/std_data
|
||||
$(INSTALL_DATA) $(srcdir)/std_data/*.*001 $(DESTDIR)$(testdir)/std_data
|
||||
|
@ -123,6 +128,7 @@ install-data-local:
|
|||
$(INSTALL_DATA) $(srcdir)/std_data/ndb_backup51_data_le/BACKUP* $(DESTDIR)$(testdir)/std_data/ndb_backup51_data_le
|
||||
$(INSTALL_DATA) $(srcdir)/std_data/parts/part_* $(DESTDIR)$(testdir)/std_data/parts
|
||||
$(INSTALL_DATA) $(srcdir)/lib/*.pl $(DESTDIR)$(testdir)/lib
|
||||
$(INSTALL_DATA) $(srcdir)/lib/My/*.pm $(DESTDIR)$(testdir)/lib/My
|
||||
for f in `(cd $(srcdir); find suite -type f | egrep -v 'SCCS|row_lock')`; \
|
||||
do \
|
||||
d=$(DESTDIR)$(testdir)/`dirname $$f`; \
|
||||
|
|
|
@ -316,3 +316,318 @@ disconnect con3;
|
|||
connection con4;
|
||||
select get_lock("a",10); # wait for rollback to finish
|
||||
|
||||
# we check that the error code of the "ROLLBACK" event is 0 and not
|
||||
# ER_SERVER_SHUTDOWN (i.e. disconnection just rolls back transaction
|
||||
# and does not make slave to stop)
|
||||
--exec $MYSQL_BINLOG --start-position=547 $MYSQLTEST_VARDIR/log/master-bin.000001 > $MYSQLTEST_VARDIR/tmp/mix_innodb_myisam_binlog.output
|
||||
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
|
||||
eval select
|
||||
(@a:=load_file("$MYSQLTEST_VARDIR/tmp/mix_innodb_myisam_binlog.output"))
|
||||
is not null;
|
||||
--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR
|
||||
eval select
|
||||
@a like "%#%error_code=0%ROLLBACK\\n/*!*/;%ROLLBACK /* added by mysqlbinlog */;%",
|
||||
@a not like "%#%error_code=%error_code=%";
|
||||
drop table t1, t2;
|
||||
|
||||
#
|
||||
# Bug #27417 thd->no_trans_update.stmt lost value inside of SF-exec-stack
|
||||
# bug #28960 non-trans temp table changes with insert .. select
|
||||
# not binlogged after rollback
|
||||
#
|
||||
# testing appearence of insert into temp_table in binlog.
|
||||
# There are two branches of execution that require different setup.
|
||||
|
||||
## send_eof() branch
|
||||
|
||||
# prepare
|
||||
|
||||
create temporary table tt (a int unique);
|
||||
create table ti (a int) engine=innodb;
|
||||
reset master;
|
||||
show master status;
|
||||
|
||||
# action
|
||||
|
||||
begin;
|
||||
insert into ti values (1);
|
||||
insert into ti values (2) ;
|
||||
insert into tt select * from ti;
|
||||
rollback;
|
||||
|
||||
# check
|
||||
|
||||
select count(*) from tt /* 2 */;
|
||||
show master status;
|
||||
--replace_column 2 # 5 #
|
||||
show binlog events from 98;
|
||||
select count(*) from ti /* zero */;
|
||||
insert into ti select * from tt;
|
||||
select * from ti /* that is what slave would miss - a bug */;
|
||||
|
||||
|
||||
## send_error() branch
|
||||
delete from ti;
|
||||
delete from tt where a=1;
|
||||
reset master;
|
||||
show master status;
|
||||
|
||||
# action
|
||||
|
||||
begin;
|
||||
insert into ti values (1);
|
||||
insert into ti values (2) /* to make the dup error in the following */;
|
||||
--error ER_DUP_ENTRY
|
||||
insert into tt select * from ti /* one affected and error */;
|
||||
rollback;
|
||||
|
||||
# check
|
||||
|
||||
show master status;
|
||||
--replace_column 2 # 5 #
|
||||
show binlog events from 98;
|
||||
select count(*) from ti /* zero */;
|
||||
insert into ti select * from tt;
|
||||
select * from tt /* that is what otherwise slave missed - the bug */;
|
||||
|
||||
drop table ti;
|
||||
|
||||
|
||||
#
|
||||
# Bug #27417 thd->no_trans_update.stmt lost value inside of SF-exec-stack
|
||||
#
|
||||
# Testing asserts: if there is a side effect of modifying non-transactional
|
||||
# table thd->no_trans_update.stmt must be TRUE;
|
||||
# the assert is active with debug build
|
||||
#
|
||||
|
||||
--disable_warnings
|
||||
drop function if exists bug27417;
|
||||
drop table if exists t1,t2;
|
||||
--enable_warnings
|
||||
# side effect table
|
||||
CREATE TABLE t1 (a int NOT NULL auto_increment primary key) ENGINE=MyISAM;
|
||||
# target tables
|
||||
CREATE TABLE t2 (a int NOT NULL auto_increment, PRIMARY KEY (a));
|
||||
|
||||
delimiter |;
|
||||
create function bug27417(n int)
|
||||
RETURNS int(11)
|
||||
begin
|
||||
insert into t1 values (null);
|
||||
return n;
|
||||
end|
|
||||
delimiter ;|
|
||||
|
||||
reset master;
|
||||
|
||||
# execute
|
||||
|
||||
insert into t2 values (bug27417(1));
|
||||
insert into t2 select bug27417(2);
|
||||
reset master;
|
||||
|
||||
--error ER_DUP_ENTRY
|
||||
insert into t2 values (bug27417(2));
|
||||
show master status; /* only (!) with fixes for #23333 will show there is the query */;
|
||||
select count(*) from t1 /* must be 3 */;
|
||||
|
||||
reset master;
|
||||
select count(*) from t2;
|
||||
delete from t2 where a=bug27417(3);
|
||||
select count(*) from t2 /* nothing got deleted */;
|
||||
show master status; /* the query must be in regardless of #23333 */;
|
||||
select count(*) from t1 /* must be 5 */;
|
||||
|
||||
--enable_info
|
||||
delete t2 from t2 where t2.a=bug27417(100) /* must not affect t2 */;
|
||||
--disable_info
|
||||
select count(*) from t1 /* must be 7 */;
|
||||
|
||||
# function bug27417 remains for the following testing of bug#23333
|
||||
drop table t1,t2;
|
||||
|
||||
#
|
||||
# Bug#23333 using the patch (and the test) for bug#27471
|
||||
#
|
||||
# throughout the bug tests
|
||||
# t1 - non-trans side effects gatherer;
|
||||
# t2 - transactional table;
|
||||
#
|
||||
|
||||
CREATE TABLE t1 (a int NOT NULL auto_increment primary key) ENGINE=MyISAM;
|
||||
CREATE TABLE t2 (a int, PRIMARY KEY (a)) ENGINE=InnoDB;
|
||||
CREATE TABLE t3 (a int, PRIMARY KEY (a), b int unique) ENGINE=MyISAM;
|
||||
CREATE TABLE t4 (a int, PRIMARY KEY (a), b int unique) ENGINE=Innodb;
|
||||
CREATE TABLE t5 (a int, PRIMARY KEY (a)) ENGINE=InnoDB;
|
||||
|
||||
|
||||
#
|
||||
# INSERT
|
||||
#
|
||||
|
||||
# prepare
|
||||
|
||||
insert into t2 values (1);
|
||||
reset master;
|
||||
|
||||
# execute
|
||||
|
||||
--error ER_DUP_ENTRY
|
||||
insert into t2 values (bug27417(1));
|
||||
|
||||
# check
|
||||
|
||||
show master status /* the offset must denote there is the query */;
|
||||
select count(*) from t1 /* must be 1 */;
|
||||
|
||||
#
|
||||
# INSERT SELECT
|
||||
#
|
||||
|
||||
# prepare
|
||||
delete from t1;
|
||||
delete from t2;
|
||||
insert into t2 values (2);
|
||||
reset master;
|
||||
|
||||
# execute
|
||||
|
||||
--error ER_DUP_ENTRY
|
||||
insert into t2 select bug27417(1) union select bug27417(2);
|
||||
|
||||
# check
|
||||
|
||||
show master status /* the offset must denote there is the query */;
|
||||
select count(*) from t1 /* must be 2 */;
|
||||
|
||||
#
|
||||
# UPDATE inc multi-update
|
||||
#
|
||||
|
||||
# prepare
|
||||
delete from t1;
|
||||
insert into t3 values (1,1),(2,3),(3,4);
|
||||
reset master;
|
||||
|
||||
# execute
|
||||
--error ER_DUP_ENTRY
|
||||
update t3 set b=b+bug27417(1);
|
||||
|
||||
# check
|
||||
show master status /* the offset must denote there is the query */;
|
||||
select count(*) from t1 /* must be 2 */;
|
||||
|
||||
## multi_update::send_eof() branch
|
||||
|
||||
# prepare
|
||||
delete from t3;
|
||||
delete from t4;
|
||||
insert into t3 values (1,1);
|
||||
insert into t4 values (1,1),(2,2);
|
||||
|
||||
reset master;
|
||||
|
||||
# execute
|
||||
--error ER_DUP_ENTRY
|
||||
UPDATE t4,t3 SET t4.a=t3.a + bug27417(1) /* top level non-ta table */;
|
||||
|
||||
# check
|
||||
show master status /* the offset must denote there is the query */;
|
||||
select count(*) from t1 /* must be 4 */;
|
||||
|
||||
## send_error() branch of multi_update
|
||||
|
||||
# prepare
|
||||
delete from t1;
|
||||
delete from t3;
|
||||
delete from t4;
|
||||
insert into t3 values (1,1),(2,2);
|
||||
insert into t4 values (1,1),(2,2);
|
||||
|
||||
reset master;
|
||||
|
||||
# execute
|
||||
--error ER_DUP_ENTRY
|
||||
UPDATE t3,t4 SET t3.a=t4.a + bug27417(1);
|
||||
|
||||
# check
|
||||
select count(*) from t1 /* must be 1 */;
|
||||
|
||||
# cleanup
|
||||
drop table t4;
|
||||
|
||||
|
||||
#
|
||||
# DELETE incl multi-delete
|
||||
#
|
||||
|
||||
# prepare
|
||||
delete from t1;
|
||||
delete from t2;
|
||||
delete from t3;
|
||||
insert into t2 values (1);
|
||||
insert into t3 values (1,1);
|
||||
create trigger trg_del before delete on t2 for each row
|
||||
insert into t3 values (bug27417(1), 2);
|
||||
reset master;
|
||||
|
||||
# execute
|
||||
--error ER_DUP_ENTRY
|
||||
delete from t2;
|
||||
# check
|
||||
show master status /* the offset must denote there is the query */;
|
||||
select count(*) from t1 /* must be 1 */;
|
||||
|
||||
# cleanup
|
||||
drop trigger trg_del;
|
||||
|
||||
# prepare
|
||||
delete from t1;
|
||||
delete from t2;
|
||||
delete from t5;
|
||||
create trigger trg_del_t2 after delete on t2 for each row
|
||||
insert into t1 values (1);
|
||||
insert into t2 values (2),(3);
|
||||
insert into t5 values (1),(2);
|
||||
reset master;
|
||||
|
||||
# execute
|
||||
--error ER_DUP_ENTRY
|
||||
delete t2.* from t2,t5 where t2.a=t5.a + 1;
|
||||
|
||||
# check
|
||||
show master status /* the offset must denote there is the query */;
|
||||
select count(*) from t1 /* must be 1 */;
|
||||
|
||||
|
||||
#
|
||||
# LOAD DATA
|
||||
#
|
||||
|
||||
# prepare
|
||||
delete from t1;
|
||||
create table t4 (a int default 0, b int primary key) engine=innodb;
|
||||
insert into t4 values (0, 17);
|
||||
reset master;
|
||||
|
||||
# execute
|
||||
--error ER_DUP_ENTRY
|
||||
load data infile '../std_data_ln/rpl_loaddata.dat' into table t4 (a, @b) set b= @b + bug27417(2);
|
||||
# check
|
||||
select * from t4;
|
||||
select count(*) from t1 /* must be 2 */;
|
||||
show master status /* the offset must denote there is the query */;
|
||||
|
||||
#
|
||||
# bug#23333 cleanup
|
||||
#
|
||||
|
||||
|
||||
drop trigger trg_del_t2;
|
||||
drop table t1,t2,t3,t4,t5;
|
||||
drop function bug27417;
|
||||
|
||||
|
||||
--echo end of tests
|
||||
|
||||
|
|
|
@ -32,3 +32,34 @@ SET FOREIGN_KEY_CHECKS=0;
|
|||
DROP TABLE IF EXISTS t1,t2,t3;
|
||||
SET FOREIGN_KEY_CHECKS=1;
|
||||
sync_slave_with_master;
|
||||
|
||||
#
|
||||
# Bug #32468 delete rows event on a table with foreign key constraint fails
|
||||
#
|
||||
|
||||
connection master;
|
||||
|
||||
eval create table t1 (b int primary key) engine = $engine_type;
|
||||
eval create table t2 (a int primary key, b int, foreign key (b) references t1(b))
|
||||
engine = $engine_type;
|
||||
|
||||
insert into t1 set b=1;
|
||||
insert into t2 set a=1, b=1;
|
||||
|
||||
set foreign_key_checks=0;
|
||||
set @@session.binlog_format=row;
|
||||
delete from t1;
|
||||
|
||||
--echo must sync w/o a problem (could not with the buggy code)
|
||||
sync_slave_with_master;
|
||||
select count(*) from t1 /* must be zero */;
|
||||
|
||||
|
||||
# cleanup for bug#32468
|
||||
|
||||
connection master;
|
||||
drop table t2,t1;
|
||||
|
||||
sync_slave_with_master;
|
||||
|
||||
|
||||
|
|
|
@ -174,11 +174,18 @@ sync_slave_with_master;
|
|||
INSERT INTO t7 VALUES (1,3), (2,6), (3,9);
|
||||
SELECT * FROM t7 ORDER BY C1;
|
||||
|
||||
# since bug#31552/31609 idempotency is not default any longer. In order
|
||||
# the preceeding test INSERT INTO t7 to pass the mode is switched
|
||||
# temprorarily
|
||||
set @@global.slave_exec_mode= 'IDEMPOTENT';
|
||||
|
||||
connection master;
|
||||
--echo --- on master: new values inserted ---
|
||||
INSERT INTO t7 VALUES (1,2), (2,4), (3,6);
|
||||
SELECT * FROM t7 ORDER BY C1;
|
||||
sync_slave_with_master;
|
||||
|
||||
set @@global.slave_exec_mode= default;
|
||||
--echo --- on slave: old values should be overwritten by replicated values ---
|
||||
SELECT * FROM t7 ORDER BY C1;
|
||||
|
||||
|
@ -206,12 +213,19 @@ SELECT * FROM t8 ORDER BY a;
|
|||
INSERT INTO t8 VALUES (1,2,3), (2,4,6), (3,6,9);
|
||||
SELECT * FROM t8 ORDER BY a;
|
||||
|
||||
# since bug#31552/31609 idempotency is not default any longer. In order
|
||||
# the preceeding test INSERT INTO t8 to pass the mode is switched
|
||||
# temprorarily
|
||||
set @@global.slave_exec_mode= 'IDEMPOTENT';
|
||||
|
||||
connection master;
|
||||
--echo --- on master ---
|
||||
# We insert a row that will cause conflict on the primary key but not
|
||||
# on the other keys.
|
||||
INSERT INTO t8 VALUES (2,4,8);
|
||||
sync_slave_with_master;
|
||||
set @@global.slave_exec_mode= default;
|
||||
|
||||
--echo --- on slave ---
|
||||
SELECT * FROM t8 ORDER BY a;
|
||||
|
||||
|
@ -234,12 +248,17 @@ connection master;
|
|||
INSERT INTO t1 VALUES ('K','K'), ('L','L'), ('M','M');
|
||||
--echo **** On Master ****
|
||||
sync_slave_with_master;
|
||||
# since bug#31552/31609 idempotency is not default any longer. In order
|
||||
# the following test DELETE FROM t1 to pass the mode is switched
|
||||
# temprorarily
|
||||
set @@global.slave_exec_mode= 'IDEMPOTENT';
|
||||
DELETE FROM t1 WHERE C1 = 'L';
|
||||
|
||||
connection master;
|
||||
DELETE FROM t1;
|
||||
query_vertical SELECT COUNT(*) FROM t1 ORDER BY c1,c2;
|
||||
sync_slave_with_master;
|
||||
set @@global.slave_exec_mode= default;
|
||||
let $last_error = query_get_value("SHOW SLAVE STATUS", Last_SQL_Errno, 1);
|
||||
disable_query_log;
|
||||
eval SELECT "$last_error" AS Last_SQL_Error;
|
||||
|
|
|
@ -69,6 +69,11 @@ ALTER TABLE t8 ADD e1 INT NOT NULL DEFAULT 0, ADD e2 INT NOT NULL DEFAULT 0,
|
|||
|
||||
# Insert some values for tables on slave side. These should not be
|
||||
# modified when the row from the master is applied.
|
||||
# since bug#31552/31609 idempotency is not default any longer. In order
|
||||
# the following INSERTs to pass the mode is switched temprorarily
|
||||
set @@global.slave_exec_mode= 'IDEMPOTENT';
|
||||
|
||||
# so the inserts are going to be overriden
|
||||
INSERT INTO t1_int VALUES (2, 4, 4711);
|
||||
INSERT INTO t1_char VALUES (2, 4, 'Foo is a bar');
|
||||
INSERT INTO t1_bit VALUES (2, 4, b'101', b'11100', b'01');
|
||||
|
@ -86,6 +91,8 @@ SELECT * FROM t1_bit ORDER BY a;
|
|||
SELECT * FROM t1_char ORDER BY a;
|
||||
--echo **** On Slave ****
|
||||
sync_slave_with_master;
|
||||
set @@global.slave_exec_mode= default;
|
||||
|
||||
SELECT a,b,x FROM t1_int ORDER BY a;
|
||||
SELECT a,b,HEX(x),HEX(y),HEX(z) FROM t1_bit ORDER BY a;
|
||||
SELECT a,b,x FROM t1_char ORDER BY a;
|
||||
|
|
|
@ -0,0 +1,7 @@
|
|||
--source include/have_log_bin.inc
|
||||
|
||||
-- require r/have_binlog_format_statement.require
|
||||
--disable_query_log
|
||||
--replace_result ROW STATEMENT
|
||||
show variables like "binlog_format";
|
||||
--enable_query_log
|
|
@ -6,7 +6,7 @@ connect (server2,127.0.0.1,root,,test,$MASTER_MYPORT1,);
|
|||
connection server1;
|
||||
disable_query_log;
|
||||
--require r/true.require
|
||||
select (support = 'YES' or support = 'DEFAULT') as `TRUE` from information_schema.engines where engine = 'ndbcluster';
|
||||
select (support = 'YES' or support = 'DEFAULT' or support = 'ENABLED') as `TRUE` from information_schema.engines where engine = 'ndbcluster';
|
||||
--source include/ndb_not_readonly.inc
|
||||
enable_query_log;
|
||||
|
||||
|
@ -14,7 +14,7 @@ enable_query_log;
|
|||
connection server2;
|
||||
disable_query_log;
|
||||
--require r/true.require
|
||||
select (support = 'YES' or support = 'DEFAULT') as `TRUE` from information_schema.engines where engine = 'ndbcluster';
|
||||
select (support = 'YES' or support = 'DEFAULT' or support = 'ENABLED') as `TRUE` from information_schema.engines where engine = 'ndbcluster';
|
||||
--source include/ndb_not_readonly.inc
|
||||
enable_query_log;
|
||||
|
||||
|
|
2
mysql-test/include/set_binlog_format_mixed.sql
Normal file
2
mysql-test/include/set_binlog_format_mixed.sql
Normal file
|
@ -0,0 +1,2 @@
|
|||
SET GLOBAL BINLOG_FORMAT=MIXED;
|
||||
SET SESSION BINLOG_FORMAT=MIXED;
|
2
mysql-test/include/set_binlog_format_row.sql
Normal file
2
mysql-test/include/set_binlog_format_row.sql
Normal file
|
@ -0,0 +1,2 @@
|
|||
SET GLOBAL BINLOG_FORMAT=ROW;
|
||||
SET SESSION BINLOG_FORMAT=ROW;
|
2
mysql-test/include/set_binlog_format_statement.sql
Normal file
2
mysql-test/include/set_binlog_format_statement.sql
Normal file
|
@ -0,0 +1,2 @@
|
|||
SET GLOBAL BINLOG_FORMAT=STATEMENT;
|
||||
SET SESSION BINLOG_FORMAT=STATEMENT;
|
422
mysql-test/lib/My/Config.pm
Normal file
422
mysql-test/lib/My/Config.pm
Normal file
|
@ -0,0 +1,422 @@
|
|||
# -*- cperl -*-
|
||||
|
||||
package My::Config::Option;
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
|
||||
|
||||
sub new {
|
||||
my ($class, $option_name, $option_value)= @_;
|
||||
my $self= bless { name => $option_name,
|
||||
value => $option_value
|
||||
}, $class;
|
||||
return $self;
|
||||
}
|
||||
|
||||
|
||||
sub name {
|
||||
my ($self)= @_;
|
||||
return $self->{name};
|
||||
}
|
||||
|
||||
|
||||
sub value {
|
||||
my ($self)= @_;
|
||||
return $self->{value};
|
||||
}
|
||||
|
||||
|
||||
package My::Config::Group;
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
|
||||
|
||||
sub new {
|
||||
my ($class, $group_name)= @_;
|
||||
my $self= bless { name => $group_name,
|
||||
options => [],
|
||||
options_by_name => {},
|
||||
}, $class;
|
||||
return $self;
|
||||
}
|
||||
|
||||
|
||||
sub insert {
|
||||
my ($self, $option_name, $value, $if_not_exist)= @_;
|
||||
my $option= $self->option($option_name);
|
||||
if (defined($option) and !$if_not_exist) {
|
||||
$option->{value}= $value;
|
||||
}
|
||||
else {
|
||||
my $option= My::Config::Option->new($option_name, $value);
|
||||
# Insert option in list
|
||||
push(@{$self->{options}}, $option);
|
||||
# Insert option in hash
|
||||
$self->{options_by_name}->{$option_name}= $option;
|
||||
}
|
||||
return $option;
|
||||
}
|
||||
|
||||
sub remove {
|
||||
my ($self, $option_name)= @_;
|
||||
|
||||
# Check that option exists
|
||||
my $option= $self->option($option_name);
|
||||
|
||||
return undef unless defined $option;
|
||||
|
||||
# Remove from the hash
|
||||
delete($self->{options_by_name}->{$option_name}) or die;
|
||||
|
||||
# Remove from the array
|
||||
@{$self->{options}}= grep { $_->name ne $option_name } @{$self->{options}};
|
||||
|
||||
return $option;
|
||||
}
|
||||
|
||||
|
||||
sub options {
|
||||
my ($self)= @_;
|
||||
return @{$self->{options}};
|
||||
}
|
||||
|
||||
|
||||
sub name {
|
||||
my ($self)= @_;
|
||||
return $self->{name};
|
||||
}
|
||||
|
||||
|
||||
#
|
||||
# Return a specific option in the group
|
||||
#
|
||||
sub option {
|
||||
my ($self, $option_name)= @_;
|
||||
|
||||
return $self->{options_by_name}->{$option_name};
|
||||
}
|
||||
|
||||
|
||||
#
|
||||
# Return a specific value for an option in the group
|
||||
#
|
||||
sub value {
|
||||
my ($self, $option_name)= @_;
|
||||
my $option= $self->option($option_name);
|
||||
|
||||
die "No option named '$option_name' in this group"
|
||||
if ! defined($option);
|
||||
|
||||
return $option->value();
|
||||
}
|
||||
|
||||
|
||||
package My::Config;
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
use IO::File;
|
||||
use File::Basename;
|
||||
|
||||
#
|
||||
# Constructor for My::Config
|
||||
# - represents a my.cnf config file
|
||||
#
|
||||
# Array of arrays
|
||||
#
|
||||
sub new {
|
||||
my ($class, $path)= @_;
|
||||
my $group_name= undef;
|
||||
|
||||
my $self= bless { groups => [] }, $class;
|
||||
my $F= IO::File->new($path, "<")
|
||||
or die "Could not open '$path': $!";
|
||||
|
||||
while ( my $line= <$F> ) {
|
||||
chomp($line);
|
||||
|
||||
# [group]
|
||||
if ( $line =~ /\[(.*)\]/ ) {
|
||||
# New group found
|
||||
$group_name= $1;
|
||||
#print "group: $group_name\n";
|
||||
|
||||
$self->insert($group_name, undef, undef);
|
||||
}
|
||||
|
||||
# Magic #! comments
|
||||
elsif ( $line =~ /^#\!/) {
|
||||
my $magic= $line;
|
||||
die "Found magic comment '$magic' outside of group"
|
||||
unless $group_name;
|
||||
|
||||
#print "$magic\n";
|
||||
$self->insert($group_name, $magic, undef);
|
||||
}
|
||||
|
||||
# Comments
|
||||
elsif ( $line =~ /^#/ || $line =~ /^;/) {
|
||||
# Skip comment
|
||||
next;
|
||||
}
|
||||
|
||||
# Empty lines
|
||||
elsif ( $line =~ /^$/ ) {
|
||||
# Skip empty lines
|
||||
next;
|
||||
}
|
||||
|
||||
# !include <filename>
|
||||
elsif ( $line =~ /^\!include\s*(.*?)\s*$/ ) {
|
||||
my $include_file_name= dirname($path)."/".$1;
|
||||
# Check that the file exists
|
||||
die "The include file '$include_file_name' does not exist"
|
||||
unless -f $include_file_name;
|
||||
|
||||
$self->append(My::Config->new($include_file_name));
|
||||
}
|
||||
|
||||
# <option>
|
||||
elsif ( $line =~ /^([\@\w-]+)\s*$/ ) {
|
||||
my $option= $1;
|
||||
|
||||
die "Found option '$option' outside of group"
|
||||
unless $group_name;
|
||||
|
||||
#print "$option\n";
|
||||
$self->insert($group_name, $option, undef);
|
||||
}
|
||||
|
||||
# <option>=<value>
|
||||
elsif ( $line =~ /^([\@\w-]+)\s*=\s*(.*?)\s*$/ ) {
|
||||
my $option= $1;
|
||||
my $value= $2;
|
||||
|
||||
die "Found option '$option=$value' outside of group"
|
||||
unless $group_name;
|
||||
|
||||
#print "$option=$value\n";
|
||||
$self->insert($group_name, $option, $value);
|
||||
} else {
|
||||
die "Unexpected line '$line' found in '$path'";
|
||||
}
|
||||
|
||||
}
|
||||
undef $F; # Close the file
|
||||
|
||||
return $self;
|
||||
}
|
||||
|
||||
#
|
||||
# Insert a new group if it does not already exist
|
||||
# and add option if defined
|
||||
#
|
||||
sub insert {
|
||||
my ($self, $group_name, $option, $value, $if_not_exist)= @_;
|
||||
my $group;
|
||||
|
||||
# Create empty array for the group if it doesn't exist
|
||||
if ( !$self->group_exists($group_name) ) {
|
||||
$group= $self->_group_insert($group_name);
|
||||
}
|
||||
else {
|
||||
$group= $self->group($group_name);
|
||||
}
|
||||
|
||||
if ( defined $option ) {
|
||||
#print "option: $option, value: $value\n";
|
||||
|
||||
# Add the option to the group
|
||||
$group->insert($option, $value, $if_not_exist);
|
||||
}
|
||||
}
|
||||
|
||||
#
|
||||
# Remove a option, given group and option name
|
||||
#
|
||||
sub remove {
|
||||
my ($self, $group_name, $option_name)= @_;
|
||||
my $group= $self->group($group_name);
|
||||
|
||||
die "group '$group_name' does not exist"
|
||||
unless defined($group);
|
||||
|
||||
$group->remove($option_name) or
|
||||
die "option '$option_name' does not exist";
|
||||
}
|
||||
|
||||
|
||||
|
||||
#
|
||||
# Check if group with given name exists in config
|
||||
#
|
||||
sub group_exists {
|
||||
my ($self, $group_name)= @_;
|
||||
|
||||
foreach my $group ($self->groups()) {
|
||||
return 1 if $group->{name} eq $group_name;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
#
|
||||
# Insert a new group into config
|
||||
#
|
||||
sub _group_insert {
|
||||
my ($self, $group_name)= @_;
|
||||
caller eq __PACKAGE__ or die;
|
||||
|
||||
# Check that group does not already exist
|
||||
die "Group already exists" if $self->group_exists($group_name);
|
||||
|
||||
my $group= My::Config::Group->new($group_name);
|
||||
push(@{$self->{groups}}, $group);
|
||||
return $group;
|
||||
}
|
||||
|
||||
|
||||
#
|
||||
# Append a configuration to current config
|
||||
#
|
||||
sub append {
|
||||
my ($self, $from)= @_;
|
||||
|
||||
foreach my $group ($from->groups()) {
|
||||
foreach my $option ($group->options()) {
|
||||
$self->insert($group->name(), $option->name(), $option->value());
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#
|
||||
# Return a list with all the groups in config
|
||||
#
|
||||
sub groups {
|
||||
my ($self)= @_;
|
||||
return ( @{$self->{groups}} );
|
||||
}
|
||||
|
||||
|
||||
#
|
||||
# Return a list of all the groups in config
|
||||
# starting with the given string
|
||||
#
|
||||
sub like {
|
||||
my ($self, $prefix)= @_;
|
||||
return ( grep ( $_->{name} =~ /^$prefix/, $self->groups()) );
|
||||
}
|
||||
|
||||
|
||||
#
|
||||
# Return the first group in config
|
||||
# starting with the given string
|
||||
#
|
||||
sub first_like {
|
||||
my ($self, $prefix)= @_;
|
||||
return ($self->like($prefix))[0];
|
||||
}
|
||||
|
||||
|
||||
#
|
||||
# Return a specific group in the config
|
||||
#
|
||||
sub group {
|
||||
my ($self, $group_name)= @_;
|
||||
|
||||
foreach my $group ( $self->groups() ) {
|
||||
return $group if $group->{name} eq $group_name;
|
||||
}
|
||||
return undef;
|
||||
}
|
||||
|
||||
|
||||
#
|
||||
# Return a list of all options in a specific group in the config
|
||||
#
|
||||
sub options_in_group {
|
||||
my ($self, $group_name)= @_;
|
||||
|
||||
my $group= $self->group($group_name);
|
||||
return () unless defined $group;
|
||||
return $group->options();
|
||||
}
|
||||
|
||||
|
||||
#
|
||||
# Return a value given group and option name
|
||||
#
|
||||
sub value {
|
||||
my ($self, $group_name, $option_name)= @_;
|
||||
my $group= $self->group($group_name);
|
||||
|
||||
die "group '$group_name' does not exist"
|
||||
unless defined($group);
|
||||
|
||||
my $option= $group->option($option_name);
|
||||
die "option '$option_name' does not exist"
|
||||
unless defined($option);
|
||||
|
||||
return $option->value();
|
||||
}
|
||||
|
||||
|
||||
#
|
||||
# Check if an option exists
|
||||
#
|
||||
sub exists {
|
||||
my ($self, $group_name, $option_name)= @_;
|
||||
my $group= $self->group($group_name);
|
||||
|
||||
die "group '$group_name' does not exist"
|
||||
unless defined($group);
|
||||
|
||||
my $option= $group->option($option_name);
|
||||
return defined($option);
|
||||
}
|
||||
|
||||
|
||||
# Overload "to string"-operator with 'stringify'
|
||||
use overload
|
||||
'""' => \&stringify;
|
||||
|
||||
#
|
||||
# Return the config as a string in my.cnf file format
|
||||
#
|
||||
sub stringify {
|
||||
my ($self)= @_;
|
||||
my $res;
|
||||
|
||||
foreach my $group ($self->groups()) {
|
||||
$res .= "[$group->{name}]\n";
|
||||
|
||||
foreach my $option ($group->options()) {
|
||||
$res .= $option->name();
|
||||
my $value= $option->value();
|
||||
if (defined $value) {
|
||||
$res .= "=$value";
|
||||
}
|
||||
$res .= "\n";
|
||||
}
|
||||
$res .= "\n";
|
||||
}
|
||||
return $res;
|
||||
}
|
||||
|
||||
|
||||
#
|
||||
# Save the config to named file
|
||||
#
|
||||
sub save {
|
||||
my ($self, $path)= @_;
|
||||
my $F= IO::File->new($path, ">")
|
||||
or die "Could not open '$path': $!";
|
||||
print $F $self;
|
||||
undef $F; # Close the file
|
||||
}
|
||||
|
||||
1;
|
|
@ -22,8 +22,10 @@ use File::Basename;
|
|||
use IO::File();
|
||||
use strict;
|
||||
|
||||
use My::Config;
|
||||
|
||||
sub collect_test_cases ($);
|
||||
sub collect_one_suite ($$);
|
||||
sub collect_one_suite ($);
|
||||
sub collect_one_test_case ($$$$$$$$$);
|
||||
|
||||
sub mtr_options_from_test_file($$);
|
||||
|
@ -61,7 +63,7 @@ sub collect_test_cases ($) {
|
|||
|
||||
foreach my $suite (split(",", $suites))
|
||||
{
|
||||
collect_one_suite($suite, $cases);
|
||||
push(@$cases, collect_one_suite($suite));
|
||||
}
|
||||
|
||||
|
||||
|
@ -205,51 +207,24 @@ sub split_testname {
|
|||
}
|
||||
|
||||
|
||||
sub collect_one_suite($$)
|
||||
sub collect_one_suite($)
|
||||
{
|
||||
my $suite= shift; # Test suite name
|
||||
my $cases= shift; # List of test cases
|
||||
my @cases; # Array of hash
|
||||
|
||||
mtr_verbose("Collecting: $suite");
|
||||
|
||||
my $combination_file= "combinations";
|
||||
my $combinations = [];
|
||||
|
||||
my $suitedir= "$::glob_mysql_test_dir"; # Default
|
||||
my $combination_file= "$::glob_mysql_test_dir/$combination_file";
|
||||
if ( $suite ne "main" )
|
||||
{
|
||||
$suitedir= mtr_path_exists("$suitedir/suite/$suite",
|
||||
"$suitedir/$suite");
|
||||
mtr_verbose("suitedir: $suitedir");
|
||||
$combination_file= "$suitedir/$combination_file";
|
||||
}
|
||||
|
||||
my $testdir= "$suitedir/t";
|
||||
my $resdir= "$suitedir/r";
|
||||
|
||||
if (!@::opt_combination)
|
||||
{
|
||||
# Read combinations file
|
||||
if ( open(COMB,$combination_file) )
|
||||
{
|
||||
while (<COMB>)
|
||||
{
|
||||
chomp;
|
||||
s/\ +/ /g;
|
||||
push (@$combinations, $_) unless ($_ eq '');
|
||||
}
|
||||
close COMB;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
# take the combination from command-line
|
||||
@$combinations = @::opt_combination;
|
||||
}
|
||||
# Remember last element position
|
||||
my $begin_index = $#{@$cases} + 1;
|
||||
|
||||
# ----------------------------------------------------------------------
|
||||
# Build a hash of disabled testcases for this suite
|
||||
# ----------------------------------------------------------------------
|
||||
|
@ -324,7 +299,7 @@ sub collect_one_suite($$)
|
|||
}
|
||||
|
||||
collect_one_test_case($testdir,$resdir,$suite,$tname,
|
||||
"$tname.$extension",$cases,\%disabled,
|
||||
"$tname.$extension",\@cases,\%disabled,
|
||||
$component_id,$suite_opts);
|
||||
}
|
||||
}
|
||||
|
@ -354,85 +329,168 @@ sub collect_one_suite($$)
|
|||
next if ($do_test and not $tname =~ /$do_test/o);
|
||||
|
||||
collect_one_test_case($testdir,$resdir,$suite,$tname,
|
||||
$elem,$cases,\%disabled,$component_id,
|
||||
$elem,\@cases,\%disabled,$component_id,
|
||||
$suite_opts);
|
||||
}
|
||||
closedir TESTDIR;
|
||||
}
|
||||
|
||||
|
||||
# Return empty list if no testcases found
|
||||
return if (@cases == 0);
|
||||
|
||||
# ----------------------------------------------------------------------
|
||||
# Proccess combinations only if new tests were added
|
||||
# Read combinations for this suite and build testcases x combinations
|
||||
# if any combinations exists
|
||||
# ----------------------------------------------------------------------
|
||||
if (0 and $combinations && $begin_index <= $#{@$cases})
|
||||
{
|
||||
my $end_index = $#{@$cases};
|
||||
my $is_copy;
|
||||
# Keep original master/slave options
|
||||
my @orig_opts;
|
||||
for (my $idx = $begin_index; $idx <= $end_index; $idx++)
|
||||
if ( ! $::opt_skip_combination )
|
||||
{
|
||||
my @combinations;
|
||||
my $combination_file= "$suitedir/combinations";
|
||||
#print "combination_file: $combination_file\n";
|
||||
if (@::opt_combinations)
|
||||
{
|
||||
foreach my $param (('master_opt','slave_opt','slave_mi'))
|
||||
{
|
||||
@{$orig_opts[$idx]{$param}} = @{$cases->[$idx]->{$param}};
|
||||
# take the combination from command-line
|
||||
mtr_verbose("Take the combination from command line");
|
||||
foreach my $combination (@::opt_combinations) {
|
||||
my $comb= {};
|
||||
$comb->{name}= $combination;
|
||||
push(@{$comb->{comb_opt}}, $combination);
|
||||
push(@combinations, $comb);
|
||||
}
|
||||
}
|
||||
my $comb_index = 1;
|
||||
# Copy original test cases
|
||||
foreach my $comb_set (@$combinations)
|
||||
{
|
||||
for (my $idx = $begin_index; $idx <= $end_index; $idx++)
|
||||
elsif (-f $combination_file )
|
||||
{
|
||||
# Read combinations file in my.cnf format
|
||||
mtr_verbose("Read combinations file");
|
||||
my $config= My::Config->new($combination_file);
|
||||
|
||||
foreach my $group ($config->groups()) {
|
||||
my $comb= {};
|
||||
$comb->{name}= $group->name();
|
||||
foreach my $option ( $group->options() ) {
|
||||
push(@{$comb->{comb_opt}}, $option->name()."=".$option->value());
|
||||
}
|
||||
push(@combinations, $comb);
|
||||
}
|
||||
}
|
||||
|
||||
if (@combinations)
|
||||
{
|
||||
print " - adding combinations\n";
|
||||
#print_testcases(@cases);
|
||||
|
||||
my @new_cases;
|
||||
foreach my $comb (@combinations)
|
||||
{
|
||||
my $test = $cases->[$idx];
|
||||
my $copied_test = {};
|
||||
foreach my $param (keys %{$test})
|
||||
{
|
||||
# Scalar. Copy as is.
|
||||
$copied_test->{$param} = $test->{$param};
|
||||
# Array. Copy reference instead itself
|
||||
if ($param =~ /(master_opt|slave_opt|slave_mi)/)
|
||||
{
|
||||
my $new_arr = [];
|
||||
@$new_arr = @{$orig_opts[$idx]{$param}};
|
||||
$copied_test->{$param} = $new_arr;
|
||||
}
|
||||
elsif ($param =~ /(comment|combinations)/)
|
||||
{
|
||||
$copied_test->{$param} = '';
|
||||
}
|
||||
}
|
||||
if ($is_copy)
|
||||
{
|
||||
push(@$cases, $copied_test);
|
||||
$test = $cases->[$#{@$cases}];
|
||||
}
|
||||
foreach my $comb_opt (split(/ /,$comb_set))
|
||||
{
|
||||
push(@{$test->{'master_opt'}},$comb_opt);
|
||||
push(@{$test->{'slave_opt'}},$comb_opt);
|
||||
# Enable rpl if added option is --binlog-format and test case supports that
|
||||
if ($comb_opt =~ /^--binlog-format=.+$/)
|
||||
{
|
||||
my @opt_pairs = split(/=/, $comb_opt);
|
||||
if ($test->{'binlog_format'} =~ /^$opt_pairs[1]$/ || $test->{'binlog_format'} eq '')
|
||||
{
|
||||
$test->{'skip'} = 0;
|
||||
$test->{'comment'} = '';
|
||||
}
|
||||
else
|
||||
{
|
||||
$test->{'skip'} = 1;
|
||||
$test->{'comment'} = "Requiring binlog format '$test->{'binlog_format'}'";;
|
||||
}
|
||||
}
|
||||
}
|
||||
$test->{'combination'} = $comb_set;
|
||||
}
|
||||
$is_copy = 1;
|
||||
$comb_index++;
|
||||
}
|
||||
foreach my $test (@cases)
|
||||
{
|
||||
#print $test->{name}, " ", $comb, "\n";
|
||||
my $new_test= {};
|
||||
|
||||
while (my ($key, $value) = each(%$test)) {
|
||||
if (ref $value eq "ARRAY") {
|
||||
push(@{$new_test->{$key}}, @$value);
|
||||
} else {
|
||||
$new_test->{$key}= $value;
|
||||
}
|
||||
}
|
||||
|
||||
# Append the combination options to master_opt and slave_opt
|
||||
push(@{$new_test->{master_opt}}, @{$comb->{comb_opt}});
|
||||
push(@{$new_test->{slave_opt}}, @{$comb->{comb_opt}});
|
||||
|
||||
# Add combination name shrt name
|
||||
$new_test->{combination}= $comb->{name};
|
||||
|
||||
# Add the new test to new test cases list
|
||||
push(@new_cases, $new_test);
|
||||
}
|
||||
}
|
||||
#print_testcases(@new_cases);
|
||||
@cases= @new_cases;
|
||||
#print_testcases(@cases);
|
||||
}
|
||||
}
|
||||
|
||||
return $cases;
|
||||
optimize_cases(\@cases);
|
||||
#print_testcases(@cases);
|
||||
|
||||
return @cases;
|
||||
}
|
||||
|
||||
|
||||
#
|
||||
# Loop through all test cases
|
||||
# - optimize which test to run by skipping unnecessary ones
|
||||
# - update settings if necessary
|
||||
#
|
||||
sub optimize_cases {
|
||||
my ($cases)= @_;
|
||||
|
||||
foreach my $tinfo ( @$cases )
|
||||
{
|
||||
# Skip processing if already marked as skipped
|
||||
next if $tinfo->{skip};
|
||||
|
||||
# Replication test needs an adjustment of binlog format
|
||||
if (mtr_match_prefix($tinfo->{'name'}, "rpl"))
|
||||
{
|
||||
|
||||
# =======================================================
|
||||
# Get binlog-format used by this test from master_opt
|
||||
# =======================================================
|
||||
my $test_binlog_format;
|
||||
foreach my $opt ( @{$tinfo->{master_opt}} ) {
|
||||
$test_binlog_format= $test_binlog_format ||
|
||||
mtr_match_prefix($opt, "--binlog-format=");
|
||||
}
|
||||
# print $tinfo->{name}." uses ".$test_binlog_format."\n";
|
||||
|
||||
# =======================================================
|
||||
# If a special binlog format was selected with
|
||||
# --mysqld=--binlog-format=x, skip all test with different
|
||||
# binlog-format
|
||||
# =======================================================
|
||||
if (defined $::used_binlog_format and
|
||||
$test_binlog_format and
|
||||
$::used_binlog_format ne $test_binlog_format)
|
||||
{
|
||||
$tinfo->{'skip'}= 1;
|
||||
$tinfo->{'comment'}= "Requires --binlog-format='$test_binlog_format'";
|
||||
next;
|
||||
}
|
||||
|
||||
# =======================================================
|
||||
# Check that testcase supports the designated binlog-format
|
||||
# =======================================================
|
||||
if ($test_binlog_format and defined $tinfo->{'sup_binlog_formats'} )
|
||||
{
|
||||
my $supported=
|
||||
grep { $_ eq $test_binlog_format } @{$tinfo->{'sup_binlog_formats'}};
|
||||
if ( !$supported )
|
||||
{
|
||||
$tinfo->{'skip'}= 1;
|
||||
$tinfo->{'comment'}=
|
||||
"Doesn't support --binlog-format='$test_binlog_format'";
|
||||
next;
|
||||
}
|
||||
}
|
||||
|
||||
# =======================================================
|
||||
# Use dynamic switching of binlog-format if mtr started
|
||||
# w/o --mysqld=--binlog-format=xxx and combinations.
|
||||
# =======================================================
|
||||
if (!defined $tinfo->{'combination'} and
|
||||
!defined $::used_binlog_format)
|
||||
{
|
||||
$test_binlog_format= $tinfo->{'sup_binlog_formats'}->[0];
|
||||
}
|
||||
|
||||
# Save binlog format for dynamic switching
|
||||
$tinfo->{binlog_format}= $test_binlog_format;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@ -522,6 +580,7 @@ sub collect_one_test_case($$$$$$$$$) {
|
|||
$tinfo->{'slave_opt'}= [];
|
||||
$tinfo->{'slave_mi'}= [];
|
||||
|
||||
|
||||
# Add suite opts
|
||||
foreach my $opt ( @$suite_opts )
|
||||
{
|
||||
|
@ -735,14 +794,6 @@ sub collect_one_test_case($$$$$$$$$) {
|
|||
return;
|
||||
}
|
||||
|
||||
if ( defined $tinfo->{'binlog_format'} and
|
||||
! ( $tinfo->{'binlog_format'} eq $::used_binlog_format ) )
|
||||
{
|
||||
$tinfo->{'skip'}= 1;
|
||||
$tinfo->{'comment'}= "Requiring binlog format '$tinfo->{'binlog_format'}'";
|
||||
return;
|
||||
}
|
||||
|
||||
if ( $tinfo->{'need_debug'} && ! $::debug_compiled_binaries )
|
||||
{
|
||||
$tinfo->{'skip'}= 1;
|
||||
|
@ -822,10 +873,17 @@ sub collect_one_test_case($$$$$$$$$) {
|
|||
our @tags=
|
||||
(
|
||||
["include/have_innodb.inc", "innodb_test", 1],
|
||||
["include/have_binlog_format_row.inc", "binlog_format", "row"],
|
||||
["include/have_binlog_format_row.inc", "sup_binlog_formats", ["row"]],
|
||||
["include/have_log_bin.inc", "need_binlog", 1],
|
||||
["include/have_binlog_format_statement.inc", "binlog_format", "statement"],
|
||||
["include/have_binlog_format_mixed.inc", "binlog_format", "mixed"],
|
||||
["include/have_binlog_format_statement.inc",
|
||||
"sup_binlog_formats", ["statement"]],
|
||||
["include/have_binlog_format_mixed.inc", "sup_binlog_formats", ["mixed"]],
|
||||
["include/have_binlog_format_mixed_or_row.inc",
|
||||
"sup_binlog_formats", ["mixed","row"]],
|
||||
["include/have_binlog_format_mixed_or_statement.inc",
|
||||
"sup_binlog_formats", ["mixed","statement"]],
|
||||
["include/have_binlog_format_row_or_statement.inc",
|
||||
"sup_binlog_formats", ["row","statement"]],
|
||||
["include/big_test.inc", "big_test", 1],
|
||||
["include/have_debug.inc", "need_debug", 1],
|
||||
["include/have_ndb.inc", "ndb_test", 1],
|
||||
|
@ -851,8 +909,8 @@ sub mtr_options_from_test_file($$) {
|
|||
{
|
||||
if ( index($line, $tag->[0]) >= 0 )
|
||||
{
|
||||
# Tag matched, assign value to "tinfo"
|
||||
$tinfo->{"$tag->[1]"}= $tag->[2];
|
||||
# Tag matched, assign value to "tinfo"
|
||||
$tinfo->{"$tag->[1]"}= $tag->[2];
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -873,8 +931,29 @@ sub mtr_options_from_test_file($$) {
|
|||
mtr_options_from_test_file($tinfo, $sourced_file);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
sub print_testcases {
|
||||
my (@cases)= @_;
|
||||
|
||||
print "=" x 60, "\n";
|
||||
foreach my $test (@cases){
|
||||
print "[", $test->{name}, "]", "\n";
|
||||
while ((my ($key, $value)) = each(%$test)) {
|
||||
print " ", $key, "=";
|
||||
if (ref $value eq "ARRAY") {
|
||||
print join(", ", @$value);
|
||||
} else {
|
||||
print $value;
|
||||
}
|
||||
print "\n";
|
||||
}
|
||||
print "\n";
|
||||
}
|
||||
print "=" x 60, "\n";
|
||||
}
|
||||
|
||||
|
||||
1;
|
||||
|
|
|
@ -280,4 +280,33 @@ sub mtr_cmp_opts ($$) {
|
|||
return 0; # They are the same
|
||||
}
|
||||
|
||||
#
|
||||
# Compare two arrays and put all unequal elements into a new one
|
||||
#
|
||||
sub mtr_diff_opts ($$) {
|
||||
my $l1= shift;
|
||||
my $l2= shift;
|
||||
my $f;
|
||||
my $l= [];
|
||||
foreach my $e1 (@$l1)
|
||||
{
|
||||
$f= undef;
|
||||
foreach my $e2 (@$l2)
|
||||
{
|
||||
$f= 1 unless ($e1 ne $e2);
|
||||
}
|
||||
push(@$l, $e1) unless (defined $f);
|
||||
}
|
||||
foreach my $e2 (@$l2)
|
||||
{
|
||||
$f= undef;
|
||||
foreach my $e1 (@$l1)
|
||||
{
|
||||
$f= 1 unless ($e1 ne $e2);
|
||||
}
|
||||
push(@$l, $e2) unless (defined $f);
|
||||
}
|
||||
return $l;
|
||||
}
|
||||
|
||||
1;
|
||||
|
|
|
@ -50,9 +50,13 @@ my $tot_real_time= 0;
|
|||
|
||||
sub mtr_report_test_name ($) {
|
||||
my $tinfo= shift;
|
||||
my $tname= $tinfo->{name};
|
||||
|
||||
_mtr_log("$tinfo->{name}");
|
||||
printf "%-30s ", $tinfo->{'name'};
|
||||
$tname.= " '$tinfo->{combination}'"
|
||||
if defined $tinfo->{combination};
|
||||
|
||||
_mtr_log($tname);
|
||||
printf "%-30s ", $tname;
|
||||
}
|
||||
|
||||
sub mtr_report_test_skipped ($) {
|
||||
|
|
|
@ -52,6 +52,9 @@
|
|||
# "perl -d:Trace mysql-test-run.pl"
|
||||
#
|
||||
|
||||
|
||||
use lib "lib/";
|
||||
|
||||
$Devel::Trace::TRACE= 0; # Don't trace boring init stuff
|
||||
|
||||
#require 5.6.1;
|
||||
|
@ -172,7 +175,8 @@ our $opt_bench= 0;
|
|||
our $opt_small_bench= 0;
|
||||
our $opt_big_test= 0;
|
||||
|
||||
our @opt_combination;
|
||||
our @opt_combinations;
|
||||
our $opt_skip_combination;
|
||||
|
||||
our @opt_extra_mysqld_opt;
|
||||
|
||||
|
@ -575,7 +579,8 @@ sub command_line_setup () {
|
|||
'skip-im' => \$opt_skip_im,
|
||||
'skip-test=s' => \$opt_skip_test,
|
||||
'big-test' => \$opt_big_test,
|
||||
'combination=s' => \@opt_combination,
|
||||
'combination=s' => \@opt_combinations,
|
||||
'skip-combination' => \$opt_skip_combination,
|
||||
|
||||
# Specify ports
|
||||
'master_port=i' => \$opt_master_myport,
|
||||
|
@ -850,20 +855,23 @@ sub command_line_setup () {
|
|||
# --------------------------------------------------------------------------
|
||||
# Find out type of logging that are being used
|
||||
# --------------------------------------------------------------------------
|
||||
# NOTE if the default binlog format is changed, this has to be changed
|
||||
$used_binlog_format= "statement";
|
||||
if (!$opt_extern && $mysql_version_id >= 50100 )
|
||||
{
|
||||
$used_binlog_format= "mixed"; # Default value for binlog format
|
||||
|
||||
foreach my $arg ( @opt_extra_mysqld_opt )
|
||||
{
|
||||
if ( $arg =~ /binlog[-_]format=(\S+)/ )
|
||||
{
|
||||
$used_binlog_format= $1;
|
||||
$used_binlog_format= $1;
|
||||
}
|
||||
}
|
||||
mtr_report("Using binlog format '$used_binlog_format'");
|
||||
if (defined $used_binlog_format)
|
||||
{
|
||||
mtr_report("Using binlog format '$used_binlog_format'");
|
||||
}
|
||||
else
|
||||
{
|
||||
mtr_report("Using dynamic switching of binlog format");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@ -981,6 +989,10 @@ sub command_line_setup () {
|
|||
mtr_error("Will not run in record mode without a specific test case");
|
||||
}
|
||||
|
||||
if ( $opt_record )
|
||||
{
|
||||
$opt_skip_combination = 1;
|
||||
}
|
||||
|
||||
# --------------------------------------------------------------------------
|
||||
# ps protcol flag
|
||||
|
@ -3379,6 +3391,7 @@ sub run_testcase_check_skip_test($)
|
|||
sub do_before_run_mysqltest($)
|
||||
{
|
||||
my $tinfo= shift;
|
||||
my $args;
|
||||
|
||||
# Remove old files produced by mysqltest
|
||||
my $base_file= mtr_match_extension($tinfo->{'result_file'},
|
||||
|
@ -3399,6 +3412,28 @@ sub do_before_run_mysqltest($)
|
|||
# if script decided to run mysqltest cluster _is_ installed ok
|
||||
$ENV{'NDB_STATUS_OK'} = "YES";
|
||||
}
|
||||
if (defined $tinfo->{binlog_format} and $mysql_version_id > 50100 )
|
||||
{
|
||||
# Dynamically switch binlog format of
|
||||
# master, slave is always restarted
|
||||
foreach my $server ( @$master )
|
||||
{
|
||||
next unless ($server->{'pid'});
|
||||
|
||||
mtr_init_args(\$args);
|
||||
mtr_add_arg($args, "--no-defaults");
|
||||
mtr_add_arg($args, "--user=root");
|
||||
mtr_add_arg($args, "--port=$server->{'port'}");
|
||||
mtr_add_arg($args, "--socket=$server->{'path_sock'}");
|
||||
|
||||
my $sql= "include/set_binlog_format_".$tinfo->{binlog_format}.".sql";
|
||||
mtr_verbose("Setting binlog format:", $tinfo->{binlog_format});
|
||||
if (mtr_run($exe_mysql, $args, $sql, "", "", "") != 0)
|
||||
{
|
||||
mtr_error("Failed to switch binlog format");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -3839,6 +3874,14 @@ sub mysqld_arguments ($$$$) {
|
|||
mtr_add_arg($args, "%s--user=root");
|
||||
}
|
||||
|
||||
# When mysqld is run by a root user(euid is 0), it will fail
|
||||
# to start unless we specify what user to run as, see BUG#30630
|
||||
my $euid= $>;
|
||||
if (!$glob_win32 and $euid == 0 and
|
||||
(grep(/^--user/, @$extra_opt, @opt_extra_mysqld_opt)) == 0) {
|
||||
mtr_add_arg($args, "%s--user=root", $prefix);
|
||||
}
|
||||
|
||||
if ( $opt_valgrind_mysqld )
|
||||
{
|
||||
mtr_add_arg($args, "%s--skip-safemalloc", $prefix);
|
||||
|
@ -3943,7 +3986,7 @@ sub mysqld_arguments ($$$$) {
|
|||
my $slave_load_path= "../tmp";
|
||||
mtr_add_arg($args, "%s--slave-load-tmpdir=%s", $prefix,
|
||||
$slave_load_path);
|
||||
mtr_add_arg($args, "%s--set-variable=slave_net_timeout=10", $prefix);
|
||||
mtr_add_arg($args, "%s--set-variable=slave_net_timeout=120", $prefix);
|
||||
|
||||
if ( @$slave_master_info )
|
||||
{
|
||||
|
@ -4296,10 +4339,19 @@ sub run_testcase_need_master_restart($)
|
|||
elsif (! mtr_same_opts($master->[0]->{'start_opts'},
|
||||
$tinfo->{'master_opt'}) )
|
||||
{
|
||||
$do_restart= 1;
|
||||
mtr_verbose("Restart master: running with different options '" .
|
||||
join(" ", @{$tinfo->{'master_opt'}}) . "' != '" .
|
||||
join(" ", @{$master->[0]->{'start_opts'}}) . "'" );
|
||||
# Chech that diff is binlog format only
|
||||
my $diff_opts= mtr_diff_opts($master->[0]->{'start_opts'},$tinfo->{'master_opt'});
|
||||
if (scalar(@$diff_opts) eq 2)
|
||||
{
|
||||
$do_restart= 1 unless ($diff_opts->[0] =~/^--binlog-format=/ and $diff_opts->[1] =~/^--binlog-format=/);
|
||||
}
|
||||
else
|
||||
{
|
||||
$do_restart= 1;
|
||||
mtr_verbose("Restart master: running with different options '" .
|
||||
join(" ", @{$tinfo->{'master_opt'}}) . "' != '" .
|
||||
join(" ", @{$master->[0]->{'start_opts'}}) . "'" );
|
||||
}
|
||||
}
|
||||
elsif( ! $master->[0]->{'pid'} )
|
||||
{
|
||||
|
@ -5222,8 +5274,9 @@ Options to control what test suites or cases to run
|
|||
skip-im Don't start IM, and skip the IM test cases
|
||||
big-test Set the environment variable BIG_TEST, which can be
|
||||
checked from test cases.
|
||||
combination="ARG1 .. ARG2" Specify a set of "mysqld" arguments for one
|
||||
combination.
|
||||
combination="ARG1 .. ARG2" Specify a set of "mysqld" arguments for one
|
||||
combination.
|
||||
skip-combination Skip any combination options and combinations files
|
||||
|
||||
Options that specify ports
|
||||
|
||||
|
|
35
mysql-test/r/bdb_notembedded.result
Normal file
35
mysql-test/r/bdb_notembedded.result
Normal file
|
@ -0,0 +1,35 @@
|
|||
set autocommit=1;
|
||||
reset master;
|
||||
create table bug16206 (a int);
|
||||
insert into bug16206 values(1);
|
||||
start transaction;
|
||||
insert into bug16206 values(2);
|
||||
commit;
|
||||
show binlog events;
|
||||
Log_name Pos Event_type Server_id End_log_pos Info
|
||||
f n Format_desc 1 n Server ver: VERSION, Binlog ver: 4
|
||||
f n Query 1 n use `test`; create table bug16206 (a int)
|
||||
f n Query 1 n use `test`; insert into bug16206 values(1)
|
||||
f n Query 1 n use `test`; insert into bug16206 values(2)
|
||||
drop table bug16206;
|
||||
reset master;
|
||||
create table bug16206 (a int) engine= bdb;
|
||||
insert into bug16206 values(0);
|
||||
insert into bug16206 values(1);
|
||||
start transaction;
|
||||
insert into bug16206 values(2);
|
||||
commit;
|
||||
insert into bug16206 values(3);
|
||||
show binlog events;
|
||||
Log_name Pos Event_type Server_id End_log_pos Info
|
||||
f n Format_desc 1 n Server ver: VERSION, Binlog ver: 4
|
||||
f n Query 1 n use `test`; create table bug16206 (a int) engine= bdb
|
||||
f n Query 1 n use `test`; insert into bug16206 values(0)
|
||||
f n Query 1 n use `test`; insert into bug16206 values(1)
|
||||
f n Query 1 n use `test`; BEGIN
|
||||
f n Query 1 n use `test`; insert into bug16206 values(2)
|
||||
f n Query 1 n use `test`; COMMIT
|
||||
f n Query 1 n use `test`; insert into bug16206 values(3)
|
||||
drop table bug16206;
|
||||
set autocommit=0;
|
||||
End of 5.0 tests
|
13
mysql-test/r/binlog_start_comment.result
Normal file
13
mysql-test/r/binlog_start_comment.result
Normal file
|
@ -0,0 +1,13 @@
|
|||
drop table if exists t1,t2;
|
||||
create table t1 (word varchar(20)) -- create table t1;
|
||||
create table t2 (word varchar(20)) -- create table t2;
|
||||
load data infile '../std_data_ln/words.dat' into table t1 -- load data to t1;
|
||||
insert into t2 values ("Ada");
|
||||
flush logs;
|
||||
select * from t2;
|
||||
word
|
||||
Ada
|
||||
flush logs;
|
||||
select * from t2;
|
||||
word
|
||||
Ada
|
|
@ -627,7 +627,7 @@ a b
|
|||
4 4
|
||||
show master status /* there must be the UPDATE query event */;
|
||||
File Position Binlog_Do_DB Binlog_Ignore_DB
|
||||
master-bin.000001 268
|
||||
master-bin.000001 336
|
||||
delete from t1;
|
||||
delete from t2;
|
||||
insert into t1 values (1,2),(3,4),(4,4);
|
||||
|
@ -637,7 +637,7 @@ UPDATE t2,t1 SET t2.a=t2.b where t2.a=t1.a;
|
|||
ERROR 23000: Duplicate entry '4' for key 'PRIMARY'
|
||||
show master status /* there must be the UPDATE query event */;
|
||||
File Position Binlog_Do_DB Binlog_Ignore_DB
|
||||
master-bin.000001 283
|
||||
master-bin.000001 351
|
||||
drop table t1, t2;
|
||||
set @@session.binlog_format= @sav_binlog_format;
|
||||
drop table if exists t1, t2, t3;
|
||||
|
|
|
@ -23,24 +23,33 @@ SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.uniq
|
|||
SET @@session.sql_mode=0/*!*/;
|
||||
/*!\C latin1 *//*!*/;
|
||||
SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/;
|
||||
drop table if exists t1,t2,t3,t4,t5,t03,t04/*!*/;
|
||||
drop table if exists t1,t2,t3,t4,t5,t03,t04
|
||||
/*!*/;
|
||||
SET TIMESTAMP=1000000000/*!*/;
|
||||
create table t1 (word varchar(20))/*!*/;
|
||||
create table t1 (word varchar(20))
|
||||
/*!*/;
|
||||
SET TIMESTAMP=1000000000/*!*/;
|
||||
create table t2 (id int auto_increment not null primary key)/*!*/;
|
||||
create table t2 (id int auto_increment not null primary key)
|
||||
/*!*/;
|
||||
SET TIMESTAMP=1000000000/*!*/;
|
||||
insert into t1 values ("abirvalg")/*!*/;
|
||||
insert into t1 values ("abirvalg")
|
||||
/*!*/;
|
||||
SET INSERT_ID=1/*!*/;
|
||||
SET TIMESTAMP=1000000000/*!*/;
|
||||
insert into t2 values ()/*!*/;
|
||||
insert into t2 values ()
|
||||
/*!*/;
|
||||
SET TIMESTAMP=1000000000/*!*/;
|
||||
load data LOCAL INFILE 'MYSQLTEST_VARDIR/tmp/SQL_LOAD_MB-1-0' INTO table t1/*!*/;
|
||||
load data LOCAL INFILE 'MYSQLTEST_VARDIR/tmp/SQL_LOAD_MB-1-0' INTO table t1
|
||||
/*!*/;
|
||||
SET TIMESTAMP=1000000000/*!*/;
|
||||
load data LOCAL INFILE 'MYSQLTEST_VARDIR/tmp/SQL_LOAD_MB-2-0' INTO table t1/*!*/;
|
||||
load data LOCAL INFILE 'MYSQLTEST_VARDIR/tmp/SQL_LOAD_MB-2-0' INTO table t1
|
||||
/*!*/;
|
||||
SET TIMESTAMP=1000000000/*!*/;
|
||||
load data LOCAL INFILE 'MYSQLTEST_VARDIR/tmp/SQL_LOAD_MB-3-0' INTO table t1/*!*/;
|
||||
load data LOCAL INFILE 'MYSQLTEST_VARDIR/tmp/SQL_LOAD_MB-3-0' INTO table t1
|
||||
/*!*/;
|
||||
SET TIMESTAMP=1000000000/*!*/;
|
||||
load data LOCAL INFILE 'MYSQLTEST_VARDIR/tmp/SQL_LOAD_MB-4-0' INTO table t1/*!*/;
|
||||
load data LOCAL INFILE 'MYSQLTEST_VARDIR/tmp/SQL_LOAD_MB-4-0' INTO table t1
|
||||
/*!*/;
|
||||
DELIMITER ;
|
||||
# End of log file
|
||||
ROLLBACK /* added by mysqlbinlog */;
|
||||
|
@ -56,7 +65,8 @@ SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.uniq
|
|||
SET @@session.sql_mode=0/*!*/;
|
||||
/*!\C latin1 *//*!*/;
|
||||
SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/;
|
||||
insert into t1 values ("Alas")/*!*/;
|
||||
insert into t1 values ("Alas")
|
||||
/*!*/;
|
||||
DELIMITER ;
|
||||
# End of log file
|
||||
ROLLBACK /* added by mysqlbinlog */;
|
||||
|
@ -83,7 +93,8 @@ SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.uniq
|
|||
SET @@session.sql_mode=0/*!*/;
|
||||
/*!\C latin1 *//*!*/;
|
||||
SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/;
|
||||
insert into t1 values ("Alas")/*!*/;
|
||||
insert into t1 values ("Alas")
|
||||
/*!*/;
|
||||
DELIMITER ;
|
||||
# End of log file
|
||||
ROLLBACK /* added by mysqlbinlog */;
|
||||
|
@ -100,24 +111,33 @@ SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.uniq
|
|||
SET @@session.sql_mode=0/*!*/;
|
||||
/*!\C latin1 *//*!*/;
|
||||
SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/;
|
||||
drop table if exists t1,t2,t3,t4,t5,t03,t04/*!*/;
|
||||
drop table if exists t1,t2,t3,t4,t5,t03,t04
|
||||
/*!*/;
|
||||
SET TIMESTAMP=1000000000/*!*/;
|
||||
create table t1 (word varchar(20))/*!*/;
|
||||
create table t1 (word varchar(20))
|
||||
/*!*/;
|
||||
SET TIMESTAMP=1000000000/*!*/;
|
||||
create table t2 (id int auto_increment not null primary key)/*!*/;
|
||||
create table t2 (id int auto_increment not null primary key)
|
||||
/*!*/;
|
||||
SET TIMESTAMP=1000000000/*!*/;
|
||||
insert into t1 values ("abirvalg")/*!*/;
|
||||
insert into t1 values ("abirvalg")
|
||||
/*!*/;
|
||||
SET INSERT_ID=1/*!*/;
|
||||
SET TIMESTAMP=1000000000/*!*/;
|
||||
insert into t2 values ()/*!*/;
|
||||
insert into t2 values ()
|
||||
/*!*/;
|
||||
SET TIMESTAMP=1000000000/*!*/;
|
||||
load data LOCAL INFILE 'MYSQLTEST_VARDIR/tmp/SQL_LOAD_MB-1-2' INTO table t1/*!*/;
|
||||
load data LOCAL INFILE 'MYSQLTEST_VARDIR/tmp/SQL_LOAD_MB-1-2' INTO table t1
|
||||
/*!*/;
|
||||
SET TIMESTAMP=1000000000/*!*/;
|
||||
load data LOCAL INFILE 'MYSQLTEST_VARDIR/tmp/SQL_LOAD_MB-2-2' INTO table t1/*!*/;
|
||||
load data LOCAL INFILE 'MYSQLTEST_VARDIR/tmp/SQL_LOAD_MB-2-2' INTO table t1
|
||||
/*!*/;
|
||||
SET TIMESTAMP=1000000000/*!*/;
|
||||
load data LOCAL INFILE 'MYSQLTEST_VARDIR/tmp/SQL_LOAD_MB-3-2' INTO table t1/*!*/;
|
||||
load data LOCAL INFILE 'MYSQLTEST_VARDIR/tmp/SQL_LOAD_MB-3-2' INTO table t1
|
||||
/*!*/;
|
||||
SET TIMESTAMP=1000000000/*!*/;
|
||||
load data LOCAL INFILE 'MYSQLTEST_VARDIR/tmp/SQL_LOAD_MB-4-2' INTO table t1/*!*/;
|
||||
load data LOCAL INFILE 'MYSQLTEST_VARDIR/tmp/SQL_LOAD_MB-4-2' INTO table t1
|
||||
/*!*/;
|
||||
DELIMITER ;
|
||||
# End of log file
|
||||
ROLLBACK /* added by mysqlbinlog */;
|
||||
|
@ -133,7 +153,8 @@ SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.uniq
|
|||
SET @@session.sql_mode=0/*!*/;
|
||||
/*!\C latin1 *//*!*/;
|
||||
SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/;
|
||||
insert into t1 values ("Alas")/*!*/;
|
||||
insert into t1 values ("Alas")
|
||||
/*!*/;
|
||||
DELIMITER ;
|
||||
# End of log file
|
||||
ROLLBACK /* added by mysqlbinlog */;
|
||||
|
@ -160,7 +181,8 @@ SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.uniq
|
|||
SET @@session.sql_mode=0/*!*/;
|
||||
/*!\C latin1 *//*!*/;
|
||||
SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/;
|
||||
insert into t1 values ("Alas")/*!*/;
|
||||
insert into t1 values ("Alas")
|
||||
/*!*/;
|
||||
DELIMITER ;
|
||||
# End of log file
|
||||
ROLLBACK /* added by mysqlbinlog */;
|
||||
|
@ -173,9 +195,11 @@ DELIMITER /*!*/;
|
|||
ROLLBACK/*!*/;
|
||||
use test/*!*/;
|
||||
SET TIMESTAMP=1108844556/*!*/;
|
||||
BEGIN/*!*/;
|
||||
BEGIN
|
||||
/*!*/;
|
||||
SET TIMESTAMP=1108844555/*!*/;
|
||||
insert t1 values (1)/*!*/;
|
||||
insert t1 values (1)
|
||||
/*!*/;
|
||||
DELIMITER ;
|
||||
# End of log file
|
||||
ROLLBACK /* added by mysqlbinlog */;
|
||||
|
@ -185,9 +209,11 @@ ROLLBACK /* added by mysqlbinlog */;
|
|||
DELIMITER /*!*/;
|
||||
use test/*!*/;
|
||||
SET TIMESTAMP=1108844556/*!*/;
|
||||
BEGIN/*!*/;
|
||||
BEGIN
|
||||
/*!*/;
|
||||
SET TIMESTAMP=1108844555/*!*/;
|
||||
insert t1 values (1)/*!*/;
|
||||
insert t1 values (1)
|
||||
/*!*/;
|
||||
DELIMITER ;
|
||||
# End of log file
|
||||
ROLLBACK /* added by mysqlbinlog */;
|
||||
|
@ -246,7 +272,8 @@ SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.
|
|||
CREATE DEFINER=`root`@`localhost` procedure p1()
|
||||
begin
|
||||
select 1;
|
||||
end/*!*/;
|
||||
end
|
||||
/*!*/;
|
||||
DELIMITER ;
|
||||
# End of log file
|
||||
ROLLBACK /* added by mysqlbinlog */;
|
||||
|
@ -288,27 +315,36 @@ SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.uniq
|
|||
SET @@session.sql_mode=0/*!*/;
|
||||
/*!\C latin1 *//*!*/;
|
||||
SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/;
|
||||
create table t1 (a varchar(64) character set utf8)/*!*/;
|
||||
create table t1 (a varchar(64) character set utf8)
|
||||
/*!*/;
|
||||
SET TIMESTAMP=1000000000/*!*/;
|
||||
load data LOCAL INFILE 'MYSQLTEST_VARDIR/tmp/SQL_LOAD_MB-6-0' INTO table t1/*!*/;
|
||||
load data LOCAL INFILE 'MYSQLTEST_VARDIR/tmp/SQL_LOAD_MB-6-0' INTO table t1
|
||||
/*!*/;
|
||||
SET TIMESTAMP=1000000000/*!*/;
|
||||
SET @@session.collation_database=7/*!*/;
|
||||
load data LOCAL INFILE 'MYSQLTEST_VARDIR/tmp/SQL_LOAD_MB-7-0' INTO table t1/*!*/;
|
||||
load data LOCAL INFILE 'MYSQLTEST_VARDIR/tmp/SQL_LOAD_MB-7-0' INTO table t1
|
||||
/*!*/;
|
||||
SET TIMESTAMP=1000000000/*!*/;
|
||||
SET @@session.collation_database=DEFAULT/*!*/;
|
||||
load data LOCAL INFILE 'MYSQLTEST_VARDIR/tmp/SQL_LOAD_MB-8-0' INTO table t1/*!*/;
|
||||
load data LOCAL INFILE 'MYSQLTEST_VARDIR/tmp/SQL_LOAD_MB-8-0' INTO table t1
|
||||
/*!*/;
|
||||
SET TIMESTAMP=1000000000/*!*/;
|
||||
load data LOCAL INFILE 'MYSQLTEST_VARDIR/tmp/SQL_LOAD_MB-9-0' INTO table t1/*!*/;
|
||||
load data LOCAL INFILE 'MYSQLTEST_VARDIR/tmp/SQL_LOAD_MB-9-0' INTO table t1
|
||||
/*!*/;
|
||||
SET TIMESTAMP=1000000000/*!*/;
|
||||
SET @@session.collation_database=7/*!*/;
|
||||
load data LOCAL INFILE 'MYSQLTEST_VARDIR/tmp/SQL_LOAD_MB-a-0' INTO table t1/*!*/;
|
||||
load data LOCAL INFILE 'MYSQLTEST_VARDIR/tmp/SQL_LOAD_MB-a-0' INTO table t1
|
||||
/*!*/;
|
||||
SET TIMESTAMP=1000000000/*!*/;
|
||||
SET @@session.collation_database=DEFAULT/*!*/;
|
||||
load data LOCAL INFILE 'MYSQLTEST_VARDIR/tmp/SQL_LOAD_MB-b-0' INTO table t1/*!*/;
|
||||
load data LOCAL INFILE 'MYSQLTEST_VARDIR/tmp/SQL_LOAD_MB-b-0' INTO table t1
|
||||
/*!*/;
|
||||
SET TIMESTAMP=1000000000/*!*/;
|
||||
load data LOCAL INFILE 'MYSQLTEST_VARDIR/tmp/SQL_LOAD_MB-c-0' INTO table t1 character set koi8r/*!*/;
|
||||
load data LOCAL INFILE 'MYSQLTEST_VARDIR/tmp/SQL_LOAD_MB-c-0' INTO table t1 character set koi8r
|
||||
/*!*/;
|
||||
SET TIMESTAMP=1000000000/*!*/;
|
||||
drop table t1/*!*/;
|
||||
drop table t1
|
||||
/*!*/;
|
||||
DELIMITER ;
|
||||
# End of log file
|
||||
ROLLBACK /* added by mysqlbinlog */;
|
||||
|
@ -352,4 +388,29 @@ a b
|
|||
1 root@localhost
|
||||
DROP DATABASE mysqltest1;
|
||||
DROP USER untrusted@localhost;
|
||||
BUG#32580: mysqlbinlog cannot read binlog event with user variables
|
||||
USE test;
|
||||
SET BINLOG_FORMAT = STATEMENT;
|
||||
FLUSH LOGS;
|
||||
CREATE TABLE t1 (a_real FLOAT, an_int INT, a_decimal DECIMAL(5,2), a_string CHAR(32));
|
||||
SET @a_real = rand(20) * 1000;
|
||||
SET @an_int = 1000;
|
||||
SET @a_decimal = CAST(rand(19) * 999 AS DECIMAL(5,2));
|
||||
SET @a_string = 'Just a test';
|
||||
INSERT INTO t1 VALUES (@a_real, @an_int, @a_decimal, @a_string);
|
||||
FLUSH LOGS;
|
||||
SELECT * FROM t1;
|
||||
a_real 158.883
|
||||
an_int 1000
|
||||
a_decimal 907.79
|
||||
a_string Just a test
|
||||
DROP TABLE t1;
|
||||
>> mysqlbinlog var/log/master-bin.000019 > var/tmp/bug32580.sql
|
||||
>> mysql test < var/tmp/bug32580.sql
|
||||
SELECT * FROM t1;
|
||||
a_real 158.883
|
||||
an_int 1000
|
||||
a_decimal 907.79
|
||||
a_string Just a test
|
||||
DROP TABLE t1;
|
||||
End of 5.1 tests
|
||||
|
|
|
@ -29,42 +29,48 @@ SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.uniq
|
|||
SET @@session.sql_mode=0/*!*/;
|
||||
/*!\C latin1 *//*!*/;
|
||||
SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/;
|
||||
create table t1 (a int auto_increment not null primary key, b char(3))/*!*/;
|
||||
create table t1 (a int auto_increment not null primary key, b char(3))
|
||||
/*!*/;
|
||||
# at {pos}
|
||||
#{yymmdd} {HH:MM:SS} server id 1 end_log_pos {pos} Intvar
|
||||
SET INSERT_ID=1/*!*/;
|
||||
# at {pos}
|
||||
#{yymmdd} {HH:MM:SS} server id 1 end_log_pos {pos} Query thread_id={integer} exec_time={integer} error_code=0
|
||||
SET TIMESTAMP=1579609942/*!*/;
|
||||
insert into t1 values(null, "a")/*!*/;
|
||||
insert into t1 values(null, "a")
|
||||
/*!*/;
|
||||
# at {pos}
|
||||
#{yymmdd} {HH:MM:SS} server id 1 end_log_pos {pos} Intvar
|
||||
SET INSERT_ID=2/*!*/;
|
||||
# at {pos}
|
||||
#{yymmdd} {HH:MM:SS} server id 1 end_log_pos {pos} Query thread_id={integer} exec_time={integer} error_code=0
|
||||
SET TIMESTAMP=1579609942/*!*/;
|
||||
insert into t1 values(null, "b")/*!*/;
|
||||
insert into t1 values(null, "b")
|
||||
/*!*/;
|
||||
# at {pos}
|
||||
#{yymmdd} {HH:MM:SS} server id 1 end_log_pos {pos} Intvar
|
||||
SET INSERT_ID=3/*!*/;
|
||||
# at {pos}
|
||||
#{yymmdd} {HH:MM:SS} server id 1 end_log_pos {pos} Query thread_id={integer} exec_time={integer} error_code=0
|
||||
SET TIMESTAMP=1579609944/*!*/;
|
||||
insert into t1 values(null, "c")/*!*/;
|
||||
insert into t1 values(null, "c")
|
||||
/*!*/;
|
||||
# at {pos}
|
||||
#{yymmdd} {HH:MM:SS} server id 1 end_log_pos {pos} Intvar
|
||||
SET INSERT_ID=4/*!*/;
|
||||
# at {pos}
|
||||
#{yymmdd} {HH:MM:SS} server id 1 end_log_pos {pos} Query thread_id={integer} exec_time={integer} error_code=0
|
||||
SET TIMESTAMP=1579609946/*!*/;
|
||||
insert into t1 values(null, "d")/*!*/;
|
||||
insert into t1 values(null, "d")
|
||||
/*!*/;
|
||||
# at {pos}
|
||||
#{yymmdd} {HH:MM:SS} server id 1 end_log_pos {pos} Intvar
|
||||
SET INSERT_ID=5/*!*/;
|
||||
# at {pos}
|
||||
#{yymmdd} {HH:MM:SS} server id 1 end_log_pos {pos} Query thread_id={integer} exec_time={integer} error_code=0
|
||||
SET TIMESTAMP=1579609946/*!*/;
|
||||
insert into t1 values(null, "e")/*!*/;
|
||||
insert into t1 values(null, "e")
|
||||
/*!*/;
|
||||
# at {pos}
|
||||
#{yymmdd} {HH:MM:SS} server id 1 end_log_pos {pos} Rotate to master-bin.000002 pos: {pos}
|
||||
DELIMITER ;
|
||||
|
@ -84,19 +90,24 @@ SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.uniq
|
|||
SET @@session.sql_mode=0/*!*/;
|
||||
/*!\C latin1 *//*!*/;
|
||||
SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/;
|
||||
insert into t1 values(null, "a")/*!*/;
|
||||
insert into t1 values(null, "a")
|
||||
/*!*/;
|
||||
SET INSERT_ID=2/*!*/;
|
||||
SET TIMESTAMP=1579609942/*!*/;
|
||||
insert into t1 values(null, "b")/*!*/;
|
||||
insert into t1 values(null, "b")
|
||||
/*!*/;
|
||||
SET INSERT_ID=3/*!*/;
|
||||
SET TIMESTAMP=1579609944/*!*/;
|
||||
insert into t1 values(null, "c")/*!*/;
|
||||
insert into t1 values(null, "c")
|
||||
/*!*/;
|
||||
SET INSERT_ID=4/*!*/;
|
||||
SET TIMESTAMP=1579609946/*!*/;
|
||||
insert into t1 values(null, "d")/*!*/;
|
||||
insert into t1 values(null, "d")
|
||||
/*!*/;
|
||||
SET INSERT_ID=5/*!*/;
|
||||
SET TIMESTAMP=1579609946/*!*/;
|
||||
insert into t1 values(null, "e")/*!*/;
|
||||
insert into t1 values(null, "e")
|
||||
/*!*/;
|
||||
DELIMITER ;
|
||||
# End of log file
|
||||
ROLLBACK /* added by mysqlbinlog */;
|
||||
|
@ -106,6 +117,7 @@ ROLLBACK /* added by mysqlbinlog */;
|
|||
/*!40019 SET @@session.max_insert_delayed_threads=0*/;
|
||||
/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;
|
||||
DELIMITER /*!*/;
|
||||
ROLLBACK/*!*/;
|
||||
SET INSERT_ID=4/*!*/;
|
||||
use test/*!*/;
|
||||
SET TIMESTAMP=1579609946/*!*/;
|
||||
|
@ -113,10 +125,12 @@ SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.uniq
|
|||
SET @@session.sql_mode=0/*!*/;
|
||||
/*!\C latin1 *//*!*/;
|
||||
SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/;
|
||||
insert into t1 values(null, "d")/*!*/;
|
||||
insert into t1 values(null, "d")
|
||||
/*!*/;
|
||||
SET INSERT_ID=5/*!*/;
|
||||
SET TIMESTAMP=1579609946/*!*/;
|
||||
insert into t1 values(null, "e")/*!*/;
|
||||
insert into t1 values(null, "e")
|
||||
/*!*/;
|
||||
DELIMITER ;
|
||||
# End of log file
|
||||
ROLLBACK /* added by mysqlbinlog */;
|
||||
|
@ -133,16 +147,20 @@ SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.uniq
|
|||
SET @@session.sql_mode=0/*!*/;
|
||||
/*!\C latin1 *//*!*/;
|
||||
SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/;
|
||||
create table t1 (a int auto_increment not null primary key, b char(3))/*!*/;
|
||||
create table t1 (a int auto_increment not null primary key, b char(3))
|
||||
/*!*/;
|
||||
SET INSERT_ID=1/*!*/;
|
||||
SET TIMESTAMP=1579609942/*!*/;
|
||||
insert into t1 values(null, "a")/*!*/;
|
||||
insert into t1 values(null, "a")
|
||||
/*!*/;
|
||||
SET INSERT_ID=2/*!*/;
|
||||
SET TIMESTAMP=1579609942/*!*/;
|
||||
insert into t1 values(null, "b")/*!*/;
|
||||
insert into t1 values(null, "b")
|
||||
/*!*/;
|
||||
SET INSERT_ID=3/*!*/;
|
||||
SET TIMESTAMP=1579609944/*!*/;
|
||||
insert into t1 values(null, "c")/*!*/;
|
||||
insert into t1 values(null, "c")
|
||||
/*!*/;
|
||||
DELIMITER ;
|
||||
# End of log file
|
||||
ROLLBACK /* added by mysqlbinlog */;
|
||||
|
@ -152,6 +170,7 @@ ROLLBACK /* added by mysqlbinlog */;
|
|||
/*!40019 SET @@session.max_insert_delayed_threads=0*/;
|
||||
/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;
|
||||
DELIMITER /*!*/;
|
||||
ROLLBACK/*!*/;
|
||||
SET INSERT_ID=4/*!*/;
|
||||
use test/*!*/;
|
||||
SET TIMESTAMP=1579609946/*!*/;
|
||||
|
@ -159,7 +178,8 @@ SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.uniq
|
|||
SET @@session.sql_mode=0/*!*/;
|
||||
/*!\C latin1 *//*!*/;
|
||||
SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/;
|
||||
insert into t1 values(null, "d")/*!*/;
|
||||
insert into t1 values(null, "d")
|
||||
/*!*/;
|
||||
DELIMITER ;
|
||||
# End of log file
|
||||
ROLLBACK /* added by mysqlbinlog */;
|
||||
|
@ -177,13 +197,16 @@ SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.uniq
|
|||
SET @@session.sql_mode=0/*!*/;
|
||||
/*!\C latin1 *//*!*/;
|
||||
SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/;
|
||||
insert into t1 values(null, "c")/*!*/;
|
||||
insert into t1 values(null, "c")
|
||||
/*!*/;
|
||||
SET INSERT_ID=4/*!*/;
|
||||
SET TIMESTAMP=1579609946/*!*/;
|
||||
insert into t1 values(null, "d")/*!*/;
|
||||
insert into t1 values(null, "d")
|
||||
/*!*/;
|
||||
SET INSERT_ID=5/*!*/;
|
||||
SET TIMESTAMP=1579609946/*!*/;
|
||||
insert into t1 values(null, "e")/*!*/;
|
||||
insert into t1 values(null, "e")
|
||||
/*!*/;
|
||||
DELIMITER ;
|
||||
# End of log file
|
||||
ROLLBACK /* added by mysqlbinlog */;
|
||||
|
@ -200,13 +223,16 @@ SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.uniq
|
|||
SET @@session.sql_mode=0/*!*/;
|
||||
/*!\C latin1 *//*!*/;
|
||||
SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/;
|
||||
create table t1 (a int auto_increment not null primary key, b char(3))/*!*/;
|
||||
create table t1 (a int auto_increment not null primary key, b char(3))
|
||||
/*!*/;
|
||||
SET INSERT_ID=1/*!*/;
|
||||
SET TIMESTAMP=1579609942/*!*/;
|
||||
insert into t1 values(null, "a")/*!*/;
|
||||
insert into t1 values(null, "a")
|
||||
/*!*/;
|
||||
SET INSERT_ID=2/*!*/;
|
||||
SET TIMESTAMP=1579609942/*!*/;
|
||||
insert into t1 values(null, "b")/*!*/;
|
||||
insert into t1 values(null, "b")
|
||||
/*!*/;
|
||||
DELIMITER ;
|
||||
# End of log file
|
||||
ROLLBACK /* added by mysqlbinlog */;
|
||||
|
@ -224,22 +250,28 @@ SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.uniq
|
|||
SET @@session.sql_mode=0/*!*/;
|
||||
/*!\C latin1 *//*!*/;
|
||||
SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/;
|
||||
create table t1 (a int auto_increment not null primary key, b char(3))/*!*/;
|
||||
create table t1 (a int auto_increment not null primary key, b char(3))
|
||||
/*!*/;
|
||||
SET INSERT_ID=1/*!*/;
|
||||
SET TIMESTAMP=1579609942/*!*/;
|
||||
insert into t1 values(null, "a")/*!*/;
|
||||
insert into t1 values(null, "a")
|
||||
/*!*/;
|
||||
SET INSERT_ID=2/*!*/;
|
||||
SET TIMESTAMP=1579609942/*!*/;
|
||||
insert into t1 values(null, "b")/*!*/;
|
||||
insert into t1 values(null, "b")
|
||||
/*!*/;
|
||||
SET INSERT_ID=3/*!*/;
|
||||
SET TIMESTAMP=1579609944/*!*/;
|
||||
insert into t1 values(null, "c")/*!*/;
|
||||
insert into t1 values(null, "c")
|
||||
/*!*/;
|
||||
SET INSERT_ID=4/*!*/;
|
||||
SET TIMESTAMP=1579609946/*!*/;
|
||||
insert into t1 values(null, "d")/*!*/;
|
||||
insert into t1 values(null, "d")
|
||||
/*!*/;
|
||||
SET INSERT_ID=5/*!*/;
|
||||
SET TIMESTAMP=1579609946/*!*/;
|
||||
insert into t1 values(null, "e")/*!*/;
|
||||
insert into t1 values(null, "e")
|
||||
/*!*/;
|
||||
DELIMITER ;
|
||||
DELIMITER /*!*/;
|
||||
SET INSERT_ID=6/*!*/;
|
||||
|
@ -249,7 +281,8 @@ SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.uniq
|
|||
SET @@session.sql_mode=0/*!*/;
|
||||
/*!\C latin1 *//*!*/;
|
||||
SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/;
|
||||
insert into t1 values(null, "f")/*!*/;
|
||||
insert into t1 values(null, "f")
|
||||
/*!*/;
|
||||
DELIMITER ;
|
||||
# End of log file
|
||||
ROLLBACK /* added by mysqlbinlog */;
|
||||
|
@ -267,19 +300,24 @@ SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.uniq
|
|||
SET @@session.sql_mode=0/*!*/;
|
||||
/*!\C latin1 *//*!*/;
|
||||
SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/;
|
||||
insert into t1 values(null, "a")/*!*/;
|
||||
insert into t1 values(null, "a")
|
||||
/*!*/;
|
||||
SET INSERT_ID=2/*!*/;
|
||||
SET TIMESTAMP=1579609942/*!*/;
|
||||
insert into t1 values(null, "b")/*!*/;
|
||||
insert into t1 values(null, "b")
|
||||
/*!*/;
|
||||
SET INSERT_ID=3/*!*/;
|
||||
SET TIMESTAMP=1579609944/*!*/;
|
||||
insert into t1 values(null, "c")/*!*/;
|
||||
insert into t1 values(null, "c")
|
||||
/*!*/;
|
||||
SET INSERT_ID=4/*!*/;
|
||||
SET TIMESTAMP=1579609946/*!*/;
|
||||
insert into t1 values(null, "d")/*!*/;
|
||||
insert into t1 values(null, "d")
|
||||
/*!*/;
|
||||
SET INSERT_ID=5/*!*/;
|
||||
SET TIMESTAMP=1579609946/*!*/;
|
||||
insert into t1 values(null, "e")/*!*/;
|
||||
insert into t1 values(null, "e")
|
||||
/*!*/;
|
||||
DELIMITER ;
|
||||
DELIMITER /*!*/;
|
||||
SET INSERT_ID=6/*!*/;
|
||||
|
@ -289,7 +327,8 @@ SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.uniq
|
|||
SET @@session.sql_mode=0/*!*/;
|
||||
/*!\C latin1 *//*!*/;
|
||||
SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/;
|
||||
insert into t1 values(null, "f")/*!*/;
|
||||
insert into t1 values(null, "f")
|
||||
/*!*/;
|
||||
DELIMITER ;
|
||||
# End of log file
|
||||
ROLLBACK /* added by mysqlbinlog */;
|
||||
|
@ -299,6 +338,7 @@ ROLLBACK /* added by mysqlbinlog */;
|
|||
/*!40019 SET @@session.max_insert_delayed_threads=0*/;
|
||||
/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;
|
||||
DELIMITER /*!*/;
|
||||
ROLLBACK/*!*/;
|
||||
SET INSERT_ID=4/*!*/;
|
||||
use test/*!*/;
|
||||
SET TIMESTAMP=1579609946/*!*/;
|
||||
|
@ -306,10 +346,12 @@ SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.uniq
|
|||
SET @@session.sql_mode=0/*!*/;
|
||||
/*!\C latin1 *//*!*/;
|
||||
SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/;
|
||||
insert into t1 values(null, "d")/*!*/;
|
||||
insert into t1 values(null, "d")
|
||||
/*!*/;
|
||||
SET INSERT_ID=5/*!*/;
|
||||
SET TIMESTAMP=1579609946/*!*/;
|
||||
insert into t1 values(null, "e")/*!*/;
|
||||
insert into t1 values(null, "e")
|
||||
/*!*/;
|
||||
DELIMITER ;
|
||||
DELIMITER /*!*/;
|
||||
SET INSERT_ID=6/*!*/;
|
||||
|
@ -319,7 +361,8 @@ SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.uniq
|
|||
SET @@session.sql_mode=0/*!*/;
|
||||
/*!\C latin1 *//*!*/;
|
||||
SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/;
|
||||
insert into t1 values(null, "f")/*!*/;
|
||||
insert into t1 values(null, "f")
|
||||
/*!*/;
|
||||
DELIMITER ;
|
||||
# End of log file
|
||||
ROLLBACK /* added by mysqlbinlog */;
|
||||
|
@ -336,22 +379,28 @@ SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.uniq
|
|||
SET @@session.sql_mode=0/*!*/;
|
||||
/*!\C latin1 *//*!*/;
|
||||
SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/;
|
||||
create table t1 (a int auto_increment not null primary key, b char(3))/*!*/;
|
||||
create table t1 (a int auto_increment not null primary key, b char(3))
|
||||
/*!*/;
|
||||
SET INSERT_ID=1/*!*/;
|
||||
SET TIMESTAMP=1579609942/*!*/;
|
||||
insert into t1 values(null, "a")/*!*/;
|
||||
insert into t1 values(null, "a")
|
||||
/*!*/;
|
||||
SET INSERT_ID=2/*!*/;
|
||||
SET TIMESTAMP=1579609942/*!*/;
|
||||
insert into t1 values(null, "b")/*!*/;
|
||||
insert into t1 values(null, "b")
|
||||
/*!*/;
|
||||
SET INSERT_ID=3/*!*/;
|
||||
SET TIMESTAMP=1579609944/*!*/;
|
||||
insert into t1 values(null, "c")/*!*/;
|
||||
insert into t1 values(null, "c")
|
||||
/*!*/;
|
||||
SET INSERT_ID=4/*!*/;
|
||||
SET TIMESTAMP=1579609946/*!*/;
|
||||
insert into t1 values(null, "d")/*!*/;
|
||||
insert into t1 values(null, "d")
|
||||
/*!*/;
|
||||
SET INSERT_ID=5/*!*/;
|
||||
SET TIMESTAMP=1579609946/*!*/;
|
||||
insert into t1 values(null, "e")/*!*/;
|
||||
insert into t1 values(null, "e")
|
||||
/*!*/;
|
||||
DELIMITER ;
|
||||
DELIMITER /*!*/;
|
||||
SET INSERT_ID=6/*!*/;
|
||||
|
@ -372,13 +421,16 @@ SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.uniq
|
|||
SET @@session.sql_mode=0/*!*/;
|
||||
/*!\C latin1 *//*!*/;
|
||||
SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/;
|
||||
insert into t1 values(null, "c")/*!*/;
|
||||
insert into t1 values(null, "c")
|
||||
/*!*/;
|
||||
SET INSERT_ID=4/*!*/;
|
||||
SET TIMESTAMP=1579609946/*!*/;
|
||||
insert into t1 values(null, "d")/*!*/;
|
||||
insert into t1 values(null, "d")
|
||||
/*!*/;
|
||||
SET INSERT_ID=5/*!*/;
|
||||
SET TIMESTAMP=1579609946/*!*/;
|
||||
insert into t1 values(null, "e")/*!*/;
|
||||
insert into t1 values(null, "e")
|
||||
/*!*/;
|
||||
DELIMITER ;
|
||||
DELIMITER /*!*/;
|
||||
SET INSERT_ID=6/*!*/;
|
||||
|
@ -388,7 +440,8 @@ SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.uniq
|
|||
SET @@session.sql_mode=0/*!*/;
|
||||
/*!\C latin1 *//*!*/;
|
||||
SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/;
|
||||
insert into t1 values(null, "f")/*!*/;
|
||||
insert into t1 values(null, "f")
|
||||
/*!*/;
|
||||
DELIMITER ;
|
||||
# End of log file
|
||||
ROLLBACK /* added by mysqlbinlog */;
|
||||
|
@ -405,13 +458,16 @@ SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.uniq
|
|||
SET @@session.sql_mode=0/*!*/;
|
||||
/*!\C latin1 *//*!*/;
|
||||
SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/;
|
||||
create table t1 (a int auto_increment not null primary key, b char(3))/*!*/;
|
||||
create table t1 (a int auto_increment not null primary key, b char(3))
|
||||
/*!*/;
|
||||
SET INSERT_ID=1/*!*/;
|
||||
SET TIMESTAMP=1579609942/*!*/;
|
||||
insert into t1 values(null, "a")/*!*/;
|
||||
insert into t1 values(null, "a")
|
||||
/*!*/;
|
||||
SET INSERT_ID=2/*!*/;
|
||||
SET TIMESTAMP=1579609942/*!*/;
|
||||
insert into t1 values(null, "b")/*!*/;
|
||||
insert into t1 values(null, "b")
|
||||
/*!*/;
|
||||
DELIMITER ;
|
||||
# End of log file
|
||||
ROLLBACK /* added by mysqlbinlog */;
|
||||
|
@ -428,22 +484,28 @@ SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.uniq
|
|||
SET @@session.sql_mode=0/*!*/;
|
||||
/*!\C latin1 *//*!*/;
|
||||
SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/;
|
||||
create table t1 (a int auto_increment not null primary key, b char(3))/*!*/;
|
||||
create table t1 (a int auto_increment not null primary key, b char(3))
|
||||
/*!*/;
|
||||
SET INSERT_ID=1/*!*/;
|
||||
SET TIMESTAMP=1579609942/*!*/;
|
||||
insert into t1 values(null, "a")/*!*/;
|
||||
insert into t1 values(null, "a")
|
||||
/*!*/;
|
||||
SET INSERT_ID=2/*!*/;
|
||||
SET TIMESTAMP=1579609942/*!*/;
|
||||
insert into t1 values(null, "b")/*!*/;
|
||||
insert into t1 values(null, "b")
|
||||
/*!*/;
|
||||
SET INSERT_ID=3/*!*/;
|
||||
SET TIMESTAMP=1579609944/*!*/;
|
||||
insert into t1 values(null, "c")/*!*/;
|
||||
insert into t1 values(null, "c")
|
||||
/*!*/;
|
||||
SET INSERT_ID=4/*!*/;
|
||||
SET TIMESTAMP=1579609946/*!*/;
|
||||
insert into t1 values(null, "d")/*!*/;
|
||||
insert into t1 values(null, "d")
|
||||
/*!*/;
|
||||
SET INSERT_ID=5/*!*/;
|
||||
SET TIMESTAMP=1579609946/*!*/;
|
||||
insert into t1 values(null, "e")/*!*/;
|
||||
insert into t1 values(null, "e")
|
||||
/*!*/;
|
||||
DELIMITER ;
|
||||
# End of log file
|
||||
ROLLBACK /* added by mysqlbinlog */;
|
||||
|
@ -461,19 +523,24 @@ SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.uniq
|
|||
SET @@session.sql_mode=0/*!*/;
|
||||
/*!\C latin1 *//*!*/;
|
||||
SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/;
|
||||
insert into t1 values(null, "a")/*!*/;
|
||||
insert into t1 values(null, "a")
|
||||
/*!*/;
|
||||
SET INSERT_ID=2/*!*/;
|
||||
SET TIMESTAMP=1579609942/*!*/;
|
||||
insert into t1 values(null, "b")/*!*/;
|
||||
insert into t1 values(null, "b")
|
||||
/*!*/;
|
||||
SET INSERT_ID=3/*!*/;
|
||||
SET TIMESTAMP=1579609944/*!*/;
|
||||
insert into t1 values(null, "c")/*!*/;
|
||||
insert into t1 values(null, "c")
|
||||
/*!*/;
|
||||
SET INSERT_ID=4/*!*/;
|
||||
SET TIMESTAMP=1579609946/*!*/;
|
||||
insert into t1 values(null, "d")/*!*/;
|
||||
insert into t1 values(null, "d")
|
||||
/*!*/;
|
||||
SET INSERT_ID=5/*!*/;
|
||||
SET TIMESTAMP=1579609946/*!*/;
|
||||
insert into t1 values(null, "e")/*!*/;
|
||||
insert into t1 values(null, "e")
|
||||
/*!*/;
|
||||
DELIMITER ;
|
||||
# End of log file
|
||||
ROLLBACK /* added by mysqlbinlog */;
|
||||
|
@ -490,10 +557,12 @@ SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.uniq
|
|||
SET @@session.sql_mode=0/*!*/;
|
||||
/*!\C latin1 *//*!*/;
|
||||
SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/;
|
||||
insert into t1 values(null, "d")/*!*/;
|
||||
insert into t1 values(null, "d")
|
||||
/*!*/;
|
||||
SET INSERT_ID=5/*!*/;
|
||||
SET TIMESTAMP=1579609946/*!*/;
|
||||
insert into t1 values(null, "e")/*!*/;
|
||||
insert into t1 values(null, "e")
|
||||
/*!*/;
|
||||
DELIMITER ;
|
||||
# End of log file
|
||||
ROLLBACK /* added by mysqlbinlog */;
|
||||
|
@ -510,16 +579,20 @@ SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.uniq
|
|||
SET @@session.sql_mode=0/*!*/;
|
||||
/*!\C latin1 *//*!*/;
|
||||
SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/;
|
||||
create table t1 (a int auto_increment not null primary key, b char(3))/*!*/;
|
||||
create table t1 (a int auto_increment not null primary key, b char(3))
|
||||
/*!*/;
|
||||
SET INSERT_ID=1/*!*/;
|
||||
SET TIMESTAMP=1579609942/*!*/;
|
||||
insert into t1 values(null, "a")/*!*/;
|
||||
insert into t1 values(null, "a")
|
||||
/*!*/;
|
||||
SET INSERT_ID=2/*!*/;
|
||||
SET TIMESTAMP=1579609942/*!*/;
|
||||
insert into t1 values(null, "b")/*!*/;
|
||||
insert into t1 values(null, "b")
|
||||
/*!*/;
|
||||
SET INSERT_ID=3/*!*/;
|
||||
SET TIMESTAMP=1579609944/*!*/;
|
||||
insert into t1 values(null, "c")/*!*/;
|
||||
insert into t1 values(null, "c")
|
||||
/*!*/;
|
||||
DELIMITER ;
|
||||
# End of log file
|
||||
ROLLBACK /* added by mysqlbinlog */;
|
||||
|
@ -536,7 +609,8 @@ SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.uniq
|
|||
SET @@session.sql_mode=0/*!*/;
|
||||
/*!\C latin1 *//*!*/;
|
||||
SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/;
|
||||
insert into t1 values(null, "d")/*!*/;
|
||||
insert into t1 values(null, "d")
|
||||
/*!*/;
|
||||
DELIMITER ;
|
||||
# End of log file
|
||||
ROLLBACK /* added by mysqlbinlog */;
|
||||
|
@ -554,13 +628,16 @@ SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.uniq
|
|||
SET @@session.sql_mode=0/*!*/;
|
||||
/*!\C latin1 *//*!*/;
|
||||
SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/;
|
||||
insert into t1 values(null, "c")/*!*/;
|
||||
insert into t1 values(null, "c")
|
||||
/*!*/;
|
||||
SET INSERT_ID=4/*!*/;
|
||||
SET TIMESTAMP=1579609946/*!*/;
|
||||
insert into t1 values(null, "d")/*!*/;
|
||||
insert into t1 values(null, "d")
|
||||
/*!*/;
|
||||
SET INSERT_ID=5/*!*/;
|
||||
SET TIMESTAMP=1579609946/*!*/;
|
||||
insert into t1 values(null, "e")/*!*/;
|
||||
insert into t1 values(null, "e")
|
||||
/*!*/;
|
||||
DELIMITER ;
|
||||
# End of log file
|
||||
ROLLBACK /* added by mysqlbinlog */;
|
||||
|
@ -577,13 +654,16 @@ SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.uniq
|
|||
SET @@session.sql_mode=0/*!*/;
|
||||
/*!\C latin1 *//*!*/;
|
||||
SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/;
|
||||
create table t1 (a int auto_increment not null primary key, b char(3))/*!*/;
|
||||
create table t1 (a int auto_increment not null primary key, b char(3))
|
||||
/*!*/;
|
||||
SET INSERT_ID=1/*!*/;
|
||||
SET TIMESTAMP=1579609942/*!*/;
|
||||
insert into t1 values(null, "a")/*!*/;
|
||||
insert into t1 values(null, "a")
|
||||
/*!*/;
|
||||
SET INSERT_ID=2/*!*/;
|
||||
SET TIMESTAMP=1579609942/*!*/;
|
||||
insert into t1 values(null, "b")/*!*/;
|
||||
insert into t1 values(null, "b")
|
||||
/*!*/;
|
||||
DELIMITER ;
|
||||
# End of log file
|
||||
ROLLBACK /* added by mysqlbinlog */;
|
||||
|
@ -600,22 +680,28 @@ SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.uniq
|
|||
SET @@session.sql_mode=0/*!*/;
|
||||
/*!\C latin1 *//*!*/;
|
||||
SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/;
|
||||
create table t1 (a int auto_increment not null primary key, b char(3))/*!*/;
|
||||
create table t1 (a int auto_increment not null primary key, b char(3))
|
||||
/*!*/;
|
||||
SET INSERT_ID=1/*!*/;
|
||||
SET TIMESTAMP=1579609942/*!*/;
|
||||
insert into t1 values(null, "a")/*!*/;
|
||||
insert into t1 values(null, "a")
|
||||
/*!*/;
|
||||
SET INSERT_ID=2/*!*/;
|
||||
SET TIMESTAMP=1579609942/*!*/;
|
||||
insert into t1 values(null, "b")/*!*/;
|
||||
insert into t1 values(null, "b")
|
||||
/*!*/;
|
||||
SET INSERT_ID=3/*!*/;
|
||||
SET TIMESTAMP=1579609944/*!*/;
|
||||
insert into t1 values(null, "c")/*!*/;
|
||||
insert into t1 values(null, "c")
|
||||
/*!*/;
|
||||
SET INSERT_ID=4/*!*/;
|
||||
SET TIMESTAMP=1579609946/*!*/;
|
||||
insert into t1 values(null, "d")/*!*/;
|
||||
insert into t1 values(null, "d")
|
||||
/*!*/;
|
||||
SET INSERT_ID=5/*!*/;
|
||||
SET TIMESTAMP=1579609946/*!*/;
|
||||
insert into t1 values(null, "e")/*!*/;
|
||||
insert into t1 values(null, "e")
|
||||
/*!*/;
|
||||
DELIMITER ;
|
||||
DELIMITER /*!*/;
|
||||
SET INSERT_ID=6/*!*/;
|
||||
|
@ -625,7 +711,8 @@ SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.uniq
|
|||
SET @@session.sql_mode=0/*!*/;
|
||||
/*!\C latin1 *//*!*/;
|
||||
SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/;
|
||||
insert into t1 values(null, "f")/*!*/;
|
||||
insert into t1 values(null, "f")
|
||||
/*!*/;
|
||||
DELIMITER ;
|
||||
# End of log file
|
||||
ROLLBACK /* added by mysqlbinlog */;
|
||||
|
@ -643,19 +730,24 @@ SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.uniq
|
|||
SET @@session.sql_mode=0/*!*/;
|
||||
/*!\C latin1 *//*!*/;
|
||||
SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/;
|
||||
insert into t1 values(null, "a")/*!*/;
|
||||
insert into t1 values(null, "a")
|
||||
/*!*/;
|
||||
SET INSERT_ID=2/*!*/;
|
||||
SET TIMESTAMP=1579609942/*!*/;
|
||||
insert into t1 values(null, "b")/*!*/;
|
||||
insert into t1 values(null, "b")
|
||||
/*!*/;
|
||||
SET INSERT_ID=3/*!*/;
|
||||
SET TIMESTAMP=1579609944/*!*/;
|
||||
insert into t1 values(null, "c")/*!*/;
|
||||
insert into t1 values(null, "c")
|
||||
/*!*/;
|
||||
SET INSERT_ID=4/*!*/;
|
||||
SET TIMESTAMP=1579609946/*!*/;
|
||||
insert into t1 values(null, "d")/*!*/;
|
||||
insert into t1 values(null, "d")
|
||||
/*!*/;
|
||||
SET INSERT_ID=5/*!*/;
|
||||
SET TIMESTAMP=1579609946/*!*/;
|
||||
insert into t1 values(null, "e")/*!*/;
|
||||
insert into t1 values(null, "e")
|
||||
/*!*/;
|
||||
DELIMITER ;
|
||||
DELIMITER /*!*/;
|
||||
SET INSERT_ID=6/*!*/;
|
||||
|
@ -665,7 +757,8 @@ SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.uniq
|
|||
SET @@session.sql_mode=0/*!*/;
|
||||
/*!\C latin1 *//*!*/;
|
||||
SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/;
|
||||
insert into t1 values(null, "f")/*!*/;
|
||||
insert into t1 values(null, "f")
|
||||
/*!*/;
|
||||
DELIMITER ;
|
||||
# End of log file
|
||||
ROLLBACK /* added by mysqlbinlog */;
|
||||
|
@ -682,10 +775,12 @@ SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.uniq
|
|||
SET @@session.sql_mode=0/*!*/;
|
||||
/*!\C latin1 *//*!*/;
|
||||
SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/;
|
||||
insert into t1 values(null, "d")/*!*/;
|
||||
insert into t1 values(null, "d")
|
||||
/*!*/;
|
||||
SET INSERT_ID=5/*!*/;
|
||||
SET TIMESTAMP=1579609946/*!*/;
|
||||
insert into t1 values(null, "e")/*!*/;
|
||||
insert into t1 values(null, "e")
|
||||
/*!*/;
|
||||
DELIMITER ;
|
||||
DELIMITER /*!*/;
|
||||
SET INSERT_ID=6/*!*/;
|
||||
|
@ -695,7 +790,8 @@ SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.uniq
|
|||
SET @@session.sql_mode=0/*!*/;
|
||||
/*!\C latin1 *//*!*/;
|
||||
SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/;
|
||||
insert into t1 values(null, "f")/*!*/;
|
||||
insert into t1 values(null, "f")
|
||||
/*!*/;
|
||||
DELIMITER ;
|
||||
# End of log file
|
||||
ROLLBACK /* added by mysqlbinlog */;
|
||||
|
@ -712,22 +808,28 @@ SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.uniq
|
|||
SET @@session.sql_mode=0/*!*/;
|
||||
/*!\C latin1 *//*!*/;
|
||||
SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/;
|
||||
create table t1 (a int auto_increment not null primary key, b char(3))/*!*/;
|
||||
create table t1 (a int auto_increment not null primary key, b char(3))
|
||||
/*!*/;
|
||||
SET INSERT_ID=1/*!*/;
|
||||
SET TIMESTAMP=1579609942/*!*/;
|
||||
insert into t1 values(null, "a")/*!*/;
|
||||
insert into t1 values(null, "a")
|
||||
/*!*/;
|
||||
SET INSERT_ID=2/*!*/;
|
||||
SET TIMESTAMP=1579609942/*!*/;
|
||||
insert into t1 values(null, "b")/*!*/;
|
||||
insert into t1 values(null, "b")
|
||||
/*!*/;
|
||||
SET INSERT_ID=3/*!*/;
|
||||
SET TIMESTAMP=1579609944/*!*/;
|
||||
insert into t1 values(null, "c")/*!*/;
|
||||
insert into t1 values(null, "c")
|
||||
/*!*/;
|
||||
SET INSERT_ID=4/*!*/;
|
||||
SET TIMESTAMP=1579609946/*!*/;
|
||||
insert into t1 values(null, "d")/*!*/;
|
||||
insert into t1 values(null, "d")
|
||||
/*!*/;
|
||||
SET INSERT_ID=5/*!*/;
|
||||
SET TIMESTAMP=1579609946/*!*/;
|
||||
insert into t1 values(null, "e")/*!*/;
|
||||
insert into t1 values(null, "e")
|
||||
/*!*/;
|
||||
DELIMITER ;
|
||||
DELIMITER /*!*/;
|
||||
SET INSERT_ID=6/*!*/;
|
||||
|
@ -748,13 +850,16 @@ SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.uniq
|
|||
SET @@session.sql_mode=0/*!*/;
|
||||
/*!\C latin1 *//*!*/;
|
||||
SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/;
|
||||
insert into t1 values(null, "c")/*!*/;
|
||||
insert into t1 values(null, "c")
|
||||
/*!*/;
|
||||
SET INSERT_ID=4/*!*/;
|
||||
SET TIMESTAMP=1579609946/*!*/;
|
||||
insert into t1 values(null, "d")/*!*/;
|
||||
insert into t1 values(null, "d")
|
||||
/*!*/;
|
||||
SET INSERT_ID=5/*!*/;
|
||||
SET TIMESTAMP=1579609946/*!*/;
|
||||
insert into t1 values(null, "e")/*!*/;
|
||||
insert into t1 values(null, "e")
|
||||
/*!*/;
|
||||
DELIMITER ;
|
||||
DELIMITER /*!*/;
|
||||
SET INSERT_ID=6/*!*/;
|
||||
|
@ -764,7 +869,8 @@ SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.uniq
|
|||
SET @@session.sql_mode=0/*!*/;
|
||||
/*!\C latin1 *//*!*/;
|
||||
SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/;
|
||||
insert into t1 values(null, "f")/*!*/;
|
||||
insert into t1 values(null, "f")
|
||||
/*!*/;
|
||||
DELIMITER ;
|
||||
# End of log file
|
||||
ROLLBACK /* added by mysqlbinlog */;
|
||||
|
@ -781,13 +887,16 @@ SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.uniq
|
|||
SET @@session.sql_mode=0/*!*/;
|
||||
/*!\C latin1 *//*!*/;
|
||||
SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/;
|
||||
create table t1 (a int auto_increment not null primary key, b char(3))/*!*/;
|
||||
create table t1 (a int auto_increment not null primary key, b char(3))
|
||||
/*!*/;
|
||||
SET INSERT_ID=1/*!*/;
|
||||
SET TIMESTAMP=1579609942/*!*/;
|
||||
insert into t1 values(null, "a")/*!*/;
|
||||
insert into t1 values(null, "a")
|
||||
/*!*/;
|
||||
SET INSERT_ID=2/*!*/;
|
||||
SET TIMESTAMP=1579609942/*!*/;
|
||||
insert into t1 values(null, "b")/*!*/;
|
||||
insert into t1 values(null, "b")
|
||||
/*!*/;
|
||||
DELIMITER ;
|
||||
# End of log file
|
||||
ROLLBACK /* added by mysqlbinlog */;
|
||||
|
@ -804,25 +913,32 @@ SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.uniq
|
|||
SET @@session.sql_mode=0/*!*/;
|
||||
/*!\C latin1 *//*!*/;
|
||||
SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/;
|
||||
create table t1 (a int auto_increment not null primary key, b char(3))/*!*/;
|
||||
create table t1 (a int auto_increment not null primary key, b char(3))
|
||||
/*!*/;
|
||||
SET INSERT_ID=1/*!*/;
|
||||
SET TIMESTAMP=1579609942/*!*/;
|
||||
insert into t1 values(null, "a")/*!*/;
|
||||
insert into t1 values(null, "a")
|
||||
/*!*/;
|
||||
SET INSERT_ID=2/*!*/;
|
||||
SET TIMESTAMP=1579609942/*!*/;
|
||||
insert into t1 values(null, "b")/*!*/;
|
||||
insert into t1 values(null, "b")
|
||||
/*!*/;
|
||||
SET INSERT_ID=3/*!*/;
|
||||
SET TIMESTAMP=1579609944/*!*/;
|
||||
insert into t1 values(null, "c")/*!*/;
|
||||
insert into t1 values(null, "c")
|
||||
/*!*/;
|
||||
SET INSERT_ID=4/*!*/;
|
||||
SET TIMESTAMP=1579609946/*!*/;
|
||||
insert into t1 values(null, "d")/*!*/;
|
||||
insert into t1 values(null, "d")
|
||||
/*!*/;
|
||||
SET INSERT_ID=5/*!*/;
|
||||
SET TIMESTAMP=1579609946/*!*/;
|
||||
insert into t1 values(null, "e")/*!*/;
|
||||
insert into t1 values(null, "e")
|
||||
/*!*/;
|
||||
SET INSERT_ID=6/*!*/;
|
||||
SET TIMESTAMP=1579609943/*!*/;
|
||||
insert into t1 values(null, "f")/*!*/;
|
||||
insert into t1 values(null, "f")
|
||||
/*!*/;
|
||||
DELIMITER ;
|
||||
# End of log file
|
||||
ROLLBACK /* added by mysqlbinlog */;
|
||||
|
|
27
mysql-test/r/rpl_drop_view.result
Normal file
27
mysql-test/r/rpl_drop_view.result
Normal file
|
@ -0,0 +1,27 @@
|
|||
stop slave;
|
||||
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
|
||||
reset master;
|
||||
reset slave;
|
||||
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
|
||||
start slave;
|
||||
drop table if exists t1, t2;
|
||||
drop view if exists v1, v2, v3, not_exist_view;
|
||||
create table t1 (a int);
|
||||
create table t2 (b int);
|
||||
create table t3 (c int);
|
||||
create view v1 as select * from t1;
|
||||
create view v2 as select * from t2;
|
||||
create view v3 as select * from t3;
|
||||
drop view not_exist_view;
|
||||
ERROR 42S02: Unknown table 'not_exist_view'
|
||||
drop view v1, not_exist_view;
|
||||
ERROR 42S02: Unknown table 'not_exist_view'
|
||||
select * from v1;
|
||||
ERROR 42S02: Table 'test.v1' doesn't exist
|
||||
drop view v2, v3;
|
||||
select * from v1;
|
||||
ERROR 42S02: Table 'test.v1' doesn't exist
|
||||
select * from v2;
|
||||
ERROR 42S02: Table 'test.v2' doesn't exist
|
||||
select * from v3;
|
||||
ERROR 42S02: Table 'test.v3' doesn't exist
|
|
@ -16,6 +16,7 @@ insert into t2 values (bug23333(),1)|
|
|||
ERROR 23000: Duplicate entry '1' for key 'PRIMARY'
|
||||
show binlog events from 106 /* with fixes for #23333 will show there is the query */|
|
||||
Log_name Pos Event_type Server_id End_log_pos Info
|
||||
master-bin.000001 # Query 1 # #
|
||||
master-bin.000001 # Table_map 1 # #
|
||||
master-bin.000001 # Table_map 1 # #
|
||||
master-bin.000001 # Write_rows 1 # #
|
||||
|
|
|
@ -25,11 +25,13 @@ SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.uniq
|
|||
SET @@session.sql_mode=0/*!*/;
|
||||
/*!\C latin1 *//*!*/;
|
||||
SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/;
|
||||
INSERT INTO t1 VALUES(@`a b`)/*!*/;
|
||||
INSERT INTO t1 VALUES(@`a b`)
|
||||
/*!*/;
|
||||
SET @`var1`:=_latin1 0x273B616161 COLLATE `latin1_swedish_ci`/*!*/;
|
||||
SET @`var2`:=_binary 0x61 COLLATE `binary`/*!*/;
|
||||
SET TIMESTAMP=10000/*!*/;
|
||||
insert into t1 values (@var1),(@var2)/*!*/;
|
||||
insert into t1 values (@var1),(@var2)
|
||||
/*!*/;
|
||||
DELIMITER ;
|
||||
# End of log file
|
||||
ROLLBACK /* added by mysqlbinlog */;
|
||||
|
|
60
mysql-test/suite/binlog/r/binlog_base64_flag.result
Normal file
60
mysql-test/suite/binlog/r/binlog_base64_flag.result
Normal file
|
@ -0,0 +1,60 @@
|
|||
==== Test BUG#32407 ====
|
||||
select * from t1;
|
||||
a
|
||||
1
|
||||
1
|
||||
==== Test BINLOG statement w/o FD event ====
|
||||
BINLOG '
|
||||
SVtYRxMBAAAAKQAAADQBAAAAABAAAAAAAAAABHRlc3QAAnQxAAEDAAE=
|
||||
SVtYRxcBAAAAIgAAAFYBAAAQABAAAAAAAAEAAf/+AgAAAA==
|
||||
';
|
||||
ERROR HY000: The BINLOG statement of type `Table_map` was not preceded by a format description BINLOG statement.
|
||||
select * from t1;
|
||||
a
|
||||
1
|
||||
1
|
||||
==== Test BINLOG statement with FD event ====
|
||||
BINLOG '
|
||||
ODdYRw8BAAAAZgAAAGoAAAABAAQANS4xLjIzLXJjLWRlYnVnLWxvZwAAAAAAAAAAAAAAAAAAAAAA
|
||||
AAAAAAAAAAAAAAAAAAA4N1hHEzgNAAgAEgAEBAQEEgAAUwAEGggAAAAICAgC
|
||||
';
|
||||
BINLOG '
|
||||
TFtYRxMBAAAAKQAAAH8BAAAAABAAAAAAAAAABHRlc3QAAnQxAAEDAAE=
|
||||
TFtYRxcBAAAAIgAAAKEBAAAQABAAAAAAAAEAAf/+AwAAAA==
|
||||
';
|
||||
select * from t1;
|
||||
a
|
||||
1
|
||||
1
|
||||
3
|
||||
==== Test --base64-output=never on a binlog with row events ====
|
||||
/*!40019 SET @@session.max_insert_delayed_threads=0*/;
|
||||
/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;
|
||||
DELIMITER /*!*/;
|
||||
# at 4
|
||||
#ROLLBACK/*!*/;
|
||||
# at 102
|
||||
#use test/*!*/;
|
||||
SET TIMESTAMP=1196959712/*!*/;
|
||||
SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1/*!*/;
|
||||
SET @@session.sql_mode=0/*!*/;
|
||||
/*!\C latin1 *//*!*/;
|
||||
SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/;
|
||||
create table t1 (a int) engine= myisam/*!*/;
|
||||
# at 203
|
||||
==== Test non-matching FD event and Row event ====
|
||||
BINLOG '
|
||||
4CdYRw8BAAAAYgAAAGYAAAAAAAQANS4xLjE1LW5kYi02LjEuMjQtZGVidWctbG9nAAAAAAAAAAAA
|
||||
AAAAAAAAAAAAAAAAAADgJ1hHEzgNAAgAEgAEBAQEEgAATwAEGggICAg=
|
||||
';
|
||||
BINLOG '
|
||||
Dl1YRxMBAAAAKQAAADQBAAAAABAAAAAAAAAABHRlc3QAAnQxAAEDAAE=
|
||||
Dl1YRxcBAAAAIgAAAFYBAAAQABAAAAAAAAEAAf/+BQAAAA==
|
||||
';
|
||||
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use
|
||||
select * from t1;
|
||||
a
|
||||
1
|
||||
1
|
||||
3
|
||||
drop table t1;
|
|
@ -66,6 +66,7 @@ COMMIT;
|
|||
show binlog events from <binlog_start>;
|
||||
Log_name Pos Event_type Server_id End_log_pos Info
|
||||
master-bin.000001 # Query # # use `test`; CREATE TABLE t1 (a INT PRIMARY KEY, b INT) ENGINE=INNODB
|
||||
master-bin.000001 # Query # # use `test`; BEGIN
|
||||
master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (1,1),(2,2),(3,3),(4,4),(5,5),(6,6)
|
||||
master-bin.000001 # Xid # # COMMIT /* XID */
|
||||
master-bin.000001 # Query # # use `test`; BEGIN
|
||||
|
|
|
@ -18,8 +18,12 @@ TRUNCATE t1n;
|
|||
show binlog events from <binlog_start>;
|
||||
Log_name Pos Event_type Server_id End_log_pos Info
|
||||
master-bin.000001 # Query # # use `test`; INSERT INTO t1m VALUES (1,1), (1,2), (2,1), (2,2)
|
||||
master-bin.000001 # Query # # use `test`; BEGIN
|
||||
master-bin.000001 # Query # # use `test`; INSERT INTO t1b VALUES (1,1), (1,2), (2,1), (2,2)
|
||||
master-bin.000001 # Query # # use `test`; COMMIT
|
||||
master-bin.000001 # Query # # use `test`; BEGIN
|
||||
master-bin.000001 # Query # # use `test`; UPDATE t1m, t1b SET m = 2, b = 3 WHERE n = c
|
||||
master-bin.000001 # Query # # use `test`; COMMIT
|
||||
master-bin.000001 # Query # # use `test`; BEGIN
|
||||
master-bin.000001 # Query # # use `test`; INSERT INTO t1n VALUES (1,1), (1,2), (2,1), (2,2)
|
||||
master-bin.000001 # Query # # use `test`; UPDATE t1m, t1n SET m = 2, e = 3 WHERE n = f
|
||||
|
@ -49,8 +53,12 @@ TRUNCATE t1n;
|
|||
show binlog events from <binlog_start>;
|
||||
Log_name Pos Event_type Server_id End_log_pos Info
|
||||
master-bin.000001 # Query # # use `test`; INSERT INTO t1m VALUES (1,1), (1,2), (2,1), (2,2)
|
||||
master-bin.000001 # Query # # use `test`; BEGIN
|
||||
master-bin.000001 # Query # # use `test`; INSERT INTO t1b VALUES (1,1), (1,2), (2,1), (2,2)
|
||||
master-bin.000001 # Query # # use `test`; COMMIT
|
||||
master-bin.000001 # Query # # use `test`; BEGIN
|
||||
master-bin.000001 # Query # # use `test`; UPDATE t1m, t1b SET m = 2, b = 3 WHERE n = c
|
||||
master-bin.000001 # Query # # use `test`; COMMIT
|
||||
master-bin.000001 # Query # # use `test`; TRUNCATE t1m
|
||||
master-bin.000001 # Query # # use `test`; TRUNCATE t1b
|
||||
master-bin.000001 # Query # # BEGIN
|
||||
|
|
15
mysql-test/suite/binlog/r/binlog_start_comment.result
Normal file
15
mysql-test/suite/binlog/r/binlog_start_comment.result
Normal file
|
@ -0,0 +1,15 @@
|
|||
reset master;
|
||||
drop table if exists t1,t2;
|
||||
create table t1 (word varchar(20)) -- create table t1;
|
||||
create table t2 (word varchar(20)) -- create table t2;
|
||||
load data infile '../std_data_ln/words.dat' into table t1 -- load data to t1;
|
||||
insert into t2 values ("Ada");
|
||||
flush logs;
|
||||
select * from t2;
|
||||
word
|
||||
Ada
|
||||
flush logs;
|
||||
select * from t2;
|
||||
word
|
||||
Ada
|
||||
drop table t1,t2;
|
|
@ -108,19 +108,35 @@ show binlog events from <binlog_start>;
|
|||
Log_name Pos Event_type Server_id End_log_pos Info
|
||||
master-bin.000001 # Query # # use `test`; drop table t1,t2
|
||||
master-bin.000001 # Query # # use `test`; create table t1 (a int) engine=blackhole
|
||||
master-bin.000001 # Query # # use `test`; BEGIN
|
||||
master-bin.000001 # Query # # use `test`; delete from t1 where a=10
|
||||
master-bin.000001 # Query # # use `test`; COMMIT
|
||||
master-bin.000001 # Query # # use `test`; BEGIN
|
||||
master-bin.000001 # Query # # use `test`; update t1 set a=11 where a=15
|
||||
master-bin.000001 # Query # # use `test`; COMMIT
|
||||
master-bin.000001 # Query # # use `test`; BEGIN
|
||||
master-bin.000001 # Query # # use `test`; insert into t1 values(1)
|
||||
master-bin.000001 # Query # # use `test`; COMMIT
|
||||
master-bin.000001 # Query # # use `test`; BEGIN
|
||||
master-bin.000001 # Query # # use `test`; insert ignore into t1 values(1)
|
||||
master-bin.000001 # Query # # use `test`; COMMIT
|
||||
master-bin.000001 # Query # # use `test`; BEGIN
|
||||
master-bin.000001 # Query # # use `test`; replace into t1 values(100)
|
||||
master-bin.000001 # Query # # use `test`; COMMIT
|
||||
master-bin.000001 # Query # # use `test`; create table t2 (a varchar(200)) engine=blackhole
|
||||
master-bin.000001 # Query # # use `test`; BEGIN
|
||||
master-bin.000001 # Begin_load_query # # ;file_id=1;block_len=581
|
||||
master-bin.000001 # Execute_load_query # # use `test`; load data infile '../std_data_ln/words.dat' into table t2 ;file_id=1
|
||||
master-bin.000001 # Query # # use `test`; COMMIT
|
||||
master-bin.000001 # Query # # use `test`; alter table t1 add b int
|
||||
master-bin.000001 # Query # # use `test`; alter table t1 drop b
|
||||
master-bin.000001 # Query # # use `test`; create table t3 like t1
|
||||
master-bin.000001 # Query # # use `test`; BEGIN
|
||||
master-bin.000001 # Query # # use `test`; insert into t1 select * from t3
|
||||
master-bin.000001 # Query # # use `test`; COMMIT
|
||||
master-bin.000001 # Query # # use `test`; BEGIN
|
||||
master-bin.000001 # Query # # use `test`; replace into t1 select * from t3
|
||||
master-bin.000001 # Query # # use `test`; COMMIT
|
||||
drop table t1,t2,t3;
|
||||
CREATE TABLE t1(a INT) ENGINE=BLACKHOLE;
|
||||
INSERT DELAYED INTO t1 VALUES(1);
|
||||
|
|
|
@ -19,7 +19,8 @@ SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.uniq
|
|||
SET @@session.sql_mode=0/*!*/;
|
||||
/*!\C latin1 *//*!*/;
|
||||
SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/;
|
||||
insert into t2 values (@v)/*!*/;
|
||||
insert into t2 values (@v)
|
||||
/*!*/;
|
||||
DELIMITER ;
|
||||
# End of log file
|
||||
ROLLBACK /* added by mysqlbinlog */;
|
||||
|
|
|
@ -100,6 +100,7 @@ insert into t1 values(9);
|
|||
insert into t2 select * from t1;
|
||||
show binlog events from <binlog_start>;
|
||||
Log_name Pos Event_type Server_id End_log_pos Info
|
||||
master-bin.000001 # Query # # use `test`; BEGIN
|
||||
master-bin.000001 # Query # # use `test`; insert into t1 values(9)
|
||||
master-bin.000001 # Xid # # COMMIT /* XID */
|
||||
master-bin.000001 # Query # # use `test`; insert into t2 select * from t1
|
||||
|
@ -111,6 +112,7 @@ begin;
|
|||
insert into t2 select * from t1;
|
||||
show binlog events from <binlog_start>;
|
||||
Log_name Pos Event_type Server_id End_log_pos Info
|
||||
master-bin.000001 # Query # # use `test`; BEGIN
|
||||
master-bin.000001 # Query # # use `test`; insert into t1 values(10)
|
||||
master-bin.000001 # Xid # # COMMIT /* XID */
|
||||
master-bin.000001 # Query # # use `test`; insert into t2 select * from t1
|
||||
|
@ -118,6 +120,7 @@ insert into t1 values(11);
|
|||
commit;
|
||||
show binlog events from <binlog_start>;
|
||||
Log_name Pos Event_type Server_id End_log_pos Info
|
||||
master-bin.000001 # Query # # use `test`; BEGIN
|
||||
master-bin.000001 # Query # # use `test`; insert into t1 values(10)
|
||||
master-bin.000001 # Xid # # COMMIT /* XID */
|
||||
master-bin.000001 # Query # # use `test`; insert into t2 select * from t1
|
||||
|
@ -233,16 +236,20 @@ master-bin.000001 # Query # # use `test`; BEGIN
|
|||
master-bin.000001 # Query # # use `test`; insert into t1 values(16)
|
||||
master-bin.000001 # Query # # use `test`; insert into t1 values(18)
|
||||
master-bin.000001 # Xid # # COMMIT /* XID */
|
||||
master-bin.000001 # Query # # use `test`; BEGIN
|
||||
master-bin.000001 # Query # # use `test`; delete from t1
|
||||
master-bin.000001 # Xid # # COMMIT /* XID */
|
||||
master-bin.000001 # Query # # use `test`; BEGIN
|
||||
master-bin.000001 # Query # # use `test`; delete from t2
|
||||
master-bin.000001 # Xid # # COMMIT /* XID */
|
||||
master-bin.000001 # Query # # use `test`; alter table t2 engine=MyISAM
|
||||
master-bin.000001 # Query # # use `test`; BEGIN
|
||||
master-bin.000001 # Query # # use `test`; insert into t1 values (1)
|
||||
master-bin.000001 # Xid # # COMMIT /* XID */
|
||||
master-bin.000001 # Query # # use `test`; insert into t2 values (20)
|
||||
master-bin.000001 # Query # # use `test`; drop table t1,t2
|
||||
master-bin.000001 # Query # # use `test`; create temporary table ti (a int) engine=innodb
|
||||
master-bin.000001 # Query # # use `test`; BEGIN
|
||||
master-bin.000001 # Query # # use `test`; insert into ti values(1)
|
||||
master-bin.000001 # Xid # # COMMIT /* XID */
|
||||
master-bin.000001 # Query # # use `test`; create temporary table t1 (a int) engine=myisam
|
||||
|
@ -339,6 +346,7 @@ master-bin.000001 # Query # # use `test`; INSERT INTO t1 values (3,3)
|
|||
master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS t2
|
||||
master-bin.000001 # Query # # use `test`; CREATE TABLE t2 (a int, b int, primary key (a)) engine=innodb
|
||||
master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (4,4)
|
||||
master-bin.000001 # Query # # use `test`; BEGIN
|
||||
master-bin.000001 # Query # # use `test`; TRUNCATE table t2
|
||||
master-bin.000001 # Xid # # COMMIT /* XID */
|
||||
master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (5,5)
|
||||
|
@ -348,6 +356,7 @@ master-bin.000001 # Query # # use `test`; CREATE TEMPORARY TABLE t2 (a int, b in
|
|||
master-bin.000001 # Query # # use `test`; INSERT INTO t1 values (7,7)
|
||||
master-bin.000001 # Query # # use `test`; INSERT INTO t1 values (8,8)
|
||||
master-bin.000001 # Query # # use `test`; INSERT INTO t1 values (9,9)
|
||||
master-bin.000001 # Query # # use `test`; BEGIN
|
||||
master-bin.000001 # Query # # use `test`; TRUNCATE table t2
|
||||
master-bin.000001 # Xid # # COMMIT /* XID */
|
||||
master-bin.000001 # Query # # use `test`; INSERT INTO t1 values (10,10)
|
||||
|
@ -375,9 +384,9 @@ is not null;
|
|||
is not null
|
||||
1
|
||||
select
|
||||
@a like "%#%error_code=0%ROLLBACK/*!*/;%ROLLBACK /* added by mysqlbinlog */;%",
|
||||
@a like "%#%error_code=0%ROLLBACK\n/*!*/;%ROLLBACK /* added by mysqlbinlog */;%",
|
||||
@a not like "%#%error_code=%error_code=%";
|
||||
@a like "%#%error_code=0%ROLLBACK/*!*/;%ROLLBACK /* added by mysqlbinlog */;%" @a not like "%#%error_code=%error_code=%"
|
||||
@a like "%#%error_code=0%ROLLBACK\n/*!*/;%ROLLBACK /* added by mysqlbinlog */;%" @a not like "%#%error_code=%error_code=%"
|
||||
1 1
|
||||
drop table t1, t2;
|
||||
set @@session.binlog_format=statement;
|
||||
|
@ -503,6 +512,7 @@ insert into t2 values (bug27417(1));
|
|||
ERROR 23000: Duplicate entry '1' for key 'PRIMARY'
|
||||
show binlog events from <binlog_start>;
|
||||
Log_name Pos Event_type Server_id End_log_pos Info
|
||||
master-bin.000001 # Query # # use `test`; BEGIN
|
||||
master-bin.000001 # Intvar # # INSERT_ID=1
|
||||
master-bin.000001 # Query # # use `test`; insert into t2 values (bug27417(1))
|
||||
master-bin.000001 # Query # # use `test`; ROLLBACK
|
||||
|
@ -517,6 +527,7 @@ insert into t2 select bug27417(1) union select bug27417(2);
|
|||
ERROR 23000: Duplicate entry '2' for key 'PRIMARY'
|
||||
show binlog events from <binlog_start>;
|
||||
Log_name Pos Event_type Server_id End_log_pos Info
|
||||
master-bin.000001 # Query # # use `test`; BEGIN
|
||||
master-bin.000001 # Intvar # # INSERT_ID=2
|
||||
master-bin.000001 # Query # # use `test`; insert into t2 select bug27417(1) union select bug27417(2)
|
||||
master-bin.000001 # Query # # use `test`; ROLLBACK
|
||||
|
@ -544,6 +555,7 @@ UPDATE t4,t3 SET t4.a=t3.a + bug27417(1) /* top level non-ta table */;
|
|||
ERROR 23000: Duplicate entry '2' for key 'PRIMARY'
|
||||
show binlog events from <binlog_start>;
|
||||
Log_name Pos Event_type Server_id End_log_pos Info
|
||||
master-bin.000001 # Query # # use `test`; BEGIN
|
||||
master-bin.000001 # Intvar # # INSERT_ID=6
|
||||
master-bin.000001 # Query # # use `test`; UPDATE t4,t3 SET t4.a=t3.a + bug27417(1) /* top level non-ta table */
|
||||
master-bin.000001 # Query # # use `test`; ROLLBACK
|
||||
|
@ -574,6 +586,7 @@ delete from t2;
|
|||
ERROR 23000: Duplicate entry '1' for key 'PRIMARY'
|
||||
show binlog events from <binlog_start>;
|
||||
Log_name Pos Event_type Server_id End_log_pos Info
|
||||
master-bin.000001 # Query # # use `test`; BEGIN
|
||||
master-bin.000001 # Intvar # # INSERT_ID=9
|
||||
master-bin.000001 # Query # # use `test`; delete from t2
|
||||
master-bin.000001 # Query # # use `test`; ROLLBACK
|
||||
|
@ -593,6 +606,7 @@ delete t2.* from t2,t5 where t2.a=t5.a + 1;
|
|||
ERROR 23000: Duplicate entry '1' for key 'PRIMARY'
|
||||
show binlog events from <binlog_start>;
|
||||
Log_name Pos Event_type Server_id End_log_pos Info
|
||||
master-bin.000001 # Query # # use `test`; BEGIN
|
||||
master-bin.000001 # Query # # use `test`; delete t2.* from t2,t5 where t2.a=t5.a + 1
|
||||
master-bin.000001 # Query # # use `test`; ROLLBACK
|
||||
select count(*) from t1 /* must be 1 */;
|
||||
|
@ -612,6 +626,7 @@ count(*)
|
|||
2
|
||||
show binlog events from <binlog_start>;
|
||||
Log_name Pos Event_type Server_id End_log_pos Info
|
||||
master-bin.000001 # Query # # use `test`; BEGIN
|
||||
master-bin.000001 # Intvar # # INSERT_ID=10
|
||||
master-bin.000001 # Begin_load_query # # ;file_id=1;block_len=12
|
||||
master-bin.000001 # Intvar # # INSERT_ID=10
|
||||
|
|
BIN
mysql-test/suite/binlog/std_data/binlog-bug32407.000001
Normal file
BIN
mysql-test/suite/binlog/std_data/binlog-bug32407.000001
Normal file
Binary file not shown.
102
mysql-test/suite/binlog/t/binlog_base64_flag.test
Normal file
102
mysql-test/suite/binlog/t/binlog_base64_flag.test
Normal file
|
@ -0,0 +1,102 @@
|
|||
# This test case verifies that the mysqlbinlog --base64-output=X flags
|
||||
# work as expected, and that BINLOG statements with row events fail if
|
||||
# they are not preceded by BINLOG statements with Format description
|
||||
# events.
|
||||
#
|
||||
# See also BUG#32407.
|
||||
|
||||
|
||||
# Test to show BUG#32407. This reads a binlog created with the
|
||||
# mysql-5.1-telco-6.1 tree, specifically at the tag
|
||||
# mysql-5.1.15-ndb-6.1.23, and applies it to the database. The test
|
||||
# should fail before BUG#32407 was fixed and succeed afterwards.
|
||||
--echo ==== Test BUG#32407 ====
|
||||
|
||||
# The binlog contains row events equivalent to:
|
||||
# CREATE TABLE t1 (a int) engine = myisam
|
||||
# INSERT INTO t1 VALUES (1), (1)
|
||||
exec $MYSQL_BINLOG suite/binlog/std_data/binlog-bug32407.000001 | $MYSQL;
|
||||
# The above line should succeed and t1 should contain two ones
|
||||
select * from t1;
|
||||
|
||||
|
||||
# Test that a BINLOG statement encoding a row event fails unless a
|
||||
# Format_description_event as been supplied with an earlier BINLOG
|
||||
# statement.
|
||||
--echo ==== Test BINLOG statement w/o FD event ====
|
||||
|
||||
# This is a binlog statement consisting of one Table_map_log_event and
|
||||
# one Write_rows_log_event. Together, they correspond to the
|
||||
# following query:
|
||||
# INSERT INTO TABLE test.t1 VALUES (2)
|
||||
|
||||
error ER_NO_FORMAT_DESCRIPTION_EVENT_BEFORE_BINLOG_STATEMENT;
|
||||
BINLOG '
|
||||
SVtYRxMBAAAAKQAAADQBAAAAABAAAAAAAAAABHRlc3QAAnQxAAEDAAE=
|
||||
SVtYRxcBAAAAIgAAAFYBAAAQABAAAAAAAAEAAf/+AgAAAA==
|
||||
';
|
||||
# The above line should fail and 2 should not be in the table
|
||||
select * from t1;
|
||||
|
||||
|
||||
# Test that it works to read a Format_description_log_event with a
|
||||
# BINLOG statement, followed by a row-event in base64 from the same
|
||||
# version.
|
||||
--echo ==== Test BINLOG statement with FD event ====
|
||||
|
||||
# This is a binlog statement containing a Format_description_log_event
|
||||
# from the same version as the Table_map and Write_rows_log_event.
|
||||
BINLOG '
|
||||
ODdYRw8BAAAAZgAAAGoAAAABAAQANS4xLjIzLXJjLWRlYnVnLWxvZwAAAAAAAAAAAAAAAAAAAAAA
|
||||
AAAAAAAAAAAAAAAAAAA4N1hHEzgNAAgAEgAEBAQEEgAAUwAEGggAAAAICAgC
|
||||
';
|
||||
|
||||
# This is a Table_map_log_event+Write_rows_log_event corresponding to:
|
||||
# INSERT INTO TABLE test.t1 VALUES (3)
|
||||
BINLOG '
|
||||
TFtYRxMBAAAAKQAAAH8BAAAAABAAAAAAAAAABHRlc3QAAnQxAAEDAAE=
|
||||
TFtYRxcBAAAAIgAAAKEBAAAQABAAAAAAAAEAAf/+AwAAAA==
|
||||
';
|
||||
# The above line should succeed and 3 should be in the table
|
||||
select * from t1;
|
||||
|
||||
|
||||
# Test that mysqlbinlog stops with an error message when the
|
||||
# --base64-output=never flag is used on a binlog with base64 events.
|
||||
--echo ==== Test --base64-output=never on a binlog with row events ====
|
||||
|
||||
# mysqlbinlog should fail
|
||||
--replace_regex /#[0-9][0-9][0-9][0-9][0-9][0-9] .*/#/
|
||||
error 1;
|
||||
exec $MYSQL_BINLOG --base64-output=never suite/binlog/std_data/binlog-bug32407.000001;
|
||||
# the above line should output the query log event and then stop
|
||||
|
||||
|
||||
# Test that the following fails cleanly: "First, read a
|
||||
# Format_description event which has N event types. Then, read an
|
||||
# event of type M>N"
|
||||
--echo ==== Test non-matching FD event and Row event ====
|
||||
|
||||
# This is the Format_description_log_event from
|
||||
# binlog-bug32407.000001, encoded in base64. It contains only the old
|
||||
# row events (number of event types is 22)
|
||||
BINLOG '
|
||||
4CdYRw8BAAAAYgAAAGYAAAAAAAQANS4xLjE1LW5kYi02LjEuMjQtZGVidWctbG9nAAAAAAAAAAAA
|
||||
AAAAAAAAAAAAAAAAAADgJ1hHEzgNAAgAEgAEBAQEEgAATwAEGggICAg=
|
||||
';
|
||||
|
||||
# The following is a Write_rows_log_event with event type 23, i.e.,
|
||||
# not supported by the Format_description_log_event above. It
|
||||
# corresponds to the following query:
|
||||
# INSERT INTO t1 VALUES (5)
|
||||
error 1149;
|
||||
BINLOG '
|
||||
Dl1YRxMBAAAAKQAAADQBAAAAABAAAAAAAAAABHRlc3QAAnQxAAEDAAE=
|
||||
Dl1YRxcBAAAAIgAAAFYBAAAQABAAAAAAAAEAAf/+BQAAAA==
|
||||
';
|
||||
# the above line should fail and 5 should not be in the binlog.
|
||||
select * from t1;
|
||||
|
||||
|
||||
# clean up
|
||||
drop table t1;
|
22
mysql-test/suite/binlog/t/binlog_start_comment.test
Normal file
22
mysql-test/suite/binlog/t/binlog_start_comment.test
Normal file
|
@ -0,0 +1,22 @@
|
|||
# Test case for bug#32205 Replaying statements from mysqlbinlog fails
|
||||
# with a syntax error, replicates fine
|
||||
|
||||
-- source include/have_log_bin.inc
|
||||
reset master;
|
||||
--disable_warnings
|
||||
drop table if exists t1,t2;
|
||||
--enable_warnings
|
||||
create table t1 (word varchar(20)) -- create table t1;
|
||||
create table t2 (word varchar(20)) -- create table t2;
|
||||
load data infile '../std_data_ln/words.dat' into table t1 -- load data to t1;
|
||||
insert into t2 values ("Ada");
|
||||
flush logs;
|
||||
select * from t2;
|
||||
--exec $MYSQL_BINLOG $MYSQLTEST_VARDIR/log/master-bin.000001 > $MYSQLTEST_VARDIR/tmp/binlog_start_comment.binlog
|
||||
--exec $MYSQL < $MYSQLTEST_VARDIR/tmp/binlog_start_comment.binlog
|
||||
flush logs;
|
||||
select * from t2;
|
||||
|
||||
# clean up
|
||||
drop table t1,t2;
|
||||
--system rm $MYSQLTEST_VARDIR/tmp/binlog_start_comment.binlog
|
|
@ -19,7 +19,7 @@ eval select
|
|||
is not null;
|
||||
--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR
|
||||
eval select
|
||||
@a like "%#%error_code=0%ROLLBACK/*!*/;%ROLLBACK /* added by mysqlbinlog */;%",
|
||||
@a like "%#%error_code=0%ROLLBACK\\n/*!*/;%ROLLBACK /* added by mysqlbinlog */;%",
|
||||
@a not like "%#%error_code=%error_code=%";
|
||||
|
||||
drop table t1, t2;
|
||||
|
|
|
@ -10,3 +10,4 @@
|
|||
#
|
||||
##############################################################################
|
||||
binlog_multi_engine : Bug#32663 binlog_multi_engine.test fails randomly
|
||||
binlog_base64_flag : BUG#33247 2007-12-14 Sven: mysqlbinlog does not clean up after itself on termination. When compiled in debug mode, this test generates lots of warnings for memory leaks.
|
||||
|
|
16
mysql-test/suite/bugs/r/rpl_bug31582.result
Normal file
16
mysql-test/suite/bugs/r/rpl_bug31582.result
Normal file
|
@ -0,0 +1,16 @@
|
|||
stop slave;
|
||||
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
|
||||
reset master;
|
||||
reset slave;
|
||||
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
|
||||
start slave;
|
||||
CREATE TABLE t1 (a VARCHAR(10) PRIMARY KEY) ENGINE=MyISAM;
|
||||
INSERT INTO t1 VALUES ('a');
|
||||
UPDATE t1 SET a = 'MyISAM';
|
||||
SELECT * FROM t1 ORDER BY a;
|
||||
a
|
||||
MyISAM
|
||||
SELECT * FROM t1 ORDER BY a;
|
||||
a
|
||||
MyISAM
|
||||
DROP TABLE t1;
|
15
mysql-test/suite/bugs/r/rpl_bug31583.result
Normal file
15
mysql-test/suite/bugs/r/rpl_bug31583.result
Normal file
|
@ -0,0 +1,15 @@
|
|||
stop slave;
|
||||
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
|
||||
reset master;
|
||||
reset slave;
|
||||
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
|
||||
start slave;
|
||||
CREATE TABLE t1 ( a INT, b INT DEFAULT -3 );
|
||||
INSERT INTO t1 VALUES (1, DEFAULT);
|
||||
UPDATE t1 SET a = 3;
|
||||
SELECT * FROM t1 ORDER BY a;
|
||||
a b
|
||||
3 -3
|
||||
SELECT * FROM t1 ORDER BY a;
|
||||
a b
|
||||
3 -3
|
25
mysql-test/suite/bugs/t/rpl_bug31582.test
Normal file
25
mysql-test/suite/bugs/t/rpl_bug31582.test
Normal file
|
@ -0,0 +1,25 @@
|
|||
|
||||
# BUG#31582: 5.1-telco-6.1 -> 5.1.22. Slave crashes when reading
|
||||
# UPDATE for VARCHAR
|
||||
|
||||
# This is a problem for any update statement replicating from an old
|
||||
# server to a new server. The bug consisted of a new slave trying to
|
||||
# read two column bitmaps, but there is only one available in the old
|
||||
# format.
|
||||
|
||||
# This test case should be executed replicating from an old server to
|
||||
# a new server, so make sure you have one handy.
|
||||
|
||||
source include/master-slave.inc;
|
||||
|
||||
CREATE TABLE t1 (a VARCHAR(10) PRIMARY KEY) ENGINE=MyISAM;
|
||||
INSERT INTO t1 VALUES ('a');
|
||||
UPDATE t1 SET a = 'MyISAM';
|
||||
SELECT * FROM t1 ORDER BY a;
|
||||
sync_slave_with_master;
|
||||
SELECT * FROM t1 ORDER BY a;
|
||||
|
||||
connection master;
|
||||
DROP TABLE t1;
|
||||
sync_slave_with_master;
|
||||
|
25
mysql-test/suite/bugs/t/rpl_bug31583.test
Normal file
25
mysql-test/suite/bugs/t/rpl_bug31583.test
Normal file
|
@ -0,0 +1,25 @@
|
|||
#
|
||||
# BUG#31583: 5.1-telco-6.1 -> 5.1.22. Slave returns Error in unknown event
|
||||
|
||||
# This is a problem for any update statement replicating from an old
|
||||
# server to a new server. The bug consisted of a new slave trying to
|
||||
# read two column bitmaps, but there is only one available in the old
|
||||
# format.
|
||||
|
||||
# This test case should be executed replicating from an old server to
|
||||
# a new server, so make sure you have one handy.
|
||||
|
||||
source include/master-slave.inc;
|
||||
|
||||
CREATE TABLE t1 ( a INT, b INT DEFAULT -3 );
|
||||
|
||||
INSERT INTO t1 VALUES (1, DEFAULT);
|
||||
UPDATE t1 SET a = 3;
|
||||
SELECT * FROM t1 ORDER BY a;
|
||||
sync_slave_with_master;
|
||||
SELECT * FROM t1 ORDER BY a;
|
||||
|
||||
connection master;
|
||||
DROP TABLE t1;
|
||||
sync_slave_with_master;
|
||||
|
|
@ -15,8 +15,12 @@ COMMIT;
|
|||
show binlog events from <binlog_start>;
|
||||
Log_name Pos Event_type Server_id End_log_pos Info
|
||||
master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (1,1), (1,2), (2,1), (2,2)
|
||||
master-bin.000001 # Query # # use `test`; BEGIN
|
||||
master-bin.000001 # Query # # use `test`; INSERT INTO t2 VALUES (1,1), (1,2), (2,1), (2,2)
|
||||
master-bin.000001 # Query # # use `test`; COMMIT
|
||||
master-bin.000001 # Query # # use `test`; BEGIN
|
||||
master-bin.000001 # Query # # use `test`; UPDATE t1, t2 SET m = 2, b = 3 WHERE n = c
|
||||
master-bin.000001 # Query # # use `test`; COMMIT
|
||||
master-bin.000001 # Query # # use `test`; BEGIN
|
||||
master-bin.000001 # Query # # use `test`; INSERT INTO t3 VALUES (1,1), (1,2), (2,1), (2,2)
|
||||
master-bin.000001 # Query # # use `test`; UPDATE t1, t3 SET m = 2, e = 3 WHERE n = f
|
||||
|
|
8
mysql-test/suite/rpl/combinations
Normal file
8
mysql-test/suite/rpl/combinations
Normal file
|
@ -0,0 +1,8 @@
|
|||
[row]
|
||||
--binlog-format=row
|
||||
|
||||
[stmt]
|
||||
--binlog-format=statement
|
||||
|
||||
[mix]
|
||||
--binlog-format=mixed
|
|
@ -40,6 +40,10 @@ KEY `data` (`data`)
|
|||
/*!40019 SET @@session.max_insert_delayed_threads=0*/;
|
||||
/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;
|
||||
BINLOG '
|
||||
O1ZVRw8BAAAAZgAAAGoAAAAAAAQANS4xLjIzLXJjLWRlYnVnLWxvZwAAAAAAAAAAAAAAAAAAAAAA
|
||||
AAAAAAAAAAAAAAAAAAA7VlVHEzgNAAgAEgAEBAQEEgAAUwAEGggAAAAICAgC
|
||||
'/*!*/;
|
||||
BINLOG '
|
||||
Bk3vRhO0AQAAOAAAALcLyQkAAJlXFwIAAAAABXRyYWNrAA12aXNpdHNfZXZlbnRzAAYJAwcPDwM=
|
||||
Bk3vRhe0AQAAWgAAABEMyQkQAJlXFwIAAAEABv/AIE4AvvVDAQZN70YAK0Rvd25sb2Fkcy9NeVNR
|
||||
TC00LjEvbXlzcWwtNC4xLjEyYS13aW4zMi56aXBPaAIC
|
||||
|
|
27
mysql-test/suite/rpl/r/rpl_drop_view.result
Normal file
27
mysql-test/suite/rpl/r/rpl_drop_view.result
Normal file
|
@ -0,0 +1,27 @@
|
|||
stop slave;
|
||||
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
|
||||
reset master;
|
||||
reset slave;
|
||||
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
|
||||
start slave;
|
||||
drop table if exists t1, t2;
|
||||
drop view if exists v1, v2, v3, not_exist_view;
|
||||
create table t1 (a int);
|
||||
create table t2 (b int);
|
||||
create table t3 (c int);
|
||||
create view v1 as select * from t1;
|
||||
create view v2 as select * from t2;
|
||||
create view v3 as select * from t3;
|
||||
drop view not_exist_view;
|
||||
ERROR 42S02: Unknown table 'not_exist_view'
|
||||
drop view v1, not_exist_view;
|
||||
ERROR 42S02: Unknown table 'not_exist_view'
|
||||
select * from v1;
|
||||
ERROR 42S02: Table 'test.v1' doesn't exist
|
||||
drop view v2, v3;
|
||||
select * from v1;
|
||||
ERROR 42S02: Table 'test.v1' doesn't exist
|
||||
select * from v2;
|
||||
ERROR 42S02: Table 'test.v2' doesn't exist
|
||||
select * from v3;
|
||||
ERROR 42S02: Table 'test.v3' doesn't exist
|
|
@ -40,3 +40,16 @@ Got one of the listed errors
|
|||
SET FOREIGN_KEY_CHECKS=0;
|
||||
DROP TABLE IF EXISTS t1,t2,t3;
|
||||
SET FOREIGN_KEY_CHECKS=1;
|
||||
create table t1 (b int primary key) engine = INNODB;
|
||||
create table t2 (a int primary key, b int, foreign key (b) references t1(b))
|
||||
engine = INNODB;
|
||||
insert into t1 set b=1;
|
||||
insert into t2 set a=1, b=1;
|
||||
set foreign_key_checks=0;
|
||||
set @@session.binlog_format=row;
|
||||
delete from t1;
|
||||
must sync w/o a problem (could not with the buggy code)
|
||||
select count(*) from t1 /* must be zero */;
|
||||
count(*)
|
||||
0
|
||||
drop table t2,t1;
|
||||
|
|
|
@ -69,3 +69,158 @@ a
|
|||
Last_SQL_Error
|
||||
0
|
||||
DROP TABLE t1, t2;
|
||||
select @@global.slave_exec_mode /* must be IDEMPOTENT */;
|
||||
@@global.slave_exec_mode
|
||||
IDEMPOTENT
|
||||
create table ti1 (b int primary key) engine = innodb;
|
||||
create table ti2 (a int primary key, b int, foreign key (b) references ti1(b))
|
||||
engine = innodb;
|
||||
set foreign_key_checks=1 /* ensure the check */;
|
||||
insert into ti1 values (1),(2),(3);
|
||||
insert into ti2 set a=2, b=2;
|
||||
select * from ti1 order by b /* must be (1),(2),(3) */;
|
||||
b
|
||||
1
|
||||
2
|
||||
3
|
||||
insert into ti2 set a=1, b=1;
|
||||
select * from ti2 order by b /* must be (1,1) (2,2) */;
|
||||
a b
|
||||
1 1
|
||||
2 2
|
||||
set @save_binlog_format= @@session.binlog_format;
|
||||
set @@session.binlog_format= row;
|
||||
delete from ti1 where b=1;
|
||||
select * from ti1 order by b /* must be (2),(3) */;
|
||||
b
|
||||
2
|
||||
3
|
||||
select * from ti1 order by b /* must stays as were on master (1),(2),(3) */;
|
||||
b
|
||||
1
|
||||
2
|
||||
3
|
||||
delete from ti1 where b=3;
|
||||
insert into ti2 set a=3, b=3;
|
||||
select * from ti2 order by b /* must be (1,1),(2,2) - not inserted */;
|
||||
a b
|
||||
1 1
|
||||
2 2
|
||||
set global slave_exec_mode='IDEMPOTENT';
|
||||
set global slave_exec_mode='STRICT';
|
||||
set global slave_exec_mode='IDEMPOTENT,STRICT';
|
||||
ERROR HY000: Ambiguous slave modes combination.
|
||||
select @@global.slave_exec_mode /* must be STRICT */;
|
||||
@@global.slave_exec_mode
|
||||
STRICT
|
||||
*** foreign keys errors as above now forces to stop
|
||||
set foreign_key_checks=0;
|
||||
drop table ti2, ti1;
|
||||
create table ti1 (b int primary key) engine = innodb;
|
||||
create table ti2 (a int primary key, b int, foreign key (b) references ti1(b))
|
||||
engine = innodb;
|
||||
set foreign_key_checks=1 /* ensure the check */;
|
||||
insert into ti1 values (1),(2),(3);
|
||||
insert into ti2 set a=2, b=2;
|
||||
select * from ti1 order by b /* must be (1),(2),(3) */;
|
||||
b
|
||||
1
|
||||
2
|
||||
3
|
||||
*** conspire future problem
|
||||
insert into ti2 set a=1, b=1;
|
||||
select * from ti2 order by b /* must be (1,1) (2,2) */;
|
||||
a b
|
||||
1 1
|
||||
2 2
|
||||
delete from ti1 where b=1 /* offending delete event */;
|
||||
select * from ti1 order by b /* must be (2),(3) */;
|
||||
b
|
||||
2
|
||||
3
|
||||
*** slave must stop
|
||||
Last_SQL_Error
|
||||
0
|
||||
select * from ti1 order by b /* must be (1),(2),(3) - not deleted */;
|
||||
b
|
||||
1
|
||||
2
|
||||
3
|
||||
set foreign_key_checks= 0;
|
||||
delete from ti2 where b=1;
|
||||
set foreign_key_checks= 1;
|
||||
set global slave_exec_mode='IDEMPOTENT';
|
||||
start slave sql_thread;
|
||||
set global slave_exec_mode='STRICT';
|
||||
*** conspire the following insert failure
|
||||
*** conspire future problem
|
||||
delete from ti1 where b=3;
|
||||
insert into ti2 set a=3, b=3 /* offending write event */;
|
||||
*** slave must stop
|
||||
Last_SQL_Error
|
||||
1452
|
||||
select * from ti2 order by b /* must be (2,2) */;
|
||||
a b
|
||||
2 2
|
||||
set foreign_key_checks= 0;
|
||||
insert into ti1 set b=3;
|
||||
set foreign_key_checks= 1;
|
||||
set global slave_exec_mode='IDEMPOTENT';
|
||||
start slave sql_thread;
|
||||
set global slave_exec_mode='STRICT';
|
||||
select * from ti2 order by b /* must be (2,2),(3,3) */;
|
||||
a b
|
||||
2 2
|
||||
3 3
|
||||
*** other errors
|
||||
*** conspiring query
|
||||
insert into ti1 set b=1;
|
||||
insert into ti1 set b=1 /* offending write event */;
|
||||
*** slave must stop
|
||||
Last_SQL_Error
|
||||
1062
|
||||
set foreign_key_checks= 0;
|
||||
delete from ti1 where b=1;
|
||||
set foreign_key_checks= 1;
|
||||
set global slave_exec_mode='IDEMPOTENT';
|
||||
start slave sql_thread;
|
||||
set global slave_exec_mode='STRICT';
|
||||
CREATE TABLE t1 (a INT PRIMARY KEY);
|
||||
CREATE TABLE t2 (a INT);
|
||||
INSERT INTO t1 VALUES (-1),(-2),(-3);
|
||||
INSERT INTO t2 VALUES (-1),(-2),(-3);
|
||||
DELETE FROM t1 WHERE a = -2;
|
||||
DELETE FROM t2 WHERE a = -2;
|
||||
DELETE FROM t1 WHERE a = -2;
|
||||
*** slave must stop
|
||||
Last_SQL_Error
|
||||
1032
|
||||
set global slave_exec_mode='IDEMPOTENT';
|
||||
start slave sql_thread;
|
||||
set global slave_exec_mode='STRICT';
|
||||
DELETE FROM t2 WHERE a = -2;
|
||||
*** slave must stop
|
||||
Last_SQL_Error
|
||||
0
|
||||
set global slave_exec_mode='IDEMPOTENT';
|
||||
start slave sql_thread;
|
||||
set global slave_exec_mode='STRICT';
|
||||
UPDATE t1 SET a = 1 WHERE a = -1;
|
||||
UPDATE t2 SET a = 1 WHERE a = -1;
|
||||
UPDATE t1 SET a = 1 WHERE a = -1;
|
||||
*** slave must stop
|
||||
Last_SQL_Error
|
||||
1032
|
||||
set global slave_exec_mode='IDEMPOTENT';
|
||||
start slave sql_thread;
|
||||
set global slave_exec_mode='STRICT';
|
||||
UPDATE t2 SET a = 1 WHERE a = -1;
|
||||
*** slave must stop
|
||||
Last_SQL_Error
|
||||
0
|
||||
set global slave_exec_mode='IDEMPOTENT';
|
||||
start slave sql_thread;
|
||||
set global slave_exec_mode='STRICT';
|
||||
set @@session.binlog_format= @save_binlog_format;
|
||||
drop table t1,t2,ti2,ti1;
|
||||
*** end of tests
|
||||
|
|
|
@ -115,6 +115,7 @@ GRANT INSERT, INSERT (a), UPDATE (a), REFERENCES (a) ON `test`.`t4` TO 'mysqltes
|
|||
show grants for mysqltest4@localhost;
|
||||
Grants for mysqltest4@localhost
|
||||
GRANT USAGE ON *.* TO 'mysqltest4'@'localhost' IDENTIFIED BY PASSWORD '*196BDEDE2AE4F84CA44C47D54D78478C7E2BD7B7'
|
||||
set global slave_exec_mode='IDEMPOTENT';
|
||||
drop table t1, t4, mysqltest2.t2;
|
||||
drop database mysqltest2;
|
||||
delete from mysql.user where user like "mysqltest%";
|
||||
|
@ -132,6 +133,7 @@ INSERT INTO t5 (word) VALUES ('TEST’');
|
|||
SELECT HEX(word) FROM t5;
|
||||
HEX(word)
|
||||
54455354E28099
|
||||
set @@global.slave_exec_mode= default;
|
||||
SELECT HEX(word) FROM t5;
|
||||
HEX(word)
|
||||
54455354E28099
|
||||
|
|
|
@ -835,108 +835,158 @@ master-bin.000001 # Format_desc 1 # Server ver: #
|
|||
master-bin.000001 # Query 1 # CREATE DATABASE test_rpl
|
||||
master-bin.000001 # Query 1 # use `test_rpl`; CREATE TABLE t1 (a int auto_increment not null, b char(254), PRIMARY KEY(a)) ENGINE=innodb
|
||||
master-bin.000001 # Query 1 # use `test_rpl`; CREATE TABLE t2 (a int auto_increment not null, b char(254), PRIMARY KEY(a)) ENGINE=innodb
|
||||
master-bin.000001 # Query 1 # use `test_rpl`; BEGIN
|
||||
master-bin.000001 # Query 1 # use `test_rpl`; INSERT INTO t1 VALUES(1, 't1, text 1')
|
||||
master-bin.000001 # Xid 1 # #
|
||||
master-bin.000001 # Query 1 # use `test_rpl`; BEGIN
|
||||
master-bin.000001 # Query 1 # use `test_rpl`; INSERT INTO t1 VALUES(2, 't1, text 2')
|
||||
master-bin.000001 # Xid 1 # #
|
||||
master-bin.000001 # Query 1 # use `test_rpl`; BEGIN
|
||||
master-bin.000001 # Query 1 # use `test_rpl`; INSERT INTO t2 VALUES(1, 't2, text 1')
|
||||
master-bin.000001 # Xid 1 # #
|
||||
master-bin.000001 # Query 1 # use `test_rpl`; BEGIN
|
||||
master-bin.000001 # Query 1 # use `test_rpl`; DELETE FROM t1 WHERE a = 1
|
||||
master-bin.000001 # Xid 1 # #
|
||||
master-bin.000001 # Query 1 # use `test_rpl`; BEGIN
|
||||
master-bin.000001 # Table_map 1 # table_id: # (test_rpl.t2)
|
||||
master-bin.000001 # Delete_rows 1 # table_id: # flags: STMT_END_F
|
||||
master-bin.000001 # Xid 1 # #
|
||||
master-bin.000001 # Query 1 # use `test_rpl`; BEGIN
|
||||
master-bin.000001 # Query 1 # use `test_rpl`; DELETE FROM t1
|
||||
master-bin.000001 # Xid 1 # #
|
||||
master-bin.000001 # Query 1 # use `test_rpl`; BEGIN
|
||||
master-bin.000001 # Query 1 # use `test_rpl`; DELETE FROM t2
|
||||
master-bin.000001 # Xid 1 # #
|
||||
master-bin.000001 # Query 1 # use `test_rpl`; BEGIN
|
||||
master-bin.000001 # Query 1 # use `test_rpl`; INSERT INTO t1 VALUES(1, 't1, text 1')
|
||||
master-bin.000001 # Xid 1 # #
|
||||
master-bin.000001 # Query 1 # use `test_rpl`; BEGIN
|
||||
master-bin.000001 # Table_map 1 # table_id: # (test_rpl.t1)
|
||||
master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
|
||||
master-bin.000001 # Xid 1 # #
|
||||
master-bin.000001 # Query 1 # use `test_rpl`; BEGIN
|
||||
master-bin.000001 # Query 1 # use `test_rpl`; INSERT INTO t2 SELECT * FROM t1
|
||||
master-bin.000001 # Xid 1 # #
|
||||
master-bin.000001 # Query 1 # use `test_rpl`; BEGIN
|
||||
master-bin.000001 # Query 1 # use `test_rpl`; INSERT INTO t2 VALUES (1, 't1, text 1') ON DUPLICATE KEY UPDATE b = 't2, text 1'
|
||||
master-bin.000001 # Xid 1 # #
|
||||
master-bin.000001 # Query 1 # use `test_rpl`; BEGIN
|
||||
master-bin.000001 # Query 1 # use `test_rpl`; DELETE FROM t1 WHERE a = 2
|
||||
master-bin.000001 # Xid 1 # #
|
||||
master-bin.000001 # Query 1 # use `test_rpl`; BEGIN
|
||||
master-bin.000001 # Query 1 # use `test_rpl`; DELETE FROM t2 WHERE a = 2
|
||||
master-bin.000001 # Xid 1 # #
|
||||
master-bin.000001 # Query 1 # use `test_rpl`; BEGIN
|
||||
master-bin.000001 # Query 1 # use `test_rpl`; DELETE FROM t1
|
||||
master-bin.000001 # Xid 1 # #
|
||||
master-bin.000001 # Query 1 # use `test_rpl`; BEGIN
|
||||
master-bin.000001 # Query 1 # use `test_rpl`; DELETE FROM t2
|
||||
master-bin.000001 # Xid 1 # #
|
||||
master-bin.000001 # Query 1 # use `test_rpl`; BEGIN
|
||||
master-bin.000001 # Begin_load_query 1 # ;file_id=#;block_len=#
|
||||
master-bin.000001 # Execute_load_query 1 # use `test_rpl`; LOAD DATA INFILE '../tmp/rpl_mixed.dat' INTO TABLE t1 FIELDS TERMINATED BY '|' ;file_id=#
|
||||
master-bin.000001 # Xid 1 # #
|
||||
master-bin.000001 # Query 1 # use `test_rpl`; BEGIN
|
||||
master-bin.000001 # Query 1 # use `test_rpl`; DELETE FROM t1
|
||||
master-bin.000001 # Xid 1 # #
|
||||
master-bin.000001 # Query 1 # use `test_rpl`; BEGIN
|
||||
master-bin.000001 # Query 1 # use `test_rpl`; DELETE FROM t2
|
||||
master-bin.000001 # Xid 1 # #
|
||||
master-bin.000001 # Query 1 # use `test_rpl`; BEGIN
|
||||
master-bin.000001 # Query 1 # use `test_rpl`; INSERT INTO t1 VALUES(1, 't1, text 1')
|
||||
master-bin.000001 # Xid 1 # #
|
||||
master-bin.000001 # Query 1 # use `test_rpl`; BEGIN
|
||||
master-bin.000001 # Query 1 # use `test_rpl`; INSERT INTO t1 VALUES(2, 't1, text 2')
|
||||
master-bin.000001 # Xid 1 # #
|
||||
master-bin.000001 # Query 1 # use `test_rpl`; BEGIN
|
||||
master-bin.000001 # Query 1 # use `test_rpl`; INSERT INTO t1 VALUES(3, 't1, text 3')
|
||||
master-bin.000001 # Xid 1 # #
|
||||
master-bin.000001 # Query 1 # use `test_rpl`; BEGIN
|
||||
master-bin.000001 # Query 1 # use `test_rpl`; REPLACE INTO t1 VALUES(1, 't1, text 11')
|
||||
master-bin.000001 # Xid 1 # #
|
||||
master-bin.000001 # Query 1 # use `test_rpl`; BEGIN
|
||||
master-bin.000001 # Table_map 1 # table_id: # (test_rpl.t1)
|
||||
master-bin.000001 # Update_rows 1 # table_id: # flags: STMT_END_F
|
||||
master-bin.000001 # Xid 1 # #
|
||||
master-bin.000001 # Query 1 # use `test_rpl`; BEGIN
|
||||
master-bin.000001 # Query 1 # use `test_rpl`; REPLACE INTO t1 SET a=3, b='t1, text 33'
|
||||
master-bin.000001 # Xid 1 # #
|
||||
master-bin.000001 # Query 1 # use `test_rpl`; BEGIN
|
||||
master-bin.000001 # Query 1 # use `test_rpl`; DELETE FROM t1 WHERE a = 2
|
||||
master-bin.000001 # Xid 1 # #
|
||||
master-bin.000001 # Query 1 # use `test_rpl`; BEGIN
|
||||
master-bin.000001 # Query 1 # use `test_rpl`; DELETE FROM t1
|
||||
master-bin.000001 # Xid 1 # #
|
||||
master-bin.000001 # Query 1 # use `test_rpl`; BEGIN
|
||||
master-bin.000001 # Query 1 # use `test_rpl`; DELETE FROM t2
|
||||
master-bin.000001 # Xid 1 # #
|
||||
master-bin.000001 # Query 1 # use `test_rpl`; BEGIN
|
||||
master-bin.000001 # Query 1 # use `test_rpl`; INSERT INTO t1 VALUES(1, 't1, text 1')
|
||||
master-bin.000001 # Xid 1 # #
|
||||
master-bin.000001 # Query 1 # use `test_rpl`; BEGIN
|
||||
master-bin.000001 # Query 1 # use `test_rpl`; DELETE FROM t1
|
||||
master-bin.000001 # Xid 1 # #
|
||||
master-bin.000001 # Query 1 # use `test_rpl`; BEGIN
|
||||
master-bin.000001 # Query 1 # use `test_rpl`; DELETE FROM t2
|
||||
master-bin.000001 # Xid 1 # #
|
||||
master-bin.000001 # Query 1 # use `test_rpl`; BEGIN
|
||||
master-bin.000001 # Query 1 # use `test_rpl`; INSERT INTO t1 VALUES(1, 'CCC')
|
||||
master-bin.000001 # Xid 1 # #
|
||||
master-bin.000001 # Query 1 # use `test_rpl`; BEGIN
|
||||
master-bin.000001 # Query 1 # use `test_rpl`; INSERT INTO t1 VALUES(2, 'DDD')
|
||||
master-bin.000001 # Xid 1 # #
|
||||
master-bin.000001 # Query 1 # use `test_rpl`; BEGIN
|
||||
master-bin.000001 # Query 1 # use `test_rpl`; INSERT INTO t2 VALUES(1, 'DDD')
|
||||
master-bin.000001 # Xid 1 # #
|
||||
master-bin.000001 # Query 1 # use `test_rpl`; BEGIN
|
||||
master-bin.000001 # Query 1 # use `test_rpl`; INSERT INTO t2 VALUES(2, 'CCC')
|
||||
master-bin.000001 # Xid 1 # #
|
||||
master-bin.000001 # Query 1 # use `test_rpl`; BEGIN
|
||||
master-bin.000001 # Query 1 # use `test_rpl`; DELETE FROM t1
|
||||
master-bin.000001 # Xid 1 # #
|
||||
master-bin.000001 # Query 1 # use `test_rpl`; BEGIN
|
||||
master-bin.000001 # Query 1 # use `test_rpl`; DELETE FROM t2
|
||||
master-bin.000001 # Xid 1 # #
|
||||
master-bin.000001 # Query 1 # use `test_rpl`; BEGIN
|
||||
master-bin.000001 # Query 1 # use `test_rpl`; INSERT INTO t1 VALUES(1, 't1, text 1')
|
||||
master-bin.000001 # Xid 1 # #
|
||||
master-bin.000001 # Query 1 # use `test_rpl`; BEGIN
|
||||
master-bin.000001 # Query 1 # use `test_rpl`; INSERT INTO t2 VALUES(1, 't2, text 1')
|
||||
master-bin.000001 # Xid 1 # #
|
||||
master-bin.000001 # Query 1 # use `test_rpl`; BEGIN
|
||||
master-bin.000001 # Query 1 # use `test_rpl`; DELETE FROM t1
|
||||
master-bin.000001 # Xid 1 # #
|
||||
master-bin.000001 # Query 1 # use `test_rpl`; BEGIN
|
||||
master-bin.000001 # Query 1 # use `test_rpl`; DELETE FROM t2
|
||||
master-bin.000001 # Xid 1 # #
|
||||
master-bin.000001 # Query 1 # use `test_rpl`; BEGIN
|
||||
master-bin.000001 # Query 1 # use `test_rpl`; INSERT INTO t1 VALUES(1, 't1, text 1')
|
||||
master-bin.000001 # Xid 1 # #
|
||||
master-bin.000001 # Query 1 # use `test_rpl`; BEGIN
|
||||
master-bin.000001 # Query 1 # use `test_rpl`; TRUNCATE t1
|
||||
master-bin.000001 # Xid 1 # #
|
||||
master-bin.000001 # Query 1 # use `test_rpl`; BEGIN
|
||||
master-bin.000001 # Query 1 # use `test_rpl`; DELETE FROM t1
|
||||
master-bin.000001 # Xid 1 # #
|
||||
master-bin.000001 # Query 1 # use `test_rpl`; BEGIN
|
||||
master-bin.000001 # Query 1 # use `test_rpl`; DELETE FROM t2
|
||||
master-bin.000001 # Xid 1 # #
|
||||
master-bin.000001 # Query 1 # use `test_rpl`; BEGIN
|
||||
master-bin.000001 # Query 1 # use `test_rpl`; INSERT INTO t1 VALUES(1, 't1, text 1')
|
||||
master-bin.000001 # Xid 1 # #
|
||||
master-bin.000001 # Query 1 # use `test_rpl`; BEGIN
|
||||
master-bin.000001 # Query 1 # use `test_rpl`; INSERT INTO t2 VALUES(1, 't2, text 1')
|
||||
master-bin.000001 # Xid 1 # #
|
||||
master-bin.000001 # Query 1 # use `test_rpl`; BEGIN
|
||||
master-bin.000001 # Query 1 # use `test_rpl`; UPDATE t1 SET b = 't1, text 1 updated' WHERE a = 1
|
||||
master-bin.000001 # Xid 1 # #
|
||||
master-bin.000001 # Query 1 # use `test_rpl`; BEGIN
|
||||
master-bin.000001 # Query 1 # use `test_rpl`; UPDATE t1, t2 SET t1.b = 'test', t2.b = 'test'
|
||||
master-bin.000001 # Xid 1 # #
|
||||
master-bin.000001 # Query 1 # use `test_rpl`; BEGIN
|
||||
master-bin.000001 # Query 1 # use `test_rpl`; DELETE FROM t1
|
||||
master-bin.000001 # Xid 1 # #
|
||||
master-bin.000001 # Query 1 # use `test_rpl`; BEGIN
|
||||
master-bin.000001 # Query 1 # use `test_rpl`; DELETE FROM t2
|
||||
master-bin.000001 # Xid 1 # #
|
||||
master-bin.000001 # Query 1 # use `test_rpl`; BEGIN
|
||||
|
@ -952,10 +1002,13 @@ master-bin.000001 # Query 1 # use `test_rpl`; INSERT INTO t1 VALUES (6, 'after s
|
|||
master-bin.000001 # Table_map 1 # table_id: # (test_rpl.t1)
|
||||
master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
|
||||
master-bin.000001 # Xid 1 # #
|
||||
master-bin.000001 # Query 1 # use `test_rpl`; BEGIN
|
||||
master-bin.000001 # Query 1 # use `test_rpl`; DELETE FROM t1 WHERE a = 7
|
||||
master-bin.000001 # Xid 1 # #
|
||||
master-bin.000001 # Query 1 # use `test_rpl`; BEGIN
|
||||
master-bin.000001 # Query 1 # use `test_rpl`; DELETE FROM t1
|
||||
master-bin.000001 # Xid 1 # #
|
||||
master-bin.000001 # Query 1 # use `test_rpl`; BEGIN
|
||||
master-bin.000001 # Query 1 # use `test_rpl`; DELETE FROM t2
|
||||
master-bin.000001 # Xid 1 # #
|
||||
master-bin.000001 # Query 1 # use `test_rpl`; CREATE USER 'user_test_rpl'@'localhost' IDENTIFIED BY PASSWORD '*1111111111111111111111111111111111111111'
|
||||
|
@ -964,6 +1017,7 @@ master-bin.000001 # Query 1 # use `test_rpl`; REVOKE SELECT ON *.* FROM 'user_te
|
|||
master-bin.000001 # Query 1 # use `test_rpl`; SET PASSWORD FOR 'user_test_rpl'@'localhost'='*0000000000000000000000000000000000000000'
|
||||
master-bin.000001 # Query 1 # use `test_rpl`; RENAME USER 'user_test_rpl'@'localhost' TO 'user_test_rpl_2'@'localhost'
|
||||
master-bin.000001 # Query 1 # use `test_rpl`; DROP USER 'user_test_rpl_2'@'localhost'
|
||||
master-bin.000001 # Query 1 # use `test_rpl`; BEGIN
|
||||
master-bin.000001 # Query 1 # use `test_rpl`; INSERT INTO t1 VALUES(100, 'test')
|
||||
master-bin.000001 # Xid 1 # #
|
||||
master-bin.000001 # Query 1 # use `test_rpl`; ANALYZE TABLE t1
|
||||
|
@ -977,50 +1031,65 @@ master-bin.000001 # Query 1 # use `test_rpl`; CREATE DEFINER=`root`@`localhost`
|
|||
BEGIN
|
||||
UPDATE t1 SET b = UUID() WHERE a = 202;
|
||||
END
|
||||
master-bin.000001 # Query 1 # use `test_rpl`; BEGIN
|
||||
master-bin.000001 # Query 1 # use `test_rpl`; INSERT INTO t1 VALUES(201, 'test 201')
|
||||
master-bin.000001 # Xid 1 # #
|
||||
master-bin.000001 # Query 1 # use `test_rpl`; BEGIN
|
||||
master-bin.000001 # Query 1 # use `test_rpl`; UPDATE t1 SET b = 'test' WHERE a = 201
|
||||
master-bin.000001 # Xid 1 # #
|
||||
master-bin.000001 # Query 1 # use `test_rpl`; BEGIN
|
||||
master-bin.000001 # Query 1 # use `test_rpl`; INSERT INTO t1 VALUES(202, 'test 202')
|
||||
master-bin.000001 # Xid 1 # #
|
||||
master-bin.000001 # Query 1 # use `test_rpl`; BEGIN
|
||||
master-bin.000001 # Table_map 1 # table_id: # (test_rpl.t1)
|
||||
master-bin.000001 # Update_rows 1 # table_id: # flags: STMT_END_F
|
||||
master-bin.000001 # Xid 1 # #
|
||||
master-bin.000001 # Query 1 # use `test_rpl`; BEGIN
|
||||
master-bin.000001 # Query 1 # use `test_rpl`; DELETE FROM t1 WHERE a = 202
|
||||
master-bin.000001 # Xid 1 # #
|
||||
master-bin.000001 # Query 1 # use `test_rpl`; ALTER PROCEDURE p1 COMMENT 'p1'
|
||||
master-bin.000001 # Query 1 # use `test_rpl`; DROP PROCEDURE p1
|
||||
master-bin.000001 # Query 1 # use `test_rpl`; DROP PROCEDURE p2
|
||||
master-bin.000001 # Query 1 # use `test_rpl`; BEGIN
|
||||
master-bin.000001 # Query 1 # use `test_rpl`; DELETE FROM t1
|
||||
master-bin.000001 # Xid 1 # #
|
||||
master-bin.000001 # Query 1 # use `test_rpl`; BEGIN
|
||||
master-bin.000001 # Query 1 # use `test_rpl`; DELETE FROM t2
|
||||
master-bin.000001 # Xid 1 # #
|
||||
master-bin.000001 # Query 1 # use `test_rpl`; CREATE DEFINER=`root`@`localhost` TRIGGER tr1 BEFORE INSERT ON t1
|
||||
FOR EACH ROW BEGIN
|
||||
INSERT INTO t2 SET a = NEW.a, b = NEW.b;
|
||||
END
|
||||
master-bin.000001 # Query 1 # use `test_rpl`; BEGIN
|
||||
master-bin.000001 # Table_map 1 # table_id: # (test_rpl.t1)
|
||||
master-bin.000001 # Table_map 1 # table_id: # (test_rpl.t2)
|
||||
master-bin.000001 # Write_rows 1 # table_id: #
|
||||
master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
|
||||
master-bin.000001 # Xid 1 # #
|
||||
master-bin.000001 # Query 1 # use `test_rpl`; BEGIN
|
||||
master-bin.000001 # Query 1 # use `test_rpl`; DELETE FROM t1
|
||||
master-bin.000001 # Xid 1 # #
|
||||
master-bin.000001 # Query 1 # use `test_rpl`; BEGIN
|
||||
master-bin.000001 # Query 1 # use `test_rpl`; DELETE FROM t2
|
||||
master-bin.000001 # Xid 1 # #
|
||||
master-bin.000001 # Query 1 # use `test_rpl`; DROP TRIGGER tr1
|
||||
master-bin.000001 # Query 1 # use `test_rpl`; GRANT EVENT ON *.* TO 'root'@'localhost'
|
||||
master-bin.000001 # Query 1 # use `test_rpl`; BEGIN
|
||||
master-bin.000001 # Query 1 # use `test_rpl`; INSERT INTO t1 VALUES(1, 'test1')
|
||||
master-bin.000001 # Xid 1 # #
|
||||
master-bin.000001 # Query 1 # use `test_rpl`; CREATE EVENT e1 ON SCHEDULE EVERY '1' SECOND COMMENT 'e_second_comment' DO DELETE FROM t1
|
||||
master-bin.000001 # Query 1 # use `test_rpl`; ALTER EVENT e1 RENAME TO e2
|
||||
master-bin.000001 # Query 1 # use `test_rpl`; DROP EVENT e2
|
||||
master-bin.000001 # Query 1 # use `test_rpl`; BEGIN
|
||||
master-bin.000001 # Query 1 # use `test_rpl`; DELETE FROM t1
|
||||
master-bin.000001 # Xid 1 # #
|
||||
master-bin.000001 # Query 1 # use `test_rpl`; BEGIN
|
||||
master-bin.000001 # Query 1 # use `test_rpl`; DELETE FROM t2
|
||||
master-bin.000001 # Xid 1 # #
|
||||
master-bin.000001 # Query 1 # use `test_rpl`; BEGIN
|
||||
master-bin.000001 # Query 1 # use `test_rpl`; INSERT INTO t1 VALUES(1, 'test1')
|
||||
master-bin.000001 # Xid 1 # #
|
||||
master-bin.000001 # Query 1 # use `test_rpl`; BEGIN
|
||||
master-bin.000001 # Query 1 # use `test_rpl`; INSERT INTO t1 VALUES(2, 'test2')
|
||||
master-bin.000001 # Xid 1 # #
|
||||
master-bin.000001 # Query 1 # use `test_rpl`; CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS SELECT * FROM t1 WHERE a = 1
|
||||
|
@ -1028,8 +1097,10 @@ master-bin.000001 # Query 1 # use `test_rpl`; CREATE ALGORITHM=UNDEFINED DEFINER
|
|||
master-bin.000001 # Query 1 # use `test_rpl`; ALTER ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS SELECT * FROM t1 WHERE a = 2
|
||||
master-bin.000001 # Query 1 # use `test_rpl`; DROP VIEW v1
|
||||
master-bin.000001 # Query 1 # use `test_rpl`; DROP VIEW v2
|
||||
master-bin.000001 # Query 1 # use `test_rpl`; BEGIN
|
||||
master-bin.000001 # Query 1 # use `test_rpl`; DELETE FROM t1
|
||||
master-bin.000001 # Xid 1 # #
|
||||
master-bin.000001 # Query 1 # use `test_rpl`; BEGIN
|
||||
master-bin.000001 # Query 1 # use `test_rpl`; DELETE FROM t2
|
||||
master-bin.000001 # Xid 1 # #
|
||||
drop database test_rpl;
|
||||
|
|
|
@ -116,23 +116,23 @@ t12
|
|||
t13
|
||||
t2
|
||||
t3
|
||||
SELECT table_name FROM information_schema.views WHERE table_schema='test';
|
||||
SELECT table_name FROM information_schema.views WHERE table_schema='test' ORDER BY table_name;
|
||||
table_name
|
||||
v1
|
||||
v11
|
||||
SELECT trigger_name, event_manipulation, event_object_table FROM information_schema.triggers WHERE trigger_schema='test';
|
||||
SELECT trigger_name, event_manipulation, event_object_table FROM information_schema.triggers WHERE trigger_schema='test' ORDER BY trigger_name;
|
||||
trigger_name event_manipulation event_object_table
|
||||
t1_tr1 INSERT t1
|
||||
t1_tr2 UPDATE t1
|
||||
t11_tr1 INSERT t11
|
||||
t11_tr2 UPDATE t11
|
||||
SELECT routine_type, routine_name FROM information_schema.routines WHERE routine_schema='test';
|
||||
t1_tr1 INSERT t1
|
||||
t1_tr2 UPDATE t1
|
||||
SELECT routine_type, routine_name FROM information_schema.routines WHERE routine_schema='test' ORDER BY routine_name;
|
||||
routine_type routine_name
|
||||
FUNCTION f1
|
||||
FUNCTION f2
|
||||
PROCEDURE p1
|
||||
PROCEDURE p11
|
||||
SELECT event_name, status FROM information_schema.events WHERE event_schema='test';
|
||||
SELECT event_name, status FROM information_schema.events WHERE event_schema='test' ORDER BY event_name;
|
||||
event_name status
|
||||
e1 DISABLED
|
||||
e11 DISABLED
|
||||
|
@ -276,23 +276,23 @@ t12
|
|||
t13
|
||||
t2
|
||||
t3
|
||||
SELECT table_name FROM information_schema.views WHERE table_schema='test';
|
||||
SELECT table_name FROM information_schema.views WHERE table_schema='test' ORDER BY table_name;
|
||||
table_name
|
||||
v1
|
||||
v11
|
||||
SELECT trigger_name, event_manipulation, event_object_table FROM information_schema.triggers WHERE trigger_schema='test';
|
||||
SELECT trigger_name, event_manipulation, event_object_table FROM information_schema.triggers WHERE trigger_schema='test' ORDER BY trigger_name;
|
||||
trigger_name event_manipulation event_object_table
|
||||
t1_tr1 INSERT t1
|
||||
t1_tr2 UPDATE t1
|
||||
t11_tr1 INSERT t11
|
||||
t11_tr2 UPDATE t11
|
||||
SELECT routine_type, routine_name FROM information_schema.routines WHERE routine_schema='test';
|
||||
t1_tr1 INSERT t1
|
||||
t1_tr2 UPDATE t1
|
||||
SELECT routine_type, routine_name FROM information_schema.routines WHERE routine_schema='test' ORDER BY routine_name;
|
||||
routine_type routine_name
|
||||
FUNCTION f1
|
||||
FUNCTION f2
|
||||
PROCEDURE p1
|
||||
PROCEDURE p11
|
||||
SELECT event_name, status FROM information_schema.events WHERE event_schema='test';
|
||||
SELECT event_name, status FROM information_schema.events WHERE event_schema='test' ORDER BY event_name;
|
||||
event_name status
|
||||
e1 SLAVESIDE_DISABLED
|
||||
e11 SLAVESIDE_DISABLED
|
||||
|
|
|
@ -257,6 +257,7 @@ SELECT * FROM t1 ORDER BY a;
|
|||
a b
|
||||
2 master,slave
|
||||
5 slave
|
||||
set @@global.slave_exec_mode= 'IDEMPOTENT';
|
||||
**** On Master ****
|
||||
UPDATE t1 SET a = 5, b = 'master' WHERE a = 1;
|
||||
SELECT * FROM t1 ORDER BY a;
|
||||
|
@ -264,6 +265,7 @@ a b
|
|||
2 master,slave
|
||||
5 master
|
||||
**** On Slave ****
|
||||
set @@global.slave_exec_mode= default;
|
||||
Last_SQL_Error
|
||||
|
||||
SELECT * FROM t1 ORDER BY a;
|
||||
|
|
|
@ -370,6 +370,7 @@ C1 C2
|
|||
1 3
|
||||
2 6
|
||||
3 9
|
||||
set @@global.slave_exec_mode= 'IDEMPOTENT';
|
||||
--- on master: new values inserted ---
|
||||
INSERT INTO t7 VALUES (1,2), (2,4), (3,6);
|
||||
SELECT * FROM t7 ORDER BY C1;
|
||||
|
@ -377,6 +378,7 @@ C1 C2
|
|||
1 2
|
||||
2 4
|
||||
3 6
|
||||
set @@global.slave_exec_mode= default;
|
||||
--- on slave: old values should be overwritten by replicated values ---
|
||||
SELECT * FROM t7 ORDER BY C1;
|
||||
C1 C2
|
||||
|
@ -406,8 +408,10 @@ a b c
|
|||
2 4 6
|
||||
3 6 9
|
||||
99 99 99
|
||||
set @@global.slave_exec_mode= 'IDEMPOTENT';
|
||||
--- on master ---
|
||||
INSERT INTO t8 VALUES (2,4,8);
|
||||
set @@global.slave_exec_mode= default;
|
||||
--- on slave ---
|
||||
SELECT * FROM t8 ORDER BY a;
|
||||
a b c
|
||||
|
@ -426,10 +430,12 @@ START SLAVE;
|
|||
**** On Master ****
|
||||
INSERT INTO t1 VALUES ('K','K'), ('L','L'), ('M','M');
|
||||
**** On Master ****
|
||||
set @@global.slave_exec_mode= 'IDEMPOTENT';
|
||||
DELETE FROM t1 WHERE C1 = 'L';
|
||||
DELETE FROM t1;
|
||||
SELECT COUNT(*) FROM t1 ORDER BY c1,c2;
|
||||
COUNT(*) 0
|
||||
set @@global.slave_exec_mode= default;
|
||||
Last_SQL_Error
|
||||
0
|
||||
SELECT COUNT(*) FROM t1 ORDER BY c1,c2;
|
||||
|
|
|
@ -370,6 +370,7 @@ C1 C2
|
|||
1 3
|
||||
2 6
|
||||
3 9
|
||||
set @@global.slave_exec_mode= 'IDEMPOTENT';
|
||||
--- on master: new values inserted ---
|
||||
INSERT INTO t7 VALUES (1,2), (2,4), (3,6);
|
||||
SELECT * FROM t7 ORDER BY C1;
|
||||
|
@ -377,6 +378,7 @@ C1 C2
|
|||
1 2
|
||||
2 4
|
||||
3 6
|
||||
set @@global.slave_exec_mode= default;
|
||||
--- on slave: old values should be overwritten by replicated values ---
|
||||
SELECT * FROM t7 ORDER BY C1;
|
||||
C1 C2
|
||||
|
@ -406,8 +408,10 @@ a b c
|
|||
2 4 6
|
||||
3 6 9
|
||||
99 99 99
|
||||
set @@global.slave_exec_mode= 'IDEMPOTENT';
|
||||
--- on master ---
|
||||
INSERT INTO t8 VALUES (2,4,8);
|
||||
set @@global.slave_exec_mode= default;
|
||||
--- on slave ---
|
||||
SELECT * FROM t8 ORDER BY a;
|
||||
a b c
|
||||
|
@ -426,10 +430,12 @@ START SLAVE;
|
|||
**** On Master ****
|
||||
INSERT INTO t1 VALUES ('K','K'), ('L','L'), ('M','M');
|
||||
**** On Master ****
|
||||
set @@global.slave_exec_mode= 'IDEMPOTENT';
|
||||
DELETE FROM t1 WHERE C1 = 'L';
|
||||
DELETE FROM t1;
|
||||
SELECT COUNT(*) FROM t1 ORDER BY c1,c2;
|
||||
COUNT(*) 0
|
||||
set @@global.slave_exec_mode= default;
|
||||
Last_SQL_Error
|
||||
0
|
||||
SELECT COUNT(*) FROM t1 ORDER BY c1,c2;
|
||||
|
|
|
@ -118,37 +118,49 @@ master-bin.000001 # Query # # create database mysqltest3
|
|||
master-bin.000001 # Query # # drop database mysqltest3
|
||||
master-bin.000001 # Query # # create database mysqltest3
|
||||
master-bin.000001 # Query # # use `mysqltest2`; create table t1 (a int auto_increment primary key, b varchar(100))engine=innodb
|
||||
master-bin.000001 # Query # # use `mysqltest2`; BEGIN
|
||||
master-bin.000001 # Table_map # # table_id: # (mysqltest2.t1)
|
||||
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
|
||||
master-bin.000001 # Xid # # COMMIT /* XID */
|
||||
master-bin.000001 # Query # # use `mysqltest2`; BEGIN
|
||||
master-bin.000001 # Table_map # # table_id: # (mysqltest2.t1)
|
||||
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
|
||||
master-bin.000001 # Xid # # COMMIT /* XID */
|
||||
master-bin.000001 # Query # # use `mysqltest2`; BEGIN
|
||||
master-bin.000001 # Table_map # # table_id: # (mysqltest2.t1)
|
||||
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
|
||||
master-bin.000001 # Xid # # COMMIT /* XID */
|
||||
master-bin.000001 # Query # # use `mysqltest2`; BEGIN
|
||||
master-bin.000001 # Table_map # # table_id: # (mysqltest2.t1)
|
||||
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
|
||||
master-bin.000001 # Xid # # COMMIT /* XID */
|
||||
master-bin.000001 # Query # # use `mysqltest2`; BEGIN
|
||||
master-bin.000001 # Table_map # # table_id: # (mysqltest2.t1)
|
||||
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
|
||||
master-bin.000001 # Xid # # COMMIT /* XID */
|
||||
master-bin.000001 # Query # # use `mysqltest2`; BEGIN
|
||||
master-bin.000001 # Query # # use `mysqltest2`; truncate table t1
|
||||
master-bin.000001 # Xid # # COMMIT /* XID */
|
||||
master-bin.000001 # Query # # use `mysqltest2`; BEGIN
|
||||
master-bin.000001 # Table_map # # table_id: # (mysqltest2.t1)
|
||||
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
|
||||
master-bin.000001 # Xid # # COMMIT /* XID */
|
||||
master-bin.000001 # Query # # use `mysqltest2`; BEGIN
|
||||
master-bin.000001 # Table_map # # table_id: # (mysqltest2.t1)
|
||||
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
|
||||
master-bin.000001 # Xid # # COMMIT /* XID */
|
||||
master-bin.000001 # Query # # use `mysqltest2`; BEGIN
|
||||
master-bin.000001 # Table_map # # table_id: # (mysqltest2.t1)
|
||||
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
|
||||
master-bin.000001 # Xid # # COMMIT /* XID */
|
||||
master-bin.000001 # Query # # use `mysqltest2`; BEGIN
|
||||
master-bin.000001 # Table_map # # table_id: # (mysqltest2.t1)
|
||||
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
|
||||
master-bin.000001 # Xid # # COMMIT /* XID */
|
||||
master-bin.000001 # Query # # use `mysqltest2`; BEGIN
|
||||
master-bin.000001 # Query # # use `mysqltest2`; truncate table t1
|
||||
master-bin.000001 # Xid # # COMMIT /* XID */
|
||||
master-bin.000001 # Query # # use `mysqltest2`; BEGIN
|
||||
master-bin.000001 # Table_map # # table_id: # (mysqltest2.t1)
|
||||
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
|
||||
master-bin.000001 # Xid # # COMMIT /* XID */
|
||||
|
|
|
@ -127,7 +127,7 @@ NULL 5 10
|
|||
NULL 6 12
|
||||
CREATE TABLE t7 (UNIQUE(b)) SELECT a,b FROM tt3;
|
||||
ERROR 23000: Duplicate entry '2' for key 'b'
|
||||
SHOW BINLOG EVENTS FROM 1100;
|
||||
SHOW BINLOG EVENTS FROM 1374;
|
||||
Log_name Pos Event_type Server_id End_log_pos Info
|
||||
CREATE TABLE t7 (a INT, b INT UNIQUE);
|
||||
INSERT INTO t7 SELECT a,b FROM tt3;
|
||||
|
@ -137,11 +137,11 @@ a b
|
|||
1 2
|
||||
2 4
|
||||
3 6
|
||||
SHOW BINLOG EVENTS FROM 1100;
|
||||
SHOW BINLOG EVENTS FROM 1374;
|
||||
Log_name Pos Event_type Server_id End_log_pos Info
|
||||
# 1100 Query # 1200 use `test`; CREATE TABLE t7 (a INT, b INT UNIQUE)
|
||||
# 1200 Table_map # 1242 table_id: # (test.t7)
|
||||
# 1242 Write_rows # 1298 table_id: # flags: STMT_END_F
|
||||
# 1374 Query # 1474 use `test`; CREATE TABLE t7 (a INT, b INT UNIQUE)
|
||||
# 1474 Table_map # 1516 table_id: # (test.t7)
|
||||
# 1516 Write_rows # 1572 table_id: # flags: STMT_END_F
|
||||
SELECT * FROM t7 ORDER BY a,b;
|
||||
a b
|
||||
1 2
|
||||
|
@ -154,10 +154,10 @@ INSERT INTO t7 SELECT a,b FROM tt4;
|
|||
ROLLBACK;
|
||||
Warnings:
|
||||
Warning 1196 Some non-transactional changed tables couldn't be rolled back
|
||||
SHOW BINLOG EVENTS FROM 1298;
|
||||
SHOW BINLOG EVENTS FROM 1572;
|
||||
Log_name Pos Event_type Server_id End_log_pos Info
|
||||
# 1298 Table_map # 1340 table_id: # (test.t7)
|
||||
# 1340 Write_rows # 1396 table_id: # flags: STMT_END_F
|
||||
# 1572 Table_map # 1614 table_id: # (test.t7)
|
||||
# 1614 Write_rows # 1670 table_id: # flags: STMT_END_F
|
||||
SELECT * FROM t7 ORDER BY a,b;
|
||||
a b
|
||||
1 2
|
||||
|
@ -192,10 +192,10 @@ Create Table CREATE TABLE `t9` (
|
|||
`a` int(11) DEFAULT NULL,
|
||||
`b` int(11) DEFAULT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
||||
SHOW BINLOG EVENTS FROM 1396;
|
||||
SHOW BINLOG EVENTS FROM 1670;
|
||||
Log_name Pos Event_type Server_id End_log_pos Info
|
||||
# 1396 Query # 1482 use `test`; CREATE TABLE t8 LIKE t4
|
||||
# 1482 Query # 1621 use `test`; CREATE TABLE `t9` (
|
||||
# 1670 Query # 1756 use `test`; CREATE TABLE t8 LIKE t4
|
||||
# 1756 Query # 1895 use `test`; CREATE TABLE `t9` (
|
||||
`a` int(11) DEFAULT NULL,
|
||||
`b` int(11) DEFAULT NULL
|
||||
)
|
||||
|
@ -398,14 +398,15 @@ SELECT * FROM t2 ORDER BY a;
|
|||
a
|
||||
SHOW BINLOG EVENTS FROM 637;
|
||||
Log_name Pos Event_type Server_id End_log_pos Info
|
||||
# 637 Query # 717 use `test`; TRUNCATE TABLE t2
|
||||
# 717 Xid # 744 COMMIT /* XID */
|
||||
# 744 Query # 812 use `test`; BEGIN
|
||||
# 812 Table_map # 853 table_id: # (test.t2)
|
||||
# 853 Write_rows # 897 table_id: # flags: STMT_END_F
|
||||
# 897 Table_map # 938 table_id: # (test.t2)
|
||||
# 938 Write_rows # 977 table_id: # flags: STMT_END_F
|
||||
# 977 Query # 1048 use `test`; ROLLBACK
|
||||
# 637 Query # 705 use `test`; BEGIN
|
||||
# 705 Query # 785 use `test`; TRUNCATE TABLE t2
|
||||
# 785 Xid # 812 COMMIT /* XID */
|
||||
# 812 Query # 880 use `test`; BEGIN
|
||||
# 880 Table_map # 921 table_id: # (test.t2)
|
||||
# 921 Write_rows # 965 table_id: # flags: STMT_END_F
|
||||
# 965 Table_map # 1006 table_id: # (test.t2)
|
||||
# 1006 Write_rows # 1045 table_id: # flags: STMT_END_F
|
||||
# 1045 Query # 1116 use `test`; ROLLBACK
|
||||
SELECT * FROM t2 ORDER BY a;
|
||||
a
|
||||
DROP TABLE t1,t2;
|
||||
|
|
|
@ -20,11 +20,13 @@ show binlog events;
|
|||
Log_name Pos Event_type Server_id End_log_pos Info
|
||||
master-bin.000001 # Format_desc 1 # Server ver: VERSION, Binlog ver: 4
|
||||
master-bin.000001 # Query 1 # use `test`; create table t1(n int not null auto_increment primary key)ENGINE=InnoDB
|
||||
master-bin.000001 # Query 1 # use `test`; BEGIN
|
||||
master-bin.000001 # Table_map 1 # table_id: # (test.t1)
|
||||
master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
|
||||
master-bin.000001 # Xid 1 # COMMIT /* XID */
|
||||
master-bin.000001 # Query 1 # use `test`; drop table t1
|
||||
master-bin.000001 # Query 1 # use `test`; create table t1 (word char(20) not null)ENGINE=InnoDB
|
||||
master-bin.000001 # Query 1 # use `test`; BEGIN
|
||||
master-bin.000001 # Table_map 1 # table_id: # (test.t1)
|
||||
master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
|
||||
master-bin.000001 # Xid 1 # COMMIT /* XID */
|
||||
|
@ -34,10 +36,10 @@ master-bin.000001 # Query 1 # use `test`; create table t1(n int not null auto_in
|
|||
show binlog events from 106 limit 2;
|
||||
Log_name Pos Event_type Server_id End_log_pos Info
|
||||
master-bin.000001 # Query 1 # use `test`; create table t1(n int not null auto_increment primary key)ENGINE=InnoDB
|
||||
master-bin.000001 # Table_map 1 # table_id: # (test.t1)
|
||||
master-bin.000001 # Query 1 # use `test`; BEGIN
|
||||
show binlog events from 106 limit 2,1;
|
||||
Log_name Pos Event_type Server_id End_log_pos Info
|
||||
master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
|
||||
master-bin.000001 # Table_map 1 # table_id: # (test.t1)
|
||||
flush logs;
|
||||
create table t3 (a int)ENGINE=InnoDB;
|
||||
select * from t1 order by 1 asc;
|
||||
|
@ -194,11 +196,13 @@ insert into t2 values (1);
|
|||
show binlog events from <binlog_start>;
|
||||
Log_name Pos Event_type Server_id End_log_pos Info
|
||||
master-bin.000001 # Query # # use `test`; create table t1(n int not null auto_increment primary key)ENGINE=InnoDB
|
||||
master-bin.000001 # Query # # use `test`; BEGIN
|
||||
master-bin.000001 # Table_map # # table_id: # (test.t1)
|
||||
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
|
||||
master-bin.000001 # Xid # # COMMIT /* XID */
|
||||
master-bin.000001 # Query # # use `test`; drop table t1
|
||||
master-bin.000001 # Query # # use `test`; create table t1 (word char(20) not null)ENGINE=InnoDB
|
||||
master-bin.000001 # Query # # use `test`; BEGIN
|
||||
master-bin.000001 # Table_map # # table_id: # (test.t1)
|
||||
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
|
||||
master-bin.000001 # Xid # # COMMIT /* XID */
|
||||
|
@ -208,27 +212,30 @@ Log_name Pos Event_type Server_id End_log_pos Info
|
|||
master-bin.000002 # Format_desc 1 # Server ver: VERSION, Binlog ver: 4
|
||||
master-bin.000002 # Query 1 # use `test`; create table t3 (a int)ENGINE=InnoDB
|
||||
master-bin.000002 # Query 1 # use `test`; create table t2 (n int)ENGINE=InnoDB
|
||||
master-bin.000002 # Query 1 # use `test`; BEGIN
|
||||
master-bin.000002 # Table_map 1 # table_id: # (test.t2)
|
||||
master-bin.000002 # Write_rows 1 # table_id: # flags: STMT_END_F
|
||||
master-bin.000002 # Xid 1 # COMMIT /* XID */
|
||||
show binary logs;
|
||||
Log_name File_size
|
||||
master-bin.000001 1320
|
||||
master-bin.000002 406
|
||||
master-bin.000001 1456
|
||||
master-bin.000002 474
|
||||
start slave;
|
||||
show binary logs;
|
||||
Log_name File_size
|
||||
slave-bin.000001 1418
|
||||
slave-bin.000002 307
|
||||
slave-bin.000001 1536
|
||||
slave-bin.000002 366
|
||||
show binlog events in 'slave-bin.000001' from 4;
|
||||
Log_name Pos Event_type Server_id End_log_pos Info
|
||||
slave-bin.000001 # Format_desc 2 # Server ver: VERSION, Binlog ver: 4
|
||||
slave-bin.000001 # Query 1 # use `test`; create table t1(n int not null auto_increment primary key)ENGINE=InnoDB
|
||||
slave-bin.000001 # Query 1 # BEGIN
|
||||
slave-bin.000001 # Table_map 1 # table_id: # (test.t1)
|
||||
slave-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
|
||||
slave-bin.000001 # Xid 1 # COMMIT /* XID */
|
||||
slave-bin.000001 # Query 1 # use `test`; drop table t1
|
||||
slave-bin.000001 # Query 1 # use `test`; create table t1 (word char(20) not null)ENGINE=InnoDB
|
||||
slave-bin.000001 # Query 1 # BEGIN
|
||||
slave-bin.000001 # Table_map 1 # table_id: # (test.t1)
|
||||
slave-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
|
||||
slave-bin.000001 # Xid 1 # COMMIT /* XID */
|
||||
|
@ -238,6 +245,7 @@ show binlog events in 'slave-bin.000002' from 4;
|
|||
Log_name Pos Event_type Server_id End_log_pos Info
|
||||
slave-bin.000002 # Format_desc 2 # Server ver: VERSION, Binlog ver: 4
|
||||
slave-bin.000002 # Query 1 # use `test`; create table t2 (n int)ENGINE=InnoDB
|
||||
slave-bin.000002 # Query 1 # BEGIN
|
||||
slave-bin.000002 # Table_map 1 # table_id: # (test.t2)
|
||||
slave-bin.000002 # Write_rows 1 # table_id: # flags: STMT_END_F
|
||||
slave-bin.000002 # Xid 1 # COMMIT /* XID */
|
||||
|
@ -248,7 +256,7 @@ Master_User root
|
|||
Master_Port MASTER_PORT
|
||||
Connect_Retry 1
|
||||
Master_Log_File master-bin.000002
|
||||
Read_Master_Log_Pos 406
|
||||
Read_Master_Log_Pos 474
|
||||
Relay_Log_File #
|
||||
Relay_Log_Pos #
|
||||
Relay_Master_Log_File master-bin.000002
|
||||
|
@ -263,7 +271,7 @@ Replicate_Wild_Ignore_Table
|
|||
Last_Errno 0
|
||||
Last_Error
|
||||
Skip_Counter 0
|
||||
Exec_Master_Log_Pos 406
|
||||
Exec_Master_Log_Pos 474
|
||||
Relay_Log_Space #
|
||||
Until_Condition None
|
||||
Until_Log_File
|
||||
|
|
|
@ -155,13 +155,15 @@ c1 c3 c4 c5
|
|||
/*!40019 SET @@session.max_insert_delayed_threads=0*/;
|
||||
/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;
|
||||
DELIMITER /*!*/;
|
||||
ROLLBACK/*!*/;
|
||||
use test/*!*/;
|
||||
SET TIMESTAMP=1000000000/*!*/;
|
||||
SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1/*!*/;
|
||||
SET @@session.sql_mode=0/*!*/;
|
||||
/*!\C latin1 *//*!*/;
|
||||
SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/;
|
||||
CREATE TABLE t3(c1 INT NOT NULL PRIMARY KEY, c2 LONGBLOB, c3 TIMESTAMP, c4 TEXT, c5 FLOAT)/*!*/;
|
||||
CREATE TABLE t3(c1 INT NOT NULL PRIMARY KEY, c2 LONGBLOB, c3 TIMESTAMP, c4 TEXT, c5 FLOAT)
|
||||
/*!*/;
|
||||
DELIMITER ;
|
||||
# End of log file
|
||||
ROLLBACK /* added by mysqlbinlog */;
|
||||
|
@ -178,13 +180,17 @@ SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.uniq
|
|||
SET @@session.sql_mode=0/*!*/;
|
||||
/*!\C latin1 *//*!*/;
|
||||
SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/;
|
||||
DROP TABLE IF EXISTS t1,t2,t3/*!*/;
|
||||
DROP TABLE IF EXISTS t1,t2,t3
|
||||
/*!*/;
|
||||
SET TIMESTAMP=1000000000/*!*/;
|
||||
CREATE TABLE t1(word VARCHAR(20))/*!*/;
|
||||
CREATE TABLE t1(word VARCHAR(20))
|
||||
/*!*/;
|
||||
SET TIMESTAMP=1000000000/*!*/;
|
||||
CREATE TABLE t2(id INT AUTO_INCREMENT NOT NULL PRIMARY KEY)/*!*/;
|
||||
CREATE TABLE t2(id INT AUTO_INCREMENT NOT NULL PRIMARY KEY)
|
||||
/*!*/;
|
||||
SET TIMESTAMP=1000000000/*!*/;
|
||||
CREATE TABLE t3(c1 INT NOT NULL PRIMARY KEY, c2 LONGBLOB, c3 TIMESTAMP, c4 TEXT, c5 FLOAT)/*!*/;
|
||||
CREATE TABLE t3(c1 INT NOT NULL PRIMARY KEY, c2 LONGBLOB, c3 TIMESTAMP, c4 TEXT, c5 FLOAT)
|
||||
/*!*/;
|
||||
DELIMITER ;
|
||||
# End of log file
|
||||
ROLLBACK /* added by mysqlbinlog */;
|
||||
|
@ -279,13 +285,17 @@ SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.uniq
|
|||
SET @@session.sql_mode=0/*!*/;
|
||||
/*!\C latin1 *//*!*/;
|
||||
SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/;
|
||||
DROP TABLE IF EXISTS t1,t2,t3/*!*/;
|
||||
DROP TABLE IF EXISTS t1,t2,t3
|
||||
/*!*/;
|
||||
SET TIMESTAMP=1000000000/*!*/;
|
||||
CREATE TABLE t1(word VARCHAR(20))/*!*/;
|
||||
CREATE TABLE t1(word VARCHAR(20))
|
||||
/*!*/;
|
||||
SET TIMESTAMP=1000000000/*!*/;
|
||||
CREATE TABLE t2(id INT AUTO_INCREMENT NOT NULL PRIMARY KEY)/*!*/;
|
||||
CREATE TABLE t2(id INT AUTO_INCREMENT NOT NULL PRIMARY KEY)
|
||||
/*!*/;
|
||||
SET TIMESTAMP=1000000000/*!*/;
|
||||
CREATE TABLE t3(c1 INT NOT NULL PRIMARY KEY, c2 LONGBLOB, c3 TIMESTAMP, c4 TEXT, c5 FLOAT)/*!*/;
|
||||
CREATE TABLE t3(c1 INT NOT NULL PRIMARY KEY, c2 LONGBLOB, c3 TIMESTAMP, c4 TEXT, c5 FLOAT)
|
||||
/*!*/;
|
||||
DELIMITER ;
|
||||
# End of log file
|
||||
ROLLBACK /* added by mysqlbinlog */;
|
||||
|
@ -295,13 +305,15 @@ ROLLBACK /* added by mysqlbinlog */;
|
|||
/*!40019 SET @@session.max_insert_delayed_threads=0*/;
|
||||
/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;
|
||||
DELIMITER /*!*/;
|
||||
ROLLBACK/*!*/;
|
||||
use test/*!*/;
|
||||
SET TIMESTAMP=1000000000/*!*/;
|
||||
SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1/*!*/;
|
||||
SET @@session.sql_mode=0/*!*/;
|
||||
/*!\C latin1 *//*!*/;
|
||||
SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/;
|
||||
CREATE TABLE t3(c1 INT NOT NULL PRIMARY KEY, c2 LONGBLOB, c3 TIMESTAMP, c4 TEXT, c5 FLOAT)/*!*/;
|
||||
CREATE TABLE t3(c1 INT NOT NULL PRIMARY KEY, c2 LONGBLOB, c3 TIMESTAMP, c4 TEXT, c5 FLOAT)
|
||||
/*!*/;
|
||||
DELIMITER ;
|
||||
# End of log file
|
||||
ROLLBACK /* added by mysqlbinlog */;
|
||||
|
|
|
@ -5,6 +5,7 @@ reset slave;
|
|||
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
|
||||
start slave;
|
||||
create table t1(n int auto_increment primary key, s char(10));
|
||||
set @@global.slave_exec_mode= 'IDEMPOTENT';
|
||||
insert into t1 values (2,'old');
|
||||
insert into t1 values(NULL,'new');
|
||||
insert into t1 values(NULL,'new');
|
||||
|
@ -28,3 +29,4 @@ n s
|
|||
1 new
|
||||
3 new
|
||||
drop table t1;
|
||||
set @@global.slave_exec_mode= default;
|
||||
|
|
|
@ -37,6 +37,7 @@ ALTER TABLE t8 ADD e1 INT NOT NULL DEFAULT 0, ADD e2 INT NOT NULL DEFAULT 0,
|
|||
ADD e3 INT NOT NULL DEFAULT 0, ADD e4 INT NOT NULL DEFAULT 0,
|
||||
ADD e5 INT NOT NULL DEFAULT 0, ADD e6 INT NOT NULL DEFAULT 0,
|
||||
ADD e7 INT NOT NULL DEFAULT 0, ADD e8 INT NOT NULL DEFAULT 0;
|
||||
set @@global.slave_exec_mode= 'IDEMPOTENT';
|
||||
INSERT INTO t1_int VALUES (2, 4, 4711);
|
||||
INSERT INTO t1_char VALUES (2, 4, 'Foo is a bar');
|
||||
INSERT INTO t1_bit VALUES (2, 4, b'101', b'11100', b'01');
|
||||
|
@ -60,6 +61,7 @@ a b
|
|||
1 2
|
||||
2 5
|
||||
**** On Slave ****
|
||||
set @@global.slave_exec_mode= default;
|
||||
SELECT a,b,x FROM t1_int ORDER BY a;
|
||||
a b x
|
||||
1 2 42
|
||||
|
@ -123,7 +125,7 @@ Replicate_Ignore_Table
|
|||
Replicate_Wild_Do_Table
|
||||
Replicate_Wild_Ignore_Table
|
||||
Last_Errno 1364
|
||||
Last_Error Error in Write_rows event: error during transaction execution on table test.t1_nodef. Field 'x' doesn't have a default value
|
||||
Last_Error Could not execute Write_rows event on table test.t1_nodef; handler error <unknown>; the event's master log master-bin.000001, end_log_pos 2674
|
||||
Skip_Counter 0
|
||||
Exec_Master_Log_Pos #
|
||||
Relay_Log_Space #
|
||||
|
@ -141,7 +143,7 @@ Master_SSL_Verify_Server_Cert No
|
|||
Last_IO_Errno 0
|
||||
Last_IO_Error
|
||||
Last_SQL_Errno 1364
|
||||
Last_SQL_Error Error in Write_rows event: error during transaction execution on table test.t1_nodef. Field 'x' doesn't have a default value
|
||||
Last_SQL_Error Could not execute Write_rows event on table test.t1_nodef; handler error <unknown>; the event's master log master-bin.000001, end_log_pos 2674
|
||||
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
|
||||
START SLAVE;
|
||||
INSERT INTO t9 VALUES (2);
|
||||
|
|
|
@ -37,6 +37,7 @@ ALTER TABLE t8 ADD e1 INT NOT NULL DEFAULT 0, ADD e2 INT NOT NULL DEFAULT 0,
|
|||
ADD e3 INT NOT NULL DEFAULT 0, ADD e4 INT NOT NULL DEFAULT 0,
|
||||
ADD e5 INT NOT NULL DEFAULT 0, ADD e6 INT NOT NULL DEFAULT 0,
|
||||
ADD e7 INT NOT NULL DEFAULT 0, ADD e8 INT NOT NULL DEFAULT 0;
|
||||
set @@global.slave_exec_mode= 'IDEMPOTENT';
|
||||
INSERT INTO t1_int VALUES (2, 4, 4711);
|
||||
INSERT INTO t1_char VALUES (2, 4, 'Foo is a bar');
|
||||
INSERT INTO t1_bit VALUES (2, 4, b'101', b'11100', b'01');
|
||||
|
@ -60,6 +61,7 @@ a b
|
|||
1 2
|
||||
2 5
|
||||
**** On Slave ****
|
||||
set @@global.slave_exec_mode= default;
|
||||
SELECT a,b,x FROM t1_int ORDER BY a;
|
||||
a b x
|
||||
1 2 42
|
||||
|
@ -123,7 +125,7 @@ Replicate_Ignore_Table
|
|||
Replicate_Wild_Do_Table
|
||||
Replicate_Wild_Ignore_Table
|
||||
Last_Errno 1364
|
||||
Last_Error Error in Write_rows event: error during transaction execution on table test.t1_nodef. Field 'x' doesn't have a default value
|
||||
Last_Error Could not execute Write_rows event on table test.t1_nodef; handler error <unknown>; the event's master log master-bin.000001, end_log_pos 2944
|
||||
Skip_Counter 0
|
||||
Exec_Master_Log_Pos #
|
||||
Relay_Log_Space #
|
||||
|
@ -141,7 +143,7 @@ Master_SSL_Verify_Server_Cert No
|
|||
Last_IO_Errno 0
|
||||
Last_IO_Error
|
||||
Last_SQL_Errno 1364
|
||||
Last_SQL_Error Error in Write_rows event: error during transaction execution on table test.t1_nodef. Field 'x' doesn't have a default value
|
||||
Last_SQL_Error Could not execute Write_rows event on table test.t1_nodef; handler error <unknown>; the event's master log master-bin.000001, end_log_pos 2944
|
||||
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
|
||||
START SLAVE;
|
||||
INSERT INTO t9 VALUES (2);
|
||||
|
|
|
@ -4,8 +4,8 @@ reset master;
|
|||
reset slave;
|
||||
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
|
||||
start slave;
|
||||
stop slave;
|
||||
create table t1(n int);
|
||||
stop slave;
|
||||
start slave;
|
||||
stop slave io_thread;
|
||||
start slave io_thread;
|
||||
|
|
|
@ -184,78 +184,101 @@ SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.uniq
|
|||
SET @@session.sql_mode=0/*!*/;
|
||||
/*!\C latin1 *//*!*/;
|
||||
SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/;
|
||||
drop database if exists mysqltest2/*!*/;
|
||||
drop database if exists mysqltest2
|
||||
/*!*/;
|
||||
SET TIMESTAMP=1000000000/*!*/;
|
||||
drop database if exists mysqltest3/*!*/;
|
||||
drop database if exists mysqltest3
|
||||
/*!*/;
|
||||
SET TIMESTAMP=1000000000/*!*/;
|
||||
create database mysqltest2 character set latin2/*!*/;
|
||||
create database mysqltest2 character set latin2
|
||||
/*!*/;
|
||||
SET TIMESTAMP=1000000000/*!*/;
|
||||
/*!\C latin1 *//*!*/;
|
||||
SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=30/*!*/;
|
||||
create database mysqltest3/*!*/;
|
||||
create database mysqltest3
|
||||
/*!*/;
|
||||
SET TIMESTAMP=1000000000/*!*/;
|
||||
/*!\C latin1 *//*!*/;
|
||||
SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=64/*!*/;
|
||||
drop database mysqltest3/*!*/;
|
||||
drop database mysqltest3
|
||||
/*!*/;
|
||||
SET TIMESTAMP=1000000000/*!*/;
|
||||
create database mysqltest3/*!*/;
|
||||
create database mysqltest3
|
||||
/*!*/;
|
||||
use mysqltest2/*!*/;
|
||||
SET TIMESTAMP=1000000000/*!*/;
|
||||
create table t1 (a int auto_increment primary key, b varchar(100))/*!*/;
|
||||
create table t1 (a int auto_increment primary key, b varchar(100))
|
||||
/*!*/;
|
||||
SET INSERT_ID=1/*!*/;
|
||||
SET TIMESTAMP=1000000000/*!*/;
|
||||
/*!\C cp850 *//*!*/;
|
||||
SET @@session.character_set_client=4,@@session.collation_connection=27,@@session.collation_server=64/*!*/;
|
||||
insert into t1 (b) values(@@character_set_server)/*!*/;
|
||||
insert into t1 (b) values(@@character_set_server)
|
||||
/*!*/;
|
||||
SET INSERT_ID=2/*!*/;
|
||||
SET TIMESTAMP=1000000000/*!*/;
|
||||
insert into t1 (b) values(@@collation_server)/*!*/;
|
||||
insert into t1 (b) values(@@collation_server)
|
||||
/*!*/;
|
||||
SET INSERT_ID=3/*!*/;
|
||||
SET TIMESTAMP=1000000000/*!*/;
|
||||
insert into t1 (b) values(@@character_set_client)/*!*/;
|
||||
insert into t1 (b) values(@@character_set_client)
|
||||
/*!*/;
|
||||
SET INSERT_ID=4/*!*/;
|
||||
SET TIMESTAMP=1000000000/*!*/;
|
||||
insert into t1 (b) values(@@character_set_connection)/*!*/;
|
||||
insert into t1 (b) values(@@character_set_connection)
|
||||
/*!*/;
|
||||
SET INSERT_ID=5/*!*/;
|
||||
SET TIMESTAMP=1000000000/*!*/;
|
||||
insert into t1 (b) values(@@collation_connection)/*!*/;
|
||||
insert into t1 (b) values(@@collation_connection)
|
||||
/*!*/;
|
||||
SET TIMESTAMP=1000000000/*!*/;
|
||||
/*!\C latin1 *//*!*/;
|
||||
SET @@session.character_set_client=8,@@session.collation_connection=5,@@session.collation_server=64/*!*/;
|
||||
truncate table t1/*!*/;
|
||||
truncate table t1
|
||||
/*!*/;
|
||||
SET INSERT_ID=1/*!*/;
|
||||
SET TIMESTAMP=1000000000/*!*/;
|
||||
insert into t1 (b) values(@@collation_connection)/*!*/;
|
||||
insert into t1 (b) values(@@collation_connection)
|
||||
/*!*/;
|
||||
SET INSERT_ID=2/*!*/;
|
||||
SET TIMESTAMP=1000000000/*!*/;
|
||||
insert into t1 (b) values(LEAST("Müller","Muffler"))/*!*/;
|
||||
insert into t1 (b) values(LEAST("Müller","Muffler"))
|
||||
/*!*/;
|
||||
SET INSERT_ID=3/*!*/;
|
||||
SET TIMESTAMP=1000000000/*!*/;
|
||||
/*!\C latin1 *//*!*/;
|
||||
SET @@session.character_set_client=8,@@session.collation_connection=31,@@session.collation_server=64/*!*/;
|
||||
insert into t1 (b) values(@@collation_connection)/*!*/;
|
||||
insert into t1 (b) values(@@collation_connection)
|
||||
/*!*/;
|
||||
SET INSERT_ID=4/*!*/;
|
||||
SET TIMESTAMP=1000000000/*!*/;
|
||||
insert into t1 (b) values(LEAST("Müller","Muffler"))/*!*/;
|
||||
insert into t1 (b) values(LEAST("Müller","Muffler"))
|
||||
/*!*/;
|
||||
SET TIMESTAMP=1000000000/*!*/;
|
||||
truncate table t1/*!*/;
|
||||
truncate table t1
|
||||
/*!*/;
|
||||
SET INSERT_ID=1/*!*/;
|
||||
SET @`a`:=_cp850 0x4DFC6C6C6572 COLLATE `cp850_general_ci`/*!*/;
|
||||
SET TIMESTAMP=1000000000/*!*/;
|
||||
insert into t1 (b) values(collation(@a))/*!*/;
|
||||
insert into t1 (b) values(collation(@a))
|
||||
/*!*/;
|
||||
SET TIMESTAMP=1000000000/*!*/;
|
||||
drop database mysqltest2/*!*/;
|
||||
drop database mysqltest2
|
||||
/*!*/;
|
||||
SET TIMESTAMP=1000000000/*!*/;
|
||||
drop database mysqltest3/*!*/;
|
||||
drop database mysqltest3
|
||||
/*!*/;
|
||||
use test/*!*/;
|
||||
SET TIMESTAMP=1000000000/*!*/;
|
||||
/*!\C latin1 *//*!*/;
|
||||
SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=30/*!*/;
|
||||
CREATE TABLE t1 (c1 VARBINARY(255), c2 VARBINARY(255))/*!*/;
|
||||
CREATE TABLE t1 (c1 VARBINARY(255), c2 VARBINARY(255))
|
||||
/*!*/;
|
||||
SET TIMESTAMP=1000000000/*!*/;
|
||||
/*!\C koi8r *//*!*/;
|
||||
SET @@session.character_set_client=7,@@session.collation_connection=51,@@session.collation_server=30/*!*/;
|
||||
INSERT INTO t1 (c1, c2) VALUES ('îÕ, ÚÁ ÒÙÂÁÌËÕ','îÕ, ÚÁ ÒÙÂÁÌËÕ')/*!*/;
|
||||
INSERT INTO t1 (c1, c2) VALUES ('îÕ, ÚÁ ÒÙÂÁÌËÕ','îÕ, ÚÁ ÒÙÂÁÌËÕ')
|
||||
/*!*/;
|
||||
DELIMITER ;
|
||||
# End of log file
|
||||
ROLLBACK /* added by mysqlbinlog */;
|
||||
|
|
|
@ -471,21 +471,27 @@ master-bin.000001 # Query # # use `mysqltest1`; insert into t1 select 'emergency
|
|||
master-bin.000001 # Table_map # # table_id: # (mysqltest1.t1)
|
||||
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
|
||||
master-bin.000001 # Query # # use `mysqltest1`; insert into t1 select "yesterday_24_"
|
||||
master-bin.000001 # Query # # use `mysqltest1`; BEGIN
|
||||
master-bin.000001 # Query # # use `mysqltest1`; CREATE TABLE `t2` (
|
||||
`rpad(UUID(),100,' ')` varchar(100) CHARACTER SET utf8 NOT NULL DEFAULT ''
|
||||
)
|
||||
master-bin.000001 # Table_map # # table_id: # (mysqltest1.t2)
|
||||
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
|
||||
master-bin.000001 # Query # # use `mysqltest1`; COMMIT
|
||||
master-bin.000001 # Query # # use `mysqltest1`; BEGIN
|
||||
master-bin.000001 # Query # # use `mysqltest1`; CREATE TABLE `t3` (
|
||||
`1` varbinary(108) NOT NULL DEFAULT ''
|
||||
)
|
||||
master-bin.000001 # Table_map # # table_id: # (mysqltest1.t3)
|
||||
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
|
||||
master-bin.000001 # Query # # use `mysqltest1`; COMMIT
|
||||
master-bin.000001 # Query # # use `mysqltest1`; BEGIN
|
||||
master-bin.000001 # Query # # use `mysqltest1`; CREATE TABLE `t4` (
|
||||
`a` varchar(100) DEFAULT NULL
|
||||
)
|
||||
master-bin.000001 # Table_map # # table_id: # (mysqltest1.t4)
|
||||
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
|
||||
master-bin.000001 # Query # # use `mysqltest1`; COMMIT
|
||||
master-bin.000001 # Query # # use `mysqltest1`; create table t5 select * from t1 where 3 in (select 1 union select 2 union select curdate() union select 3)
|
||||
master-bin.000001 # Table_map # # table_id: # (mysqltest1.t5)
|
||||
master-bin.000001 # Write_rows # # table_id: #
|
||||
|
@ -799,21 +805,27 @@ master-bin.000001 # Query # # use `mysqltest1`; insert into t1 select 'emergency
|
|||
master-bin.000001 # Table_map # # table_id: # (mysqltest1.t1)
|
||||
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
|
||||
master-bin.000001 # Query # # use `mysqltest1`; insert into t1 select "yesterday_24_"
|
||||
master-bin.000001 # Query # # use `mysqltest1`; BEGIN
|
||||
master-bin.000001 # Query # # use `mysqltest1`; CREATE TABLE `t2` (
|
||||
`rpad(UUID(),100,' ')` varchar(100) CHARACTER SET utf8 NOT NULL DEFAULT ''
|
||||
)
|
||||
master-bin.000001 # Table_map # # table_id: # (mysqltest1.t2)
|
||||
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
|
||||
master-bin.000001 # Query # # use `mysqltest1`; COMMIT
|
||||
master-bin.000001 # Query # # use `mysqltest1`; BEGIN
|
||||
master-bin.000001 # Query # # use `mysqltest1`; CREATE TABLE `t3` (
|
||||
`1` varbinary(108) NOT NULL DEFAULT ''
|
||||
)
|
||||
master-bin.000001 # Table_map # # table_id: # (mysqltest1.t3)
|
||||
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
|
||||
master-bin.000001 # Query # # use `mysqltest1`; COMMIT
|
||||
master-bin.000001 # Query # # use `mysqltest1`; BEGIN
|
||||
master-bin.000001 # Query # # use `mysqltest1`; CREATE TABLE `t4` (
|
||||
`a` varchar(100) DEFAULT NULL
|
||||
)
|
||||
master-bin.000001 # Table_map # # table_id: # (mysqltest1.t4)
|
||||
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
|
||||
master-bin.000001 # Query # # use `mysqltest1`; COMMIT
|
||||
master-bin.000001 # Query # # use `mysqltest1`; create table t5 select * from t1 where 3 in (select 1 union select 2 union select curdate() union select 3)
|
||||
master-bin.000001 # Table_map # # table_id: # (mysqltest1.t5)
|
||||
master-bin.000001 # Write_rows # # table_id: #
|
||||
|
|
|
@ -12,6 +12,7 @@ INSERT INTO t1 VALUES (1,1), (2,2), (3,3), (4,4);
|
|||
SHOW STATUS LIKE 'Slave_retried_transactions';
|
||||
Variable_name Value
|
||||
Slave_retried_transactions 0
|
||||
set @@global.slave_exec_mode= 'IDEMPOTENT';
|
||||
UPDATE t1 SET a = 5, b = 47 WHERE a = 1;
|
||||
SELECT * FROM t1;
|
||||
a b
|
||||
|
@ -28,6 +29,7 @@ a b
|
|||
3 3
|
||||
4 4
|
||||
**** On Slave ****
|
||||
set @@global.slave_exec_mode= default;
|
||||
SHOW STATUS LIKE 'Slave_retried_transactions';
|
||||
Variable_name Value
|
||||
Slave_retried_transactions 0
|
||||
|
|
|
@ -40,6 +40,44 @@ SELECT * FROM t1 ORDER BY n;
|
|||
t n
|
||||
2004-01-01 00:00:00 5
|
||||
2004-06-11 09:39:02 6
|
||||
select * from t1;
|
||||
t
|
||||
2004-01-01 00:00:00
|
||||
2004-06-11 09:39:02
|
||||
/*!40019 SET @@session.max_insert_delayed_threads=0*/;
|
||||
/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;
|
||||
DELIMITER /*!*/;
|
||||
ROLLBACK/*!*/;
|
||||
use test/*!*/;
|
||||
SET TIMESTAMP=100000000/*!*/;
|
||||
SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1/*!*/;
|
||||
SET @@session.sql_mode=0/*!*/;
|
||||
/*!\C latin1 *//*!*/;
|
||||
SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/;
|
||||
create table t1 (t timestamp)
|
||||
/*!*/;
|
||||
SET TIMESTAMP=100000000/*!*/;
|
||||
create table t2 (t char(32))
|
||||
/*!*/;
|
||||
SET TIMESTAMP=100000000/*!*/;
|
||||
SET @@session.time_zone='Europe/Moscow'/*!*/;
|
||||
insert into t1 values ('20050101000000'), ('20050611093902')
|
||||
/*!*/;
|
||||
SET TIMESTAMP=100000000/*!*/;
|
||||
SET @@session.time_zone='UTC'/*!*/;
|
||||
insert into t1 values ('20040101000000'), ('20040611093902')
|
||||
/*!*/;
|
||||
SET TIMESTAMP=100000000/*!*/;
|
||||
delete from t1
|
||||
/*!*/;
|
||||
SET TIMESTAMP=100000000/*!*/;
|
||||
SET @@session.time_zone='Europe/Moscow'/*!*/;
|
||||
insert into t1 values ('20040101000000'), ('20040611093902')
|
||||
/*!*/;
|
||||
DELIMITER ;
|
||||
# End of log file
|
||||
ROLLBACK /* added by mysqlbinlog */;
|
||||
/*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/;
|
||||
delete from t1;
|
||||
set time_zone='UTC';
|
||||
load data infile '../std_data_ln/rpl_timezone2.dat' into table t1;
|
||||
|
|
|
@ -38,8 +38,10 @@ show binlog events from <binlog_start>;
|
|||
Log_name Pos Event_type Server_id End_log_pos Info
|
||||
master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS t1
|
||||
master-bin.000001 # Query # # use `test`; CREATE TABLE t1 (a INT, b LONG) ENGINE=InnoDB
|
||||
master-bin.000001 # Query # # use `test`; BEGIN
|
||||
master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (1,1), (2,2)
|
||||
master-bin.000001 # Xid # # COMMIT /* XID */
|
||||
master-bin.000001 # Query # # use `test`; BEGIN
|
||||
master-bin.000001 # Query # # use `test`; TRUNCATE TABLE t1
|
||||
master-bin.000001 # Xid # # COMMIT /* XID */
|
||||
master-bin.000001 # Query # # use `test`; DROP TABLE t1
|
||||
|
@ -78,8 +80,10 @@ show binlog events from <binlog_start>;
|
|||
Log_name Pos Event_type Server_id End_log_pos Info
|
||||
master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS t1
|
||||
master-bin.000001 # Query # # use `test`; CREATE TABLE t1 (a INT, b LONG) ENGINE=InnoDB
|
||||
master-bin.000001 # Query # # use `test`; BEGIN
|
||||
master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (1,1), (2,2)
|
||||
master-bin.000001 # Xid # # COMMIT /* XID */
|
||||
master-bin.000001 # Query # # use `test`; BEGIN
|
||||
master-bin.000001 # Query # # use `test`; TRUNCATE TABLE t1
|
||||
master-bin.000001 # Xid # # COMMIT /* XID */
|
||||
master-bin.000001 # Query # # use `test`; DROP TABLE t1
|
||||
|
@ -118,9 +122,11 @@ show binlog events from <binlog_start>;
|
|||
Log_name Pos Event_type Server_id End_log_pos Info
|
||||
master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS t1
|
||||
master-bin.000001 # Query # # use `test`; CREATE TABLE t1 (a INT, b LONG) ENGINE=InnoDB
|
||||
master-bin.000001 # Query # # use `test`; BEGIN
|
||||
master-bin.000001 # Table_map # # table_id: # (test.t1)
|
||||
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
|
||||
master-bin.000001 # Xid # # COMMIT /* XID */
|
||||
master-bin.000001 # Query # # use `test`; BEGIN
|
||||
master-bin.000001 # Query # # use `test`; TRUNCATE TABLE t1
|
||||
master-bin.000001 # Xid # # COMMIT /* XID */
|
||||
master-bin.000001 # Query # # use `test`; DROP TABLE t1
|
||||
|
@ -159,8 +165,10 @@ show binlog events from <binlog_start>;
|
|||
Log_name Pos Event_type Server_id End_log_pos Info
|
||||
master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS t1
|
||||
master-bin.000001 # Query # # use `test`; CREATE TABLE t1 (a INT, b LONG) ENGINE=InnoDB
|
||||
master-bin.000001 # Query # # use `test`; BEGIN
|
||||
master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (1,1), (2,2)
|
||||
master-bin.000001 # Xid # # COMMIT /* XID */
|
||||
master-bin.000001 # Query # # use `test`; BEGIN
|
||||
master-bin.000001 # Query # # use `test`; DELETE FROM t1
|
||||
master-bin.000001 # Xid # # COMMIT /* XID */
|
||||
master-bin.000001 # Query # # use `test`; DROP TABLE t1
|
||||
|
@ -199,8 +207,10 @@ show binlog events from <binlog_start>;
|
|||
Log_name Pos Event_type Server_id End_log_pos Info
|
||||
master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS t1
|
||||
master-bin.000001 # Query # # use `test`; CREATE TABLE t1 (a INT, b LONG) ENGINE=InnoDB
|
||||
master-bin.000001 # Query # # use `test`; BEGIN
|
||||
master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (1,1), (2,2)
|
||||
master-bin.000001 # Xid # # COMMIT /* XID */
|
||||
master-bin.000001 # Query # # use `test`; BEGIN
|
||||
master-bin.000001 # Query # # use `test`; DELETE FROM t1
|
||||
master-bin.000001 # Xid # # COMMIT /* XID */
|
||||
master-bin.000001 # Query # # use `test`; DROP TABLE t1
|
||||
|
@ -240,9 +250,11 @@ show binlog events from <binlog_start>;
|
|||
Log_name Pos Event_type Server_id End_log_pos Info
|
||||
master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS t1
|
||||
master-bin.000001 # Query # # use `test`; CREATE TABLE t1 (a INT, b LONG) ENGINE=InnoDB
|
||||
master-bin.000001 # Query # # use `test`; BEGIN
|
||||
master-bin.000001 # Table_map # # table_id: # (test.t1)
|
||||
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
|
||||
master-bin.000001 # Xid # # COMMIT /* XID */
|
||||
master-bin.000001 # Query # # use `test`; BEGIN
|
||||
master-bin.000001 # Table_map # # table_id: # (test.t1)
|
||||
master-bin.000001 # Delete_rows # # table_id: # flags: STMT_END_F
|
||||
master-bin.000001 # Xid # # COMMIT /* XID */
|
||||
|
|
|
@ -39,6 +39,24 @@ CREATE TABLE `visits_events` (
|
|||
/*!40019 SET @@session.max_insert_delayed_threads=0*/;
|
||||
/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;
|
||||
--delimiter /*!*/;
|
||||
|
||||
# at 4 (0x4)
|
||||
#071204 14:29:31 server id 1 end_log_pos 106
|
||||
# Position Timestamp Type Master ID Size Master Pos Flags
|
||||
# 4 3b 56 55 47 0f 01 00 00 00 66 00 00 00 6a 00 00 00 00 00
|
||||
# 17 04 00 35 2e 31 2e 32 33 2d 72 63 2d 64 65 62 75 |..5.1.23.rc.debu|
|
||||
# 27 67 2d 6c 6f 67 00 00 00 00 00 00 00 00 00 00 00 |g.log...........|
|
||||
# 37 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
|
||||
# 47 00 00 00 00 3b 56 55 47 13 38 0d 00 08 00 12 00 |.....VUG.8......|
|
||||
# 57 04 04 04 04 12 00 00 53 00 04 1a 08 00 00 00 08 |.......S........|
|
||||
# 67 08 08 02 |...|
|
||||
# Start: binlog v 4, server v 5.1.23-rc-debug-log created 071204 14:29:31 at startup
|
||||
|
||||
BINLOG '
|
||||
O1ZVRw8BAAAAZgAAAGoAAAAAAAQANS4xLjIzLXJjLWRlYnVnLWxvZwAAAAAAAAAAAAAAAAAAAAAA
|
||||
AAAAAAAAAAAAAAAAAAA7VlVHEzgNAAgAEgAEBAQEEgAAUwAEGggAAAAICAgC
|
||||
'/*!*/;
|
||||
|
||||
# at 164170623
|
||||
# at 164170679
|
||||
#7918 3:59:2 server id 436 end_log_pos 164170679
|
||||
|
|
|
@ -34,7 +34,8 @@ connection master1;
|
|||
|
||||
# This sleep is picked so that the query above has started to insert
|
||||
# some rows into t2. If it hasn't the slave will not stop below.
|
||||
sleep 4;
|
||||
let $wait_condition= SELECT COUNT(*) > 1000 FROM t1;
|
||||
source include/wait_condition.inc
|
||||
|
||||
# SHOW PROCESSLIST;
|
||||
|
||||
|
|
31
mysql-test/suite/rpl/t/rpl_drop_view.test
Normal file
31
mysql-test/suite/rpl/t/rpl_drop_view.test
Normal file
|
@ -0,0 +1,31 @@
|
|||
# test case for bug#30998
|
||||
# Drop View breaks replication if view does not exist
|
||||
#
|
||||
|
||||
source include/master-slave.inc;
|
||||
--disable_warnings
|
||||
drop table if exists t1, t2;
|
||||
drop view if exists v1, v2, v3, not_exist_view;
|
||||
--enable_warnings
|
||||
create table t1 (a int);
|
||||
create table t2 (b int);
|
||||
create table t3 (c int);
|
||||
create view v1 as select * from t1;
|
||||
create view v2 as select * from t2;
|
||||
create view v3 as select * from t3;
|
||||
--error 1051
|
||||
drop view not_exist_view;
|
||||
--error 1051
|
||||
drop view v1, not_exist_view;
|
||||
--error 1146
|
||||
select * from v1;
|
||||
drop view v2, v3;
|
||||
save_master_pos;
|
||||
connection slave;
|
||||
sync_with_master;
|
||||
--error 1146
|
||||
select * from v1;
|
||||
--error 1146
|
||||
select * from v2;
|
||||
--error 1146
|
||||
select * from v3;
|
|
@ -43,7 +43,8 @@ insert into t3 values(connection_id());
|
|||
send update t2 set a = a + 1 + get_lock('crash_lock%20C', 10);
|
||||
|
||||
connection master1;
|
||||
real_sleep 2;
|
||||
let $wait_condition= SELECT a > 1 FROM t2;
|
||||
source include/wait_condition.inc;
|
||||
select (@id := id) - id from t3;
|
||||
kill @id;
|
||||
drop table t2,t3;
|
||||
|
|
2
mysql-test/suite/rpl/t/rpl_idempotency-master.opt
Normal file
2
mysql-test/suite/rpl/t/rpl_idempotency-master.opt
Normal file
|
@ -0,0 +1,2 @@
|
|||
--innodb
|
||||
|
2
mysql-test/suite/rpl/t/rpl_idempotency-slave.opt
Normal file
2
mysql-test/suite/rpl/t/rpl_idempotency-slave.opt
Normal file
|
@ -0,0 +1,2 @@
|
|||
--slave-exec-mode=IDEMPOTENT --innodb
|
||||
|
|
@ -77,3 +77,335 @@ enable_query_log;
|
|||
connection master;
|
||||
DROP TABLE t1, t2;
|
||||
sync_slave_with_master;
|
||||
|
||||
# bug#31609 Not all RBR slave errors reported as errors
|
||||
# bug#31552 Replication breaks when deleting rows from out-of-sync table
|
||||
# without PK
|
||||
|
||||
#
|
||||
# Idempotent applying is not default any longer.
|
||||
# The default for slave-exec-mode option and server
|
||||
# variable slave_exec_mode is 'STRICT'.
|
||||
# When 'STRICT' mode is set, the slave SQL thread will stop whenever
|
||||
# the row to change is not found. In 'IDEMPOTENT' mode, the SQL thread
|
||||
# will continue running and apply the row - replace if it's Write_rows event -
|
||||
# or skip to the next event.
|
||||
|
||||
# the previous part of the tests was with IDEMPOTENT slave's mode.
|
||||
|
||||
|
||||
#
|
||||
# Other than above idempotent errors dealing with foreign keys constraint
|
||||
#
|
||||
|
||||
select @@global.slave_exec_mode /* must be IDEMPOTENT */;
|
||||
|
||||
connection master;
|
||||
|
||||
create table ti1 (b int primary key) engine = innodb;
|
||||
create table ti2 (a int primary key, b int, foreign key (b) references ti1(b))
|
||||
engine = innodb;
|
||||
set foreign_key_checks=1 /* ensure the check */;
|
||||
|
||||
insert into ti1 values (1),(2),(3);
|
||||
insert into ti2 set a=2, b=2;
|
||||
|
||||
sync_slave_with_master;
|
||||
|
||||
#connection slave;
|
||||
select * from ti1 order by b /* must be (1),(2),(3) */;
|
||||
insert into ti2 set a=1, b=1;
|
||||
select * from ti2 order by b /* must be (1,1) (2,2) */;
|
||||
|
||||
connection master;
|
||||
|
||||
# from now on checking rbr specific idempotent errors
|
||||
set @save_binlog_format= @@session.binlog_format;
|
||||
set @@session.binlog_format= row;
|
||||
delete from ti1 where b=1;
|
||||
|
||||
select * from ti1 order by b /* must be (2),(3) */;
|
||||
|
||||
# slave must catch up (expect some warnings in error.log)
|
||||
sync_slave_with_master;
|
||||
|
||||
#connection slave;
|
||||
select * from ti1 order by b /* must stays as were on master (1),(2),(3) */;
|
||||
|
||||
delete from ti1 where b=3;
|
||||
|
||||
connection master;
|
||||
insert into ti2 set a=3, b=3;
|
||||
|
||||
# slave must catch up (expect some warnings in error.log)
|
||||
sync_slave_with_master;
|
||||
|
||||
#connection slave;
|
||||
select * from ti2 order by b /* must be (1,1),(2,2) - not inserted */;
|
||||
|
||||
|
||||
#
|
||||
# Checking the new global sys variable
|
||||
#
|
||||
|
||||
connection slave;
|
||||
|
||||
set global slave_exec_mode='IDEMPOTENT';
|
||||
set global slave_exec_mode='STRICT';
|
||||
|
||||
# checking mutual exclusion for the options
|
||||
--error ER_SLAVE_AMBIGOUS_EXEC_MODE
|
||||
set global slave_exec_mode='IDEMPOTENT,STRICT';
|
||||
|
||||
select @@global.slave_exec_mode /* must be STRICT */;
|
||||
|
||||
#
|
||||
# Checking stops.
|
||||
# In the following sections strict slave sql thread is going to
|
||||
# stop when faces an idempotent error. In order to proceed
|
||||
# the mode is temporarily switched to indempotent.
|
||||
#
|
||||
|
||||
#
|
||||
--echo *** foreign keys errors as above now forces to stop
|
||||
#
|
||||
|
||||
connection master;
|
||||
|
||||
set foreign_key_checks=0;
|
||||
drop table ti2, ti1;
|
||||
|
||||
create table ti1 (b int primary key) engine = innodb;
|
||||
create table ti2 (a int primary key, b int, foreign key (b) references ti1(b))
|
||||
engine = innodb;
|
||||
set foreign_key_checks=1 /* ensure the check */;
|
||||
|
||||
insert into ti1 values (1),(2),(3);
|
||||
insert into ti2 set a=2, b=2;
|
||||
|
||||
sync_slave_with_master;
|
||||
|
||||
#connection slave;
|
||||
select * from ti1 order by b /* must be (1),(2),(3) */;
|
||||
--echo *** conspire future problem
|
||||
insert into ti2 set a=1, b=1;
|
||||
select * from ti2 order by b /* must be (1,1) (2,2) */;
|
||||
|
||||
connection master;
|
||||
|
||||
delete from ti1 where b=1 /* offending delete event */;
|
||||
select * from ti1 order by b /* must be (2),(3) */;
|
||||
|
||||
# foreign key: row is referenced
|
||||
|
||||
--echo *** slave must stop
|
||||
source include/wait_for_slave_sql_to_stop.inc;
|
||||
|
||||
connection slave;
|
||||
|
||||
let $last_error = query_get_value("SHOW SLAVE STATUS", Last_SQL_Errno, 1);
|
||||
disable_query_log;
|
||||
eval SELECT "$last_error" AS Last_SQL_Error;
|
||||
enable_query_log;
|
||||
|
||||
select * from ti1 order by b /* must be (1),(2),(3) - not deleted */;
|
||||
set foreign_key_checks= 0;
|
||||
delete from ti2 where b=1;
|
||||
set foreign_key_checks= 1;
|
||||
set global slave_exec_mode='IDEMPOTENT';
|
||||
start slave sql_thread;
|
||||
connection master;
|
||||
sync_slave_with_master;
|
||||
#connection slave;
|
||||
set global slave_exec_mode='STRICT';
|
||||
|
||||
connection master;
|
||||
|
||||
sync_slave_with_master;
|
||||
|
||||
#connection slave;
|
||||
--echo *** conspire the following insert failure
|
||||
# foreign key: no referenced row
|
||||
|
||||
--echo *** conspire future problem
|
||||
delete from ti1 where b=3;
|
||||
|
||||
connection master;
|
||||
insert into ti2 set a=3, b=3 /* offending write event */;
|
||||
--echo *** slave must stop
|
||||
|
||||
source include/wait_for_slave_sql_to_stop.inc;
|
||||
|
||||
connection slave;
|
||||
|
||||
let $last_error = query_get_value("SHOW SLAVE STATUS", Last_SQL_Errno, 1);
|
||||
disable_query_log;
|
||||
eval SELECT "$last_error" AS Last_SQL_Error;
|
||||
enable_query_log;
|
||||
|
||||
select * from ti2 order by b /* must be (2,2) */;
|
||||
set foreign_key_checks= 0;
|
||||
insert into ti1 set b=3;
|
||||
set foreign_key_checks= 1;
|
||||
set global slave_exec_mode='IDEMPOTENT';
|
||||
start slave sql_thread;
|
||||
connection master;
|
||||
sync_slave_with_master;
|
||||
#connection slave;
|
||||
set global slave_exec_mode='STRICT';
|
||||
|
||||
connection master;
|
||||
|
||||
sync_slave_with_master;
|
||||
|
||||
select * from ti2 order by b /* must be (2,2),(3,3) */;
|
||||
|
||||
#
|
||||
--echo *** other errors
|
||||
#
|
||||
|
||||
# dup key insert
|
||||
|
||||
#connection slave;
|
||||
--echo *** conspiring query
|
||||
insert into ti1 set b=1;
|
||||
|
||||
connection master;
|
||||
insert into ti1 set b=1 /* offending write event */;
|
||||
|
||||
--echo *** slave must stop
|
||||
source include/wait_for_slave_sql_to_stop.inc;
|
||||
|
||||
connection slave;
|
||||
|
||||
let $last_error = query_get_value("SHOW SLAVE STATUS", Last_SQL_Errno, 1);
|
||||
disable_query_log;
|
||||
eval SELECT "$last_error" AS Last_SQL_Error;
|
||||
enable_query_log;
|
||||
|
||||
set foreign_key_checks= 0;
|
||||
delete from ti1 where b=1;
|
||||
set foreign_key_checks= 1;
|
||||
set global slave_exec_mode='IDEMPOTENT';
|
||||
start slave sql_thread;
|
||||
connection master;
|
||||
sync_slave_with_master;
|
||||
#connection slave;
|
||||
set global slave_exec_mode='STRICT';
|
||||
|
||||
# key not found
|
||||
|
||||
connection master;
|
||||
|
||||
CREATE TABLE t1 (a INT PRIMARY KEY);
|
||||
CREATE TABLE t2 (a INT);
|
||||
INSERT INTO t1 VALUES (-1),(-2),(-3);
|
||||
INSERT INTO t2 VALUES (-1),(-2),(-3);
|
||||
sync_slave_with_master;
|
||||
|
||||
#connection slave;
|
||||
DELETE FROM t1 WHERE a = -2;
|
||||
DELETE FROM t2 WHERE a = -2;
|
||||
connection master;
|
||||
DELETE FROM t1 WHERE a = -2;
|
||||
|
||||
--echo *** slave must stop
|
||||
source include/wait_for_slave_sql_to_stop.inc;
|
||||
|
||||
connection slave;
|
||||
|
||||
let $last_error = query_get_value("SHOW SLAVE STATUS", Last_SQL_Errno, 1);
|
||||
disable_query_log;
|
||||
eval SELECT "$last_error" AS Last_SQL_Error;
|
||||
enable_query_log;
|
||||
|
||||
set global slave_exec_mode='IDEMPOTENT';
|
||||
start slave sql_thread;
|
||||
connection master;
|
||||
sync_slave_with_master;
|
||||
#connection slave;
|
||||
set global slave_exec_mode='STRICT';
|
||||
|
||||
connection master;
|
||||
DELETE FROM t2 WHERE a = -2;
|
||||
--echo *** slave must stop
|
||||
source include/wait_for_slave_sql_to_stop.inc;
|
||||
|
||||
connection slave;
|
||||
|
||||
let $last_error = query_get_value("SHOW SLAVE STATUS", Last_SQL_Errno, 1);
|
||||
disable_query_log;
|
||||
eval SELECT "$last_error" AS Last_SQL_Error;
|
||||
enable_query_log;
|
||||
|
||||
set global slave_exec_mode='IDEMPOTENT';
|
||||
start slave sql_thread;
|
||||
connection master;
|
||||
sync_slave_with_master;
|
||||
#connection slave;
|
||||
set global slave_exec_mode='STRICT';
|
||||
|
||||
UPDATE t1 SET a = 1 WHERE a = -1;
|
||||
UPDATE t2 SET a = 1 WHERE a = -1;
|
||||
|
||||
connection master;
|
||||
UPDATE t1 SET a = 1 WHERE a = -1;
|
||||
|
||||
--echo *** slave must stop
|
||||
source include/wait_for_slave_sql_to_stop.inc;
|
||||
|
||||
connection slave;
|
||||
|
||||
let $last_error = query_get_value("SHOW SLAVE STATUS", Last_SQL_Errno, 1);
|
||||
disable_query_log;
|
||||
eval SELECT "$last_error" AS Last_SQL_Error;
|
||||
enable_query_log;
|
||||
|
||||
set global slave_exec_mode='IDEMPOTENT';
|
||||
start slave sql_thread;
|
||||
connection master;
|
||||
sync_slave_with_master;
|
||||
#connection slave;
|
||||
set global slave_exec_mode='STRICT';
|
||||
|
||||
|
||||
connection master;
|
||||
UPDATE t2 SET a = 1 WHERE a = -1;
|
||||
|
||||
--echo *** slave must stop
|
||||
source include/wait_for_slave_sql_to_stop.inc;
|
||||
|
||||
connection slave;
|
||||
|
||||
let $last_error = query_get_value("SHOW SLAVE STATUS", Last_SQL_Errno, 1);
|
||||
disable_query_log;
|
||||
eval SELECT "$last_error" AS Last_SQL_Error;
|
||||
enable_query_log;
|
||||
|
||||
set global slave_exec_mode='IDEMPOTENT';
|
||||
start slave sql_thread;
|
||||
connection master;
|
||||
sync_slave_with_master;
|
||||
#connection slave;
|
||||
set global slave_exec_mode='STRICT';
|
||||
|
||||
|
||||
# cleanup for bug#31609 tests
|
||||
|
||||
connection master;
|
||||
set @@session.binlog_format= @save_binlog_format;
|
||||
drop table t1,t2,ti2,ti1;
|
||||
|
||||
sync_slave_with_master;
|
||||
|
||||
|
||||
--echo *** end of tests
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -119,6 +119,13 @@ show grants for mysqltest3@localhost;
|
|||
show grants for mysqltest4@localhost;
|
||||
|
||||
# Cleanup
|
||||
# connection slave;
|
||||
# BUG31552 changes idempotency is not default any longer
|
||||
# In order the following `delete from mysql.user',
|
||||
# where mysqltest1 does not exist on slave,
|
||||
# to succeed on slave the mode is temporarily changed
|
||||
set global slave_exec_mode='IDEMPOTENT';
|
||||
|
||||
connection master;
|
||||
drop table t1, t4, mysqltest2.t2;
|
||||
drop database mysqltest2;
|
||||
|
@ -129,7 +136,10 @@ delete from mysql.db where user like "mysqltest%";
|
|||
# move it to slave instead
|
||||
#delete from mysql.tables_priv where user like "mysqltest%";
|
||||
delete from mysql.columns_priv where user like "mysqltest%";
|
||||
|
||||
sync_slave_with_master;
|
||||
# bug#31552: do not restore the mode here but later in order
|
||||
# to succeed with yet the following delete from mysql.tables_priv
|
||||
|
||||
#BUG27606
|
||||
delete from mysql.tables_priv where user like "mysqltest%";
|
||||
|
@ -155,6 +165,7 @@ CREATE TEMPORARY TABLE tmptbl504451f4258$1 (id INT NOT NULL) ENGINE=MEMORY;
|
|||
INSERT INTO t5 (word) VALUES ('TEST’');
|
||||
SELECT HEX(word) FROM t5;
|
||||
sync_slave_with_master;
|
||||
set @@global.slave_exec_mode= default; # bug#31552 comments above
|
||||
connection slave;
|
||||
SELECT HEX(word) FROM t5;
|
||||
--error 1146
|
||||
|
|
|
@ -6,7 +6,6 @@ source include/master-slave.inc;
|
|||
|
||||
save_master_pos;
|
||||
connection slave;
|
||||
sleep 1;
|
||||
show variables like 'init_slave';
|
||||
show variables like 'max_connections';
|
||||
sync_with_master;
|
||||
|
|
|
@ -17,18 +17,8 @@ let $query = "INSERT DELAYED INTO t1 VALUES (1, 'Dr. No'), (2, 'From Russia With
|
|||
--exec $MYSQL_SLAP --silent --concurrency=5 --iterations=200 --query=$query --delimiter=";"
|
||||
|
||||
# Wait until all the 5000 inserts has been inserted into the table
|
||||
--disable_query_log
|
||||
let $counter= 300; # Max 30 seconds wait
|
||||
while (`select count(*)!=5000 from mysqlslap.t1`)
|
||||
{
|
||||
sleep 0.1;
|
||||
dec $counter;
|
||||
if (!$counter)
|
||||
{
|
||||
Number of records in t1 didnt reach 5000;
|
||||
}
|
||||
}
|
||||
--enable_query_log
|
||||
let $wait_condition= SELECT COUNT(*) = 5000 FROM mysqlslap.t1;
|
||||
--source include/wait_condition.inc
|
||||
|
||||
SELECT COUNT(*) FROM mysqlslap.t1;
|
||||
sync_slave_with_master;
|
||||
|
|
|
@ -202,10 +202,10 @@ SET GLOBAL EVENT_SCHEDULER = off;
|
|||
# Check original objects
|
||||
--echo
|
||||
SHOW TABLES LIKE 't%';
|
||||
SELECT table_name FROM information_schema.views WHERE table_schema='test';
|
||||
SELECT trigger_name, event_manipulation, event_object_table FROM information_schema.triggers WHERE trigger_schema='test';
|
||||
SELECT routine_type, routine_name FROM information_schema.routines WHERE routine_schema='test';
|
||||
SELECT event_name, status FROM information_schema.events WHERE event_schema='test';
|
||||
SELECT table_name FROM information_schema.views WHERE table_schema='test' ORDER BY table_name;
|
||||
SELECT trigger_name, event_manipulation, event_object_table FROM information_schema.triggers WHERE trigger_schema='test' ORDER BY trigger_name;
|
||||
SELECT routine_type, routine_name FROM information_schema.routines WHERE routine_schema='test' ORDER BY routine_name;
|
||||
SELECT event_name, status FROM information_schema.events WHERE event_schema='test' ORDER BY event_name;
|
||||
|
||||
# Check original data
|
||||
--echo
|
||||
|
@ -229,10 +229,10 @@ SELECT a,b FROM v11 ORDER BY a;
|
|||
# Check replicated objects
|
||||
--echo
|
||||
SHOW TABLES LIKE 't%';
|
||||
SELECT table_name FROM information_schema.views WHERE table_schema='test';
|
||||
SELECT trigger_name, event_manipulation, event_object_table FROM information_schema.triggers WHERE trigger_schema='test';
|
||||
SELECT routine_type, routine_name FROM information_schema.routines WHERE routine_schema='test';
|
||||
SELECT event_name, status FROM information_schema.events WHERE event_schema='test';
|
||||
SELECT table_name FROM information_schema.views WHERE table_schema='test' ORDER BY table_name;
|
||||
SELECT trigger_name, event_manipulation, event_object_table FROM information_schema.triggers WHERE trigger_schema='test' ORDER BY trigger_name;
|
||||
SELECT routine_type, routine_name FROM information_schema.routines WHERE routine_schema='test' ORDER BY routine_name;
|
||||
SELECT event_name, status FROM information_schema.events WHERE event_schema='test' ORDER BY event_name;
|
||||
|
||||
# Check replicated data
|
||||
--echo
|
||||
|
|
|
@ -36,11 +36,12 @@ delimiter ;|
|
|||
CALL test.p1();
|
||||
SELECT * FROM test.t1 ORDER BY blob_column;
|
||||
save_master_pos;
|
||||
# Need to allow some time when NDB engine is used for
|
||||
# the injector thread to have time to populate binlog
|
||||
sleep 10;
|
||||
sync_slave_with_master;
|
||||
connection slave;
|
||||
# Need to allow some time when NDB engine is used for
|
||||
# the injector thread to have time to populate binlog
|
||||
let $wait_condition= SELECT INSTR(blob_column,'aberration') > 0 FROM test.t1 WHERE a = 2;
|
||||
--source include/wait_condition.inc
|
||||
SELECT * FROM test.t1 ORDER BY blob_column;
|
||||
|
||||
# Cleanup
|
||||
|
|
|
@ -109,6 +109,7 @@ DROP TABLE t1, t1_slave;
|
|||
DROP PROCEDURE test_replication_sp1;
|
||||
DROP PROCEDURE test_replication_sp2;
|
||||
DROP FUNCTION test_replication_sf;
|
||||
--remove_file $MYSQLTEST_VARDIR/master-data/test/rpl_misc_functions.outfile
|
||||
--sync_slave_with_master
|
||||
|
||||
|
||||
|
|
|
@ -242,12 +242,17 @@ INSERT INTO t1 VALUES (1,'master,slave'), (2,'master,slave');
|
|||
sync_slave_with_master;
|
||||
UPDATE t1 SET a = 5, b = 'slave' WHERE a = 1;
|
||||
SELECT * FROM t1 ORDER BY a;
|
||||
# since bug#31552/31609 idempotency is not default any longer. In
|
||||
# order the preceeding test UPDATE t1 to pass the mode is switched
|
||||
# temprorarily
|
||||
set @@global.slave_exec_mode= 'IDEMPOTENT';
|
||||
--echo **** On Master ****
|
||||
connection master;
|
||||
UPDATE t1 SET a = 5, b = 'master' WHERE a = 1;
|
||||
SELECT * FROM t1 ORDER BY a;
|
||||
--echo **** On Slave ****
|
||||
sync_slave_with_master;
|
||||
set @@global.slave_exec_mode= default;
|
||||
let $last_error = query_get_value("SHOW SLAVE STATUS", Last_SQL_Error, 1);
|
||||
disable_query_log;
|
||||
eval SELECT "$last_error" AS Last_SQL_Error;
|
||||
|
|
|
@ -72,7 +72,7 @@ CREATE TABLE t7 (UNIQUE(b)) SELECT a,b FROM tt3;
|
|||
# Shouldn't be written to the binary log
|
||||
--replace_column 1 # 4 #
|
||||
--replace_regex /\/\* xid=.* \*\//\/* XID *\// /table_id: [0-9]+/table_id: #/
|
||||
SHOW BINLOG EVENTS FROM 1100;
|
||||
SHOW BINLOG EVENTS FROM 1374;
|
||||
|
||||
# Test that INSERT-SELECT works the same way as for SBR.
|
||||
CREATE TABLE t7 (a INT, b INT UNIQUE);
|
||||
|
@ -82,7 +82,7 @@ SELECT * FROM t7 ORDER BY a,b;
|
|||
# Should be written to the binary log
|
||||
--replace_column 1 # 4 #
|
||||
--replace_regex /\/\* xid=.* \*\//\/* XID *\// /table_id: [0-9]+/table_id: #/
|
||||
SHOW BINLOG EVENTS FROM 1100;
|
||||
SHOW BINLOG EVENTS FROM 1374;
|
||||
sync_slave_with_master;
|
||||
SELECT * FROM t7 ORDER BY a,b;
|
||||
|
||||
|
@ -94,7 +94,7 @@ INSERT INTO t7 SELECT a,b FROM tt4;
|
|||
ROLLBACK;
|
||||
--replace_column 1 # 4 #
|
||||
--replace_regex /\/\* xid=.* \*\//\/* XID *\// /table_id: [0-9]+/table_id: #/
|
||||
SHOW BINLOG EVENTS FROM 1298;
|
||||
SHOW BINLOG EVENTS FROM 1572;
|
||||
SELECT * FROM t7 ORDER BY a,b;
|
||||
sync_slave_with_master;
|
||||
SELECT * FROM t7 ORDER BY a,b;
|
||||
|
@ -110,7 +110,7 @@ CREATE TEMPORARY TABLE tt7 SELECT 1;
|
|||
--query_vertical SHOW CREATE TABLE t9
|
||||
--replace_column 1 # 4 #
|
||||
--replace_regex /\/\* xid=.* \*\//\/* XID *\// /table_id: [0-9]+/table_id: #/
|
||||
SHOW BINLOG EVENTS FROM 1396;
|
||||
SHOW BINLOG EVENTS FROM 1670;
|
||||
sync_slave_with_master;
|
||||
--echo **** On Slave ****
|
||||
--query_vertical SHOW CREATE TABLE t8
|
||||
|
|
|
@ -9,6 +9,12 @@
|
|||
# first, cause a duplicate key problem on the slave
|
||||
create table t1(n int auto_increment primary key, s char(10));
|
||||
sync_slave_with_master;
|
||||
|
||||
# bug#31552/31609 idempotency is not default any longer
|
||||
# so that the declared in heading comments aim of the test
|
||||
# should be backed up with explicit setting of the slave mode
|
||||
set @@global.slave_exec_mode= 'IDEMPOTENT';
|
||||
|
||||
insert into t1 values (2,'old');
|
||||
connection master;
|
||||
insert into t1 values(NULL,'new');
|
||||
|
@ -43,3 +49,4 @@ select * from t1 order by n;
|
|||
connection master;
|
||||
drop table t1;
|
||||
sync_slave_with_master;
|
||||
set @@global.slave_exec_mode= default;
|
||||
|
|
|
@ -46,11 +46,15 @@ delimiter ;//
|
|||
|
||||
-- disable_query_log
|
||||
-- disable_result_log
|
||||
SET @wait_count=1;
|
||||
let $1=10;
|
||||
while ($1)
|
||||
{
|
||||
call test.p1();
|
||||
sleep 1;
|
||||
let $wait_condition= SELECT COUNT(*) = @wait_count FROM test.t1;
|
||||
-- source include/wait_condition.inc
|
||||
-- disable_query_log
|
||||
SET @wait_count = @wait_count + 1;
|
||||
dec $1;
|
||||
}
|
||||
-- enable_result_log
|
||||
|
|
|
@ -84,7 +84,8 @@ let $message=< ---- Master selects-- >;
|
|||
--source include/show_msg.inc
|
||||
connection master;
|
||||
CALL test.p1();
|
||||
sleep 6;
|
||||
let $wait_condition= SELECT COUNT(*) = 4 FROM t3;
|
||||
--source include/wait_condition.inc
|
||||
SELECT * FROM test.t3 ORDER BY id3;
|
||||
|
||||
let $message=< ---- Slave selects-- >;
|
||||
|
|
|
@ -33,7 +33,8 @@ start slave;
|
|||
# hope one second is not enough for slave to reach the last
|
||||
# Rows_log_event, so that test actually tests something.
|
||||
|
||||
real_sleep 1;
|
||||
let $wait_condition= SELECT COUNT(*) >= 10 FROM t1;
|
||||
--source include/wait_condition.inc
|
||||
stop slave;
|
||||
|
||||
# see if slave hangs on DROP TABLE
|
||||
|
|
|
@ -53,11 +53,15 @@ delimiter ;//
|
|||
|
||||
-- disable_query_log
|
||||
-- disable_result_log
|
||||
SET @wait_count = 1;
|
||||
let $1=10;
|
||||
while ($1)
|
||||
{
|
||||
CALL test.p2();
|
||||
sleep 1;
|
||||
let $wait_condition= SELECT COUNT(*) = @wait_count FROM test.t3;
|
||||
--source include/wait_condition.inc
|
||||
--disable_query_log
|
||||
SET @wait_count = @wait_count + 1;
|
||||
dec $1;
|
||||
}
|
||||
-- enable_result_log
|
||||
|
|
|
@ -108,11 +108,13 @@ UPDATE test.t2 SET b1 = 0 WHERE b1 = 1;
|
|||
|
||||
INSERT INTO test.t1 VALUES(NULL,1,'add some more test data test.', 'and hope for the best', 3.321,5.221,0,YEAR(NOW()),NOW());
|
||||
|
||||
# To make sure BUG#14698 is gone, we sleep 2 seconds before calling trigger
|
||||
# To make sure BUG#14698 is gone, we sleep before calling trigger
|
||||
# (with the bug in, that caused differences in TIMESTAMP columns).
|
||||
# We just need to let the machine's clock advance, it's not
|
||||
# to do synchronization, so real_sleep is good.
|
||||
real_sleep 2;
|
||||
# to do synchronization.
|
||||
|
||||
let $wait_condition= SELECT SUM(f)= ROUND(SUM(f)) FROM t3;
|
||||
--source include/wait_condition.inc
|
||||
|
||||
DELETE FROM test.t1 WHERE id = 1;
|
||||
|
||||
|
|
|
@ -51,8 +51,9 @@ CREATE TABLE t1 (
|
|||
`data` varchar(100),
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=MyISAM;
|
||||
|
||||
--disable_warnings
|
||||
INSERT INTO t1(data) VALUES(SESSION_USER());
|
||||
--enable_warnings
|
||||
save_master_pos;
|
||||
connection slave;
|
||||
sync_with_master;
|
||||
|
|
|
@ -24,7 +24,8 @@ start slave;
|
|||
connection master;
|
||||
insert into t1 values (1);
|
||||
#reasonable timeout for changes to propagate to slave
|
||||
sleep 3;
|
||||
let $wait_condition= SELECT COUNT(*) = 1 FROM t1;
|
||||
source include/wait_condition.inc;
|
||||
connection slave;
|
||||
select * from t1;
|
||||
|
||||
|
|
|
@ -3,12 +3,12 @@ source include/master-slave.inc;
|
|||
#
|
||||
# Bug#6148 ()
|
||||
#
|
||||
connection slave;
|
||||
stop slave;
|
||||
|
||||
# Let the master do lots of insertions
|
||||
connection master;
|
||||
create table t1(n int);
|
||||
sync_slave_with_master;
|
||||
stop slave;
|
||||
connection master;
|
||||
let $1=5000;
|
||||
disable_query_log;
|
||||
while ($1)
|
||||
|
@ -21,7 +21,8 @@ save_master_pos;
|
|||
|
||||
connection slave;
|
||||
start slave;
|
||||
sleep 1;
|
||||
let $wait_condition= SELECT COUNT(*) > 0 FROM t1;
|
||||
source include/wait_condition.inc;
|
||||
stop slave io_thread;
|
||||
start slave io_thread;
|
||||
sync_with_master;
|
||||
|
|
|
@ -293,7 +293,8 @@ insert delayed into t2 values(rand());
|
|||
set @a=2.345;
|
||||
insert delayed into t2 values(@a);
|
||||
|
||||
sleep 4; # time for the delayed inserts to reach disk
|
||||
let $wait_condition= SELECT COUNT(*) = 19 FROM t2;
|
||||
--source include/wait_condition.inc
|
||||
|
||||
# If you want to do manual testing of the mixed mode regarding UDFs (not
|
||||
# testable automatically as quite platform- and compiler-dependent),
|
||||
|
|
|
@ -60,23 +60,24 @@ insert into t1 values (1),(2),(3),(4),(5),(6),(7),(8),(9),(10);
|
|||
connection con1;
|
||||
create temporary table t3(f int);
|
||||
insert into t3 select * from t1 where f<6;
|
||||
sleep 1;
|
||||
let $wait_condition= SELECT COUNT(*) = 5 FROM t3;
|
||||
--source include/wait_condition.inc
|
||||
|
||||
connection con2;
|
||||
create temporary table t3(f int);
|
||||
sleep 1;
|
||||
|
||||
connection con1;
|
||||
insert into t2 select count(*) from t3;
|
||||
sleep 1;
|
||||
let $wait_condition= SELECT COUNT(*) = 1 FROM t2;
|
||||
--source include/wait_condition.inc
|
||||
|
||||
connection con2;
|
||||
insert into t3 select * from t1 where f>=4;
|
||||
sleep 1;
|
||||
let $wait_condition= SELECT COUNT(*) = 7 FROM t3;
|
||||
--source include/wait_condition.inc
|
||||
|
||||
connection con1;
|
||||
drop temporary table t3;
|
||||
sleep 1;
|
||||
|
||||
connection con2;
|
||||
insert into t2 select count(*) from t3;
|
||||
|
|
|
@ -8,6 +8,9 @@ INSERT INTO t1 VALUES (1,1), (2,2), (3,3), (4,4);
|
|||
--echo **** On Slave ****
|
||||
sync_slave_with_master;
|
||||
SHOW STATUS LIKE 'Slave_retried_transactions';
|
||||
# since bug#31552/31609 idempotency is not default any longer. In order
|
||||
# the following UPDATE t1 to pass the mode is switched temprorarily
|
||||
set @@global.slave_exec_mode= 'IDEMPOTENT';
|
||||
UPDATE t1 SET a = 5, b = 47 WHERE a = 1;
|
||||
SELECT * FROM t1;
|
||||
--echo **** On Master ****
|
||||
|
@ -17,6 +20,7 @@ SELECT * FROM t1;
|
|||
#SHOW BINLOG EVENTS;
|
||||
--echo **** On Slave ****
|
||||
sync_slave_with_master;
|
||||
set @@global.slave_exec_mode= default;
|
||||
SHOW STATUS LIKE 'Slave_retried_transactions';
|
||||
SELECT * FROM t1;
|
||||
source include/show_slave_status.inc;
|
||||
|
|
|
@ -1,3 +1,9 @@
|
|||
stop slave;
|
||||
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
|
||||
reset master;
|
||||
reset slave;
|
||||
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
|
||||
start slave;
|
||||
show variables like 'collation_server';
|
||||
Variable_name Value
|
||||
collation_server ucs2_unicode_ci
|
||||
|
@ -5,5 +11,17 @@ show variables like "%character_set_ser%";
|
|||
Variable_name Value
|
||||
character_set_server ucs2
|
||||
DROP TABLE IF EXISTS t1;
|
||||
create table t1 (a int);
|
||||
create table t1 (a int) ENGINE=NDB;
|
||||
drop table t1;
|
||||
CREATE TABLE `t1` ( `nid` int(11) NOT NULL default '0',
|
||||
`nom` char(4) default NULL,
|
||||
`prenom` char(4) default NULL,
|
||||
PRIMARY KEY (`nid`))
|
||||
ENGINE=ndbcluster;
|
||||
INSERT INTO t1 VALUES(1,"XYZ1","ABC1");
|
||||
select * from t1 order by nid;
|
||||
nid nom prenom
|
||||
1 XYZ1 ABC1
|
||||
select * from t1 order by nid;
|
||||
nid nom prenom
|
||||
1 XYZ1 ABC1
|
||||
|
|
|
@ -22,11 +22,11 @@ from mysql.ndb_apply_status;
|
|||
|
||||
show binlog events from <start_pos> limit 1;
|
||||
Log_name Pos Event_type Server_id End_log_pos Info
|
||||
master-bin.000001 <start_pos> Query 1 # use `test`; insert into t1 values (1,2)
|
||||
master-bin.000001 <start_pos> Query 1 # use `test`; BEGIN
|
||||
|
||||
show binlog events from <start_pos> limit 1,1;
|
||||
Log_name Pos Event_type Server_id End_log_pos Info
|
||||
master-bin.000001 # Xid 1 445 COMMIT /* XID */
|
||||
master-bin.000001 # Query 1 486 use `test`; insert into t1 values (1,2)
|
||||
|
||||
begin;
|
||||
insert into t1 values (2,3);
|
||||
|
|
140
mysql-test/suite/rpl_ndb/r/rpl_ndb_transaction.result
Normal file
140
mysql-test/suite/rpl_ndb/r/rpl_ndb_transaction.result
Normal file
|
@ -0,0 +1,140 @@
|
|||
stop slave;
|
||||
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
|
||||
reset master;
|
||||
reset slave;
|
||||
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
|
||||
start slave;
|
||||
CREATE TABLE tmyisam (a int) ENGINE = MYISAM;
|
||||
CREATE TABLE tinnodb (a int) ENGINE = INNODB;
|
||||
CREATE TABLE tndb (a int) ENGINE = NDB;
|
||||
SHOW CREATE TABLE tmyisam;
|
||||
Table Create Table
|
||||
tmyisam CREATE TABLE `tmyisam` (
|
||||
`a` int(11) DEFAULT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
||||
SHOW CREATE TABLE tinnodb;
|
||||
Table Create Table
|
||||
tinnodb CREATE TABLE `tinnodb` (
|
||||
`a` int(11) DEFAULT NULL
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=latin1
|
||||
SHOW CREATE TABLE tndb;
|
||||
Table Create Table
|
||||
tndb CREATE TABLE `tndb` (
|
||||
`a` int(11) DEFAULT NULL
|
||||
) ENGINE=ndbcluster DEFAULT CHARSET=latin1
|
||||
==== Test 1: Non-XA Engines ====
|
||||
--- on master ---
|
||||
SET AUTOCOMMIT = 1;
|
||||
INSERT INTO tndb VALUES (1);
|
||||
INSERT INTO tmyisam VALUES (1);
|
||||
BEGIN;
|
||||
INSERT INTO tndb VALUES (2);
|
||||
INSERT INTO tndb VALUES (3);
|
||||
COMMIT;
|
||||
BEGIN;
|
||||
INSERT INTO tmyisam VALUES (2);
|
||||
INSERT INTO tmyisam VALUES (3);
|
||||
COMMIT;
|
||||
BEGIN;
|
||||
INSERT INTO tndb VALUES (4);
|
||||
INSERT INTO tmyisam VALUES (4);
|
||||
COMMIT;
|
||||
BEGIN;
|
||||
INSERT INTO tndb VALUES (5);
|
||||
INSERT INTO tndb VALUES (6);
|
||||
ROLLBACK;
|
||||
BEGIN;
|
||||
INSERT INTO tmyisam VALUES (5);
|
||||
INSERT INTO tmyisam VALUES (6);
|
||||
ROLLBACK;
|
||||
Warnings:
|
||||
Warning 1196 Some non-transactional changed tables couldn't be rolled back
|
||||
BEGIN;
|
||||
INSERT INTO tndb VALUES (7);
|
||||
INSERT INTO tmyisam VALUES (7);
|
||||
ROLLBACK;
|
||||
Warnings:
|
||||
Warning 1196 Some non-transactional changed tables couldn't be rolled back
|
||||
SELECT * FROM tndb ORDER BY a;
|
||||
a
|
||||
1
|
||||
2
|
||||
3
|
||||
4
|
||||
SELECT * FROM tmyisam ORDER BY a;
|
||||
a
|
||||
1
|
||||
2
|
||||
3
|
||||
4
|
||||
5
|
||||
6
|
||||
7
|
||||
--- on slave ---
|
||||
SELECT * FROM tndb ORDER BY a;
|
||||
a
|
||||
1
|
||||
2
|
||||
3
|
||||
4
|
||||
SELECT * FROM tmyisam ORDER BY a;
|
||||
a
|
||||
1
|
||||
2
|
||||
3
|
||||
4
|
||||
5
|
||||
6
|
||||
7
|
||||
==== Test 2: Master crash before writing XID event on XA engine ====
|
||||
--- on master ---
|
||||
INSERT INTO tinnodb VALUES (1);
|
||||
SELECT * FROM tinnodb ORDER BY a;
|
||||
a
|
||||
1
|
||||
--- on slave ---
|
||||
STOP SLAVE;
|
||||
SHOW SLAVE STATUS;
|
||||
Slave_IO_State #
|
||||
Master_Host 127.0.0.1
|
||||
Master_User root
|
||||
Master_Port MASTER_PORT
|
||||
Connect_Retry 1
|
||||
Master_Log_File master-bin.000001
|
||||
Read_Master_Log_Pos 1740
|
||||
Relay_Log_File #
|
||||
Relay_Log_Pos #
|
||||
Relay_Master_Log_File master-bin.000001
|
||||
Slave_IO_Running No
|
||||
Slave_SQL_Running No
|
||||
Replicate_Do_DB
|
||||
Replicate_Ignore_DB
|
||||
Replicate_Do_Table
|
||||
Replicate_Ignore_Table #
|
||||
Replicate_Wild_Do_Table
|
||||
Replicate_Wild_Ignore_Table
|
||||
Last_Errno 0
|
||||
Last_Error
|
||||
Skip_Counter 0
|
||||
Exec_Master_Log_Pos 1579
|
||||
Relay_Log_Space #
|
||||
Until_Condition None
|
||||
Until_Log_File
|
||||
Until_Log_Pos 0
|
||||
Master_SSL_Allowed No
|
||||
Master_SSL_CA_File
|
||||
Master_SSL_CA_Path
|
||||
Master_SSL_Cert
|
||||
Master_SSL_Cipher
|
||||
Master_SSL_Key
|
||||
Seconds_Behind_Master #
|
||||
Master_SSL_Verify_Server_Cert No
|
||||
Last_IO_Errno #
|
||||
Last_IO_Error #
|
||||
Last_SQL_Errno 0
|
||||
Last_SQL_Error
|
||||
SELECT * FROM tinnodb ORDER BY a;
|
||||
a
|
||||
DROP TABLE tmyisam;
|
||||
DROP TABLE tinnodb;
|
||||
DROP TABLE tndb;
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue