1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-29 05:21:33 +03:00

Merge stella.local:/home2/mydev/mysql-5.1-ateam

into  stella.local:/home2/mydev/mysql-5.1-axmrg
This commit is contained in:
unknown
2008-02-14 21:00:10 +01:00
250 changed files with 26242 additions and 2944 deletions

View 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"

View 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

View 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

View File

@ -32,7 +32,8 @@ INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include
ADD_EXECUTABLE(mysql completion_hash.cc mysql.cc readline.cc sql_string.cc ../mysys/my_conio.c) ADD_EXECUTABLE(mysql completion_hash.cc mysql.cc readline.cc sql_string.cc ../mysys/my_conio.c)
TARGET_LINK_LIBRARIES(mysql mysqlclient_notls wsock32) TARGET_LINK_LIBRARIES(mysql mysqlclient_notls wsock32)
ADD_EXECUTABLE(mysqltest mysqltest.c ../mysys/my_getsystime.c ../mysys/my_copy.c) ADD_EXECUTABLE(mysqltest mysqltest.c ../mysys/my_getsystime.c
../mysys/my_copy.c ../mysys/my_mkdir.c)
TARGET_LINK_LIBRARIES(mysqltest mysqlclient_notls regex wsock32) TARGET_LINK_LIBRARIES(mysqltest mysqlclient_notls regex wsock32)
ADD_EXECUTABLE(mysqlcheck mysqlcheck.c) ADD_EXECUTABLE(mysqlcheck mysqlcheck.c)

View File

@ -88,7 +88,8 @@ mysqlslap_LDADD = $(CXXLDFLAGS) $(CLIENT_THREAD_LIBS) \
mysqltest_SOURCES= mysqltest.c \ mysqltest_SOURCES= mysqltest.c \
$(top_srcdir)/mysys/my_getsystime.c \ $(top_srcdir)/mysys/my_getsystime.c \
$(top_srcdir)/mysys/my_copy.c $(top_srcdir)/mysys/my_copy.c \
$(top_srcdir)/mysys/my_mkdir.c
mysqltest_LDADD = $(top_builddir)/regex/libregex.a $(LDADD) mysqltest_LDADD = $(top_builddir)/regex/libregex.a $(LDADD)
mysql_upgrade_SOURCES= mysql_upgrade.c \ mysql_upgrade_SOURCES= mysql_upgrade.c \

View File

@ -76,7 +76,7 @@ enum options_client
OPT_SLAP_POST_SYSTEM, OPT_SLAP_POST_SYSTEM,
OPT_SLAP_COMMIT, OPT_SLAP_COMMIT,
OPT_SLAP_DETACH, 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_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_DEBUG_INFO, OPT_DEBUG_CHECK, OPT_COLUMN_TYPES, OPT_ERROR_LOG_FILE,
OPT_WRITE_BINLOG, OPT_DUMP_DATE, OPT_WRITE_BINLOG, OPT_DUMP_DATE,

View File

@ -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 one_database=0, to_last_remote_log= 0, disable_log_bin= 0;
static bool opt_hexdump= 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 const char* database= 0;
static my_bool force_opt= 0, short_form= 0, remote_opt= 0; static my_bool force_opt= 0, short_form= 0, remote_opt= 0;
static my_bool debug_info_flag, debug_check_flag; 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() This is because the event will be created (alloced) in read_log_event()
(which returns a pointer) in check_header(). (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, static int dump_local_log_entries(PRINT_EVENT_INFO *print_event_info,
const char* logname); const char* logname);
@ -265,7 +270,7 @@ public:
File prepare_new_file_for_old_format(Load_log_event *le, char *filename); File prepare_new_file_for_old_format(Load_log_event *le, char *filename);
int load_old_format_file(NET* net, const char *server_fname, int load_old_format_file(NET* net, const char *server_fname,
uint server_fname_len, File file); uint server_fname_len, File file);
int process_first_event(const char *bname, uint blen, const char *block, int process_first_event(const char *bname, uint blen, const uchar *block,
uint block_len, uint file_id, uint block_len, uint file_id,
Create_file_log_event *ce); Create_file_log_event *ce);
}; };
@ -370,7 +375,7 @@ int Load_log_processor::load_old_format_file(NET* net, const char*server_fname,
*/ */
int Load_log_processor::process_first_event(const char *bname, uint blen, int Load_log_processor::process_first_event(const char *bname, uint blen,
const char *block, uint block_len, const uchar *block, uint block_len,
uint file_id, uint file_id,
Create_file_log_event *ce) Create_file_log_event *ce)
{ {
@ -557,7 +562,7 @@ int process_event(PRINT_EVENT_INFO *print_event_info, Log_event *ev,
else else
print_event_info->hexdump_from= pos; 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())); 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: case QUERY_EVENT:
if (check_database(((Query_log_event*)ev)->db)) if (check_database(((Query_log_event*)ev)->db))
goto end; 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); write_event_header_and_base64(ev, result_file, print_event_info);
else else
ev->print(result_file, print_event_info); 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' filename and use LOCAL), prepared in the 'case EXEC_LOAD_EVENT'
below. below.
*/ */
if (opt_base64_output) if (opt_base64_output_mode == BASE64_OUTPUT_ALWAYS)
{ {
write_event_header_and_base64(ce, result_file, print_event_info); write_event_header_and_base64(ce, result_file, print_event_info);
} }
@ -670,6 +675,13 @@ Create_file event for file_id: %u\n",exv->file_id);
if (fname) if (fname)
{ {
/*
Fix the path so it can be consumed by mysql client (requires Unix path).
*/
int stop= strlen(fname);
for (int i= 0; i < stop; i++)
if (fname[i] == '\\')
fname[i]= '/';
exlq->print(result_file, print_event_info, fname); exlq->print(result_file, print_event_info, fname);
my_free(fname, MYF(MY_WME)); my_free(fname, MYF(MY_WME));
} }
@ -678,6 +690,38 @@ Create_file event for file_id: %u\n",exv->file_id);
Begin_load_query event for file_id: %u\n", exlq->file_id); Begin_load_query event for file_id: %u\n", exlq->file_id);
break; 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: default:
ev->print(result_file, print_event_info); ev->print(result_file, print_event_info);
} }
@ -707,12 +751,17 @@ static struct my_option my_long_options[] =
{"autoclose", OPT_AUTO_CLOSE, "Auto close the screen on exit for Netware.", {"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}, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
#endif #endif
{"base64-output", OPT_BASE64_OUTPUT, {"base64-output", OPT_BASE64_OUTPUT_MODE,
"Print all binlog entries using base64 encoding. " "Determine when the output statements should be base64-encoded BINLOG "
"This is for debugging only. Logs produced using this option " "statements: 'never' disables it and works only for binlogs without "
"should not be applied on production systems.", "row-based events; 'auto' is the default and prints base64 only when "
(uchar**) &opt_base64_output, (uchar**) &opt_base64_output, 0, GET_BOOL, "necessary (i.e., for row-based events and format description events); "
NO_ARG, 0, 0, 0, 0, 0, 0}, "'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 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 number found in binlog to a charset name (to be able to print things
@ -788,7 +837,10 @@ static struct my_option my_long_options[] =
{"set-charset", OPT_SET_CHARSET, {"set-charset", OPT_SET_CHARSET,
"Add 'SET NAMES character_set' to the output.", (uchar**) &charset, "Add 'SET NAMES character_set' to the output.", (uchar**) &charset,
(uchar**) &charset, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, (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, (uchar**) &short_form, (uchar**) &short_form, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0,
0, 0}, 0, 0},
{"socket", 'S', "Socket file to use for connection.", {"socket", 'S', "Socket file to use for connection.",
@ -973,6 +1025,15 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
case OPT_STOP_DATETIME: case OPT_STOP_DATETIME:
stop_datetime= convert_str_to_timestamp(stop_datetime_str); stop_datetime= convert_str_to_timestamp(stop_datetime_str);
break; 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': case 'V':
print_version(); print_version();
exit(0); exit(0);
@ -1305,8 +1366,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, 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 header[BIN_LOG_HEADER_SIZE];
uchar buf[PROBE_HEADER_LEN]; uchar buf[PROBE_HEADER_LEN];
@ -1369,10 +1453,12 @@ Could not read entry at offset %lu : Error in log format or read error",
} }
else 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 */ /* 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) < if (uint4korr(buf + EVENT_LEN_OFFSET) <
(LOG_EVENT_MINIMAL_HEADER_LEN + START_V3_HEADER_LEN)) (LOG_EVENT_MINIMAL_HEADER_LEN + START_V3_HEADER_LEN))
{ {
@ -1384,8 +1470,9 @@ Could not read entry at offset %lu : Error in log format or read error",
} }
else if (tmp_pos >= start_position) else if (tmp_pos >= start_position)
break; 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; Format_description_log_event *new_description_event;
my_b_seek(file, tmp_pos); /* seek back to event's start */ my_b_seek(file, tmp_pos); /* seek back to event's start */
if (!(new_description_event= (Format_description_log_event*) if (!(new_description_event= (Format_description_log_event*)
@ -1397,11 +1484,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", at offset %lu ; this could be a log format error or read error",
tmp_pos); tmp_pos);
} }
delete *description_event; if (opt_base64_output_mode == BASE64_OUTPUT_AUTO
*description_event= new_description_event; || 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")); DBUG_PRINT("info",("Setting description_event"));
} }
else if (buf[4] == ROTATE_EVENT) else if (buf[EVENT_TYPE_OFFSET] == ROTATE_EVENT)
{ {
Log_event *ev; Log_event *ev;
my_b_seek(file, tmp_pos); /* seek back to event's start */ my_b_seek(file, tmp_pos); /* seek back to event's start */
@ -1430,7 +1528,7 @@ static int dump_local_log_entries(PRINT_EVENT_INFO *print_event_info,
uchar tmp_buff[BIN_LOG_HEADER_SIZE]; uchar tmp_buff[BIN_LOG_HEADER_SIZE];
int error= 0; 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) if ((fd = my_open(logname, O_RDONLY | O_BINARY, MYF(MY_WME))) < 0)
return 1; return 1;
@ -1440,7 +1538,7 @@ static int dump_local_log_entries(PRINT_EVENT_INFO *print_event_info,
my_close(fd, MYF(MY_WME)); my_close(fd, MYF(MY_WME));
return 1; return 1;
} }
check_header(file, &glob_description_event); check_header(file, &glob_description_event, print_event_info);
} }
else // reading from stdin; else // reading from stdin;
{ {
@ -1462,7 +1560,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, if (init_io_cache(file, fileno(stdin), 0, READ_CACHE, (my_off_t) 0,
0, MYF(MY_WME | MY_NABP | MY_DONT_CHECK_FILESIZE))) 0, MYF(MY_WME | MY_NABP | MY_DONT_CHECK_FILESIZE)))
return 1; return 1;
check_header(file, &glob_description_event); check_header(file, &glob_description_event, print_event_info);
if (start_position) if (start_position)
{ {
/* skip 'start_position' characters from stdin */ /* skip 'start_position' characters from stdin */
@ -1554,6 +1652,9 @@ int main(int argc, char** argv)
exit(1); 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_set_max_open_files(open_files_limit);
MY_TMPDIR tmpdir; MY_TMPDIR tmpdir;

View File

@ -45,6 +45,10 @@
#ifdef HAVE_SYS_WAIT_H #ifdef HAVE_SYS_WAIT_H
#include <sys/wait.h> #include <sys/wait.h>
#endif #endif
#ifdef __WIN__
#include <direct.h>
#endif
/* Use cygwin for --exec and --system before 5.0 */ /* Use cygwin for --exec and --system before 5.0 */
#if MYSQL_VERSION_ID < 50000 #if MYSQL_VERSION_ID < 50000
@ -263,7 +267,7 @@ enum enum_commands {
Q_REPLACE_REGEX, Q_REMOVE_FILE, Q_FILE_EXIST, Q_REPLACE_REGEX, Q_REMOVE_FILE, Q_FILE_EXIST,
Q_WRITE_FILE, Q_COPY_FILE, Q_PERL, Q_DIE, Q_EXIT, Q_SKIP, Q_WRITE_FILE, Q_COPY_FILE, Q_PERL, Q_DIE, Q_EXIT, Q_SKIP,
Q_CHMOD_FILE, Q_APPEND_FILE, Q_CAT_FILE, Q_DIFF_FILES, Q_CHMOD_FILE, Q_APPEND_FILE, Q_CAT_FILE, Q_DIFF_FILES,
Q_SEND_QUIT, Q_CHANGE_USER, Q_SEND_QUIT, Q_CHANGE_USER, Q_MKDIR, Q_RMDIR,
Q_UNKNOWN, /* Unknown command. */ Q_UNKNOWN, /* Unknown command. */
Q_COMMENT, /* Comments, ignored. */ Q_COMMENT, /* Comments, ignored. */
@ -353,6 +357,9 @@ const char *command_names[]=
"diff_files", "diff_files",
"send_quit", "send_quit",
"change_user", "change_user",
"mkdir",
"rmdir",
0 0
}; };
@ -2736,6 +2743,67 @@ void do_file_exist(struct st_command *command)
} }
/*
SYNOPSIS
do_mkdir
command called command
DESCRIPTION
mkdir <dir_name>
Create the directory <dir_name>
*/
void do_mkdir(struct st_command *command)
{
int error;
static DYNAMIC_STRING ds_dirname;
const struct command_arg mkdir_args[] = {
"dirname", ARG_STRING, TRUE, &ds_dirname, "Directory to create"
};
DBUG_ENTER("do_mkdir");
check_command_args(command, command->first_argument,
mkdir_args, sizeof(mkdir_args)/sizeof(struct command_arg),
' ');
DBUG_PRINT("info", ("creating directory: %s", ds_dirname.str));
error= my_mkdir(ds_dirname.str, 0777, MYF(0)) != 0;
handle_command_error(command, error);
dynstr_free(&ds_dirname);
DBUG_VOID_RETURN;
}
/*
SYNOPSIS
do_rmdir
command called command
DESCRIPTION
rmdir <dir_name>
Remove the empty directory <dir_name>
*/
void do_rmdir(struct st_command *command)
{
int error;
static DYNAMIC_STRING ds_dirname;
const struct command_arg rmdir_args[] = {
"dirname", ARG_STRING, TRUE, &ds_dirname, "Directory to remove"
};
DBUG_ENTER("do_rmdir");
check_command_args(command, command->first_argument,
rmdir_args, sizeof(rmdir_args)/sizeof(struct command_arg),
' ');
DBUG_PRINT("info", ("removing directory: %s", ds_dirname.str));
error= rmdir(ds_dirname.str) != 0;
handle_command_error(command, error);
dynstr_free(&ds_dirname);
DBUG_VOID_RETURN;
}
/* /*
Read characters from line buffer or file. This is needed to allow Read characters from line buffer or file. This is needed to allow
my_ungetc() to buffer MAX_DELIMITER_LENGTH characters for a file my_ungetc() to buffer MAX_DELIMITER_LENGTH characters for a file
@ -6913,6 +6981,8 @@ int main(int argc, char **argv)
case Q_ECHO: do_echo(command); command_executed++; break; case Q_ECHO: do_echo(command); command_executed++; break;
case Q_SYSTEM: do_system(command); break; case Q_SYSTEM: do_system(command); break;
case Q_REMOVE_FILE: do_remove_file(command); break; case Q_REMOVE_FILE: do_remove_file(command); break;
case Q_MKDIR: do_mkdir(command); break;
case Q_RMDIR: do_rmdir(command); break;
case Q_FILE_EXIST: do_file_exist(command); break; case Q_FILE_EXIST: do_file_exist(command); break;
case Q_WRITE_FILE: do_write_file(command); break; case Q_WRITE_FILE: do_write_file(command); break;
case Q_APPEND_FILE: do_append_file(command); break; case Q_APPEND_FILE: do_append_file(command); break;

View File

@ -813,8 +813,8 @@ AC_CHECK_HEADERS(fcntl.h float.h floatingpoint.h ieeefp.h limits.h \
sys/timeb.h sys/types.h sys/un.h sys/vadvise.h sys/wait.h term.h \ sys/timeb.h sys/types.h sys/un.h sys/vadvise.h sys/wait.h term.h \
unistd.h utime.h sys/utime.h termio.h termios.h sched.h crypt.h alloca.h \ unistd.h utime.h sys/utime.h termio.h termios.h sched.h crypt.h alloca.h \
sys/ioctl.h malloc.h sys/malloc.h sys/ipc.h sys/shm.h linux/config.h \ sys/ioctl.h malloc.h sys/malloc.h sys/ipc.h sys/shm.h linux/config.h \
sys/prctl.h \ sys/prctl.h sys/resource.h sys/param.h port.h ieeefp.h \
sys/resource.h sys/param.h port.h ieeefp.h) execinfo.h)
AC_CHECK_HEADERS([xfs/xfs.h]) AC_CHECK_HEADERS([xfs/xfs.h])
@ -2041,7 +2041,7 @@ AC_CHECK_FUNCS(alarm bcmp bfill bmove bsearch bzero \
sighold sigset sigthreadmask port_create sleep \ sighold sigset sigthreadmask port_create sleep \
snprintf socket stpcpy strcasecmp strerror strsignal strnlen strpbrk strstr \ snprintf socket stpcpy strcasecmp strerror strsignal strnlen strpbrk strstr \
strtol strtoll strtoul strtoull tell tempnam thr_setconcurrency vidattr \ strtol strtoll strtoul strtoull tell tempnam thr_setconcurrency vidattr \
posix_fallocate) posix_fallocate backtrace backtrace_symbols backtrace_symbols_fd)
# #
# #
@ -2331,6 +2331,21 @@ then
fi fi
AC_MSG_RESULT("$netinet_inc") AC_MSG_RESULT("$netinet_inc")
AC_LANG_SAVE
AC_LANG_CPLUSPLUS
AC_CHECK_HEADERS(cxxabi.h)
AC_CACHE_CHECK([checking for abi::__cxa_demangle], mysql_cv_cxa_demangle,
[AC_TRY_LINK([#include <cxxabi.h>], [
char *foo= 0; int bar= 0;
foo= abi::__cxa_demangle(foo, foo, 0, &bar);
], [mysql_cv_cxa_demangle=yes], [mysql_cv_cxa_demangle=no])])
AC_LANG_RESTORE
if test "x$mysql_cv_cxa_demangle" = xyes; then
AC_DEFINE(HAVE_ABI_CXA_DEMANGLE, 1,
[Define to 1 if you have the `abi::__cxa_demangle' function.])
fi
#-------------------------------------------------------------------- #--------------------------------------------------------------------
# Check for requested features # Check for requested features
#-------------------------------------------------------------------- #--------------------------------------------------------------------

View File

@ -159,6 +159,22 @@ static inline my_bool bitmap_cmp(const MY_BITMAP *map1, const MY_BITMAP *map2)
#define bitmap_set_all(MAP) \ #define bitmap_set_all(MAP) \
(memset((MAP)->bitmap, 0xFF, 4*no_words_in_map((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 #ifdef __cplusplus
} }
#endif #endif

View File

@ -521,6 +521,11 @@ typedef int (*qsort2_cmp)(const void *, const void *, const void *);
#define my_b_tell(info) ((info)->pos_in_file + \ #define my_b_tell(info) ((info)->pos_in_file + \
(size_t) (*(info)->current_pos - (info)->request_pos)) (size_t) (*(info)->current_pos - (info)->request_pos))
#define my_b_get_buffer_start(info) (info)->request_pos
#define my_b_get_bytes_in_buffer(info) (char*) (info)->read_end - \
(char*) my_b_get_buffer_start(info)
#define my_b_get_pos_in_file(info) (info)->pos_in_file
/* tell write offset in the SEQ_APPEND cache */ /* tell write offset in the SEQ_APPEND cache */
int my_b_copy_to_file(IO_CACHE *cache, FILE *file); int my_b_copy_to_file(IO_CACHE *cache, FILE *file);
my_off_t my_b_append_tell(IO_CACHE* info); my_off_t my_b_append_tell(IO_CACHE* info);

View File

@ -45,7 +45,8 @@ dist-hook:
$(distdir)/std_data/ndb_backup51_data_be \ $(distdir)/std_data/ndb_backup51_data_be \
$(distdir)/std_data/ndb_backup51_data_le \ $(distdir)/std_data/ndb_backup51_data_le \
$(distdir)/std_data/parts \ $(distdir)/std_data/parts \
$(distdir)/lib $(distdir)/lib \
$(distdir)/lib/My
-$(INSTALL_DATA) $(srcdir)/t/*.def $(distdir)/t -$(INSTALL_DATA) $(srcdir)/t/*.def $(distdir)/t
$(INSTALL_DATA) $(srcdir)/t/*.test $(distdir)/t $(INSTALL_DATA) $(srcdir)/t/*.test $(distdir)/t
-$(INSTALL_DATA) $(srcdir)/t/*.imtest $(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/binlog_tests/*.opt $(distdir)/extra/binlog_tests
-$(INSTALL_DATA) $(srcdir)/extra/rpl_tests/*.opt $(distdir)/extra/rpl_tests -$(INSTALL_DATA) $(srcdir)/extra/rpl_tests/*.opt $(distdir)/extra/rpl_tests
$(INSTALL_DATA) $(srcdir)/include/*.inc $(distdir)/include $(INSTALL_DATA) $(srcdir)/include/*.inc $(distdir)/include
$(INSTALL_DATA) $(srcdir)/include/*.sql $(distdir)/include
$(INSTALL_DATA) $(srcdir)/include/*.test $(distdir)/include $(INSTALL_DATA) $(srcdir)/include/*.test $(distdir)/include
$(INSTALL_DATA) $(srcdir)/r/*.result $(srcdir)/r/*.require $(distdir)/r $(INSTALL_DATA) $(srcdir)/r/*.result $(srcdir)/r/*.require $(distdir)/r
$(INSTALL_DATA) $(srcdir)/std_data/Moscow_leap $(distdir)/std_data $(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/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)/std_data/parts/part_* $(distdir)/std_data/parts
$(INSTALL_DATA) $(srcdir)/lib/*.pl $(distdir)/lib $(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 -rm -rf `find $(distdir)/suite -type d -name SCCS` $(distdir)/suite/row_lock
install-data-local: 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_be \
$(DESTDIR)$(testdir)/std_data/ndb_backup51_data_le \ $(DESTDIR)$(testdir)/std_data/ndb_backup51_data_le \
$(DESTDIR)$(testdir)/std_data/parts \ $(DESTDIR)$(testdir)/std_data/parts \
$(DESTDIR)$(testdir)/lib $(DESTDIR)$(testdir)/lib \
$(DESTDIR)$(testdir)/lib/My
$(INSTALL_DATA) $(srcdir)/README $(DESTDIR)$(testdir) $(INSTALL_DATA) $(srcdir)/README $(DESTDIR)$(testdir)
-$(INSTALL_DATA) $(srcdir)/t/*.def $(DESTDIR)$(testdir)/t -$(INSTALL_DATA) $(srcdir)/t/*.def $(DESTDIR)$(testdir)/t
$(INSTALL_DATA) $(srcdir)/t/*.test $(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/binlog_tests/*.opt $(DESTDIR)$(testdir)/extra/binlog_tests
-$(INSTALL_DATA) $(srcdir)/extra/rpl_tests/*.opt $(DESTDIR)$(testdir)/extra/rpl_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/*.inc $(DESTDIR)$(testdir)/include
$(INSTALL_DATA) $(srcdir)/include/*.sql $(DESTDIR)$(testdir)/include
$(INSTALL_DATA) $(srcdir)/include/*.test $(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/*.dat $(DESTDIR)$(testdir)/std_data
$(INSTALL_DATA) $(srcdir)/std_data/*.*001 $(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/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)/std_data/parts/part_* $(DESTDIR)$(testdir)/std_data/parts
$(INSTALL_DATA) $(srcdir)/lib/*.pl $(DESTDIR)$(testdir)/lib $(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')`; \ for f in `(cd $(srcdir); find suite -type f | egrep -v 'SCCS|row_lock')`; \
do \ do \
d=$(DESTDIR)$(testdir)/`dirname $$f`; \ d=$(DESTDIR)$(testdir)/`dirname $$f`; \

View File

@ -108,6 +108,23 @@ drop table t1;
set global binlog_cache_size=@bcs; set global binlog_cache_size=@bcs;
set session autocommit = @ac; set session autocommit = @ac;
#
# Bug#33798: prepared statements improperly handle large unsigned ints
#
--disable_warnings
drop table if exists t1;
--enable_warnings
reset master;
create table t1 (a bigint unsigned, b bigint(20) unsigned);
prepare stmt from "insert into t1 values (?,?)";
set @a= 9999999999999999;
set @b= 14632475938453979136;
execute stmt using @a, @b;
deallocate prepare stmt;
drop table t1;
--replace_regex /\/\* xid=.* \*\//\/* XID *\// /table_id: [0-9]+/table_id: #/ /Server ver: [^,]*,/Server version,/
show binlog events from 0;
--echo End of 5.0 tests --echo End of 5.0 tests
# Test of a too big SET INSERT_ID: see if the truncated value goes # Test of a too big SET INSERT_ID: see if the truncated value goes

View File

@ -126,7 +126,12 @@ select * from t2;
select * from t3; select * from t3;
let $VERSION=`select version()`; let $VERSION=`select version()`;
source include/show_binlog_events.inc; --replace_result $VERSION VERSION
--replace_column 2 # 4 # 5 #
--replace_regex /\/\* xid=.* \*\//\/* XID *\// /table_id: [0-9]+/table_id: #/
--replace_regex /file_id=[0-9]+/file_id=#/
show binlog events;
drop table t1,t2,t3; drop table t1,t2,t3;
# #
@ -178,7 +183,14 @@ start transaction;
insert into t1 values(2); insert into t1 values(2);
rollback; rollback;
set autocommit=1; set autocommit=1;
source include/show_binlog_events.inc;
let $VERSION=`select version()`;
--replace_result $VERSION VERSION
--replace_column 2 # 4 # 5 #
--replace_regex /\/\* xid=.* \*\//\/* XID *\// /table_id: [0-9]+/table_id: #/
--replace_regex /file_id=[0-9]+/file_id=#/
show binlog events;
drop table if exists t1; drop table if exists t1;
# End of 5.1 tests # End of 5.1 tests

View File

@ -315,4 +315,324 @@ disconnect con3;
connection con4; connection con4;
select get_lock("a",10); # wait for rollback to finish select get_lock("a",10); # wait for rollback to finish
flush logs;
# 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)
if (`select @@binlog_format = 'ROW'`)
{
--exec $MYSQL_BINLOG --start-position=524 $MYSQLTEST_VARDIR/log/master-bin.000001 > $MYSQLTEST_VARDIR/tmp/mix_innodb_myisam_binlog.output
}
if (`select @@binlog_format = 'STATEMENT' || @@binlog_format = 'MIXED'`)
{
--exec $MYSQL_BINLOG --start-position=555 $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 */;%" OR
@a like "%#%error_code=0%ROLLBACK\\r\\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;
# 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 */;
source include/show_binlog_events.inc;
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;
# 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
source include/show_binlog_events.inc;
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, tt;
#
# 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));
source include/show_binlog_events.inc; /* 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 */;
source include/show_binlog_events.inc; /* 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
source include/show_binlog_events.inc; /* the output 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
source include/show_binlog_events.inc; /* the output 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
source include/show_binlog_events.inc; /* the output 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
source include/show_binlog_events.inc; /* the output 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
source include/show_binlog_events.inc; /* the output 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
source include/show_binlog_events.inc; /* the output 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 */;
source include/show_binlog_events.inc; /* the output 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

View File

@ -18,7 +18,6 @@
create temporary table tt (a int unique); create temporary table tt (a int unique);
create table ti (a int) engine=innodb; create table ti (a int) engine=innodb;
reset master; reset master;
show master status;
# action # action
@ -31,7 +30,6 @@ rollback;
# check # check
select count(*) from tt /* 2 */; select count(*) from tt /* 2 */;
show master status;
source include/show_binlog_events.inc; source include/show_binlog_events.inc;
select count(*) from ti /* zero */; select count(*) from ti /* zero */;
insert into ti select * from tt; insert into ti select * from tt;
@ -42,7 +40,6 @@ select * from ti /* that is what slave would miss - bug#28960 */;
delete from ti; delete from ti;
delete from tt where a=1; delete from tt where a=1;
reset master; reset master;
show master status;
# action # action
@ -55,7 +52,6 @@ rollback;
# check # check
show master status;
source include/show_binlog_events.inc; # nothing in binlog with row bilog format source include/show_binlog_events.inc; # nothing in binlog with row bilog format
select count(*) from ti /* zero */; select count(*) from ti /* zero */;
insert into ti select * from tt; insert into ti select * from tt;

View File

@ -32,3 +32,34 @@ SET FOREIGN_KEY_CHECKS=0;
DROP TABLE IF EXISTS t1,t2,t3; DROP TABLE IF EXISTS t1,t2,t3;
SET FOREIGN_KEY_CHECKS=1; SET FOREIGN_KEY_CHECKS=1;
sync_slave_with_master; 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;

View File

@ -43,7 +43,7 @@ set global max_relay_log_size=8192-1; # mapped to 4096
select @@global.max_relay_log_size; select @@global.max_relay_log_size;
start slave; start slave;
sync_with_master; sync_with_master;
source include/show_slave_status.inc; source include/show_slave_status2.inc;
--echo # --echo #
--echo # Test 2 --echo # Test 2
@ -55,7 +55,7 @@ set global max_relay_log_size=(5*4096);
query_vertical select @@global.max_relay_log_size; query_vertical select @@global.max_relay_log_size;
start slave; start slave;
sync_with_master; sync_with_master;
source include/show_slave_status.inc; source include/show_slave_status2.inc;
--echo # --echo #
--echo # Test 3: max_relay_log_size = 0 --echo # Test 3: max_relay_log_size = 0
@ -67,7 +67,7 @@ set global max_relay_log_size=0;
query_vertical select @@global.max_relay_log_size; query_vertical select @@global.max_relay_log_size;
start slave; start slave;
sync_with_master; sync_with_master;
source include/show_slave_status.inc; source include/show_slave_status2.inc;
--echo # --echo #
--echo # Test 4: Tests below are mainly to ensure that we have not coded with wrong assumptions --echo # Test 4: Tests below are mainly to ensure that we have not coded with wrong assumptions
@ -78,7 +78,7 @@ reset slave;
# test of relay log rotation when the slave is stopped # test of relay log rotation when the slave is stopped
# (to make sure it does not crash). # (to make sure it does not crash).
flush logs; flush logs;
source include/show_slave_status.inc; source include/show_slave_status2.inc;
--echo # --echo #
--echo # Test 5 --echo # Test 5
@ -96,7 +96,7 @@ create table t1 (a int);
save_master_pos; save_master_pos;
connection slave; connection slave;
sync_with_master; sync_with_master;
source include/show_slave_status.inc; source include/show_slave_status2.inc;
--echo # --echo #
--echo # Test 6: one more rotation, to be sure Relay_Log_Space is correctly updated --echo # Test 6: one more rotation, to be sure Relay_Log_Space is correctly updated
@ -108,13 +108,12 @@ drop table t1;
save_master_pos; save_master_pos;
connection slave; connection slave;
sync_with_master; sync_with_master;
source include/show_slave_status.inc; source include/show_slave_status2.inc;
connection master; connection master;
# test that the absence of relay logs does not make a master crash # test that the absence of relay logs does not make a master crash
flush logs; flush logs;
-- replace_column 3 <Binlog_Ignore_DB> source include/show_master_status.inc;
query_vertical show master status;
# Restore max_binlog_size # Restore max_binlog_size
connection slave; connection slave;

View File

@ -13,18 +13,18 @@ connection master;
save_master_pos; save_master_pos;
connection slave; connection slave;
sync_with_master; sync_with_master;
source include/show_slave_status.inc; source include/show_slave_status2.inc;
stop slave; stop slave;
change master to master_user='test'; change master to master_user='test';
source include/show_slave_status.inc; source include/show_slave_status2.inc;
reset slave; reset slave;
source include/show_slave_status.inc; source include/show_slave_status2.inc;
start slave; start slave;
sync_with_master; sync_with_master;
source include/show_slave_status.inc; source include/show_slave_status2.inc;
# test of crash with temp tables & RESET SLAVE # test of crash with temp tables & RESET SLAVE
# (test to see if RESET SLAVE clears temp tables in memory and disk) # (test to see if RESET SLAVE clears temp tables in memory and disk)

View File

@ -174,11 +174,18 @@ sync_slave_with_master;
INSERT INTO t7 VALUES (1,3), (2,6), (3,9); INSERT INTO t7 VALUES (1,3), (2,6), (3,9);
SELECT * FROM t7 ORDER BY C1; 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; connection master;
--echo --- on master: new values inserted --- --echo --- on master: new values inserted ---
INSERT INTO t7 VALUES (1,2), (2,4), (3,6); INSERT INTO t7 VALUES (1,2), (2,4), (3,6);
SELECT * FROM t7 ORDER BY C1; SELECT * FROM t7 ORDER BY C1;
sync_slave_with_master; sync_slave_with_master;
set @@global.slave_exec_mode= default;
--echo --- on slave: old values should be overwritten by replicated values --- --echo --- on slave: old values should be overwritten by replicated values ---
SELECT * FROM t7 ORDER BY C1; 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); INSERT INTO t8 VALUES (1,2,3), (2,4,6), (3,6,9);
SELECT * FROM t8 ORDER BY a; 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; connection master;
--echo --- on master --- --echo --- on master ---
# We insert a row that will cause conflict on the primary key but not # We insert a row that will cause conflict on the primary key but not
# on the other keys. # on the other keys.
INSERT INTO t8 VALUES (2,4,8); INSERT INTO t8 VALUES (2,4,8);
sync_slave_with_master; sync_slave_with_master;
set @@global.slave_exec_mode= default;
--echo --- on slave --- --echo --- on slave ---
SELECT * FROM t8 ORDER BY a; SELECT * FROM t8 ORDER BY a;
@ -234,12 +248,17 @@ connection master;
INSERT INTO t1 VALUES ('K','K'), ('L','L'), ('M','M'); INSERT INTO t1 VALUES ('K','K'), ('L','L'), ('M','M');
--echo **** On Master **** --echo **** On Master ****
sync_slave_with_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'; DELETE FROM t1 WHERE C1 = 'L';
connection master; connection master;
DELETE FROM t1; DELETE FROM t1;
query_vertical SELECT COUNT(*) FROM t1 ORDER BY c1,c2; query_vertical SELECT COUNT(*) FROM t1 ORDER BY c1,c2;
sync_slave_with_master; sync_slave_with_master;
set @@global.slave_exec_mode= default;
let $last_error = query_get_value("SHOW SLAVE STATUS", Last_SQL_Errno, 1); let $last_error = query_get_value("SHOW SLAVE STATUS", Last_SQL_Errno, 1);
disable_query_log; disable_query_log;
eval SELECT "$last_error" AS Last_SQL_Error; eval SELECT "$last_error" AS Last_SQL_Error;

View File

@ -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 # Insert some values for tables on slave side. These should not be
# modified when the row from the master is applied. # 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_int VALUES (2, 4, 4711);
INSERT INTO t1_char VALUES (2, 4, 'Foo is a bar'); INSERT INTO t1_char VALUES (2, 4, 'Foo is a bar');
INSERT INTO t1_bit VALUES (2, 4, b'101', b'11100', b'01'); 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; SELECT * FROM t1_char ORDER BY a;
--echo **** On Slave **** --echo **** On Slave ****
sync_slave_with_master; sync_slave_with_master;
set @@global.slave_exec_mode= default;
SELECT a,b,x FROM t1_int ORDER BY a; 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,HEX(x),HEX(y),HEX(z) FROM t1_bit ORDER BY a;
SELECT a,b,x FROM t1_char ORDER BY a; SELECT a,b,x FROM t1_char ORDER BY a;
@ -115,7 +122,7 @@ INSERT INTO t1_nodef VALUES (1,2);
connection slave; connection slave;
--source include/wait_for_slave_sql_to_stop.inc --source include/wait_for_slave_sql_to_stop.inc
--replace_result $MASTER_MYPORT MASTER_PORT --replace_result $MASTER_MYPORT MASTER_PORT
--replace_column 1 # 4 # 7 # 8 # 9 # 22 # 23 # 33 # --replace_column 1 # 4 # 7 # 8 # 9 # 20 <Last_Error> 22 # 23 # 33 # 36 <Last_IO_Error> 38 <Last_SQL_Error>
--query_vertical SHOW SLAVE STATUS --query_vertical SHOW SLAVE STATUS
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2; SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
START SLAVE; START SLAVE;
@ -135,7 +142,7 @@ sync_slave_with_master;
--echo **** On Slave **** --echo **** On Slave ****
SELECT * FROM t2; SELECT * FROM t2;
--replace_result $MASTER_MYPORT MASTER_PORT --replace_result $MASTER_MYPORT MASTER_PORT
--replace_column 1 # 4 # 7 # 8 # 9 # 22 # 23 # 33 # --replace_column 1 # 4 # 7 # 8 # 9 # 20 <Last_Error> 22 # 23 # 33 # 36 <Last_IO_Error> 38 <Last_SQL_Error>
--query_vertical SHOW SLAVE STATUS --query_vertical SHOW SLAVE STATUS
connection master; connection master;
@ -147,7 +154,7 @@ INSERT INTO t4 VALUES (4);
connection slave; connection slave;
--source include/wait_for_slave_sql_to_stop.inc --source include/wait_for_slave_sql_to_stop.inc
--replace_result $MASTER_MYPORT MASTER_PORT --replace_result $MASTER_MYPORT MASTER_PORT
--replace_column 1 # 4 # 7 # 8 # 9 # 22 # 23 # 33 # --replace_column 1 # 4 # 7 # 8 # 9 # 20 <Last_Error> 22 # 23 # 33 # 36 <Last_IO_Error> 38 <Last_SQL_Error>
--query_vertical SHOW SLAVE STATUS --query_vertical SHOW SLAVE STATUS
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2; SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
START SLAVE; START SLAVE;
@ -161,7 +168,7 @@ INSERT INTO t5 VALUES (5,10,25);
connection slave; connection slave;
--source include/wait_for_slave_sql_to_stop.inc --source include/wait_for_slave_sql_to_stop.inc
--replace_result $MASTER_MYPORT MASTER_PORT --replace_result $MASTER_MYPORT MASTER_PORT
--replace_column 1 # 4 # 7 # 8 # 9 # 22 # 23 # 33 # --replace_column 1 # 4 # 7 # 8 # 9 # 20 <Last_Error> 22 # 23 # 33 # 36 <Last_IO_Error> 38 <Last_SQL_Error>
--query_vertical SHOW SLAVE STATUS --query_vertical SHOW SLAVE STATUS
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2; SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
START SLAVE; START SLAVE;
@ -175,7 +182,7 @@ INSERT INTO t6 VALUES (6,12,36);
connection slave; connection slave;
--source include/wait_for_slave_sql_to_stop.inc --source include/wait_for_slave_sql_to_stop.inc
--replace_result $MASTER_MYPORT MASTER_PORT --replace_result $MASTER_MYPORT MASTER_PORT
--replace_column 1 # 4 # 7 # 8 # 9 # 22 # 23 # 33 # --replace_column 1 # 4 # 7 # 8 # 9 # 20 <Last_Error> 22 # 23 # 33 # 36 <Last_IO_Error> 38 <Last_SQL_Error>
--query_vertical SHOW SLAVE STATUS --query_vertical SHOW SLAVE STATUS
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2; SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
START SLAVE; START SLAVE;
@ -184,7 +191,7 @@ connection master;
INSERT INTO t9 VALUES (6); INSERT INTO t9 VALUES (6);
sync_slave_with_master; sync_slave_with_master;
--replace_result $SLAVE_MYPORT SLAVE_PORT --replace_result $SLAVE_MYPORT SLAVE_PORT
--replace_column 1 # 4 # 7 # 8 # 9 # 22 # 23 # 33 # --replace_column 1 # 4 # 7 # 8 # 9 # 20 <Last_Error> 22 # 23 # 33 # 36 <Last_IO_Error> 38 <Last_SQL_Error>
--query_vertical SHOW SLAVE STATUS --query_vertical SHOW SLAVE STATUS
# Testing some tables extra field that can be null and cannot be null # Testing some tables extra field that can be null and cannot be null

View File

@ -1,5 +1,7 @@
# Remove anonymous users added by add_anonymous_users.inc # Remove anonymous users added by add_anonymous_users.inc
disable_warnings;
disable_query_log; disable_query_log;
DELETE FROM mysql.user where host='localhost' and user=''; DELETE FROM mysql.user where host='localhost' and user='';
FLUSH PRIVILEGES; FLUSH PRIVILEGES;
enable_query_log; enable_query_log;
enable_warnings;

View File

@ -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

View File

@ -1,4 +1,4 @@
disable_query_log; disable_query_log;
--require r/true.require --require r/true.require
select (support = 'YES' or support = 'DEFAULT') as `TRUE` from information_schema.engines where engine = 'innodb'; select (support = 'YES' or support = 'DEFAULT' or support = 'ENABLED') as `TRUE` from information_schema.engines where engine = 'innodb';
enable_query_log; enable_query_log;

View File

@ -0,0 +1,4 @@
--require r/have_local_infile.require
disable_query_log;
show variables like 'local_infile';
enable_query_log;

View File

@ -4,18 +4,26 @@ connect (server2,127.0.0.1,root,,test,$MASTER_MYPORT1,);
# Check that server1 has NDB support # Check that server1 has NDB support
connection server1; connection server1;
let $engines_table= query_get_value(SHOW TABLES FROM information_schema LIKE 'ENGINES', Tables_in_information_schema (ENGINES), 1);
disable_query_log; disable_query_log;
if (`SELECT 1 FROM dual WHERE '$engines_table' = 'engines'`)
{
--require r/true.require --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 --source include/ndb_not_readonly.inc
}
enable_query_log; enable_query_log;
# Check that server2 has NDB support # Check that server2 has NDB support
connection server2; connection server2;
let $engines_table= query_get_value(SHOW TABLES FROM information_schema LIKE 'ENGINES', Tables_in_information_schema (ENGINES), 1);
disable_query_log; disable_query_log;
if (`SELECT 1 FROM dual WHERE '$engines_table' = 'engines'`)
{
--require r/true.require --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 --source include/ndb_not_readonly.inc
}
enable_query_log; enable_query_log;
# cleanup # cleanup

View File

@ -0,0 +1,2 @@
SET GLOBAL BINLOG_FORMAT=MIXED;
SET SESSION BINLOG_FORMAT=MIXED;

View File

@ -0,0 +1,2 @@
SET GLOBAL BINLOG_FORMAT=ROW;
SET SESSION BINLOG_FORMAT=ROW;

View File

@ -0,0 +1,2 @@
SET GLOBAL BINLOG_FORMAT=STATEMENT;
SET SESSION BINLOG_FORMAT=STATEMENT;

View File

@ -0,0 +1,5 @@
# show binary logs
# mask out the binlog position
-- replace_column 2 #
show binary logs;

View File

@ -1,5 +1,5 @@
--let $binlog_start=106 --let $binlog_start=106
--replace_result $binlog_start <binlog_start> --replace_result $binlog_start <binlog_start>
--replace_column 2 # 4 # 5 # --replace_column 2 # 4 # 5 #
--replace_regex /\/\* xid=.* \*\//\/* XID *\// /table_id: [0-9]+/table_id: #/ --replace_regex /\/\* xid=.* \*\//\/* XID *\// /table_id: [0-9]+/table_id: #/ /file_id=[0-9]+/file_id=#/
--eval show binlog events from $binlog_start --eval show binlog events from $binlog_start

View File

@ -1,7 +1,3 @@
#
# Differs slightly from show_binlog events in showing server_id
# which is important for some tests
#
--let $binlog_start=106 --let $binlog_start=106
--replace_result $binlog_start <binlog_start> --replace_result $binlog_start <binlog_start>
--replace_column 2 # 5 # --replace_column 2 # 5 #

View File

@ -0,0 +1,5 @@
# show master logs
# mask out the binlog position
-- replace_column 2 #
query_vertical show master logs;

View File

@ -0,0 +1,5 @@
# show master status
# mask out the binlog position
-- replace_column 2 # 3 <Binlog_Do_DB> 4 <Binlog_Ignore_DB>
show master status;

View File

@ -0,0 +1,8 @@
# Include file to show the slave status, masking out some information
# that varies depending on where the test is executed.
# masked out log positions
--replace_result $MASTER_MYPORT MASTER_PORT
--replace_column 1 # 7 # 8 # 9 # 16 # 22 # 23 # 33 # 35 # 36 #
query_vertical SHOW SLAVE STATUS;

422
mysql-test/lib/My/Config.pm Normal file
View 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;

View File

@ -22,8 +22,10 @@ use File::Basename;
use IO::File(); use IO::File();
use strict; use strict;
use My::Config;
sub collect_test_cases ($); sub collect_test_cases ($);
sub collect_one_suite ($$); sub collect_one_suite ($);
sub collect_one_test_case ($$$$$$$$$); sub collect_one_test_case ($$$$$$$$$);
sub mtr_options_from_test_file($$); sub mtr_options_from_test_file($$);
@ -61,7 +63,7 @@ sub collect_test_cases ($) {
foreach my $suite (split(",", $suites)) 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 $suite= shift; # Test suite name
my $cases= shift; # List of test cases my @cases; # Array of hash
mtr_verbose("Collecting: $suite"); mtr_verbose("Collecting: $suite");
my $combination_file= "combinations";
my $combinations = [];
my $suitedir= "$::glob_mysql_test_dir"; # Default my $suitedir= "$::glob_mysql_test_dir"; # Default
my $combination_file= "$::glob_mysql_test_dir/$combination_file";
if ( $suite ne "main" ) if ( $suite ne "main" )
{ {
$suitedir= mtr_path_exists("$suitedir/suite/$suite", $suitedir= mtr_path_exists("$suitedir/suite/$suite",
"$suitedir/$suite"); "$suitedir/$suite");
mtr_verbose("suitedir: $suitedir"); mtr_verbose("suitedir: $suitedir");
$combination_file= "$suitedir/$combination_file";
} }
my $testdir= "$suitedir/t"; my $testdir= "$suitedir/t";
my $resdir= "$suitedir/r"; 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 # 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, collect_one_test_case($testdir,$resdir,$suite,$tname,
"$tname.$extension",$cases,\%disabled, "$tname.$extension",\@cases,\%disabled,
$component_id,$suite_opts); $component_id,$suite_opts);
} }
} }
@ -354,85 +329,168 @@ sub collect_one_suite($$)
next if ($do_test and not $tname =~ /$do_test/o); next if ($do_test and not $tname =~ /$do_test/o);
collect_one_test_case($testdir,$resdir,$suite,$tname, collect_one_test_case($testdir,$resdir,$suite,$tname,
$elem,$cases,\%disabled,$component_id, $elem,\@cases,\%disabled,$component_id,
$suite_opts); $suite_opts);
} }
closedir TESTDIR; 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}) if ( ! $::opt_skip_combination )
{ {
my $end_index = $#{@$cases}; my @combinations;
my $is_copy; my $combination_file= "$suitedir/combinations";
# Keep original master/slave options #print "combination_file: $combination_file\n";
my @orig_opts; if (@::opt_combinations)
for (my $idx = $begin_index; $idx <= $end_index; $idx++)
{ {
foreach my $param (('master_opt','slave_opt','slave_mi')) # take the combination from command-line
{ mtr_verbose("Take the combination from command line");
@{$orig_opts[$idx]{$param}} = @{$cases->[$idx]->{$param}}; foreach my $combination (@::opt_combinations) {
my $comb= {};
$comb->{name}= $combination;
push(@{$comb->{comb_opt}}, $combination);
push(@combinations, $comb);
} }
} }
my $comb_index = 1; elsif (-f $combination_file )
# Copy original test cases {
foreach my $comb_set (@$combinations) # Read combinations file in my.cnf format
{ mtr_verbose("Read combinations file");
for (my $idx = $begin_index; $idx <= $end_index; $idx++) 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]; foreach my $test (@cases)
my $copied_test = {}; {
foreach my $param (keys %{$test}) #print $test->{name}, " ", $comb, "\n";
{ my $new_test= {};
# Scalar. Copy as is.
$copied_test->{$param} = $test->{$param}; while (my ($key, $value) = each(%$test)) {
# Array. Copy reference instead itself if (ref $value eq "ARRAY") {
if ($param =~ /(master_opt|slave_opt|slave_mi)/) push(@{$new_test->{$key}}, @$value);
{ } else {
my $new_arr = []; $new_test->{$key}= $value;
@$new_arr = @{$orig_opts[$idx]{$param}}; }
$copied_test->{$param} = $new_arr; }
}
elsif ($param =~ /(comment|combinations)/) # Append the combination options to master_opt and slave_opt
{ push(@{$new_test->{master_opt}}, @{$comb->{comb_opt}});
$copied_test->{$param} = ''; push(@{$new_test->{slave_opt}}, @{$comb->{comb_opt}});
}
} # Add combination name shrt name
if ($is_copy) $new_test->{combination}= $comb->{name};
{
push(@$cases, $copied_test); # Add the new test to new test cases list
$test = $cases->[$#{@$cases}]; push(@new_cases, $new_test);
} }
foreach my $comb_opt (split(/ /,$comb_set)) }
{ #print_testcases(@new_cases);
push(@{$test->{'master_opt'}},$comb_opt); @cases= @new_cases;
push(@{$test->{'slave_opt'}},$comb_opt); #print_testcases(@cases);
# 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++;
}
} }
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_opt'}= [];
$tinfo->{'slave_mi'}= []; $tinfo->{'slave_mi'}= [];
# Add suite opts # Add suite opts
foreach my $opt ( @$suite_opts ) foreach my $opt ( @$suite_opts )
{ {
@ -735,14 +794,6 @@ sub collect_one_test_case($$$$$$$$$) {
return; 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 ) if ( $tinfo->{'need_debug'} && ! $::debug_compiled_binaries )
{ {
$tinfo->{'skip'}= 1; $tinfo->{'skip'}= 1;
@ -822,10 +873,17 @@ sub collect_one_test_case($$$$$$$$$) {
our @tags= our @tags=
( (
["include/have_innodb.inc", "innodb_test", 1], ["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_log_bin.inc", "need_binlog", 1],
["include/have_binlog_format_statement.inc", "binlog_format", "statement"], ["include/have_binlog_format_statement.inc",
["include/have_binlog_format_mixed.inc", "binlog_format", "mixed"], "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/big_test.inc", "big_test", 1],
["include/have_debug.inc", "need_debug", 1], ["include/have_debug.inc", "need_debug", 1],
["include/have_ndb.inc", "ndb_test", 1], ["include/have_ndb.inc", "ndb_test", 1],
@ -851,8 +909,8 @@ sub mtr_options_from_test_file($$) {
{ {
if ( index($line, $tag->[0]) >= 0 ) if ( index($line, $tag->[0]) >= 0 )
{ {
# Tag matched, assign value to "tinfo" # Tag matched, assign value to "tinfo"
$tinfo->{"$tag->[1]"}= $tag->[2]; $tinfo->{"$tag->[1]"}= $tag->[2];
} }
} }
@ -873,8 +931,29 @@ sub mtr_options_from_test_file($$) {
mtr_options_from_test_file($tinfo, $sourced_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; 1;

View File

@ -280,4 +280,33 @@ sub mtr_cmp_opts ($$) {
return 0; # They are the same 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; 1;

View File

@ -50,9 +50,13 @@ my $tot_real_time= 0;
sub mtr_report_test_name ($) { sub mtr_report_test_name ($) {
my $tinfo= shift; my $tinfo= shift;
my $tname= $tinfo->{name};
_mtr_log("$tinfo->{name}"); $tname.= " '$tinfo->{combination}'"
printf "%-30s ", $tinfo->{'name'}; if defined $tinfo->{combination};
_mtr_log($tname);
printf "%-30s ", $tname;
} }
sub mtr_report_test_skipped ($) { sub mtr_report_test_skipped ($) {
@ -363,8 +367,27 @@ sub mtr_report_stats ($) {
# master # master
/Slave: Unknown column 'c7' in 't15' Error_code: 1054/ or /Slave: Unknown column 'c7' in 't15' Error_code: 1054/ or
/Slave: Can't DROP 'c7'.* 1091/ or /Slave: Can't DROP 'c7'.* 1091/ or
/Slave: Key column 'c6'.* 1072/ /Slave: Key column 'c6'.* 1072/ or
)
# rpl_idempotency.test produces warnings for the slave.
($testname eq 'rpl.rpl_idempotency' and
(/Slave: Can\'t find record in \'t1\' Error_code: 1032/ or
/Slave: Cannot add or update a child row: a foreign key constraint fails .* Error_code: 1452/
)) or
# These tests does "kill" on queries, causing sporadic errors when writing to logs
(($testname eq 'rpl.rpl_skip_error' or
$testname eq 'rpl.rpl_err_ignoredtable' or
$testname eq 'binlog.binlog_killed_simulate' or
$testname eq 'binlog.binlog_killed') and
(/Failed to write to mysql\.\w+_log/
)) or
# rpl_temporary has an error on slave that can be ignored
($testname eq 'rpl.rpl_temporary' and
(/Slave: Can\'t find record in \'user\' Error_code: 1032/
))
)
{ {
next; # Skip these lines next; # Skip these lines
} }

View File

@ -52,6 +52,9 @@
# "perl -d:Trace mysql-test-run.pl" # "perl -d:Trace mysql-test-run.pl"
# #
use lib "lib/";
$Devel::Trace::TRACE= 0; # Don't trace boring init stuff $Devel::Trace::TRACE= 0; # Don't trace boring init stuff
#require 5.6.1; #require 5.6.1;
@ -172,7 +175,8 @@ our $opt_bench= 0;
our $opt_small_bench= 0; our $opt_small_bench= 0;
our $opt_big_test= 0; our $opt_big_test= 0;
our @opt_combination; our @opt_combinations;
our $opt_skip_combination;
our @opt_extra_mysqld_opt; our @opt_extra_mysqld_opt;
@ -570,7 +574,8 @@ sub command_line_setup () {
'skip-im' => \$opt_skip_im, 'skip-im' => \$opt_skip_im,
'skip-test=s' => \$opt_skip_test, 'skip-test=s' => \$opt_skip_test,
'big-test' => \$opt_big_test, 'big-test' => \$opt_big_test,
'combination=s' => \@opt_combination, 'combination=s' => \@opt_combinations,
'skip-combination' => \$opt_skip_combination,
# Specify ports # Specify ports
'master_port=i' => \$opt_master_myport, 'master_port=i' => \$opt_master_myport,
@ -845,20 +850,23 @@ sub command_line_setup () {
# -------------------------------------------------------------------------- # --------------------------------------------------------------------------
# Find out type of logging that are being used # 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 ) if (!$opt_extern && $mysql_version_id >= 50100 )
{ {
$used_binlog_format= "mixed"; # Default value for binlog format
foreach my $arg ( @opt_extra_mysqld_opt ) foreach my $arg ( @opt_extra_mysqld_opt )
{ {
if ( $arg =~ /binlog[-_]format=(\S+)/ ) 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");
}
} }
@ -976,6 +984,10 @@ sub command_line_setup () {
mtr_error("Will not run in record mode without a specific test case"); mtr_error("Will not run in record mode without a specific test case");
} }
if ( $opt_record )
{
$opt_skip_combination = 1;
}
# -------------------------------------------------------------------------- # --------------------------------------------------------------------------
# ps protcol flag # ps protcol flag
@ -3375,6 +3387,7 @@ sub run_testcase_check_skip_test($)
sub do_before_run_mysqltest($) sub do_before_run_mysqltest($)
{ {
my $tinfo= shift; my $tinfo= shift;
my $args;
# Remove old files produced by mysqltest # Remove old files produced by mysqltest
my $base_file= mtr_match_extension($tinfo->{'result_file'}, my $base_file= mtr_match_extension($tinfo->{'result_file'},
@ -3395,6 +3408,28 @@ sub do_before_run_mysqltest($)
# if script decided to run mysqltest cluster _is_ installed ok # if script decided to run mysqltest cluster _is_ installed ok
$ENV{'NDB_STATUS_OK'} = "YES"; $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");
}
}
}
} }
} }
@ -3835,6 +3870,14 @@ sub mysqld_arguments ($$$$) {
mtr_add_arg($args, "%s--user=root"); 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 ) if ( $opt_valgrind_mysqld )
{ {
mtr_add_arg($args, "%s--skip-safemalloc", $prefix); mtr_add_arg($args, "%s--skip-safemalloc", $prefix);
@ -3939,7 +3982,7 @@ sub mysqld_arguments ($$$$) {
my $slave_load_path= "../tmp"; my $slave_load_path= "../tmp";
mtr_add_arg($args, "%s--slave-load-tmpdir=%s", $prefix, mtr_add_arg($args, "%s--slave-load-tmpdir=%s", $prefix,
$slave_load_path); $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 ) if ( @$slave_master_info )
{ {
@ -4292,10 +4335,19 @@ sub run_testcase_need_master_restart($)
elsif (! mtr_same_opts($master->[0]->{'start_opts'}, elsif (! mtr_same_opts($master->[0]->{'start_opts'},
$tinfo->{'master_opt'}) ) $tinfo->{'master_opt'}) )
{ {
$do_restart= 1; # Chech that diff is binlog format only
mtr_verbose("Restart master: running with different options '" . my $diff_opts= mtr_diff_opts($master->[0]->{'start_opts'},$tinfo->{'master_opt'});
join(" ", @{$tinfo->{'master_opt'}}) . "' != '" . if (scalar(@$diff_opts) eq 2)
join(" ", @{$master->[0]->{'start_opts'}}) . "'" ); {
$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'} ) elsif( ! $master->[0]->{'pid'} )
{ {
@ -5218,8 +5270,9 @@ Options to control what test suites or cases to run
skip-im Don't start IM, and skip the IM test cases skip-im Don't start IM, and skip the IM test cases
big-test Set the environment variable BIG_TEST, which can be big-test Set the environment variable BIG_TEST, which can be
checked from test cases. checked from test cases.
combination="ARG1 .. ARG2" Specify a set of "mysqld" arguments for one combination="ARG1 .. ARG2" Specify a set of "mysqld" arguments for one
combination. combination.
skip-combination Skip any combination options and combinations files
Options that specify ports Options that specify ports

View File

@ -1,35 +0,0 @@
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

View File

@ -1743,4 +1743,50 @@ t1 CREATE TABLE `t1` (
`MAXLEN` bigint(3) NOT NULL DEFAULT '0' `MAXLEN` bigint(3) NOT NULL DEFAULT '0'
) ENGINE=MEMORY DEFAULT CHARSET=utf8 ) ENGINE=MEMORY DEFAULT CHARSET=utf8
drop table t1; drop table t1;
# --
# -- Bug#21380: DEFAULT definition not always transfered by CREATE
# -- TABLE/SELECT to the new table.
# --
DROP TABLE IF EXISTS t1;
DROP TABLE IF EXISTS t2;
CREATE TABLE t1(
c1 INT DEFAULT 12 COMMENT 'column1',
c2 INT NULL COMMENT 'column2',
c3 INT NOT NULL COMMENT 'column3',
c4 VARCHAR(255) CHARACTER SET utf8 NOT NULL DEFAULT 'a',
c5 VARCHAR(255) COLLATE utf8_unicode_ci NULL DEFAULT 'b',
c6 VARCHAR(255))
COLLATE latin1_bin;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`c1` int(11) DEFAULT '12' COMMENT 'column1',
`c2` int(11) DEFAULT NULL COMMENT 'column2',
`c3` int(11) NOT NULL COMMENT 'column3',
`c4` varchar(255) CHARACTER SET utf8 NOT NULL DEFAULT 'a',
`c5` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci DEFAULT 'b',
`c6` varchar(255) COLLATE latin1_bin DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_bin
CREATE TABLE t2 AS SELECT * FROM t1;
SHOW CREATE TABLE t2;
Table Create Table
t2 CREATE TABLE `t2` (
`c1` int(11) DEFAULT '12' COMMENT 'column1',
`c2` int(11) DEFAULT NULL COMMENT 'column2',
`c3` int(11) NOT NULL COMMENT 'column3',
`c4` varchar(255) CHARACTER SET utf8 NOT NULL DEFAULT 'a',
`c5` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci DEFAULT 'b',
`c6` varchar(255) CHARACTER SET latin1 COLLATE latin1_bin DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t2;
# -- End of test case for Bug#21380.
End of 5.1 tests End of 5.1 tests

View File

@ -722,4 +722,17 @@ DROP USER mysqltest_u1@localhost;
# #
##################################################################### #####################################################################
drop procedure if exists p;
set @old_mode= @@sql_mode;
set @@sql_mode= pow(2,32)-1;
create event e1 on schedule every 1 day do select 1;
select @@sql_mode;
@@sql_mode
REAL_AS_FLOAT,PIPES_AS_CONCAT,ANSI_QUOTES,IGNORE_SPACE,?,ONLY_FULL_GROUP_BY,NO_UNSIGNED_SUBTRACTION,NO_DIR_IN_CREATE,POSTGRESQL,ORACLE,MSSQL,DB2,MAXDB,NO_KEY_OPTIONS,NO_TABLE_OPTIONS,NO_FIELD_OPTIONS,MYSQL323,MYSQL40,ANSI,NO_AUTO_VALUE_ON_ZERO,NO_BACKSLASH_ESCAPES,STRICT_TRANS_TABLES,STRICT_ALL_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ALLOW_INVALID_DATES,ERROR_FOR_DIVISION_BY_ZERO,TRADITIONAL,NO_AUTO_CREATE_USER,HIGH_NOT_PRECEDENCE,NO_ENGINE_SUBSTITUTION,PAD_CHAR_TO_FULL_LENGTH
set @@sql_mode= @old_mode;
select replace(@full_mode, '?', 'NOT_USED') into @full_mode;
select replace(@full_mode, 'ALLOW_INVALID_DATES', 'INVALID_DATES') into @full_mode;
select name from mysql.event where name = 'p' and sql_mode = @full_mode;
name
drop event e1;
DROP DATABASE events_test; DROP DATABASE events_test;

View File

@ -1218,6 +1218,28 @@ DROP USER mysqltest_1@localhost;
DROP DATABASE db27878; DROP DATABASE db27878;
use test; use test;
DROP TABLE t1; DROP TABLE t1;
drop table if exists test;
Warnings:
Note 1051 Unknown table 'test'
drop function if exists test_function;
Warnings:
Note 1305 FUNCTION test_function does not exist
drop view if exists v1;
Warnings:
Note 1051 Unknown table 'test.v1'
create table test (col1 varchar(30));
create function test_function() returns varchar(30)
begin
declare tmp varchar(30);
select col1 from test limit 1 into tmp;
return '1';
end|
create view v1 as select test.* from test where test.col1=test_function();
grant update (col1) on v1 to 'greg'@'localhost';
drop user 'greg'@'localhost';
drop view v1;
drop table test;
drop function test_function;
End of 5.0 tests End of 5.0 tests
set names utf8; set names utf8;
grant select on test.* to юзер_юзер@localhost; grant select on test.* to юзер_юзер@localhost;
@ -1282,5 +1304,6 @@ CALL mysqltest1.test();
1 1
DROP DATABASE mysqltest1; DROP DATABASE mysqltest1;
RENAME TABLE mysql.procs_gone TO mysql.procs_priv; RENAME TABLE mysql.procs_gone TO mysql.procs_priv;
DROP USER mysqltest_1@localhost;
FLUSH PRIVILEGES; FLUSH PRIVILEGES;
End of 5.1 tests End of 5.1 tests

View File

@ -0,0 +1,2 @@
Variable_name Value
local_infile ON

View File

@ -588,7 +588,7 @@ proc body longblob
proc definer char(77) proc definer char(77)
proc created timestamp proc created timestamp
proc modified timestamp proc modified timestamp
proc sql_mode set('REAL_AS_FLOAT','PIPES_AS_CONCAT','ANSI_QUOTES','IGNORE_SPACE','NOT_USED','ONLY_FULL_GROUP_BY','NO_UNSIGNED_SUBTRACTION','NO_DIR_IN_CREATE','POSTGRESQL','ORACLE','MSSQL','DB2','MAXDB','NO_KEY_OPTIONS','NO_TABLE_OPTIONS','NO_FIELD_OPTIONS','MYSQL323','MYSQL40','ANSI','NO_AUTO_VALUE_ON_ZERO','NO_BACKSLASH_ESCAPES','STRICT_TRANS_TABLES','STRICT_ALL_TABLES','NO_ZERO_IN_DATE','NO_ZERO_DATE','INVALID_DATES','ERROR_FOR_DIVISION_BY_ZERO','TRADITIONAL','NO_AUTO_CREATE_USER','HIGH_NOT_PRECEDENCE') proc sql_mode set('REAL_AS_FLOAT','PIPES_AS_CONCAT','ANSI_QUOTES','IGNORE_SPACE','NOT_USED','ONLY_FULL_GROUP_BY','NO_UNSIGNED_SUBTRACTION','NO_DIR_IN_CREATE','POSTGRESQL','ORACLE','MSSQL','DB2','MAXDB','NO_KEY_OPTIONS','NO_TABLE_OPTIONS','NO_FIELD_OPTIONS','MYSQL323','MYSQL40','ANSI','NO_AUTO_VALUE_ON_ZERO','NO_BACKSLASH_ESCAPES','STRICT_TRANS_TABLES','STRICT_ALL_TABLES','NO_ZERO_IN_DATE','NO_ZERO_DATE','INVALID_DATES','ERROR_FOR_DIVISION_BY_ZERO','TRADITIONAL','NO_AUTO_CREATE_USER','HIGH_NOT_PRECEDENCE','NO_ENGINE_SUBSTITUTION','PAD_CHAR_TO_FULL_LENGTH')
proc comment char(64) proc comment char(64)
proc character_set_client char(32) proc character_set_client char(32)
proc collation_connection char(32) proc collation_connection char(32)
@ -1623,4 +1623,19 @@ Db Name Definer Time zone Type Execute at Interval value Interval field Starts E
show events where Db= 'information_schema'; show events where Db= 'information_schema';
Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator character_set_client collation_connection Database Collation Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator character_set_client collation_connection Database Collation
use test; use test;
#
# Bug#34166: Server crash in SHOW OPEN TABLES and prelocking
#
drop table if exists t1;
drop function if exists f1;
create table t1 (a int);
create function f1() returns int
begin
insert into t1 (a) values (1);
return 0;
end|
show open tables where f1()=0;
show open tables where f1()=0;
drop table t1;
drop function f1;
End of 5.1 tests. End of 5.1 tests.

View File

@ -143,4 +143,14 @@ connection: default
flush tables; flush tables;
unlock tables; unlock tables;
drop table t1; drop table t1;
drop table if exists t1,t2;
create table t1 (a int);
flush status;
lock tables t1 read;
insert into t1 values(1);;
unlock tables;
drop table t1;
select @tlwa < @tlwb;
@tlwa < @tlwb
1
End of 5.1 tests End of 5.1 tests

View File

@ -24,54 +24,3 @@ UNLOCK TABLES;
SET SESSION debug="-d,sleep_open_and_lock_after_open"; SET SESSION debug="-d,sleep_open_and_lock_after_open";
# connection default # connection default
DROP TABLE t1; DROP TABLE t1;
#
# Extra tests for Bug#26379 - Combination of FLUSH TABLE and
# REPAIR TABLE corrupts a MERGE table
#
CREATE TABLE t1 (c1 INT);
CREATE TABLE t2 (c1 INT);
CREATE TABLE t3 (c1 INT);
INSERT INTO t1 VALUES (1);
INSERT INTO t2 VALUES (2);
INSERT INTO t3 VALUES (3);
#
# CREATE ... SELECT
# try to access parent from another thread.
#
# connection con1
SET SESSION debug="+d,sleep_create_select_before_lock";
CREATE TABLE t4 (c1 INT) ENGINE=MRG_MYISAM UNION=(t1,t2)
INSERT_METHOD=FIRST SELECT * FROM t3;
# connection default
# Now try to access the parent.
# If 3 is in table, SELECT had to wait.
SELECT * FROM t4 ORDER BY c1;
c1
1
2
3
# connection con1
SET SESSION debug="-d,sleep_create_select_before_lock";
# connection default
# Cleanup for next test.
DROP TABLE t4;
DELETE FROM t1 WHERE c1 != 1;
#
# CREATE ... SELECT
# try to access child from another thread.
#
# connection con1
SET SESSION debug="+d,sleep_create_select_before_lock";
CREATE TABLE t4 (c1 INT) ENGINE=MRG_MYISAM UNION=(t1,t2)
INSERT_METHOD=FIRST SELECT * FROM t3;
# connection default
# Now try to access a child.
# If 3 is in table, SELECT had to wait.
SELECT * FROM t1 ORDER BY c1;
c1
1
3
# connection con1
SET SESSION debug="-d,sleep_create_select_before_lock";
# connection default
DROP TABLE t1, t2, t3, t4;

View File

@ -627,7 +627,7 @@ a b
4 4 4 4
show master status /* there must be the UPDATE query event */; show master status /* there must be the UPDATE query event */;
File Position Binlog_Do_DB Binlog_Ignore_DB File Position Binlog_Do_DB Binlog_Ignore_DB
master-bin.000001 268 master-bin.000001 336
delete from t1; delete from t1;
delete from t2; delete from t2;
insert into t1 values (1,2),(3,4),(4,4); 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' ERROR 23000: Duplicate entry '4' for key 'PRIMARY'
show master status /* there must be the UPDATE query event */; show master status /* there must be the UPDATE query event */;
File Position Binlog_Do_DB Binlog_Ignore_DB File Position Binlog_Do_DB Binlog_Ignore_DB
master-bin.000001 283 master-bin.000001 351
drop table t1, t2; drop table t1, t2;
set @@session.binlog_format= @sav_binlog_format; set @@session.binlog_format= @sav_binlog_format;
drop table if exists t1, t2, t3; drop table if exists t1, t2, t3;

View File

@ -23,24 +23,33 @@ SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.uniq
SET @@session.sql_mode=0/*!*/; SET @@session.sql_mode=0/*!*/;
/*!\C latin1 *//*!*/; /*!\C latin1 *//*!*/;
SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/; 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/*!*/; SET TIMESTAMP=1000000000/*!*/;
create table t1 (word varchar(20))/*!*/; create table t1 (word varchar(20))
/*!*/;
SET TIMESTAMP=1000000000/*!*/; 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/*!*/; SET TIMESTAMP=1000000000/*!*/;
insert into t1 values ("abirvalg")/*!*/; insert into t1 values ("abirvalg")
/*!*/;
SET INSERT_ID=1/*!*/; SET INSERT_ID=1/*!*/;
SET TIMESTAMP=1000000000/*!*/; SET TIMESTAMP=1000000000/*!*/;
insert into t2 values ()/*!*/; insert into t2 values ()
/*!*/;
SET TIMESTAMP=1000000000/*!*/; 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-#-#' INTO table t1
/*!*/;
SET TIMESTAMP=1000000000/*!*/; 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-#-#' INTO table t1
/*!*/;
SET TIMESTAMP=1000000000/*!*/; 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-#-#' INTO table t1
/*!*/;
SET TIMESTAMP=1000000000/*!*/; 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-#-#' INTO table t1
/*!*/;
DELIMITER ; DELIMITER ;
# End of log file # End of log file
ROLLBACK /* added by mysqlbinlog */; 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/*!*/; SET @@session.sql_mode=0/*!*/;
/*!\C latin1 *//*!*/; /*!\C latin1 *//*!*/;
SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/; 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 ; DELIMITER ;
# End of log file # End of log file
ROLLBACK /* added by mysqlbinlog */; 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/*!*/; SET @@session.sql_mode=0/*!*/;
/*!\C latin1 *//*!*/; /*!\C latin1 *//*!*/;
SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/; 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 ; DELIMITER ;
# End of log file # End of log file
ROLLBACK /* added by mysqlbinlog */; 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/*!*/; SET @@session.sql_mode=0/*!*/;
/*!\C latin1 *//*!*/; /*!\C latin1 *//*!*/;
SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/; 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/*!*/; SET TIMESTAMP=1000000000/*!*/;
create table t1 (word varchar(20))/*!*/; create table t1 (word varchar(20))
/*!*/;
SET TIMESTAMP=1000000000/*!*/; 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/*!*/; SET TIMESTAMP=1000000000/*!*/;
insert into t1 values ("abirvalg")/*!*/; insert into t1 values ("abirvalg")
/*!*/;
SET INSERT_ID=1/*!*/; SET INSERT_ID=1/*!*/;
SET TIMESTAMP=1000000000/*!*/; SET TIMESTAMP=1000000000/*!*/;
insert into t2 values ()/*!*/; insert into t2 values ()
/*!*/;
SET TIMESTAMP=1000000000/*!*/; 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-#-#' INTO table t1
/*!*/;
SET TIMESTAMP=1000000000/*!*/; 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-#-#' INTO table t1
/*!*/;
SET TIMESTAMP=1000000000/*!*/; 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-#-#' INTO table t1
/*!*/;
SET TIMESTAMP=1000000000/*!*/; 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-#-#' INTO table t1
/*!*/;
DELIMITER ; DELIMITER ;
# End of log file # End of log file
ROLLBACK /* added by mysqlbinlog */; 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/*!*/; SET @@session.sql_mode=0/*!*/;
/*!\C latin1 *//*!*/; /*!\C latin1 *//*!*/;
SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/; 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 ; DELIMITER ;
# End of log file # End of log file
ROLLBACK /* added by mysqlbinlog */; 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/*!*/; SET @@session.sql_mode=0/*!*/;
/*!\C latin1 *//*!*/; /*!\C latin1 *//*!*/;
SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/; 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 ; DELIMITER ;
# End of log file # End of log file
ROLLBACK /* added by mysqlbinlog */; ROLLBACK /* added by mysqlbinlog */;
@ -173,9 +195,11 @@ DELIMITER /*!*/;
ROLLBACK/*!*/; ROLLBACK/*!*/;
use test/*!*/; use test/*!*/;
SET TIMESTAMP=1108844556/*!*/; SET TIMESTAMP=1108844556/*!*/;
BEGIN/*!*/; BEGIN
/*!*/;
SET TIMESTAMP=1108844555/*!*/; SET TIMESTAMP=1108844555/*!*/;
insert t1 values (1)/*!*/; insert t1 values (1)
/*!*/;
DELIMITER ; DELIMITER ;
# End of log file # End of log file
ROLLBACK /* added by mysqlbinlog */; ROLLBACK /* added by mysqlbinlog */;
@ -185,9 +209,11 @@ ROLLBACK /* added by mysqlbinlog */;
DELIMITER /*!*/; DELIMITER /*!*/;
use test/*!*/; use test/*!*/;
SET TIMESTAMP=1108844556/*!*/; SET TIMESTAMP=1108844556/*!*/;
BEGIN/*!*/; BEGIN
/*!*/;
SET TIMESTAMP=1108844555/*!*/; SET TIMESTAMP=1108844555/*!*/;
insert t1 values (1)/*!*/; insert t1 values (1)
/*!*/;
DELIMITER ; DELIMITER ;
# End of log file # End of log file
ROLLBACK /* added by mysqlbinlog */; 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() CREATE DEFINER=`root`@`localhost` procedure p1()
begin begin
select 1; select 1;
end/*!*/; end
/*!*/;
DELIMITER ; DELIMITER ;
# End of log file # End of log file
ROLLBACK /* added by mysqlbinlog */; 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/*!*/; SET @@session.sql_mode=0/*!*/;
/*!\C latin1 *//*!*/; /*!\C latin1 *//*!*/;
SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/; 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/*!*/; 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-#-#' INTO table t1
/*!*/;
SET TIMESTAMP=1000000000/*!*/; SET TIMESTAMP=1000000000/*!*/;
SET @@session.collation_database=7/*!*/; 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-#-#' INTO table t1
/*!*/;
SET TIMESTAMP=1000000000/*!*/; SET TIMESTAMP=1000000000/*!*/;
SET @@session.collation_database=DEFAULT/*!*/; 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-#-#' INTO table t1
/*!*/;
SET TIMESTAMP=1000000000/*!*/; 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-#-#' INTO table t1
/*!*/;
SET TIMESTAMP=1000000000/*!*/; SET TIMESTAMP=1000000000/*!*/;
SET @@session.collation_database=7/*!*/; 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 TIMESTAMP=1000000000/*!*/;
SET @@session.collation_database=DEFAULT/*!*/; 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/*!*/; 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/*!*/; SET TIMESTAMP=1000000000/*!*/;
drop table t1/*!*/; drop table t1
/*!*/;
DELIMITER ; DELIMITER ;
# End of log file # End of log file
ROLLBACK /* added by mysqlbinlog */; ROLLBACK /* added by mysqlbinlog */;
@ -352,4 +388,29 @@ a b
1 root@localhost 1 root@localhost
DROP DATABASE mysqltest1; DROP DATABASE mysqltest1;
DROP USER untrusted@localhost; 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 End of 5.1 tests

View File

@ -29,42 +29,48 @@ SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.uniq
SET @@session.sql_mode=0/*!*/; SET @@session.sql_mode=0/*!*/;
/*!\C latin1 *//*!*/; /*!\C latin1 *//*!*/;
SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/; 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} # at {pos}
#{yymmdd} {HH:MM:SS} server id 1 end_log_pos {pos} Intvar #{yymmdd} {HH:MM:SS} server id 1 end_log_pos {pos} Intvar
SET INSERT_ID=1/*!*/; SET INSERT_ID=1/*!*/;
# at {pos} # at {pos}
#{yymmdd} {HH:MM:SS} server id 1 end_log_pos {pos} Query thread_id={integer} exec_time={integer} error_code=0 #{yymmdd} {HH:MM:SS} server id 1 end_log_pos {pos} Query thread_id={integer} exec_time={integer} error_code=0
SET TIMESTAMP=1579609942/*!*/; SET TIMESTAMP=1579609942/*!*/;
insert into t1 values(null, "a")/*!*/; insert into t1 values(null, "a")
/*!*/;
# at {pos} # at {pos}
#{yymmdd} {HH:MM:SS} server id 1 end_log_pos {pos} Intvar #{yymmdd} {HH:MM:SS} server id 1 end_log_pos {pos} Intvar
SET INSERT_ID=2/*!*/; SET INSERT_ID=2/*!*/;
# at {pos} # at {pos}
#{yymmdd} {HH:MM:SS} server id 1 end_log_pos {pos} Query thread_id={integer} exec_time={integer} error_code=0 #{yymmdd} {HH:MM:SS} server id 1 end_log_pos {pos} Query thread_id={integer} exec_time={integer} error_code=0
SET TIMESTAMP=1579609942/*!*/; SET TIMESTAMP=1579609942/*!*/;
insert into t1 values(null, "b")/*!*/; insert into t1 values(null, "b")
/*!*/;
# at {pos} # at {pos}
#{yymmdd} {HH:MM:SS} server id 1 end_log_pos {pos} Intvar #{yymmdd} {HH:MM:SS} server id 1 end_log_pos {pos} Intvar
SET INSERT_ID=3/*!*/; SET INSERT_ID=3/*!*/;
# at {pos} # at {pos}
#{yymmdd} {HH:MM:SS} server id 1 end_log_pos {pos} Query thread_id={integer} exec_time={integer} error_code=0 #{yymmdd} {HH:MM:SS} server id 1 end_log_pos {pos} Query thread_id={integer} exec_time={integer} error_code=0
SET TIMESTAMP=1579609944/*!*/; SET TIMESTAMP=1579609944/*!*/;
insert into t1 values(null, "c")/*!*/; insert into t1 values(null, "c")
/*!*/;
# at {pos} # at {pos}
#{yymmdd} {HH:MM:SS} server id 1 end_log_pos {pos} Intvar #{yymmdd} {HH:MM:SS} server id 1 end_log_pos {pos} Intvar
SET INSERT_ID=4/*!*/; SET INSERT_ID=4/*!*/;
# at {pos} # at {pos}
#{yymmdd} {HH:MM:SS} server id 1 end_log_pos {pos} Query thread_id={integer} exec_time={integer} error_code=0 #{yymmdd} {HH:MM:SS} server id 1 end_log_pos {pos} Query thread_id={integer} exec_time={integer} error_code=0
SET TIMESTAMP=1579609946/*!*/; SET TIMESTAMP=1579609946/*!*/;
insert into t1 values(null, "d")/*!*/; insert into t1 values(null, "d")
/*!*/;
# at {pos} # at {pos}
#{yymmdd} {HH:MM:SS} server id 1 end_log_pos {pos} Intvar #{yymmdd} {HH:MM:SS} server id 1 end_log_pos {pos} Intvar
SET INSERT_ID=5/*!*/; SET INSERT_ID=5/*!*/;
# at {pos} # at {pos}
#{yymmdd} {HH:MM:SS} server id 1 end_log_pos {pos} Query thread_id={integer} exec_time={integer} error_code=0 #{yymmdd} {HH:MM:SS} server id 1 end_log_pos {pos} Query thread_id={integer} exec_time={integer} error_code=0
SET TIMESTAMP=1579609946/*!*/; SET TIMESTAMP=1579609946/*!*/;
insert into t1 values(null, "e")/*!*/; insert into t1 values(null, "e")
/*!*/;
# at {pos} # at {pos}
#{yymmdd} {HH:MM:SS} server id 1 end_log_pos {pos} Rotate to master-bin.000002 pos: {pos} #{yymmdd} {HH:MM:SS} server id 1 end_log_pos {pos} Rotate to master-bin.000002 pos: {pos}
DELIMITER ; DELIMITER ;
@ -84,19 +90,24 @@ SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.uniq
SET @@session.sql_mode=0/*!*/; SET @@session.sql_mode=0/*!*/;
/*!\C latin1 *//*!*/; /*!\C latin1 *//*!*/;
SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/; 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 INSERT_ID=2/*!*/;
SET TIMESTAMP=1579609942/*!*/; SET TIMESTAMP=1579609942/*!*/;
insert into t1 values(null, "b")/*!*/; insert into t1 values(null, "b")
/*!*/;
SET INSERT_ID=3/*!*/; SET INSERT_ID=3/*!*/;
SET TIMESTAMP=1579609944/*!*/; SET TIMESTAMP=1579609944/*!*/;
insert into t1 values(null, "c")/*!*/; insert into t1 values(null, "c")
/*!*/;
SET INSERT_ID=4/*!*/; SET INSERT_ID=4/*!*/;
SET TIMESTAMP=1579609946/*!*/; SET TIMESTAMP=1579609946/*!*/;
insert into t1 values(null, "d")/*!*/; insert into t1 values(null, "d")
/*!*/;
SET INSERT_ID=5/*!*/; SET INSERT_ID=5/*!*/;
SET TIMESTAMP=1579609946/*!*/; SET TIMESTAMP=1579609946/*!*/;
insert into t1 values(null, "e")/*!*/; insert into t1 values(null, "e")
/*!*/;
DELIMITER ; DELIMITER ;
# End of log file # End of log file
ROLLBACK /* added by mysqlbinlog */; ROLLBACK /* added by mysqlbinlog */;
@ -106,6 +117,7 @@ ROLLBACK /* added by mysqlbinlog */;
/*!40019 SET @@session.max_insert_delayed_threads=0*/; /*!40019 SET @@session.max_insert_delayed_threads=0*/;
/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/; /*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;
DELIMITER /*!*/; DELIMITER /*!*/;
ROLLBACK/*!*/;
SET INSERT_ID=4/*!*/; SET INSERT_ID=4/*!*/;
use test/*!*/; use test/*!*/;
SET TIMESTAMP=1579609946/*!*/; 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/*!*/; SET @@session.sql_mode=0/*!*/;
/*!\C latin1 *//*!*/; /*!\C latin1 *//*!*/;
SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/; 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 INSERT_ID=5/*!*/;
SET TIMESTAMP=1579609946/*!*/; SET TIMESTAMP=1579609946/*!*/;
insert into t1 values(null, "e")/*!*/; insert into t1 values(null, "e")
/*!*/;
DELIMITER ; DELIMITER ;
# End of log file # End of log file
ROLLBACK /* added by mysqlbinlog */; 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/*!*/; SET @@session.sql_mode=0/*!*/;
/*!\C latin1 *//*!*/; /*!\C latin1 *//*!*/;
SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/; 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 INSERT_ID=1/*!*/;
SET TIMESTAMP=1579609942/*!*/; SET TIMESTAMP=1579609942/*!*/;
insert into t1 values(null, "a")/*!*/; insert into t1 values(null, "a")
/*!*/;
SET INSERT_ID=2/*!*/; SET INSERT_ID=2/*!*/;
SET TIMESTAMP=1579609942/*!*/; SET TIMESTAMP=1579609942/*!*/;
insert into t1 values(null, "b")/*!*/; insert into t1 values(null, "b")
/*!*/;
SET INSERT_ID=3/*!*/; SET INSERT_ID=3/*!*/;
SET TIMESTAMP=1579609944/*!*/; SET TIMESTAMP=1579609944/*!*/;
insert into t1 values(null, "c")/*!*/; insert into t1 values(null, "c")
/*!*/;
DELIMITER ; DELIMITER ;
# End of log file # End of log file
ROLLBACK /* added by mysqlbinlog */; ROLLBACK /* added by mysqlbinlog */;
@ -152,6 +170,7 @@ ROLLBACK /* added by mysqlbinlog */;
/*!40019 SET @@session.max_insert_delayed_threads=0*/; /*!40019 SET @@session.max_insert_delayed_threads=0*/;
/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/; /*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;
DELIMITER /*!*/; DELIMITER /*!*/;
ROLLBACK/*!*/;
SET INSERT_ID=4/*!*/; SET INSERT_ID=4/*!*/;
use test/*!*/; use test/*!*/;
SET TIMESTAMP=1579609946/*!*/; 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/*!*/; SET @@session.sql_mode=0/*!*/;
/*!\C latin1 *//*!*/; /*!\C latin1 *//*!*/;
SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/; 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 ; DELIMITER ;
# End of log file # End of log file
ROLLBACK /* added by mysqlbinlog */; 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/*!*/; SET @@session.sql_mode=0/*!*/;
/*!\C latin1 *//*!*/; /*!\C latin1 *//*!*/;
SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/; 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 INSERT_ID=4/*!*/;
SET TIMESTAMP=1579609946/*!*/; SET TIMESTAMP=1579609946/*!*/;
insert into t1 values(null, "d")/*!*/; insert into t1 values(null, "d")
/*!*/;
SET INSERT_ID=5/*!*/; SET INSERT_ID=5/*!*/;
SET TIMESTAMP=1579609946/*!*/; SET TIMESTAMP=1579609946/*!*/;
insert into t1 values(null, "e")/*!*/; insert into t1 values(null, "e")
/*!*/;
DELIMITER ; DELIMITER ;
# End of log file # End of log file
ROLLBACK /* added by mysqlbinlog */; 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/*!*/; SET @@session.sql_mode=0/*!*/;
/*!\C latin1 *//*!*/; /*!\C latin1 *//*!*/;
SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/; 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 INSERT_ID=1/*!*/;
SET TIMESTAMP=1579609942/*!*/; SET TIMESTAMP=1579609942/*!*/;
insert into t1 values(null, "a")/*!*/; insert into t1 values(null, "a")
/*!*/;
SET INSERT_ID=2/*!*/; SET INSERT_ID=2/*!*/;
SET TIMESTAMP=1579609942/*!*/; SET TIMESTAMP=1579609942/*!*/;
insert into t1 values(null, "b")/*!*/; insert into t1 values(null, "b")
/*!*/;
DELIMITER ; DELIMITER ;
# End of log file # End of log file
ROLLBACK /* added by mysqlbinlog */; 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/*!*/; SET @@session.sql_mode=0/*!*/;
/*!\C latin1 *//*!*/; /*!\C latin1 *//*!*/;
SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/; 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 INSERT_ID=1/*!*/;
SET TIMESTAMP=1579609942/*!*/; SET TIMESTAMP=1579609942/*!*/;
insert into t1 values(null, "a")/*!*/; insert into t1 values(null, "a")
/*!*/;
SET INSERT_ID=2/*!*/; SET INSERT_ID=2/*!*/;
SET TIMESTAMP=1579609942/*!*/; SET TIMESTAMP=1579609942/*!*/;
insert into t1 values(null, "b")/*!*/; insert into t1 values(null, "b")
/*!*/;
SET INSERT_ID=3/*!*/; SET INSERT_ID=3/*!*/;
SET TIMESTAMP=1579609944/*!*/; SET TIMESTAMP=1579609944/*!*/;
insert into t1 values(null, "c")/*!*/; insert into t1 values(null, "c")
/*!*/;
SET INSERT_ID=4/*!*/; SET INSERT_ID=4/*!*/;
SET TIMESTAMP=1579609946/*!*/; SET TIMESTAMP=1579609946/*!*/;
insert into t1 values(null, "d")/*!*/; insert into t1 values(null, "d")
/*!*/;
SET INSERT_ID=5/*!*/; SET INSERT_ID=5/*!*/;
SET TIMESTAMP=1579609946/*!*/; SET TIMESTAMP=1579609946/*!*/;
insert into t1 values(null, "e")/*!*/; insert into t1 values(null, "e")
/*!*/;
DELIMITER ; DELIMITER ;
DELIMITER /*!*/; DELIMITER /*!*/;
SET INSERT_ID=6/*!*/; 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/*!*/; SET @@session.sql_mode=0/*!*/;
/*!\C latin1 *//*!*/; /*!\C latin1 *//*!*/;
SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/; 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 ; DELIMITER ;
# End of log file # End of log file
ROLLBACK /* added by mysqlbinlog */; 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/*!*/; SET @@session.sql_mode=0/*!*/;
/*!\C latin1 *//*!*/; /*!\C latin1 *//*!*/;
SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/; 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 INSERT_ID=2/*!*/;
SET TIMESTAMP=1579609942/*!*/; SET TIMESTAMP=1579609942/*!*/;
insert into t1 values(null, "b")/*!*/; insert into t1 values(null, "b")
/*!*/;
SET INSERT_ID=3/*!*/; SET INSERT_ID=3/*!*/;
SET TIMESTAMP=1579609944/*!*/; SET TIMESTAMP=1579609944/*!*/;
insert into t1 values(null, "c")/*!*/; insert into t1 values(null, "c")
/*!*/;
SET INSERT_ID=4/*!*/; SET INSERT_ID=4/*!*/;
SET TIMESTAMP=1579609946/*!*/; SET TIMESTAMP=1579609946/*!*/;
insert into t1 values(null, "d")/*!*/; insert into t1 values(null, "d")
/*!*/;
SET INSERT_ID=5/*!*/; SET INSERT_ID=5/*!*/;
SET TIMESTAMP=1579609946/*!*/; SET TIMESTAMP=1579609946/*!*/;
insert into t1 values(null, "e")/*!*/; insert into t1 values(null, "e")
/*!*/;
DELIMITER ; DELIMITER ;
DELIMITER /*!*/; DELIMITER /*!*/;
SET INSERT_ID=6/*!*/; 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/*!*/; SET @@session.sql_mode=0/*!*/;
/*!\C latin1 *//*!*/; /*!\C latin1 *//*!*/;
SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/; 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 ; DELIMITER ;
# End of log file # End of log file
ROLLBACK /* added by mysqlbinlog */; ROLLBACK /* added by mysqlbinlog */;
@ -299,6 +338,7 @@ ROLLBACK /* added by mysqlbinlog */;
/*!40019 SET @@session.max_insert_delayed_threads=0*/; /*!40019 SET @@session.max_insert_delayed_threads=0*/;
/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/; /*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;
DELIMITER /*!*/; DELIMITER /*!*/;
ROLLBACK/*!*/;
SET INSERT_ID=4/*!*/; SET INSERT_ID=4/*!*/;
use test/*!*/; use test/*!*/;
SET TIMESTAMP=1579609946/*!*/; 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/*!*/; SET @@session.sql_mode=0/*!*/;
/*!\C latin1 *//*!*/; /*!\C latin1 *//*!*/;
SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/; 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 INSERT_ID=5/*!*/;
SET TIMESTAMP=1579609946/*!*/; SET TIMESTAMP=1579609946/*!*/;
insert into t1 values(null, "e")/*!*/; insert into t1 values(null, "e")
/*!*/;
DELIMITER ; DELIMITER ;
DELIMITER /*!*/; DELIMITER /*!*/;
SET INSERT_ID=6/*!*/; 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/*!*/; SET @@session.sql_mode=0/*!*/;
/*!\C latin1 *//*!*/; /*!\C latin1 *//*!*/;
SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/; 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 ; DELIMITER ;
# End of log file # End of log file
ROLLBACK /* added by mysqlbinlog */; 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/*!*/; SET @@session.sql_mode=0/*!*/;
/*!\C latin1 *//*!*/; /*!\C latin1 *//*!*/;
SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/; 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 INSERT_ID=1/*!*/;
SET TIMESTAMP=1579609942/*!*/; SET TIMESTAMP=1579609942/*!*/;
insert into t1 values(null, "a")/*!*/; insert into t1 values(null, "a")
/*!*/;
SET INSERT_ID=2/*!*/; SET INSERT_ID=2/*!*/;
SET TIMESTAMP=1579609942/*!*/; SET TIMESTAMP=1579609942/*!*/;
insert into t1 values(null, "b")/*!*/; insert into t1 values(null, "b")
/*!*/;
SET INSERT_ID=3/*!*/; SET INSERT_ID=3/*!*/;
SET TIMESTAMP=1579609944/*!*/; SET TIMESTAMP=1579609944/*!*/;
insert into t1 values(null, "c")/*!*/; insert into t1 values(null, "c")
/*!*/;
SET INSERT_ID=4/*!*/; SET INSERT_ID=4/*!*/;
SET TIMESTAMP=1579609946/*!*/; SET TIMESTAMP=1579609946/*!*/;
insert into t1 values(null, "d")/*!*/; insert into t1 values(null, "d")
/*!*/;
SET INSERT_ID=5/*!*/; SET INSERT_ID=5/*!*/;
SET TIMESTAMP=1579609946/*!*/; SET TIMESTAMP=1579609946/*!*/;
insert into t1 values(null, "e")/*!*/; insert into t1 values(null, "e")
/*!*/;
DELIMITER ; DELIMITER ;
DELIMITER /*!*/; DELIMITER /*!*/;
SET INSERT_ID=6/*!*/; 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/*!*/; SET @@session.sql_mode=0/*!*/;
/*!\C latin1 *//*!*/; /*!\C latin1 *//*!*/;
SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/; 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 INSERT_ID=4/*!*/;
SET TIMESTAMP=1579609946/*!*/; SET TIMESTAMP=1579609946/*!*/;
insert into t1 values(null, "d")/*!*/; insert into t1 values(null, "d")
/*!*/;
SET INSERT_ID=5/*!*/; SET INSERT_ID=5/*!*/;
SET TIMESTAMP=1579609946/*!*/; SET TIMESTAMP=1579609946/*!*/;
insert into t1 values(null, "e")/*!*/; insert into t1 values(null, "e")
/*!*/;
DELIMITER ; DELIMITER ;
DELIMITER /*!*/; DELIMITER /*!*/;
SET INSERT_ID=6/*!*/; 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/*!*/; SET @@session.sql_mode=0/*!*/;
/*!\C latin1 *//*!*/; /*!\C latin1 *//*!*/;
SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/; 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 ; DELIMITER ;
# End of log file # End of log file
ROLLBACK /* added by mysqlbinlog */; 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/*!*/; SET @@session.sql_mode=0/*!*/;
/*!\C latin1 *//*!*/; /*!\C latin1 *//*!*/;
SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/; 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 INSERT_ID=1/*!*/;
SET TIMESTAMP=1579609942/*!*/; SET TIMESTAMP=1579609942/*!*/;
insert into t1 values(null, "a")/*!*/; insert into t1 values(null, "a")
/*!*/;
SET INSERT_ID=2/*!*/; SET INSERT_ID=2/*!*/;
SET TIMESTAMP=1579609942/*!*/; SET TIMESTAMP=1579609942/*!*/;
insert into t1 values(null, "b")/*!*/; insert into t1 values(null, "b")
/*!*/;
DELIMITER ; DELIMITER ;
# End of log file # End of log file
ROLLBACK /* added by mysqlbinlog */; 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/*!*/; SET @@session.sql_mode=0/*!*/;
/*!\C latin1 *//*!*/; /*!\C latin1 *//*!*/;
SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/; 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 INSERT_ID=1/*!*/;
SET TIMESTAMP=1579609942/*!*/; SET TIMESTAMP=1579609942/*!*/;
insert into t1 values(null, "a")/*!*/; insert into t1 values(null, "a")
/*!*/;
SET INSERT_ID=2/*!*/; SET INSERT_ID=2/*!*/;
SET TIMESTAMP=1579609942/*!*/; SET TIMESTAMP=1579609942/*!*/;
insert into t1 values(null, "b")/*!*/; insert into t1 values(null, "b")
/*!*/;
SET INSERT_ID=3/*!*/; SET INSERT_ID=3/*!*/;
SET TIMESTAMP=1579609944/*!*/; SET TIMESTAMP=1579609944/*!*/;
insert into t1 values(null, "c")/*!*/; insert into t1 values(null, "c")
/*!*/;
SET INSERT_ID=4/*!*/; SET INSERT_ID=4/*!*/;
SET TIMESTAMP=1579609946/*!*/; SET TIMESTAMP=1579609946/*!*/;
insert into t1 values(null, "d")/*!*/; insert into t1 values(null, "d")
/*!*/;
SET INSERT_ID=5/*!*/; SET INSERT_ID=5/*!*/;
SET TIMESTAMP=1579609946/*!*/; SET TIMESTAMP=1579609946/*!*/;
insert into t1 values(null, "e")/*!*/; insert into t1 values(null, "e")
/*!*/;
DELIMITER ; DELIMITER ;
# End of log file # End of log file
ROLLBACK /* added by mysqlbinlog */; 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/*!*/; SET @@session.sql_mode=0/*!*/;
/*!\C latin1 *//*!*/; /*!\C latin1 *//*!*/;
SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/; 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 INSERT_ID=2/*!*/;
SET TIMESTAMP=1579609942/*!*/; SET TIMESTAMP=1579609942/*!*/;
insert into t1 values(null, "b")/*!*/; insert into t1 values(null, "b")
/*!*/;
SET INSERT_ID=3/*!*/; SET INSERT_ID=3/*!*/;
SET TIMESTAMP=1579609944/*!*/; SET TIMESTAMP=1579609944/*!*/;
insert into t1 values(null, "c")/*!*/; insert into t1 values(null, "c")
/*!*/;
SET INSERT_ID=4/*!*/; SET INSERT_ID=4/*!*/;
SET TIMESTAMP=1579609946/*!*/; SET TIMESTAMP=1579609946/*!*/;
insert into t1 values(null, "d")/*!*/; insert into t1 values(null, "d")
/*!*/;
SET INSERT_ID=5/*!*/; SET INSERT_ID=5/*!*/;
SET TIMESTAMP=1579609946/*!*/; SET TIMESTAMP=1579609946/*!*/;
insert into t1 values(null, "e")/*!*/; insert into t1 values(null, "e")
/*!*/;
DELIMITER ; DELIMITER ;
# End of log file # End of log file
ROLLBACK /* added by mysqlbinlog */; 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/*!*/; SET @@session.sql_mode=0/*!*/;
/*!\C latin1 *//*!*/; /*!\C latin1 *//*!*/;
SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/; 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 INSERT_ID=5/*!*/;
SET TIMESTAMP=1579609946/*!*/; SET TIMESTAMP=1579609946/*!*/;
insert into t1 values(null, "e")/*!*/; insert into t1 values(null, "e")
/*!*/;
DELIMITER ; DELIMITER ;
# End of log file # End of log file
ROLLBACK /* added by mysqlbinlog */; 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/*!*/; SET @@session.sql_mode=0/*!*/;
/*!\C latin1 *//*!*/; /*!\C latin1 *//*!*/;
SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/; 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 INSERT_ID=1/*!*/;
SET TIMESTAMP=1579609942/*!*/; SET TIMESTAMP=1579609942/*!*/;
insert into t1 values(null, "a")/*!*/; insert into t1 values(null, "a")
/*!*/;
SET INSERT_ID=2/*!*/; SET INSERT_ID=2/*!*/;
SET TIMESTAMP=1579609942/*!*/; SET TIMESTAMP=1579609942/*!*/;
insert into t1 values(null, "b")/*!*/; insert into t1 values(null, "b")
/*!*/;
SET INSERT_ID=3/*!*/; SET INSERT_ID=3/*!*/;
SET TIMESTAMP=1579609944/*!*/; SET TIMESTAMP=1579609944/*!*/;
insert into t1 values(null, "c")/*!*/; insert into t1 values(null, "c")
/*!*/;
DELIMITER ; DELIMITER ;
# End of log file # End of log file
ROLLBACK /* added by mysqlbinlog */; 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/*!*/; SET @@session.sql_mode=0/*!*/;
/*!\C latin1 *//*!*/; /*!\C latin1 *//*!*/;
SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/; 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 ; DELIMITER ;
# End of log file # End of log file
ROLLBACK /* added by mysqlbinlog */; 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/*!*/; SET @@session.sql_mode=0/*!*/;
/*!\C latin1 *//*!*/; /*!\C latin1 *//*!*/;
SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/; 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 INSERT_ID=4/*!*/;
SET TIMESTAMP=1579609946/*!*/; SET TIMESTAMP=1579609946/*!*/;
insert into t1 values(null, "d")/*!*/; insert into t1 values(null, "d")
/*!*/;
SET INSERT_ID=5/*!*/; SET INSERT_ID=5/*!*/;
SET TIMESTAMP=1579609946/*!*/; SET TIMESTAMP=1579609946/*!*/;
insert into t1 values(null, "e")/*!*/; insert into t1 values(null, "e")
/*!*/;
DELIMITER ; DELIMITER ;
# End of log file # End of log file
ROLLBACK /* added by mysqlbinlog */; 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/*!*/; SET @@session.sql_mode=0/*!*/;
/*!\C latin1 *//*!*/; /*!\C latin1 *//*!*/;
SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/; 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 INSERT_ID=1/*!*/;
SET TIMESTAMP=1579609942/*!*/; SET TIMESTAMP=1579609942/*!*/;
insert into t1 values(null, "a")/*!*/; insert into t1 values(null, "a")
/*!*/;
SET INSERT_ID=2/*!*/; SET INSERT_ID=2/*!*/;
SET TIMESTAMP=1579609942/*!*/; SET TIMESTAMP=1579609942/*!*/;
insert into t1 values(null, "b")/*!*/; insert into t1 values(null, "b")
/*!*/;
DELIMITER ; DELIMITER ;
# End of log file # End of log file
ROLLBACK /* added by mysqlbinlog */; 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/*!*/; SET @@session.sql_mode=0/*!*/;
/*!\C latin1 *//*!*/; /*!\C latin1 *//*!*/;
SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/; 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 INSERT_ID=1/*!*/;
SET TIMESTAMP=1579609942/*!*/; SET TIMESTAMP=1579609942/*!*/;
insert into t1 values(null, "a")/*!*/; insert into t1 values(null, "a")
/*!*/;
SET INSERT_ID=2/*!*/; SET INSERT_ID=2/*!*/;
SET TIMESTAMP=1579609942/*!*/; SET TIMESTAMP=1579609942/*!*/;
insert into t1 values(null, "b")/*!*/; insert into t1 values(null, "b")
/*!*/;
SET INSERT_ID=3/*!*/; SET INSERT_ID=3/*!*/;
SET TIMESTAMP=1579609944/*!*/; SET TIMESTAMP=1579609944/*!*/;
insert into t1 values(null, "c")/*!*/; insert into t1 values(null, "c")
/*!*/;
SET INSERT_ID=4/*!*/; SET INSERT_ID=4/*!*/;
SET TIMESTAMP=1579609946/*!*/; SET TIMESTAMP=1579609946/*!*/;
insert into t1 values(null, "d")/*!*/; insert into t1 values(null, "d")
/*!*/;
SET INSERT_ID=5/*!*/; SET INSERT_ID=5/*!*/;
SET TIMESTAMP=1579609946/*!*/; SET TIMESTAMP=1579609946/*!*/;
insert into t1 values(null, "e")/*!*/; insert into t1 values(null, "e")
/*!*/;
DELIMITER ; DELIMITER ;
DELIMITER /*!*/; DELIMITER /*!*/;
SET INSERT_ID=6/*!*/; 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/*!*/; SET @@session.sql_mode=0/*!*/;
/*!\C latin1 *//*!*/; /*!\C latin1 *//*!*/;
SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/; 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 ; DELIMITER ;
# End of log file # End of log file
ROLLBACK /* added by mysqlbinlog */; 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/*!*/; SET @@session.sql_mode=0/*!*/;
/*!\C latin1 *//*!*/; /*!\C latin1 *//*!*/;
SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/; 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 INSERT_ID=2/*!*/;
SET TIMESTAMP=1579609942/*!*/; SET TIMESTAMP=1579609942/*!*/;
insert into t1 values(null, "b")/*!*/; insert into t1 values(null, "b")
/*!*/;
SET INSERT_ID=3/*!*/; SET INSERT_ID=3/*!*/;
SET TIMESTAMP=1579609944/*!*/; SET TIMESTAMP=1579609944/*!*/;
insert into t1 values(null, "c")/*!*/; insert into t1 values(null, "c")
/*!*/;
SET INSERT_ID=4/*!*/; SET INSERT_ID=4/*!*/;
SET TIMESTAMP=1579609946/*!*/; SET TIMESTAMP=1579609946/*!*/;
insert into t1 values(null, "d")/*!*/; insert into t1 values(null, "d")
/*!*/;
SET INSERT_ID=5/*!*/; SET INSERT_ID=5/*!*/;
SET TIMESTAMP=1579609946/*!*/; SET TIMESTAMP=1579609946/*!*/;
insert into t1 values(null, "e")/*!*/; insert into t1 values(null, "e")
/*!*/;
DELIMITER ; DELIMITER ;
DELIMITER /*!*/; DELIMITER /*!*/;
SET INSERT_ID=6/*!*/; 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/*!*/; SET @@session.sql_mode=0/*!*/;
/*!\C latin1 *//*!*/; /*!\C latin1 *//*!*/;
SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/; 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 ; DELIMITER ;
# End of log file # End of log file
ROLLBACK /* added by mysqlbinlog */; 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/*!*/; SET @@session.sql_mode=0/*!*/;
/*!\C latin1 *//*!*/; /*!\C latin1 *//*!*/;
SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/; 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 INSERT_ID=5/*!*/;
SET TIMESTAMP=1579609946/*!*/; SET TIMESTAMP=1579609946/*!*/;
insert into t1 values(null, "e")/*!*/; insert into t1 values(null, "e")
/*!*/;
DELIMITER ; DELIMITER ;
DELIMITER /*!*/; DELIMITER /*!*/;
SET INSERT_ID=6/*!*/; 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/*!*/; SET @@session.sql_mode=0/*!*/;
/*!\C latin1 *//*!*/; /*!\C latin1 *//*!*/;
SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/; 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 ; DELIMITER ;
# End of log file # End of log file
ROLLBACK /* added by mysqlbinlog */; 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/*!*/; SET @@session.sql_mode=0/*!*/;
/*!\C latin1 *//*!*/; /*!\C latin1 *//*!*/;
SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/; 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 INSERT_ID=1/*!*/;
SET TIMESTAMP=1579609942/*!*/; SET TIMESTAMP=1579609942/*!*/;
insert into t1 values(null, "a")/*!*/; insert into t1 values(null, "a")
/*!*/;
SET INSERT_ID=2/*!*/; SET INSERT_ID=2/*!*/;
SET TIMESTAMP=1579609942/*!*/; SET TIMESTAMP=1579609942/*!*/;
insert into t1 values(null, "b")/*!*/; insert into t1 values(null, "b")
/*!*/;
SET INSERT_ID=3/*!*/; SET INSERT_ID=3/*!*/;
SET TIMESTAMP=1579609944/*!*/; SET TIMESTAMP=1579609944/*!*/;
insert into t1 values(null, "c")/*!*/; insert into t1 values(null, "c")
/*!*/;
SET INSERT_ID=4/*!*/; SET INSERT_ID=4/*!*/;
SET TIMESTAMP=1579609946/*!*/; SET TIMESTAMP=1579609946/*!*/;
insert into t1 values(null, "d")/*!*/; insert into t1 values(null, "d")
/*!*/;
SET INSERT_ID=5/*!*/; SET INSERT_ID=5/*!*/;
SET TIMESTAMP=1579609946/*!*/; SET TIMESTAMP=1579609946/*!*/;
insert into t1 values(null, "e")/*!*/; insert into t1 values(null, "e")
/*!*/;
DELIMITER ; DELIMITER ;
DELIMITER /*!*/; DELIMITER /*!*/;
SET INSERT_ID=6/*!*/; 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/*!*/; SET @@session.sql_mode=0/*!*/;
/*!\C latin1 *//*!*/; /*!\C latin1 *//*!*/;
SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/; 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 INSERT_ID=4/*!*/;
SET TIMESTAMP=1579609946/*!*/; SET TIMESTAMP=1579609946/*!*/;
insert into t1 values(null, "d")/*!*/; insert into t1 values(null, "d")
/*!*/;
SET INSERT_ID=5/*!*/; SET INSERT_ID=5/*!*/;
SET TIMESTAMP=1579609946/*!*/; SET TIMESTAMP=1579609946/*!*/;
insert into t1 values(null, "e")/*!*/; insert into t1 values(null, "e")
/*!*/;
DELIMITER ; DELIMITER ;
DELIMITER /*!*/; DELIMITER /*!*/;
SET INSERT_ID=6/*!*/; 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/*!*/; SET @@session.sql_mode=0/*!*/;
/*!\C latin1 *//*!*/; /*!\C latin1 *//*!*/;
SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/; 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 ; DELIMITER ;
# End of log file # End of log file
ROLLBACK /* added by mysqlbinlog */; 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/*!*/; SET @@session.sql_mode=0/*!*/;
/*!\C latin1 *//*!*/; /*!\C latin1 *//*!*/;
SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/; 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 INSERT_ID=1/*!*/;
SET TIMESTAMP=1579609942/*!*/; SET TIMESTAMP=1579609942/*!*/;
insert into t1 values(null, "a")/*!*/; insert into t1 values(null, "a")
/*!*/;
SET INSERT_ID=2/*!*/; SET INSERT_ID=2/*!*/;
SET TIMESTAMP=1579609942/*!*/; SET TIMESTAMP=1579609942/*!*/;
insert into t1 values(null, "b")/*!*/; insert into t1 values(null, "b")
/*!*/;
DELIMITER ; DELIMITER ;
# End of log file # End of log file
ROLLBACK /* added by mysqlbinlog */; 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/*!*/; SET @@session.sql_mode=0/*!*/;
/*!\C latin1 *//*!*/; /*!\C latin1 *//*!*/;
SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/; 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 INSERT_ID=1/*!*/;
SET TIMESTAMP=1579609942/*!*/; SET TIMESTAMP=1579609942/*!*/;
insert into t1 values(null, "a")/*!*/; insert into t1 values(null, "a")
/*!*/;
SET INSERT_ID=2/*!*/; SET INSERT_ID=2/*!*/;
SET TIMESTAMP=1579609942/*!*/; SET TIMESTAMP=1579609942/*!*/;
insert into t1 values(null, "b")/*!*/; insert into t1 values(null, "b")
/*!*/;
SET INSERT_ID=3/*!*/; SET INSERT_ID=3/*!*/;
SET TIMESTAMP=1579609944/*!*/; SET TIMESTAMP=1579609944/*!*/;
insert into t1 values(null, "c")/*!*/; insert into t1 values(null, "c")
/*!*/;
SET INSERT_ID=4/*!*/; SET INSERT_ID=4/*!*/;
SET TIMESTAMP=1579609946/*!*/; SET TIMESTAMP=1579609946/*!*/;
insert into t1 values(null, "d")/*!*/; insert into t1 values(null, "d")
/*!*/;
SET INSERT_ID=5/*!*/; SET INSERT_ID=5/*!*/;
SET TIMESTAMP=1579609946/*!*/; SET TIMESTAMP=1579609946/*!*/;
insert into t1 values(null, "e")/*!*/; insert into t1 values(null, "e")
/*!*/;
SET INSERT_ID=6/*!*/; SET INSERT_ID=6/*!*/;
SET TIMESTAMP=1579609943/*!*/; SET TIMESTAMP=1579609943/*!*/;
insert into t1 values(null, "f")/*!*/; insert into t1 values(null, "f")
/*!*/;
DELIMITER ; DELIMITER ;
# End of log file # End of log file
ROLLBACK /* added by mysqlbinlog */; ROLLBACK /* added by mysqlbinlog */;

View File

@ -1717,6 +1717,22 @@ t1 CREATE TABLE `t1` (
`?` decimal(2,1) DEFAULT NULL `?` decimal(2,1) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 ) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1; drop table t1;
drop table if exists t1;
create table t1 (a bigint unsigned, b bigint(20) unsigned);
prepare stmt from "insert into t1 values (?,?)";
set @a= 9999999999999999;
set @b= 14632475938453979136;
insert into t1 values (@a, @b);
select * from t1 where a = @a and b = @b;
a b
9999999999999999 14632475938453979136
execute stmt using @a, @b;
select * from t1 where a = @a and b = @b;
a b
9999999999999999 14632475938453979136
9999999999999999 14632475938453979136
deallocate prepare stmt;
drop table t1;
End of 5.0 tests. End of 5.0 tests.
create procedure proc_1() reset query cache; create procedure proc_1() reset query cache;
call proc_1(); call proc_1();

File diff suppressed because it is too large Load Diff

View File

@ -1427,4 +1427,9 @@ DROP FUNCTION f1;
DROP TABLE t1; DROP TABLE t1;
DROP EVENT ev1; DROP EVENT ev1;
SHOW TABLE TYPES; SHOW TABLE TYPES;
CREATE USER test_u@localhost;
GRANT PROCESS ON *.* TO test_u@localhost;
SHOW ENGINE MYISAM MUTEX;
SHOW ENGINE MYISAM STATUS;
DROP USER test_u@localhost;
End of 5.1 tests End of 5.1 tests

View File

@ -1627,3 +1627,14 @@ end loop label1;
end loop; end loop;
end| end|
ERROR 42000: End-label label1 without match ERROR 42000: End-label label1 without match
drop procedure if exists p1;
create procedure p1()
begin
create table t1 (a int) type=MyISAM;
drop table t1;
end|
Warnings:
Warning 1287 The syntax 'TYPE=storage_engine' is deprecated and will be removed in MySQL 5.2. Please use 'ENGINE=storage_engine' instead
call p1();
call p1();
drop procedure p1;

View File

@ -6963,6 +6963,22 @@ END latin1 latin1_swedish_ci latin1_swedish_ci
DROP FUNCTION f1; DROP FUNCTION f1;
drop procedure if exists p;
set @old_mode= @@sql_mode;
set @@sql_mode= pow(2,32)-1;
select @@sql_mode into @full_mode;
create procedure p() begin end;
call p();
select @@sql_mode;
@@sql_mode
REAL_AS_FLOAT,PIPES_AS_CONCAT,ANSI_QUOTES,IGNORE_SPACE,?,ONLY_FULL_GROUP_BY,NO_UNSIGNED_SUBTRACTION,NO_DIR_IN_CREATE,POSTGRESQL,ORACLE,MSSQL,DB2,MAXDB,NO_KEY_OPTIONS,NO_TABLE_OPTIONS,NO_FIELD_OPTIONS,MYSQL323,MYSQL40,ANSI,NO_AUTO_VALUE_ON_ZERO,NO_BACKSLASH_ESCAPES,STRICT_TRANS_TABLES,STRICT_ALL_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ALLOW_INVALID_DATES,ERROR_FOR_DIVISION_BY_ZERO,TRADITIONAL,NO_AUTO_CREATE_USER,HIGH_NOT_PRECEDENCE,NO_ENGINE_SUBSTITUTION,PAD_CHAR_TO_FULL_LENGTH
set @@sql_mode= @old_mode;
select replace(@full_mode, '?', 'NOT_USED') into @full_mode;
select replace(@full_mode, 'ALLOW_INVALID_DATES', 'INVALID_DATES') into @full_mode;
select name from mysql.proc where name = 'p' and sql_mode = @full_mode;
name
p
drop procedure p;
# ------------------------------------------------------------------ # ------------------------------------------------------------------
# -- End of 5.1 tests # -- End of 5.1 tests
# ------------------------------------------------------------------ # ------------------------------------------------------------------

View File

@ -16,6 +16,7 @@ insert into t2 values (bug23333(),1)|
ERROR 23000: Duplicate entry '1' for key 'PRIMARY' ERROR 23000: Duplicate entry '1' for key 'PRIMARY'
show binlog events from 106 /* with fixes for #23333 will show there is the query */| 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 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 # Table_map 1 # # master-bin.000001 # Table_map 1 # #
master-bin.000001 # Write_rows 1 # # master-bin.000001 # Write_rows 1 # #

View File

@ -1,28 +0,0 @@
drop table if exists t1;
set @org_mode=@@sql_mode;
create table t1
(
`a` tinyint(4) NOT NULL auto_increment,
primary key (`a`)
) engine = 'BDB' ;
set @@sql_mode='strict_all_tables';
insert into t1 values(1000);
ERROR 22003: Out of range value for column 'a' at row 1
select count(*) from t1;
count(*)
0
set auto_increment_increment=1000;
set auto_increment_offset=700;
insert into t1 values(null);
ERROR 22003: Out of range value for column 'a' at row 1
select count(*) from t1;
count(*)
0
set @@sql_mode=@org_mode;
insert into t1 values(null);
Warnings:
Warning 1264 Out of range value for column 'a' at row 1
select * from t1;
a
127
drop table t1;

View File

@ -201,7 +201,7 @@ proc CREATE TABLE `proc` (
`definer` char(77) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT '', `definer` char(77) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT '',
`created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`modified` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', `modified` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
`sql_mode` set('REAL_AS_FLOAT','PIPES_AS_CONCAT','ANSI_QUOTES','IGNORE_SPACE','NOT_USED','ONLY_FULL_GROUP_BY','NO_UNSIGNED_SUBTRACTION','NO_DIR_IN_CREATE','POSTGRESQL','ORACLE','MSSQL','DB2','MAXDB','NO_KEY_OPTIONS','NO_TABLE_OPTIONS','NO_FIELD_OPTIONS','MYSQL323','MYSQL40','ANSI','NO_AUTO_VALUE_ON_ZERO','NO_BACKSLASH_ESCAPES','STRICT_TRANS_TABLES','STRICT_ALL_TABLES','NO_ZERO_IN_DATE','NO_ZERO_DATE','INVALID_DATES','ERROR_FOR_DIVISION_BY_ZERO','TRADITIONAL','NO_AUTO_CREATE_USER','HIGH_NOT_PRECEDENCE') NOT NULL DEFAULT '', `sql_mode` set('REAL_AS_FLOAT','PIPES_AS_CONCAT','ANSI_QUOTES','IGNORE_SPACE','NOT_USED','ONLY_FULL_GROUP_BY','NO_UNSIGNED_SUBTRACTION','NO_DIR_IN_CREATE','POSTGRESQL','ORACLE','MSSQL','DB2','MAXDB','NO_KEY_OPTIONS','NO_TABLE_OPTIONS','NO_FIELD_OPTIONS','MYSQL323','MYSQL40','ANSI','NO_AUTO_VALUE_ON_ZERO','NO_BACKSLASH_ESCAPES','STRICT_TRANS_TABLES','STRICT_ALL_TABLES','NO_ZERO_IN_DATE','NO_ZERO_DATE','INVALID_DATES','ERROR_FOR_DIVISION_BY_ZERO','TRADITIONAL','NO_AUTO_CREATE_USER','HIGH_NOT_PRECEDENCE','NO_ENGINE_SUBSTITUTION','PAD_CHAR_TO_FULL_LENGTH') NOT NULL DEFAULT '',
`comment` char(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT '', `comment` char(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT '',
`character_set_client` char(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL, `character_set_client` char(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL,
`collation_connection` char(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL, `collation_connection` char(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL,
@ -226,7 +226,7 @@ event CREATE TABLE `event` (
`ends` datetime DEFAULT NULL, `ends` datetime DEFAULT NULL,
`status` enum('ENABLED','DISABLED','SLAVESIDE_DISABLED') NOT NULL DEFAULT 'ENABLED', `status` enum('ENABLED','DISABLED','SLAVESIDE_DISABLED') NOT NULL DEFAULT 'ENABLED',
`on_completion` enum('DROP','PRESERVE') NOT NULL DEFAULT 'DROP', `on_completion` enum('DROP','PRESERVE') NOT NULL DEFAULT 'DROP',
`sql_mode` set('REAL_AS_FLOAT','PIPES_AS_CONCAT','ANSI_QUOTES','IGNORE_SPACE','NOT_USED','ONLY_FULL_GROUP_BY','NO_UNSIGNED_SUBTRACTION','NO_DIR_IN_CREATE','POSTGRESQL','ORACLE','MSSQL','DB2','MAXDB','NO_KEY_OPTIONS','NO_TABLE_OPTIONS','NO_FIELD_OPTIONS','MYSQL323','MYSQL40','ANSI','NO_AUTO_VALUE_ON_ZERO','NO_BACKSLASH_ESCAPES','STRICT_TRANS_TABLES','STRICT_ALL_TABLES','NO_ZERO_IN_DATE','NO_ZERO_DATE','INVALID_DATES','ERROR_FOR_DIVISION_BY_ZERO','TRADITIONAL','NO_AUTO_CREATE_USER','HIGH_NOT_PRECEDENCE') NOT NULL DEFAULT '', `sql_mode` set('REAL_AS_FLOAT','PIPES_AS_CONCAT','ANSI_QUOTES','IGNORE_SPACE','NOT_USED','ONLY_FULL_GROUP_BY','NO_UNSIGNED_SUBTRACTION','NO_DIR_IN_CREATE','POSTGRESQL','ORACLE','MSSQL','DB2','MAXDB','NO_KEY_OPTIONS','NO_TABLE_OPTIONS','NO_FIELD_OPTIONS','MYSQL323','MYSQL40','ANSI','NO_AUTO_VALUE_ON_ZERO','NO_BACKSLASH_ESCAPES','STRICT_TRANS_TABLES','STRICT_ALL_TABLES','NO_ZERO_IN_DATE','NO_ZERO_DATE','INVALID_DATES','ERROR_FOR_DIVISION_BY_ZERO','TRADITIONAL','NO_AUTO_CREATE_USER','HIGH_NOT_PRECEDENCE','NO_ENGINE_SUBSTITUTION','PAD_CHAR_TO_FULL_LENGTH') NOT NULL DEFAULT '',
`comment` char(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT '', `comment` char(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT '',
`originator` int(10) NOT NULL, `originator` int(10) NOT NULL,
`time_zone` char(64) CHARACTER SET latin1 NOT NULL DEFAULT 'SYSTEM', `time_zone` char(64) CHARACTER SET latin1 NOT NULL DEFAULT 'SYSTEM',

View File

@ -25,11 +25,13 @@ SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.uniq
SET @@session.sql_mode=0/*!*/; SET @@session.sql_mode=0/*!*/;
/*!\C latin1 *//*!*/; /*!\C latin1 *//*!*/;
SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/; 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 @`var1`:=_latin1 0x273B616161 COLLATE `latin1_swedish_ci`/*!*/;
SET @`var2`:=_binary 0x61 COLLATE `binary`/*!*/; SET @`var2`:=_binary 0x61 COLLATE `binary`/*!*/;
SET TIMESTAMP=10000/*!*/; SET TIMESTAMP=10000/*!*/;
insert into t1 values (@var1),(@var2)/*!*/; insert into t1 values (@var1),(@var2)
/*!*/;
DELIMITER ; DELIMITER ;
# End of log file # End of log file
ROLLBACK /* added by mysqlbinlog */; ROLLBACK /* added by mysqlbinlog */;

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View 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;

View File

@ -66,6 +66,7 @@ COMMIT;
show binlog events from <binlog_start>; show binlog events from <binlog_start>;
Log_name Pos Event_type Server_id End_log_pos Info 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`; 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 # 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 # Xid # # COMMIT /* XID */
master-bin.000001 # Query # # use `test`; BEGIN master-bin.000001 # Query # # use `test`; BEGIN

View File

@ -18,8 +18,8 @@ load data infile '../std_data_ln/rpl_loaddata.dat' into table t2 /* will be "kil
ERROR 70100: Query execution was interrupted ERROR 70100: Query execution was interrupted
show binlog events from <binlog_start>; show binlog events from <binlog_start>;
Log_name Pos Event_type Server_id End_log_pos Info Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # Begin_load_query # # ;file_id=1;block_len=12 master-bin.000001 # Begin_load_query # # ;file_id=#;block_len=12
master-bin.000001 # Execute_load_query # # use `test`; load data infile '../std_data_ln/rpl_loaddata.dat' into table t2 /* will be "killed" in the middle */ ;file_id=1 master-bin.000001 # Execute_load_query # # use `test`; load data infile '../std_data_ln/rpl_loaddata.dat' into table t2 /* will be "killed" in the middle */ ;file_id=#
select select
(@a:=load_file("MYSQLTEST_VARDIR/tmp/binlog_killed_bug27571.binlog")) (@a:=load_file("MYSQLTEST_VARDIR/tmp/binlog_killed_bug27571.binlog"))
is not null; is not null;

View File

@ -18,8 +18,12 @@ TRUNCATE t1n;
show binlog events from <binlog_start>; show binlog events from <binlog_start>;
Log_name Pos Event_type Server_id End_log_pos Info 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`; 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`; 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`; 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`; 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`; 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 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>; show binlog events from <binlog_start>;
Log_name Pos Event_type Server_id End_log_pos Info 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`; 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`; 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`; 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 t1m
master-bin.000001 # Query # # use `test`; TRUNCATE t1b master-bin.000001 # Query # # use `test`; TRUNCATE t1b
master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # BEGIN

View File

@ -0,0 +1,61 @@
DROP TABLE IF EXISTS t1, t2, t3;
==== Read modern binlog (version 5.1.23) ====
SELECT * FROM t1 ORDER BY a;
a b
0 last_insert_id
1 one
3 last stm in trx: next event should be xid
4 four
674568 random
SELECT * FROM t2 ORDER BY a;
a b
3 first stm in trx
SELECT COUNT(*) FROM t3;
COUNT(*)
17920
DROP TABLE t1, t2, t3;
==== Read binlog from version 5.1.17 ====
SELECT * FROM t1 ORDER BY a;
a b
0 last_insert_id
1 one
3 last stm in trx: next event should be xid
4 four
764247 random
SELECT * FROM t2 ORDER BY a;
a b
3 first stm in trx
SELECT COUNT(*) FROM t3;
COUNT(*)
17920
DROP TABLE t1, t2, t3;
==== Read binlog from alcatel tree (mysql-5.1-wl2325-5.0-drop6) ====
SELECT * FROM t1 ORDER BY a;
a b
0 last_insert_id
1 one
3 last stm in trx: next event should be xid
4 four
781729 random
SELECT * FROM t2 ORDER BY a;
a b
3 first stm in trx
SELECT COUNT(*) FROM t3;
COUNT(*)
17920
DROP TABLE t1, t2, t3;
==== Read binlog from ndb tree (mysql-5.1-telco-6.1) ====
SELECT * FROM t1 ORDER BY a;
a b
0 last_insert_id
1 one
3 last stm in trx: next event should be xid
4 four
703356 random
SELECT * FROM t2 ORDER BY a;
a b
3 first stm in trx
SELECT COUNT(*) FROM t3;
COUNT(*)
17920
DROP TABLE t1, t2, t3;

View File

@ -1072,6 +1072,22 @@ master-bin.000001 30301 Rotate 1 30345 master-bin.000002;pos=4
drop table t1; drop table t1;
set global binlog_cache_size=@bcs; set global binlog_cache_size=@bcs;
set session autocommit = @ac; set session autocommit = @ac;
drop table if exists t1;
reset master;
create table t1 (a bigint unsigned, b bigint(20) unsigned);
prepare stmt from "insert into t1 values (?,?)";
set @a= 9999999999999999;
set @b= 14632475938453979136;
execute stmt using @a, @b;
deallocate prepare stmt;
drop table t1;
show binlog events from 0;
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 4 Format_desc 1 106 Server version, Binlog ver: 4
master-bin.000001 106 Query 1 227 use `test`; create table t1 (a bigint unsigned, b bigint(20) unsigned)
master-bin.000001 227 Table_map 1 269 table_id: # (test.t1)
master-bin.000001 269 Write_rows 1 315 table_id: # flags: STMT_END_F
master-bin.000001 315 Query 1 391 use `test`; drop table t1
End of 5.0 tests End of 5.0 tests
reset master; reset master;
create table t1 (id tinyint auto_increment primary key); create table t1 (id tinyint auto_increment primary key);
@ -1099,9 +1115,11 @@ master-bin.000001 # Table_map # # table_id: # (test.t1)
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
master-bin.000001 # Query # # use `test`; drop table t1 master-bin.000001 # Query # # use `test`; drop table t1
master-bin.000001 # Query # # use `test`; create table t1 (a int) master-bin.000001 # Query # # use `test`; create table t1 (a int)
master-bin.000001 # Query # # use `test`; BEGIN
master-bin.000001 # Query # # use `test`; CREATE TABLE IF NOT EXISTS `t2` ( master-bin.000001 # Query # # use `test`; CREATE TABLE IF NOT EXISTS `t2` (
`a` int(11) DEFAULT NULL `a` int(11) DEFAULT NULL
) )
master-bin.000001 # Query # # use `test`; COMMIT
master-bin.000001 # Query # # use `test`; CREATE TABLE IF NOT EXISTS `t3` ( master-bin.000001 # Query # # use `test`; CREATE TABLE IF NOT EXISTS `t3` (
`a` int(11) DEFAULT NULL `a` int(11) DEFAULT NULL
) )
@ -1124,9 +1142,11 @@ master-bin.000001 # Table_map # # table_id: # (test.t1)
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
master-bin.000001 # Query # # use `test`; drop table t1 master-bin.000001 # Query # # use `test`; drop table t1
master-bin.000001 # Query # # use `test`; create table t1 (a int) master-bin.000001 # Query # # use `test`; create table t1 (a int)
master-bin.000001 # Query # # use `test`; BEGIN
master-bin.000001 # Query # # use `test`; CREATE TABLE IF NOT EXISTS `t2` ( master-bin.000001 # Query # # use `test`; CREATE TABLE IF NOT EXISTS `t2` (
`a` int(11) DEFAULT NULL `a` int(11) DEFAULT NULL
) )
master-bin.000001 # Query # # use `test`; COMMIT
master-bin.000001 # Query # # use `test`; CREATE TABLE IF NOT EXISTS `t3` ( master-bin.000001 # Query # # use `test`; CREATE TABLE IF NOT EXISTS `t3` (
`a` int(11) DEFAULT NULL `a` int(11) DEFAULT NULL
) )

View File

@ -113,6 +113,7 @@ insert into t1 values(9);
insert into t2 select * from t1; insert into t2 select * from t1;
show binlog events from <binlog_start>; show binlog events from <binlog_start>;
Log_name Pos Event_type Server_id End_log_pos Info Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # Query # # use `test`; BEGIN
master-bin.000001 # Table_map # # table_id: # (test.t1) master-bin.000001 # Table_map # # table_id: # (test.t1)
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
master-bin.000001 # Xid # # COMMIT /* XID */ master-bin.000001 # Xid # # COMMIT /* XID */
@ -126,6 +127,7 @@ begin;
insert into t2 select * from t1; insert into t2 select * from t1;
show binlog events from <binlog_start>; show binlog events from <binlog_start>;
Log_name Pos Event_type Server_id End_log_pos Info Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # Query # # use `test`; BEGIN
master-bin.000001 # Table_map # # table_id: # (test.t1) master-bin.000001 # Table_map # # table_id: # (test.t1)
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
master-bin.000001 # Xid # # COMMIT /* XID */ master-bin.000001 # Xid # # COMMIT /* XID */
@ -135,6 +137,7 @@ insert into t1 values(11);
commit; commit;
show binlog events from <binlog_start>; show binlog events from <binlog_start>;
Log_name Pos Event_type Server_id End_log_pos Info Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # Query # # use `test`; BEGIN
master-bin.000001 # Table_map # # table_id: # (test.t1) master-bin.000001 # Table_map # # table_id: # (test.t1)
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
master-bin.000001 # Xid # # COMMIT /* XID */ master-bin.000001 # Xid # # COMMIT /* XID */
@ -260,10 +263,12 @@ master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
master-bin.000001 # Table_map # # table_id: # (test.t1) master-bin.000001 # Table_map # # table_id: # (test.t1)
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
master-bin.000001 # Xid # # COMMIT /* XID */ 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 # Table_map # # table_id: # (test.t1)
master-bin.000001 # Delete_rows # # table_id: # flags: STMT_END_F master-bin.000001 # Delete_rows # # table_id: # flags: STMT_END_F
master-bin.000001 # Xid # # COMMIT /* XID */ master-bin.000001 # Xid # # COMMIT /* XID */
master-bin.000001 # Query # # use `test`; alter table t2 engine=MyISAM master-bin.000001 # Query # # use `test`; alter table t2 engine=MyISAM
master-bin.000001 # Query # # use `test`; BEGIN
master-bin.000001 # Table_map # # table_id: # (test.t1) master-bin.000001 # Table_map # # table_id: # (test.t1)
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
master-bin.000001 # Xid # # COMMIT /* XID */ master-bin.000001 # Xid # # COMMIT /* XID */
@ -366,6 +371,7 @@ 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`; CREATE TABLE t2 (a int, b int, primary key (a)) engine=innodb
master-bin.000001 # Table_map # # table_id: # (test.t1) master-bin.000001 # Table_map # # table_id: # (test.t1)
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
master-bin.000001 # Query # # use `test`; BEGIN
master-bin.000001 # Query # # use `test`; TRUNCATE table t2 master-bin.000001 # Query # # use `test`; TRUNCATE table t2
master-bin.000001 # Xid # # COMMIT /* XID */ master-bin.000001 # Xid # # COMMIT /* XID */
master-bin.000001 # Table_map # # table_id: # (test.t1) master-bin.000001 # Table_map # # table_id: # (test.t1)
@ -383,6 +389,7 @@ master-bin.000001 # Table_map # # table_id: # (test.t1)
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
master-bin.000001 # Table_map # # table_id: # (test.t1) master-bin.000001 # Table_map # # table_id: # (test.t1)
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
master-bin.000001 # Query # # use `test`; BEGIN
master-bin.000001 # Query # # use `test`; TRUNCATE table t2 master-bin.000001 # Query # # use `test`; TRUNCATE table t2
master-bin.000001 # Xid # # COMMIT /* XID */ master-bin.000001 # Xid # # COMMIT /* XID */
master-bin.000001 # Table_map # # table_id: # (test.t1) master-bin.000001 # Table_map # # table_id: # (test.t1)
@ -408,17 +415,16 @@ is not null;
is not null is not null
1 1
select select
@a like "%#%error_code=0%ROLLBACK/*!*/;%ROLLBACK /* added by mysqlbinlog */;%", @a like "%#%error_code=0%ROLLBACK\n/*!*/;%ROLLBACK /* added by mysqlbinlog */;%" OR
@a like "%#%error_code=0%ROLLBACK\r\n/*!*/;%ROLLBACK /* added by mysqlbinlog */;%",
@a not like "%#%error_code=%error_code=%"; @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 */;%" OR
@a like "%#%error_code=0%ROLLBACK\r\n/*!*/;%ROLLBACK /* added by mysqlbinlog */;%" @a not like "%#%error_code=%error_code=%"
1 1 1 1
drop table t1, t2; drop table t1, t2;
create temporary table tt (a int unique); create temporary table tt (a int unique);
create table ti (a int) engine=innodb; create table ti (a int) engine=innodb;
reset master; reset master;
show master status;
File Position Binlog_Do_DB Binlog_Ignore_DB
master-bin.000001 106
begin; begin;
insert into ti values (1); insert into ti values (1);
insert into ti values (2) ; insert into ti values (2) ;
@ -429,9 +435,259 @@ Warning 1196 Some non-transactional changed tables couldn't be rolled back
select count(*) from tt /* 2 */; select count(*) from tt /* 2 */;
count(*) count(*)
2 2
show master status; show binlog events from <binlog_start>;
File Position Binlog_Do_DB Binlog_Ignore_DB Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 395 master-bin.000001 # Query # # use `test`; BEGIN
master-bin.000001 # Table_map # # table_id: # (test.ti)
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
master-bin.000001 # Table_map # # table_id: # (test.ti)
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
master-bin.000001 # Query # # use `test`; ROLLBACK
select count(*) from ti /* zero */;
count(*)
0
insert into ti select * from tt;
select * from ti /* that is what slave would miss - a bug */;
a
1
2
delete from ti;
delete from tt where a=1;
reset master;
begin;
insert into ti values (1);
insert into ti values (2) /* to make the dup error in the following */;
insert into tt select * from ti /* one affected and error */;
ERROR 23000: Duplicate entry '2' for key 'a'
rollback;
show binlog events from <binlog_start>;
Log_name Pos Event_type Server_id End_log_pos Info
select count(*) from ti /* zero */;
count(*)
0
insert into ti select * from tt;
select * from tt /* that is what otherwise slave missed - the bug */;
a
1
2
drop table ti, tt;
drop function if exists bug27417;
drop table if exists t1,t2;
CREATE TABLE t1 (a int NOT NULL auto_increment primary key) ENGINE=MyISAM;
CREATE TABLE t2 (a int NOT NULL auto_increment, PRIMARY KEY (a));
create function bug27417(n int)
RETURNS int(11)
begin
insert into t1 values (null);
return n;
end|
reset master;
insert into t2 values (bug27417(1));
insert into t2 select bug27417(2);
reset master;
insert into t2 values (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 # Table_map # # table_id: # (test.t2)
master-bin.000001 # Table_map # # table_id: # (test.t1)
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
/* only (!) with fixes for #23333 will show there is the query */;
select count(*) from t1 /* must be 3 */;
count(*)
3
reset master;
select count(*) from t2;
count(*)
2
delete from t2 where a=bug27417(3);
select count(*) from t2 /* nothing got deleted */;
count(*)
2
show binlog events from <binlog_start>;
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # Table_map # # table_id: # (test.t2)
master-bin.000001 # Table_map # # table_id: # (test.t1)
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
/* the query must be in regardless of #23333 */;
select count(*) from t1 /* must be 5 */;
count(*)
5
delete t2 from t2 where t2.a=bug27417(100) /* must not affect t2 */;
affected rows: 0
select count(*) from t1 /* must be 7 */;
count(*)
7
drop table t1,t2;
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 into t2 values (1);
reset master;
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 # Table_map # # table_id: # (test.t2)
master-bin.000001 # Table_map # # table_id: # (test.t1)
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
master-bin.000001 # Query # # use `test`; ROLLBACK
/* the output must denote there is the query */;
select count(*) from t1 /* must be 1 */;
count(*)
1
delete from t1;
delete from t2;
insert into t2 values (2);
reset master;
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 # Table_map # # table_id: # (test.t2)
master-bin.000001 # Table_map # # table_id: # (test.t1)
master-bin.000001 # Write_rows # # table_id: #
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
master-bin.000001 # Query # # use `test`; ROLLBACK
/* the output must denote there is the query */;
select count(*) from t1 /* must be 2 */;
count(*)
2
delete from t1;
insert into t3 values (1,1),(2,3),(3,4);
reset master;
update t3 set b=b+bug27417(1);
ERROR 23000: Duplicate entry '4' for key 'b'
show binlog events from <binlog_start>;
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # Table_map # # table_id: # (test.t3)
master-bin.000001 # Table_map # # table_id: # (test.t1)
master-bin.000001 # Write_rows # # table_id: #
master-bin.000001 # Update_rows # # table_id: #
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
/* the output must denote there is the query */;
select count(*) from t1 /* must be 2 */;
count(*)
2
delete from t3;
delete from t4;
insert into t3 values (1,1);
insert into t4 values (1,1),(2,2);
reset master;
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 # Table_map # # table_id: # (test.t4)
master-bin.000001 # Table_map # # table_id: # (test.t1)
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
master-bin.000001 # Query # # use `test`; ROLLBACK
/* the output must denote there is the query */;
select count(*) from t1 /* must be 4 */;
count(*)
4
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;
UPDATE t3,t4 SET t3.a=t4.a + bug27417(1);
ERROR 23000: Duplicate entry '2' for key 'PRIMARY'
select count(*) from t1 /* must be 1 */;
count(*)
2
drop table t4;
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;
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 # Table_map # # table_id: # (test.t2)
master-bin.000001 # Table_map # # table_id: # (test.t3)
master-bin.000001 # Table_map # # table_id: # (test.t1)
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
master-bin.000001 # Query # # use `test`; ROLLBACK
/* the output must denote there is the query */;
select count(*) from t1 /* must be 1 */;
count(*)
1
drop trigger trg_del;
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;
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 # Table_map # # table_id: # (test.t2)
master-bin.000001 # Table_map # # table_id: # (test.t1)
master-bin.000001 # Delete_rows # # table_id: #
master-bin.000001 # Write_rows # # table_id: #
master-bin.000001 # Delete_rows # # table_id: # flags: STMT_END_F
master-bin.000001 # Query # # use `test`; ROLLBACK
/* the output must denote there is the query */;
select count(*) from t1 /* must be 1 */;
count(*)
1
delete from t1;
create table t4 (a int default 0, b int primary key) engine=innodb;
insert into t4 values (0, 17);
reset master;
load data infile '../std_data_ln/rpl_loaddata.dat' into table t4 (a, @b) set b= @b + bug27417(2);
ERROR 23000: Duplicate entry '17' for key 'PRIMARY'
select * from t4;
a b
0 17
select count(*) from t1 /* must be 2 */;
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 # Table_map # # table_id: # (test.t4)
master-bin.000001 # Table_map # # table_id: # (test.t1)
master-bin.000001 # Write_rows # # table_id: #
master-bin.000001 # Write_rows # # table_id: #
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
master-bin.000001 # Query # # use `test`; ROLLBACK
/* the output must denote there is the query */;
drop trigger trg_del_t2;
drop table t1,t2,t3,t4,t5;
drop function bug27417;
end of tests
create temporary table tt (a int unique);
create table ti (a int) engine=innodb;
reset master;
begin;
insert into ti values (1);
insert into ti values (2) ;
insert into tt select * from ti;
rollback;
Warnings:
Warning 1196 Some non-transactional changed tables couldn't be rolled back
select count(*) from tt /* 2 */;
count(*)
2
show binlog events from <binlog_start>; show binlog events from <binlog_start>;
Log_name Pos Event_type Server_id End_log_pos Info Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # Query # # use `test`; BEGIN master-bin.000001 # Query # # use `test`; BEGIN
@ -451,18 +707,12 @@ a
delete from ti; delete from ti;
delete from tt where a=1; delete from tt where a=1;
reset master; reset master;
show master status;
File Position Binlog_Do_DB Binlog_Ignore_DB
master-bin.000001 106
begin; begin;
insert into ti values (1); insert into ti values (1);
insert into ti values (2) /* to make the dup error in the following */; insert into ti values (2) /* to make the dup error in the following */;
insert into tt select * from ti /* one affected and error */; insert into tt select * from ti /* one affected and error */;
ERROR 23000: Duplicate entry '2' for key 'a' ERROR 23000: Duplicate entry '2' for key 'a'
rollback; rollback;
show master status;
File Position Binlog_Do_DB Binlog_Ignore_DB
master-bin.000001 106
show binlog events from <binlog_start>; show binlog events from <binlog_start>;
Log_name Pos Event_type Server_id End_log_pos Info Log_name Pos Event_type Server_id End_log_pos Info
select count(*) from ti /* zero */; select count(*) from ti /* zero */;
@ -529,6 +779,7 @@ insert into t2 values (bug27417(1));
ERROR 23000: Duplicate entry '1' for key 'PRIMARY' ERROR 23000: Duplicate entry '1' for key 'PRIMARY'
show binlog events from <binlog_start>; show binlog events from <binlog_start>;
Log_name Pos Event_type Server_id End_log_pos Info 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 # Intvar # # INSERT_ID=1
master-bin.000001 # Query # # use `test`; insert into t2 values (bug27417(1)) master-bin.000001 # Query # # use `test`; insert into t2 values (bug27417(1))
master-bin.000001 # Query # # use `test`; ROLLBACK master-bin.000001 # Query # # use `test`; ROLLBACK
@ -543,6 +794,7 @@ insert into t2 select bug27417(1) union select bug27417(2);
ERROR 23000: Duplicate entry '2' for key 'PRIMARY' ERROR 23000: Duplicate entry '2' for key 'PRIMARY'
show binlog events from <binlog_start>; show binlog events from <binlog_start>;
Log_name Pos Event_type Server_id End_log_pos Info 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 # 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`; insert into t2 select bug27417(1) union select bug27417(2)
master-bin.000001 # Query # # use `test`; ROLLBACK master-bin.000001 # Query # # use `test`; ROLLBACK
@ -570,6 +822,7 @@ UPDATE t4,t3 SET t4.a=t3.a + bug27417(1) /* top level non-ta table */;
ERROR 23000: Duplicate entry '2' for key 'PRIMARY' ERROR 23000: Duplicate entry '2' for key 'PRIMARY'
show binlog events from <binlog_start>; show binlog events from <binlog_start>;
Log_name Pos Event_type Server_id End_log_pos Info 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 # 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`; UPDATE t4,t3 SET t4.a=t3.a + bug27417(1) /* top level non-ta table */
master-bin.000001 # Query # # use `test`; ROLLBACK master-bin.000001 # Query # # use `test`; ROLLBACK
@ -600,6 +853,7 @@ delete from t2;
ERROR 23000: Duplicate entry '1' for key 'PRIMARY' ERROR 23000: Duplicate entry '1' for key 'PRIMARY'
show binlog events from <binlog_start>; show binlog events from <binlog_start>;
Log_name Pos Event_type Server_id End_log_pos Info 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 # Intvar # # INSERT_ID=9
master-bin.000001 # Query # # use `test`; delete from t2 master-bin.000001 # Query # # use `test`; delete from t2
master-bin.000001 # Query # # use `test`; ROLLBACK master-bin.000001 # Query # # use `test`; ROLLBACK
@ -619,6 +873,7 @@ delete t2.* from t2,t5 where t2.a=t5.a + 1;
ERROR 23000: Duplicate entry '1' for key 'PRIMARY' ERROR 23000: Duplicate entry '1' for key 'PRIMARY'
show binlog events from <binlog_start>; show binlog events from <binlog_start>;
Log_name Pos Event_type Server_id End_log_pos Info 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`; delete t2.* from t2,t5 where t2.a=t5.a + 1
master-bin.000001 # Query # # use `test`; ROLLBACK master-bin.000001 # Query # # use `test`; ROLLBACK
select count(*) from t1 /* must be 1 */; select count(*) from t1 /* must be 1 */;
@ -638,10 +893,13 @@ count(*)
2 2
show binlog events from <binlog_start>; show binlog events from <binlog_start>;
Log_name Pos Event_type Server_id End_log_pos Info 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 # Intvar # # INSERT_ID=10
master-bin.000001 # Begin_load_query # # ;file_id=1;block_len=12 master-bin.000001 # User var # # @`b`=_latin1 0x3135 COLLATE latin1_swedish_ci
master-bin.000001 # Begin_load_query # # ;file_id=#;block_len=12
master-bin.000001 # Intvar # # INSERT_ID=10 master-bin.000001 # Intvar # # INSERT_ID=10
master-bin.000001 # Execute_load_query # # use `test`; load data infile '../std_data_ln/rpl_loaddata.dat' into table t4 (a, @b) set b= @b + bug27417(2) ;file_id=1 master-bin.000001 # User var # # @`b`=_latin1 0x3135 COLLATE latin1_swedish_ci
master-bin.000001 # Execute_load_query # # use `test`; load data infile '../std_data_ln/rpl_loaddata.dat' into table t4 (a, @b) set b= @b + bug27417(2) ;file_id=#
master-bin.000001 # Query # # use `test`; ROLLBACK master-bin.000001 # Query # # use `test`; ROLLBACK
drop trigger trg_del_t2; drop trigger trg_del_t2;
drop table t1,t2,t3,t4,t5; drop table t1,t2,t3,t4,t5;

View 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;

View File

@ -579,6 +579,21 @@ master-bin.000001 36593 Rotate 1 36637 master-bin.000002;pos=4
drop table t1; drop table t1;
set global binlog_cache_size=@bcs; set global binlog_cache_size=@bcs;
set session autocommit = @ac; set session autocommit = @ac;
drop table if exists t1;
reset master;
create table t1 (a bigint unsigned, b bigint(20) unsigned);
prepare stmt from "insert into t1 values (?,?)";
set @a= 9999999999999999;
set @b= 14632475938453979136;
execute stmt using @a, @b;
deallocate prepare stmt;
drop table t1;
show binlog events from 0;
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 4 Format_desc 1 106 Server version, Binlog ver: 4
master-bin.000001 106 Query 1 227 use `test`; create table t1 (a bigint unsigned, b bigint(20) unsigned)
master-bin.000001 227 Query 1 351 use `test`; insert into t1 values (9999999999999999,14632475938453979136)
master-bin.000001 351 Query 1 427 use `test`; drop table t1
End of 5.0 tests End of 5.0 tests
reset master; reset master;
create table t1 (id tinyint auto_increment primary key); create table t1 (id tinyint auto_increment primary key);

View File

@ -104,23 +104,40 @@ select * from t2;
a a
select * from t3; select * from t3;
a a
show binlog events from <binlog_start>; show binlog events;
Log_name Pos Event_type Server_id End_log_pos Info Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # Format_desc # # Server ver: VERSION, Binlog ver: 4
master-bin.000001 # Query # # use `test`; drop table t1,t2 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`; 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`; 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`; 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`; 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`; 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`; 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`; create table t2 (a varchar(200)) engine=blackhole
master-bin.000001 # Begin_load_query # # ;file_id=1;block_len=581 master-bin.000001 # Query # # use `test`; BEGIN
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 # Begin_load_query # # ;file_id=#;block_len=581
master-bin.000001 # Execute_load_query # # use `test`; load data infile '../std_data_ln/words.dat' into table t2 ;file_id=#
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 add b int
master-bin.000001 # Query # # use `test`; alter table t1 drop b 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`; 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`; 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`; replace into t1 select * from t3
master-bin.000001 # Query # # use `test`; COMMIT
drop table t1,t2,t3; drop table t1,t2,t3;
CREATE TABLE t1(a INT) ENGINE=BLACKHOLE; CREATE TABLE t1(a INT) ENGINE=BLACKHOLE;
INSERT DELAYED INTO t1 VALUES(1); INSERT DELAYED INTO t1 VALUES(1);
@ -147,8 +164,9 @@ start transaction;
insert into t1 values(2); insert into t1 values(2);
rollback; rollback;
set autocommit=1; set autocommit=1;
show binlog events from <binlog_start>; show binlog events;
Log_name Pos Event_type Server_id End_log_pos Info Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # Format_desc # # Server ver: VERSION, Binlog ver: 4
master-bin.000001 # Query # # use `test`; create table t1 (a int) engine=blackhole 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`; BEGIN
master-bin.000001 # Query # # use `test`; insert into t1 values(1) master-bin.000001 # Query # # use `test`; insert into t1 values(1)

View File

@ -19,7 +19,8 @@ SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.uniq
SET @@session.sql_mode=0/*!*/; SET @@session.sql_mode=0/*!*/;
/*!\C latin1 *//*!*/; /*!\C latin1 *//*!*/;
SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/; 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 ; DELIMITER ;
# End of log file # End of log file
ROLLBACK /* added by mysqlbinlog */; ROLLBACK /* added by mysqlbinlog */;

View File

@ -100,6 +100,7 @@ insert into t1 values(9);
insert into t2 select * from t1; insert into t2 select * from t1;
show binlog events from <binlog_start>; show binlog events from <binlog_start>;
Log_name Pos Event_type Server_id End_log_pos Info 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 # Query # # use `test`; insert into t1 values(9)
master-bin.000001 # Xid # # COMMIT /* XID */ master-bin.000001 # Xid # # COMMIT /* XID */
master-bin.000001 # Query # # use `test`; insert into t2 select * from t1 master-bin.000001 # Query # # use `test`; insert into t2 select * from t1
@ -111,6 +112,7 @@ begin;
insert into t2 select * from t1; insert into t2 select * from t1;
show binlog events from <binlog_start>; show binlog events from <binlog_start>;
Log_name Pos Event_type Server_id End_log_pos Info 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 # Query # # use `test`; insert into t1 values(10)
master-bin.000001 # Xid # # COMMIT /* XID */ master-bin.000001 # Xid # # COMMIT /* XID */
master-bin.000001 # Query # # use `test`; insert into t2 select * from t1 master-bin.000001 # Query # # use `test`; insert into t2 select * from t1
@ -118,6 +120,7 @@ insert into t1 values(11);
commit; commit;
show binlog events from <binlog_start>; show binlog events from <binlog_start>;
Log_name Pos Event_type Server_id End_log_pos Info 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 # Query # # use `test`; insert into t1 values(10)
master-bin.000001 # Xid # # COMMIT /* XID */ master-bin.000001 # Xid # # COMMIT /* XID */
master-bin.000001 # Query # # use `test`; insert into t2 select * from t1 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(16)
master-bin.000001 # Query # # use `test`; insert into t1 values(18) master-bin.000001 # Query # # use `test`; insert into t1 values(18)
master-bin.000001 # Xid # # COMMIT /* XID */ 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 # Query # # use `test`; delete from t1
master-bin.000001 # Xid # # COMMIT /* XID */ 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 # Query # # use `test`; delete from t2
master-bin.000001 # Xid # # COMMIT /* XID */ master-bin.000001 # Xid # # COMMIT /* XID */
master-bin.000001 # Query # # use `test`; alter table t2 engine=MyISAM 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 # Query # # use `test`; insert into t1 values (1)
master-bin.000001 # Xid # # COMMIT /* XID */ master-bin.000001 # Xid # # COMMIT /* XID */
master-bin.000001 # Query # # use `test`; insert into t2 values (20) 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`; drop table t1,t2
master-bin.000001 # Query # # use `test`; create temporary table ti (a int) engine=innodb 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 # Query # # use `test`; insert into ti values(1)
master-bin.000001 # Xid # # COMMIT /* XID */ master-bin.000001 # Xid # # COMMIT /* XID */
master-bin.000001 # Query # # use `test`; create temporary table t1 (a int) engine=myisam 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`; 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`; 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`; 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 # Query # # use `test`; TRUNCATE table t2
master-bin.000001 # Xid # # COMMIT /* XID */ master-bin.000001 # Xid # # COMMIT /* XID */
master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (5,5) 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 (7,7)
master-bin.000001 # Query # # use `test`; INSERT INTO t1 values (8,8) 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`; 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 # Query # # use `test`; TRUNCATE table t2
master-bin.000001 # Xid # # COMMIT /* XID */ master-bin.000001 # Xid # # COMMIT /* XID */
master-bin.000001 # Query # # use `test`; INSERT INTO t1 values (10,10) master-bin.000001 # Query # # use `test`; INSERT INTO t1 values (10,10)
@ -375,18 +384,16 @@ is not null;
is not null is not null
1 1
select select
@a like "%#%error_code=0%ROLLBACK/*!*/;%ROLLBACK /* added by mysqlbinlog */;%", @a like "%#%error_code=0%ROLLBACK\n/*!*/;%ROLLBACK /* added by mysqlbinlog */;%" OR
@a like "%#%error_code=0%ROLLBACK\r\n/*!*/;%ROLLBACK /* added by mysqlbinlog */;%",
@a not like "%#%error_code=%error_code=%"; @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 */;%" OR
@a like "%#%error_code=0%ROLLBACK\r\n/*!*/;%ROLLBACK /* added by mysqlbinlog */;%" @a not like "%#%error_code=%error_code=%"
1 1 1 1
drop table t1, t2; drop table t1, t2;
set @@session.binlog_format=statement;
create temporary table tt (a int unique); create temporary table tt (a int unique);
create table ti (a int) engine=innodb; create table ti (a int) engine=innodb;
reset master; reset master;
show master status;
File Position Binlog_Do_DB Binlog_Ignore_DB
master-bin.000001 106
begin; begin;
insert into ti values (1); insert into ti values (1);
insert into ti values (2) ; insert into ti values (2) ;
@ -397,9 +404,250 @@ Warning 1196 Some non-transactional changed tables couldn't be rolled back
select count(*) from tt /* 2 */; select count(*) from tt /* 2 */;
count(*) count(*)
2 2
show master status; show binlog events from <binlog_start>;
File Position Binlog_Do_DB Binlog_Ignore_DB Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 515 master-bin.000001 # Query # # use `test`; BEGIN
master-bin.000001 # Query # # use `test`; insert into ti values (1)
master-bin.000001 # Query # # use `test`; insert into ti values (2)
master-bin.000001 # Query # # use `test`; insert into tt select * from ti
master-bin.000001 # Query # # use `test`; ROLLBACK
select count(*) from ti /* zero */;
count(*)
0
insert into ti select * from tt;
select * from ti /* that is what slave would miss - a bug */;
a
1
2
delete from ti;
delete from tt where a=1;
reset master;
begin;
insert into ti values (1);
insert into ti values (2) /* to make the dup error in the following */;
insert into tt select * from ti /* one affected and error */;
ERROR 23000: Duplicate entry '2' for key 'a'
rollback;
Warnings:
Warning 1196 Some non-transactional changed tables couldn't be rolled back
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 ti values (1)
master-bin.000001 # Query # # use `test`; insert into ti values (2) /* to make the dup error in the following */
master-bin.000001 # Query # # use `test`; insert into tt select * from ti /* one affected and error */
master-bin.000001 # Query # # use `test`; ROLLBACK
select count(*) from ti /* zero */;
count(*)
0
insert into ti select * from tt;
select * from tt /* that is what otherwise slave missed - the bug */;
a
1
2
drop table ti, tt;
drop function if exists bug27417;
drop table if exists t1,t2;
CREATE TABLE t1 (a int NOT NULL auto_increment primary key) ENGINE=MyISAM;
CREATE TABLE t2 (a int NOT NULL auto_increment, PRIMARY KEY (a));
create function bug27417(n int)
RETURNS int(11)
begin
insert into t1 values (null);
return n;
end|
reset master;
insert into t2 values (bug27417(1));
insert into t2 select bug27417(2);
reset master;
insert into t2 values (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 # Intvar # # INSERT_ID=3
master-bin.000001 # Query # # use `test`; insert into t2 values (bug27417(2))
/* only (!) with fixes for #23333 will show there is the query */;
select count(*) from t1 /* must be 3 */;
count(*)
3
reset master;
select count(*) from t2;
count(*)
2
delete from t2 where a=bug27417(3);
select count(*) from t2 /* nothing got deleted */;
count(*)
2
show binlog events from <binlog_start>;
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # Intvar # # INSERT_ID=4
master-bin.000001 # Query # # use `test`; delete from t2 where a=bug27417(3)
/* the query must be in regardless of #23333 */;
select count(*) from t1 /* must be 5 */;
count(*)
5
delete t2 from t2 where t2.a=bug27417(100) /* must not affect t2 */;
affected rows: 0
select count(*) from t1 /* must be 7 */;
count(*)
7
drop table t1,t2;
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 into t2 values (1);
reset master;
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
/* the output must denote there is the query */;
select count(*) from t1 /* must be 1 */;
count(*)
1
delete from t1;
delete from t2;
insert into t2 values (2);
reset master;
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
/* the output must denote there is the query */;
select count(*) from t1 /* must be 2 */;
count(*)
2
delete from t1;
insert into t3 values (1,1),(2,3),(3,4);
reset master;
update t3 set b=b+bug27417(1);
ERROR 23000: Duplicate entry '4' for key 'b'
show binlog events from <binlog_start>;
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # Intvar # # INSERT_ID=4
master-bin.000001 # Query # # use `test`; update t3 set b=b+bug27417(1)
/* the output must denote there is the query */;
select count(*) from t1 /* must be 2 */;
count(*)
2
delete from t3;
delete from t4;
insert into t3 values (1,1);
insert into t4 values (1,1),(2,2);
reset master;
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
/* the output must denote there is the query */;
select count(*) from t1 /* must be 4 */;
count(*)
4
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;
UPDATE t3,t4 SET t3.a=t4.a + bug27417(1);
ERROR 23000: Duplicate entry '2' for key 'PRIMARY'
select count(*) from t1 /* must be 1 */;
count(*)
1
drop table t4;
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;
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
/* the output must denote there is the query */;
select count(*) from t1 /* must be 1 */;
count(*)
1
drop trigger trg_del;
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;
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
/* the output must denote there is the query */;
select count(*) from t1 /* must be 1 */;
count(*)
1
delete from t1;
create table t4 (a int default 0, b int primary key) engine=innodb;
insert into t4 values (0, 17);
reset master;
load data infile '../std_data_ln/rpl_loaddata.dat' into table t4 (a, @b) set b= @b + bug27417(2);
ERROR 23000: Duplicate entry '17' for key 'PRIMARY'
select * from t4;
a b
0 17
select count(*) from t1 /* must be 2 */;
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=#;block_len=12
master-bin.000001 # Intvar # # INSERT_ID=10
master-bin.000001 # Execute_load_query # # use `test`; load data infile '../std_data_ln/rpl_loaddata.dat' into table t4 (a, @b) set b= @b + bug27417(2) ;file_id=#
master-bin.000001 # Query # # use `test`; ROLLBACK
/* the output must denote there is the query */;
drop trigger trg_del_t2;
drop table t1,t2,t3,t4,t5;
drop function bug27417;
end of tests
set @@session.binlog_format=statement;
create temporary table tt (a int unique);
create table ti (a int) engine=innodb;
reset master;
begin;
insert into ti values (1);
insert into ti values (2) ;
insert into tt select * from ti;
rollback;
Warnings:
Warning 1196 Some non-transactional changed tables couldn't be rolled back
select count(*) from tt /* 2 */;
count(*)
2
show binlog events from <binlog_start>; show binlog events from <binlog_start>;
Log_name Pos Event_type Server_id End_log_pos Info Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # Query # # use `test`; BEGIN master-bin.000001 # Query # # use `test`; BEGIN
@ -418,9 +666,6 @@ a
delete from ti; delete from ti;
delete from tt where a=1; delete from tt where a=1;
reset master; reset master;
show master status;
File Position Binlog_Do_DB Binlog_Ignore_DB
master-bin.000001 106
begin; begin;
insert into ti values (1); insert into ti values (1);
insert into ti values (2) /* to make the dup error in the following */; insert into ti values (2) /* to make the dup error in the following */;
@ -429,9 +674,6 @@ ERROR 23000: Duplicate entry '2' for key 'a'
rollback; rollback;
Warnings: Warnings:
Warning 1196 Some non-transactional changed tables couldn't be rolled back Warning 1196 Some non-transactional changed tables couldn't be rolled back
show master status;
File Position Binlog_Do_DB Binlog_Ignore_DB
master-bin.000001 589
show binlog events from <binlog_start>; show binlog events from <binlog_start>;
Log_name Pos Event_type Server_id End_log_pos Info Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # Query # # use `test`; BEGIN master-bin.000001 # Query # # use `test`; BEGIN
@ -503,6 +745,7 @@ insert into t2 values (bug27417(1));
ERROR 23000: Duplicate entry '1' for key 'PRIMARY' ERROR 23000: Duplicate entry '1' for key 'PRIMARY'
show binlog events from <binlog_start>; show binlog events from <binlog_start>;
Log_name Pos Event_type Server_id End_log_pos Info 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 # Intvar # # INSERT_ID=1
master-bin.000001 # Query # # use `test`; insert into t2 values (bug27417(1)) master-bin.000001 # Query # # use `test`; insert into t2 values (bug27417(1))
master-bin.000001 # Query # # use `test`; ROLLBACK master-bin.000001 # Query # # use `test`; ROLLBACK
@ -517,6 +760,7 @@ insert into t2 select bug27417(1) union select bug27417(2);
ERROR 23000: Duplicate entry '2' for key 'PRIMARY' ERROR 23000: Duplicate entry '2' for key 'PRIMARY'
show binlog events from <binlog_start>; show binlog events from <binlog_start>;
Log_name Pos Event_type Server_id End_log_pos Info 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 # 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`; insert into t2 select bug27417(1) union select bug27417(2)
master-bin.000001 # Query # # use `test`; ROLLBACK master-bin.000001 # Query # # use `test`; ROLLBACK
@ -544,6 +788,7 @@ UPDATE t4,t3 SET t4.a=t3.a + bug27417(1) /* top level non-ta table */;
ERROR 23000: Duplicate entry '2' for key 'PRIMARY' ERROR 23000: Duplicate entry '2' for key 'PRIMARY'
show binlog events from <binlog_start>; show binlog events from <binlog_start>;
Log_name Pos Event_type Server_id End_log_pos Info 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 # 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`; UPDATE t4,t3 SET t4.a=t3.a + bug27417(1) /* top level non-ta table */
master-bin.000001 # Query # # use `test`; ROLLBACK master-bin.000001 # Query # # use `test`; ROLLBACK
@ -574,6 +819,7 @@ delete from t2;
ERROR 23000: Duplicate entry '1' for key 'PRIMARY' ERROR 23000: Duplicate entry '1' for key 'PRIMARY'
show binlog events from <binlog_start>; show binlog events from <binlog_start>;
Log_name Pos Event_type Server_id End_log_pos Info 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 # Intvar # # INSERT_ID=9
master-bin.000001 # Query # # use `test`; delete from t2 master-bin.000001 # Query # # use `test`; delete from t2
master-bin.000001 # Query # # use `test`; ROLLBACK master-bin.000001 # Query # # use `test`; ROLLBACK
@ -593,6 +839,7 @@ delete t2.* from t2,t5 where t2.a=t5.a + 1;
ERROR 23000: Duplicate entry '1' for key 'PRIMARY' ERROR 23000: Duplicate entry '1' for key 'PRIMARY'
show binlog events from <binlog_start>; show binlog events from <binlog_start>;
Log_name Pos Event_type Server_id End_log_pos Info 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`; delete t2.* from t2,t5 where t2.a=t5.a + 1
master-bin.000001 # Query # # use `test`; ROLLBACK master-bin.000001 # Query # # use `test`; ROLLBACK
select count(*) from t1 /* must be 1 */; select count(*) from t1 /* must be 1 */;
@ -612,10 +859,13 @@ count(*)
2 2
show binlog events from <binlog_start>; show binlog events from <binlog_start>;
Log_name Pos Event_type Server_id End_log_pos Info 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 # Intvar # # INSERT_ID=10
master-bin.000001 # Begin_load_query # # ;file_id=1;block_len=12 master-bin.000001 # User var # # @`b`=_latin1 0x3135 COLLATE latin1_swedish_ci
master-bin.000001 # Begin_load_query # # ;file_id=#;block_len=12
master-bin.000001 # Intvar # # INSERT_ID=10 master-bin.000001 # Intvar # # INSERT_ID=10
master-bin.000001 # Execute_load_query # # use `test`; load data infile '../std_data_ln/rpl_loaddata.dat' into table t4 (a, @b) set b= @b + bug27417(2) ;file_id=1 master-bin.000001 # User var # # @`b`=_latin1 0x3135 COLLATE latin1_swedish_ci
master-bin.000001 # Execute_load_query # # use `test`; load data infile '../std_data_ln/rpl_loaddata.dat' into table t4 (a, @b) set b= @b + bug27417(2) ;file_id=#
master-bin.000001 # Query # # use `test`; ROLLBACK master-bin.000001 # Query # # use `test`; ROLLBACK
drop trigger trg_del_t2; drop trigger trg_del_t2;
drop table t1,t2,t3,t4,t5; drop table t1,t2,t3,t4,t5;

View 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;

View File

@ -0,0 +1,148 @@
# Test that old binlog formats can be read.
# Some previous versions of MySQL use their own binlog format,
# especially in row-based replication. This test uses saved binlogs
# from those old versions to test that we can replicate from old
# versions to the present version.
# Replicating from old versions to new versions is necessary in an
# online upgrade scenario, where the .
# The previous versions we currently test are:
# - version 5.1.17 and earlier trees
# - mysql-5.1-wl2325-xxx trees (AKA alcatel trees)
# - mysql-5.1-telco-6.1 trees (AKA ndb trees)
# For completeness, we also test mysql-5.1-new_rpl, which is supposed
# to be the "correct" version.
# All binlogs were generated with the same commands (listed at the end
# of this test for reference). The binlogs contain the following
# events: Table_map, Write_rows, Update_rows, Delete_rows Query, Xid,
# User_var, Int_var, Rand, Begin_load, Append_file, Execute_load.
# Related bugs: BUG#27779, BUG#31581, BUG#31582, BUG#31583, BUG#32407
source include/not_embedded.inc;
--disable_warnings
DROP TABLE IF EXISTS t1, t2, t3;
--echo ==== Read modern binlog (version 5.1.23) ====
# Read binlog.
--exec $MYSQL_BINLOG --local-load=$MYSQLTEST_VARDIR/tmp/ suite/binlog/std_data/binlog_old_version_5_1_23.000001 | $MYSQL --local-infile=1
# Show result.
SELECT * FROM t1 ORDER BY a;
SELECT * FROM t2 ORDER BY a;
SELECT COUNT(*) FROM t3;
# Reset.
DROP TABLE t1, t2, t3;
--echo ==== Read binlog from version 5.1.17 ====
# Read binlog.
--exec $MYSQL_BINLOG --local-load=$MYSQLTEST_VARDIR/tmp/ suite/binlog/std_data/binlog_old_version_5_1_17.000001 | $MYSQL --local-infile=1
# Show result.
SELECT * FROM t1 ORDER BY a;
SELECT * FROM t2 ORDER BY a;
SELECT COUNT(*) FROM t3;
# Reset.
DROP TABLE t1, t2, t3;
--echo ==== Read binlog from alcatel tree (mysql-5.1-wl2325-5.0-drop6) ====
# In this version, it was not possible to switch between row-based and
# statement-based binlogging without restarting the server. So, we
# have two binlogs; one for row based and one for statement based
# replication.
# Read rbr binlog.
--exec $MYSQL_BINLOG --local-load=$MYSQLTEST_VARDIR/tmp/ suite/binlog/std_data/binlog_old_version_5_1-wl2325_row.000001 | $MYSQL --local-infile=1
# Read stm binlog.
--exec $MYSQL_BINLOG --local-load=$MYSQLTEST_VARDIR/tmp/ suite/binlog/std_data/binlog_old_version_5_1-wl2325_stm.000001 | $MYSQL --local-infile=1
# Show result.
SELECT * FROM t1 ORDER BY a;
SELECT * FROM t2 ORDER BY a;
SELECT COUNT(*) FROM t3;
# Reset.
DROP TABLE t1, t2, t3;
--echo ==== Read binlog from ndb tree (mysql-5.1-telco-6.1) ====
# Read binlog.
--exec $MYSQL_BINLOG --local-load=$MYSQLTEST_VARDIR/tmp/ suite/binlog/std_data/binlog_old_version_5_1-telco.000001 | $MYSQL --local-infile=1
# Show resulting tablea.
SELECT * FROM t1 ORDER BY a;
SELECT * FROM t2 ORDER BY a;
SELECT COUNT(*) FROM t3;
# Reset.
DROP TABLE t1, t2, t3;
#### The following commands were used to generate the binlogs ####
#
#source include/master-slave.inc;
#
## ==== initialize ====
#USE test;
#CREATE TABLE t1 (a int, b char(50)) ENGINE = MyISAM;
#CREATE TABLE t2 (a int, b char(50)) ENGINE = InnoDB;
#CREATE TABLE t3 (a char(20));
#
#
## ==== row based tests ====
#SET BINLOG_FORMAT='row';
#
## ---- get write, update, and delete rows events ----
#INSERT INTO t1 VALUES (0, 'one'), (1, 'two');
#UPDATE t1 SET a=a+1;
#DELETE FROM t1 WHERE a=2;
#
#
## ==== statement based tests ====
#SET BINLOG_FORMAT = 'statement';
#
## ---- get xid events ----
#BEGIN;
#INSERT INTO t2 VALUES (3, 'first stm in trx');
#INSERT INTO t1 VALUES (3, 'last stm in trx: next event should be xid');
#COMMIT;
#
## ---- get user var events ----
#SET @x = 4;
#INSERT INTO t1 VALUES (@x, 'four');
#
## ---- get rand event ----
#INSERT INTO t1 VALUES (RAND() * 1000000, 'random');
#
## ---- get intvar event ----
#INSERT INTO t1 VALUES (LAST_INSERT_ID(), 'last_insert_id');
#
## ---- get begin, append and execute load events ----
## double the file until we have more than 2^17 bytes, so that the
## event has to be split and we can use Append_file_log_event.
#
#SET SQL_LOG_BIN=0;
#CREATE TABLE temp (a char(20));
#LOAD DATA INFILE '../std_data_ln/words.dat' INTO TABLE temp;
#INSERT INTO temp SELECT * FROM temp;
#INSERT INTO temp SELECT * FROM temp;
#INSERT INTO temp SELECT * FROM temp;
#INSERT INTO temp SELECT * FROM temp;
#INSERT INTO temp SELECT * FROM temp;
#INSERT INTO temp SELECT * FROM temp;
#INSERT INTO temp SELECT * FROM temp;
#INSERT INTO temp SELECT * FROM temp;
#SELECT a FROM temp INTO OUTFILE 'big_file.dat';
#DROP TABLE temp;
#SET SQL_LOG_BIN=1;
#
#LOAD DATA INFILE 'big_file.dat' INTO TABLE t3;
#
#SELECT * FROM t1 ORDER BY a;
#SELECT * FROM t2 ORDER BY a;
#SELECT COUNT(*) FROM t3;

View File

@ -12,24 +12,4 @@
--enable_ps_protocol --enable_ps_protocol
# This piece below cannot be put into
# extra/binlog_tests/mix_innodb_myisam_binlog.test
# because the argument of --start-position differs between statement-
# and row-based (and "eval --exec" doesn't work).
# 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)
flush logs;
--exec $MYSQL_BINLOG --start-position=524 $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/*!*/;%ROLLBACK /* added by mysqlbinlog */;%",
@a not like "%#%error_code=%error_code=%";
drop table t1, t2;
-- source extra/binlog_tests/mix_innodb_myisam_side_effects.test -- source extra/binlog_tests/mix_innodb_myisam_side_effects.test

View File

@ -0,0 +1,24 @@
# Test case for bug#32205 Replaying statements from mysqlbinlog fails
# with a syntax error, replicates fine
source include/have_log_bin.inc;
source include/have_local_infile.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 --local-load=$MYSQLTEST_VARDIR/tmp/ $MYSQLTEST_VARDIR/log/master-bin.000001 > $MYSQLTEST_VARDIR/tmp/binlog_start_comment.binlog
--exec $MYSQL --local-infile=1 < $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

View File

@ -1,29 +1,9 @@
# This is a wrapper for binlog.test so that the same test case can be used # This is a wrapper for binlog.test so that the same test case can be used
# For both statement and row based bin logs 9/19/2005 [jbm] # For both statement and row based bin logs 9/19/2005 [jbm]
-- source include/have_binlog_format_mixed_or_statement.inc -- source include/have_binlog_format_statement.inc
-- source extra/binlog_tests/mix_innodb_myisam_binlog.test -- source extra/binlog_tests/mix_innodb_myisam_binlog.test
# This piece below cannot be put into
# extra/binlog_tests/mix_innodb_myisam_binlog.test
# because the argument of --start-position differs between statement-
# and row-based (and "eval --exec" doesn't work).
# 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)
flush logs;
--exec $MYSQL_BINLOG --start-position=555 $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/*!*/;%ROLLBACK /* added by mysqlbinlog */;%",
@a not like "%#%error_code=%error_code=%";
drop table t1, t2;
set @@session.binlog_format=statement; set @@session.binlog_format=statement;
-- source extra/binlog_tests/mix_innodb_myisam_side_effects.test -- source extra/binlog_tests/mix_innodb_myisam_side_effects.test
set @@session.binlog_format=@@global.binlog_format; set @@session.binlog_format=@@global.binlog_format;

View File

@ -10,3 +10,4 @@
# #
############################################################################## ##############################################################################
binlog_multi_engine : Bug#32663 binlog_multi_engine.test fails randomly 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.

View 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;

View 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

View 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;

View 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;

View File

@ -15,8 +15,12 @@ COMMIT;
show binlog events from <binlog_start>; show binlog events from <binlog_start>;
Log_name Pos Event_type Server_id End_log_pos Info 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`; 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`; 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`; 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`; 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`; 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 master-bin.000001 # Query # # use `test`; UPDATE t1, t3 SET m = 2, e = 3 WHERE n = f

View File

@ -3,16 +3,23 @@ ndb_dd_backuprestore : cannot create t1
ndb_partition_error : cannot create t1 ndb_partition_error : cannot create t1
ndb_partition_list : cannot create t1 ndb_partition_list : cannot create t1
ndb_partition_range : cannot create t1 ndb_partition_range : cannot create t1
partition_bit_ndb : cannot create t1 part_supported_sql_func_ndb : cannot create t1
partition_int_ndb : cannot create t1
partition_syntax_ndb : cannot create t1
partition_value_myisam : Bug#30581 partition_value tests use disallowed CAST() function
partition_value_innodb : Bug#30581 partition_value tests use disallowed CAST() function
partition_value_ndb : cannot create t1
partition_basic_ndb : cannot create t1
partition_alter1_ndb : timeout. Needs too much time. partition_alter1_ndb : timeout. Needs too much time.
partition_alter2_ndb : cannot create t1 partition_alter2_ndb : cannot create t1
partition_sessions : needs system_3_init.inc partition_basic_ndb : cannot create t1
partition_bit_myisam : BUG#34225 2008-02-02 mats test suit parts uses /tmp-dir instead of mysql-test dir, which causes failures
partition_bit_ndb : cannot create t1
partition_char_myisam : BUG#34225 2008-02-02 mats test suit parts uses /tmp-dir instead of mysql-test dir, which causes failures
partition_datetime_myisam : BUG#34225 2008-02-02 mats test suit parts uses /tmp-dir instead of mysql-test dir, which causes failures
partition_decimal_myisam : BUG#34225 2008-02-02 mats test suit parts uses /tmp-dir instead of mysql-test dir, which causes failures
partition_engine_ndb : cannot create t1 partition_engine_ndb : cannot create t1
part_supported_sql_func_ndb : cannot create t1 partition_float_myisam : BUG#34225 2008-02-02 mats test suit parts uses /tmp-dir instead of mysql-test dir, which causes failures
partition_int_myisam : BUG#34225 2008-02-02 mats test suit parts uses /tmp-dir instead of mysql-test dir, which causes failures
partition_int_ndb : cannot create t1
partition_sessions : needs system_3_init.inc
partition_special_myisam : BUG#34225 2008-02-02 mats test suit parts uses /tmp-dir instead of mysql-test dir, which causes failures
partition_syntax_ndb : cannot create t1
partition_value_innodb : Bug#30581 partition_value tests use disallowed CAST() function
partition_value_myisam : Bug#30581 partition_value tests use disallowed CAST() function
partition_value_ndb : cannot create t1
rpl_ndb_dd_partitions : cannot create t1 rpl_ndb_dd_partitions : cannot create t1

View File

@ -0,0 +1,8 @@
[row]
--binlog-format=row
[stmt]
--binlog-format=statement
[mix]
--binlog-format=mixed

View File

@ -1,7 +1,7 @@
reset master; reset master;
show master status; show master status;
File Position Binlog_Do_DB Binlog_Ignore_DB File Position Binlog_Do_DB Binlog_Ignore_DB
master-bin.000001 106 master-bin.000001 # <Binlog_Do_DB> <Binlog_Ignore_DB>
reset slave; reset slave;
SHOW SLAVE STATUS; SHOW SLAVE STATUS;
change master to master_host='127.0.0.1'; change master to master_host='127.0.0.1';
@ -12,7 +12,7 @@ Master_User test
Master_Port 3306 Master_Port 3306
Connect_Retry 7 Connect_Retry 7
Master_Log_File Master_Log_File
Read_Master_Log_Pos 4 Read_Master_Log_Pos #
Relay_Log_File # Relay_Log_File #
Relay_Log_Pos # Relay_Log_Pos #
Relay_Master_Log_File Relay_Master_Log_File
@ -27,7 +27,7 @@ Replicate_Wild_Ignore_Table
Last_Errno 0 Last_Errno 0
Last_Error Last_Error
Skip_Counter 0 Skip_Counter 0
Exec_Master_Log_Pos 0 Exec_Master_Log_Pos #
Relay_Log_Space # Relay_Log_Space #
Until_Condition None Until_Condition None
Until_Log_File Until_Log_File
@ -53,7 +53,7 @@ Master_User root
Master_Port MASTER_PORT Master_Port MASTER_PORT
Connect_Retry 7 Connect_Retry 7
Master_Log_File Master_Log_File
Read_Master_Log_Pos 4 Read_Master_Log_Pos #
Relay_Log_File # Relay_Log_File #
Relay_Log_Pos # Relay_Log_Pos #
Relay_Master_Log_File Relay_Master_Log_File
@ -68,7 +68,7 @@ Replicate_Wild_Ignore_Table
Last_Errno 0 Last_Errno 0
Last_Error Last_Error
Skip_Counter 0 Skip_Counter 0
Exec_Master_Log_Pos 0 Exec_Master_Log_Pos #
Relay_Log_Space # Relay_Log_Space #
Until_Condition None Until_Condition None
Until_Log_File Until_Log_File
@ -93,7 +93,7 @@ Master_User root
Master_Port MASTER_PORT Master_Port MASTER_PORT
Connect_Retry 7 Connect_Retry 7
Master_Log_File master-bin.000001 Master_Log_File master-bin.000001
Read_Master_Log_Pos 106 Read_Master_Log_Pos #
Relay_Log_File # Relay_Log_File #
Relay_Log_Pos # Relay_Log_Pos #
Relay_Master_Log_File master-bin.000001 Relay_Master_Log_File master-bin.000001
@ -108,7 +108,7 @@ Replicate_Wild_Ignore_Table
Last_Errno 0 Last_Errno 0
Last_Error Last_Error
Skip_Counter 0 Skip_Counter 0
Exec_Master_Log_Pos 106 Exec_Master_Log_Pos #
Relay_Log_Space # Relay_Log_Space #
Until_Condition None Until_Condition None
Until_Log_File Until_Log_File

View File

@ -40,6 +40,10 @@ KEY `data` (`data`)
/*!40019 SET @@session.max_insert_delayed_threads=0*/; /*!40019 SET @@session.max_insert_delayed_threads=0*/;
/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/; /*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;
BINLOG ' BINLOG '
O1ZVRw8BAAAAZgAAAGoAAAAAAAQANS4xLjIzLXJjLWRlYnVnLWxvZwAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAA7VlVHEzgNAAgAEgAEBAQEEgAAUwAEGggAAAAICAgC
'/*!*/;
BINLOG '
Bk3vRhO0AQAAOAAAALcLyQkAAJlXFwIAAAAABXRyYWNrAA12aXNpdHNfZXZlbnRzAAYJAwcPDwM= Bk3vRhO0AQAAOAAAALcLyQkAAJlXFwIAAAAABXRyYWNrAA12aXNpdHNfZXZlbnRzAAYJAwcPDwM=
Bk3vRhe0AQAAWgAAABEMyQkQAJlXFwIAAAEABv/AIE4AvvVDAQZN70YAK0Rvd25sb2Fkcy9NeVNR Bk3vRhe0AQAAWgAAABEMyQkQAJlXFwIAAAEABv/AIE4AvvVDAQZN70YAK0Rvd25sb2Fkcy9NeVNR
TC00LjEvbXlzcWwtNC4xLjEyYS13aW4zMi56aXBPaAIC TC00LjEvbXlzcWwtNC4xLjEyYS13aW4zMi56aXBPaAIC

View File

@ -33,7 +33,7 @@ Replicate_Wild_Ignore_Table
Last_Errno 0 Last_Errno 0
Last_Error Last_Error
Skip_Counter 0 Skip_Counter 0
Exec_Master_Log_Pos 191 Exec_Master_Log_Pos #
Relay_Log_Space # Relay_Log_Space #
Until_Condition None Until_Condition None
Until_Log_File Until_Log_File
@ -73,7 +73,7 @@ Replicate_Wild_Ignore_Table
Last_Errno 0 Last_Errno 0
Last_Error Last_Error
Skip_Counter 0 Skip_Counter 0
Exec_Master_Log_Pos 191 Exec_Master_Log_Pos #
Relay_Log_Space # Relay_Log_Space #
Until_Condition None Until_Condition None
Until_Log_File Until_Log_File

View File

@ -20,21 +20,17 @@ INSERT INTO t2 VALUES(2);
ALTER DATABASE mysqltest_sisyfos CHARACTER SET latin1; ALTER DATABASE mysqltest_sisyfos CHARACTER SET latin1;
USE mysqltest_sisyfos; USE mysqltest_sisyfos;
ALTER DATABASE mysqltest_bob CHARACTER SET latin1; ALTER DATABASE mysqltest_bob CHARACTER SET latin1;
SHOW DATABASES; SHOW DATABASES LIKE 'mysql%';
Database Database (mysql%)
information_schema
mysql mysql
mysqltest_bob mysqltest_bob
mysqltest_prometheus mysqltest_prometheus
mysqltest_sisyfos mysqltest_sisyfos
test SHOW DATABASES LIKE 'mysql%';
SHOW DATABASES; Database (mysql%)
Database
information_schema
mysql mysql
mysqltest_prometheus mysqltest_prometheus
mysqltest_sisyfos mysqltest_sisyfos
test
DROP DATABASE IF EXISTS mysqltest_sisyfos; DROP DATABASE IF EXISTS mysqltest_sisyfos;
USE mysqltest_prometheus; USE mysqltest_prometheus;
CREATE TABLE t1 (a INT); CREATE TABLE t1 (a INT);
@ -42,21 +38,17 @@ INSERT INTO t1 VALUES (1);
CREATE DATABASE mysqltest_sisyfos; CREATE DATABASE mysqltest_sisyfos;
USE mysqltest_sisyfos; USE mysqltest_sisyfos;
CREATE TABLE t2 (a INT); CREATE TABLE t2 (a INT);
SHOW DATABASES; SHOW DATABASES LIKE 'mysql%';
Database Database (mysql%)
information_schema
mysql mysql
mysqltest_bob mysqltest_bob
mysqltest_prometheus mysqltest_prometheus
mysqltest_sisyfos mysqltest_sisyfos
test SHOW DATABASES LIKE 'mysql%';
SHOW DATABASES; Database (mysql%)
Database
information_schema
mysql mysql
mysqltest_prometheus mysqltest_prometheus
mysqltest_sisyfos mysqltest_sisyfos
test
USE mysqltest_prometheus; USE mysqltest_prometheus;
SHOW TABLES; SHOW TABLES;
Tables_in_mysqltest_prometheus Tables_in_mysqltest_prometheus

View 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

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