new merge from next-mr

This commit is contained in:
Bjorn Munch 2009-10-22 09:36:39 +02:00
commit 23e557d48a
343 changed files with 12865 additions and 3331 deletions

View file

@ -3065,3 +3065,4 @@ sql/share/swedish
sql/share/ukrainian
libmysqld/examples/mysqltest.cc
libmysqld/sql_signal.cc
libmysqld/debug_sync.cc

View file

@ -70,6 +70,12 @@ IF(EXTRA_DEBUG)
ADD_DEFINITIONS(-D EXTRA_DEBUG)
ENDIF(EXTRA_DEBUG)
IF(ENABLED_DEBUG_SYNC)
ADD_DEFINITIONS(-D ENABLED_DEBUG_SYNC)
ENDIF(ENABLED_DEBUG_SYNC)
SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DENABLED_DEBUG_SYNC")
SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DENABLED_DEBUG_SYNC")
# in some places we use DBUG_OFF
SET(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -DDBUG_OFF")
SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} -DDBUG_OFF")
@ -215,12 +221,16 @@ ENDIF(WITHOUT_DYNAMIC_PLUGINS)
FILE(GLOB STORAGE_SUBDIRS storage/*)
FOREACH(SUBDIR ${STORAGE_SUBDIRS})
FILE(RELATIVE_PATH DIRNAME ${PROJECT_SOURCE_DIR}/storage ${SUBDIR})
STRING(TOUPPER ${DIRNAME} ENGINE)
STRING(TOLOWER ${DIRNAME} ENGINE_LOWER)
IF (EXISTS ${SUBDIR}/CMakeLists.txt)
# Check MYSQL_STORAGE_ENGINE macro is present
FILE(STRINGS ${SUBDIR}/CMakeLists.txt HAVE_STORAGE_ENGINE REGEX MYSQL_STORAGE_ENGINE)
IF(HAVE_STORAGE_ENGINE)
# Extract name of engine from HAVE_STORAGE_ENGINE
STRING(REGEX REPLACE ".*MYSQL_STORAGE_ENGINE\\((.*\)\\).*"
"\\1" ENGINE_NAME ${HAVE_STORAGE_ENGINE})
STRING(TOUPPER ${ENGINE_NAME} ENGINE)
STRING(TOLOWER ${ENGINE_NAME} ENGINE_LOWER)
SET(ENGINE_BUILD_TYPE "DYNAMIC")
# Read plug.in to find out if a plugin is mandatory and whether it supports
# build as shared library (dynamic).
@ -246,6 +256,7 @@ FOREACH(SUBDIR ${STORAGE_SUBDIRS})
SET (MYSQLD_STATIC_ENGINE_LIBS ${MYSQLD_STATIC_ENGINE_LIBS} ${ENGINE_LOWER})
SET (STORAGE_ENGINE_DEFS "${STORAGE_ENGINE_DEFS} -DWITH_${ENGINE}_STORAGE_ENGINE")
SET (WITH_${ENGINE}_STORAGE_ENGINE TRUE)
SET (${ENGINE}_DIR ${DIRNAME})
ENDIF (ENGINE_BUILD_TYPE STREQUAL "STATIC")
ENDIF(EXISTS ${SUBDIR}/plug.in)

View file

@ -2868,7 +2868,7 @@ com_help(String *buffer __attribute__((unused)),
"For developer information, including the MySQL Reference Manual, "
"visit:\n"
" http://dev.mysql.com/\n"
"To buy MySQL Network Support, training, or other products, visit:\n"
"To buy MySQL Enterprise support, training, or other products, visit:\n"
" https://shop.mysql.com/\n", INFO_INFO);
put_info("List of all MySQL commands:", INFO_INFO);
if (!named_cmds)
@ -3566,7 +3566,7 @@ static void print_warnings()
messages. To be safe, skip printing the duplicate only if it is the only
warning.
*/
if (!cur || num_rows == 1 && error == (uint) strtoul(cur[1], NULL, 10))
if (!cur || (num_rows == 1 && error == (uint) strtoul(cur[1], NULL, 10)))
goto end;
/* Print the warnings */

View file

@ -54,6 +54,8 @@ static char **defaults_argv;
static my_bool not_used; /* Can't use GET_BOOL without a value pointer */
static my_bool opt_write_binlog;
#include <help_start.h>
static struct my_option my_long_options[]=
@ -124,6 +126,11 @@ static struct my_option my_long_options[]=
{"verbose", 'v', "Display more output about the process",
(uchar**) &opt_verbose, (uchar**) &opt_verbose, 0,
GET_BOOL, NO_ARG, 1, 0, 0, 0, 0, 0},
{"write-binlog", OPT_WRITE_BINLOG,
"All commands including mysqlcheck are binlogged. Enabled by default;"
"use --skip-write-binlog when commands should not be sent to replication slaves.",
(uchar**) &opt_write_binlog, (uchar**) &opt_write_binlog, 0, GET_BOOL, NO_ARG,
1, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}
};
@ -448,6 +455,8 @@ static int run_query(const char *query, DYNAMIC_STRING *ds_res,
int ret;
File fd;
char query_file_path[FN_REFLEN];
const uchar sql_log_bin[]= "SET SQL_LOG_BIN=0;";
DBUG_ENTER("run_query");
DBUG_PRINT("enter", ("query: %s", query));
if ((fd= create_temp_file(query_file_path, opt_tmpdir,
@ -455,6 +464,22 @@ static int run_query(const char *query, DYNAMIC_STRING *ds_res,
MYF(MY_WME))) < 0)
die("Failed to create temporary file for defaults");
/*
Master and slave should be upgraded separately. All statements executed
by mysql_upgrade will not be binlogged.
'SET SQL_LOG_BIN=0' is executed before any other statements.
*/
if (!opt_write_binlog)
{
if (my_write(fd, sql_log_bin, sizeof(sql_log_bin)-1,
MYF(MY_FNABP | MY_WME)))
{
my_close(fd, MYF(0));
my_delete(query_file_path, MYF(0));
die("Failed to write to '%s'", query_file_path);
}
}
if (my_write(fd, (uchar*) query, strlen(query),
MYF(MY_FNABP | MY_WME)))
{
@ -648,6 +673,7 @@ static int run_mysqlcheck_upgrade(void)
"--check-upgrade",
"--all-databases",
"--auto-repair",
opt_write_binlog ? "--write-binlog" : "--skip-write-binlog",
NULL);
}
@ -662,6 +688,7 @@ static int run_mysqlcheck_fixnames(void)
"--all-databases",
"--fix-db-names",
"--fix-table-names",
opt_write_binlog ? "--write-binlog" : "--skip-write-binlog",
NULL);
}

View file

@ -726,7 +726,10 @@ Exit_status process_event(PRINT_EVENT_INFO *print_event_info, Log_event *ev,
switch (ev_type) {
case QUERY_EVENT:
if (shall_skip_database(((Query_log_event*)ev)->db))
if (strncmp(((Query_log_event*)ev)->query, "BEGIN", 5) &&
strncmp(((Query_log_event*)ev)->query, "COMMIT", 6) &&
strncmp(((Query_log_event*)ev)->query, "ROLLBACK", 8) &&
shall_skip_database(((Query_log_event*)ev)->db))
goto end;
if (opt_base64_output_mode == BASE64_OUTPUT_ALWAYS)
{

View file

@ -652,6 +652,17 @@ static int use_db(char *database)
return 0;
} /* use_db */
static int disable_binlog()
{
const char *stmt= "SET SQL_LOG_BIN=0";
if (mysql_query(sock, stmt))
{
fprintf(stderr, "Failed to %s\n", stmt);
fprintf(stderr, "Error: %s\n", mysql_error(sock));
return 1;
}
return 0;
}
static int handle_request_for_tables(char *tables, uint length)
{
@ -844,6 +855,14 @@ int main(int argc, char **argv)
if (dbConnect(current_host, current_user, opt_password))
exit(EX_MYSQLERR);
if (!opt_write_binlog)
{
if (disable_binlog()) {
first_error= 1;
goto end;
}
}
if (opt_auto_repair &&
my_init_dynamic_array(&tables4repair, sizeof(char)*(NAME_LEN*2+2),16,64))
{

View file

@ -423,6 +423,7 @@ void concurrency_loop(MYSQL *mysql, uint current, option_string *eptr)
stats *sptr;
conclusions conclusion;
unsigned long long client_limit;
int sysret;
head_sptr= (stats *)my_malloc(sizeof(stats) * iterations,
MYF(MY_ZEROFILL|MY_FAE|MY_WME));
@ -463,7 +464,9 @@ void concurrency_loop(MYSQL *mysql, uint current, option_string *eptr)
run_query(mysql, "SET AUTOCOMMIT=0", strlen("SET AUTOCOMMIT=0"));
if (pre_system)
system(pre_system);
if ((sysret= system(pre_system)) != 0)
fprintf(stderr, "Warning: Execution of pre_system option returned %d.\n",
sysret);
/*
Pre statements are always run after all other logic so they can
@ -478,7 +481,9 @@ void concurrency_loop(MYSQL *mysql, uint current, option_string *eptr)
run_statements(mysql, post_statements);
if (post_system)
system(post_system);
if ((sysret= system(post_system)) != 0)
fprintf(stderr, "Warning: Execution of post_system option returned %d.\n",
sysret);
/* We are finished with this run */
if (auto_generate_sql_autoincrement || auto_generate_sql_guid_primary)

View file

@ -6775,8 +6775,10 @@ void run_query_stmt(MYSQL *mysql, struct st_command *command,
MYSQL_STMT *stmt;
DYNAMIC_STRING ds_prepare_warnings;
DYNAMIC_STRING ds_execute_warnings;
ulonglong affected_rows;
DBUG_ENTER("run_query_stmt");
DBUG_PRINT("query", ("'%-.60s'", query));
LINT_INIT(affected_rows);
/*
Init a new stmt if it's not already one created for this connection
@ -6907,6 +6909,13 @@ void run_query_stmt(MYSQL *mysql, struct st_command *command,
*/
}
/*
Need to grab affected rows information before getting
warnings here
*/
if (!disable_info)
affected_rows= mysql_affected_rows(mysql);
if (!disable_warnings)
{
/* Get the warnings from execute */
@ -6931,7 +6940,7 @@ void run_query_stmt(MYSQL *mysql, struct st_command *command,
}
if (!disable_info)
append_info(ds, mysql_affected_rows(mysql), mysql_info(mysql));
append_info(ds, affected_rows, mysql_info(mysql));
}

View file

@ -465,10 +465,10 @@ rl_redisplay ()
int newlines, lpos, temp, modmark;
const char *prompt_this_line;
#if defined (HANDLE_MULTIBYTE)
int num, n0;
int num, n0= 0;
wchar_t wc;
size_t wc_bytes;
int wc_width;
int wc_width= 0;
mbstate_t ps;
int _rl_wrapped_multicolumn = 0;
#endif
@ -828,7 +828,7 @@ rl_redisplay ()
cpos_buffer_position = out;
lb_linenum = newlines;
}
for (i = in; i < in+wc_bytes; i++)
for (i = in; i < in+(int)wc_bytes; i++)
line[out++] = rl_line_buffer[i];
for (i = 0; i < wc_width; i++)
CHECK_LPOS();

View file

@ -1726,6 +1726,23 @@ else
CXXFLAGS="$OPTIMIZE_CXXFLAGS $CXXFLAGS"
fi
# Debug Sync Facility. NOTE: depends on 'with_debug'. Must be behind it.
AC_MSG_CHECKING(if Debug Sync Facility should be enabled.)
AC_ARG_ENABLE(debug_sync,
AS_HELP_STRING([--enable-debug-sync],
[Build a version with Debug Sync Facility]),
[ enable_debug_sync=$enableval ],
[ enable_debug_sync=$with_debug ])
if test "$enable_debug_sync" != "no"
then
AC_DEFINE([ENABLED_DEBUG_SYNC], [1],
[If Debug Sync Facility should be enabled])
AC_MSG_RESULT([yes])
else
AC_MSG_RESULT([no])
fi
# If we should allow error injection tests
AC_ARG_WITH(error-inject,
AC_HELP_STRING([--with-error-inject],[Enable error injection in MySQL Server]),
@ -2818,7 +2835,7 @@ server_scripts=
dnl This probably should be cleaned up more - for now the threaded
dnl client is just using plain-old libs.
sql_client_dirs="strings regex mysys dbug libmysql"
sql_client_dirs="strings mysys dbug extra regex libmysql"
AM_CONDITIONAL(THREAD_SAFE_CLIENT, test "$THREAD_SAFE_CLIENT" != "no")
@ -2884,9 +2901,10 @@ AC_SUBST(mysql_plugin_defs)
# Now that sql_client_dirs and sql_server_dirs are stable, determine the union.
# Start with the (longer) server list, add each client item not yet present.
sql_union_dirs=" $sql_server_dirs "
for DIR in $sql_client_dirs
# We support client-only builds by "--without-server", but not vice versa,
# so we start with the client list, then add each server item not yet present.
sql_union_dirs=" $sql_client_dirs "
for DIR in $sql_server_dirs
do
if echo " $sql_union_dirs " | grep " $DIR " >/dev/null
then

View file

@ -441,7 +441,7 @@ public:
const Ciphers& GetCiphers() const;
const DH_Parms& GetDH_Parms() const;
const Stats& GetStats() const;
const VerifyCallback getVerifyCallback() const;
VerifyCallback getVerifyCallback() const;
pem_password_cb GetPasswordCb() const;
void* GetUserData() const;
bool GetSessionCacheOff() const;

View file

@ -1833,7 +1833,7 @@ SSL_CTX::GetCA_List() const
}
const VerifyCallback SSL_CTX::getVerifyCallback() const
VerifyCallback SSL_CTX::getVerifyCallback() const
{
return verifyCallback_;
}

View file

@ -137,13 +137,13 @@ extern FILE *_db_fp_(void);
#define DBUG_EVALUATE_IF(keyword,a1,a2) (a2)
#define DBUG_PRINT(keyword,arglist) do { } while(0)
#define DBUG_PUSH(a1)
#define DBUG_SET(a1)
#define DBUG_SET_INITIAL(a1)
#define DBUG_SET(a1) do { } while(0)
#define DBUG_SET_INITIAL(a1) do { } while(0)
#define DBUG_POP()
#define DBUG_PROCESS(a1)
#define DBUG_SETJMP(a1) setjmp(a1)
#define DBUG_LONGJMP(a1) longjmp(a1)
#define DBUG_DUMP(keyword,a1,a2)
#define DBUG_DUMP(keyword,a1,a2) do { } while(0)
#define DBUG_END()
#define DBUG_ASSERT(A) do { } while(0)
#define DBUG_LOCK_FILE

View file

@ -559,12 +559,6 @@ int __void__;
#define LINT_INIT(var)
#endif
#if defined(_lint) || defined(FORCE_INIT_OF_VARS) || defined(HAVE_purify)
#define PURIFY_OR_LINT_INIT(var) var=0
#else
#define PURIFY_OR_LINT_INIT(var)
#endif
/*
Suppress uninitialized variable warning without generating code.

View file

@ -181,6 +181,16 @@ extern char *my_strndup(const char *from, size_t length,
#define TRASH(A,B) /* nothing */
#endif
#if defined(ENABLED_DEBUG_SYNC)
extern void (*debug_sync_C_callback_ptr)(const char *, size_t);
#define DEBUG_SYNC_C(_sync_point_name_) do { \
if (debug_sync_C_callback_ptr != NULL) \
(*debug_sync_C_callback_ptr)(STRING_WITH_LEN(_sync_point_name_)); } \
while(0)
#else
#define DEBUG_SYNC_C(_sync_point_name_)
#endif /* defined(ENABLED_DEBUG_SYNC) */
#ifdef HAVE_LARGE_PAGES
extern uint my_get_large_page_size(void);
extern uchar * my_large_malloc(size_t size, myf my_flags);
@ -734,7 +744,6 @@ extern int wild_compare(const char *str,const char *wildstr,
extern WF_PACK *wf_comp(char * str);
extern int wf_test(struct wild_file_pack *wf_pack,const char *name);
extern void wf_end(struct wild_file_pack *buffer);
extern size_t strip_sp(char * str);
extern my_bool array_append_string_unique(const char *str,
const char **array, size_t size);
extern void get_date(char * to,int timeflag,time_t use_time);

View file

@ -81,10 +81,11 @@ ENDFOREACH(rpath)
FOREACH (ENGINE_LIB ${MYSQLD_STATIC_ENGINE_LIBS})
INCLUDE(${CMAKE_SOURCE_DIR}/storage/${ENGINE_LIB}/CMakeLists.txt)
STRING(TOUPPER ${ENGINE_LIB} ENGINE_LIB_UPPER)
SET(ENGINE_DIR ${${ENGINE_LIB_UPPER}_DIR})
INCLUDE(${CMAKE_SOURCE_DIR}/storage/${ENGINE_DIR}/CMakeLists.txt)
FOREACH(rpath ${${ENGINE_LIB_UPPER}_SOURCES})
SET(LIB_SOURCES ${LIB_SOURCES} ${CMAKE_SOURCE_DIR}/storage/${ENGINE_LIB}/${rpath})
SET(LIB_SOURCES ${LIB_SOURCES} ${CMAKE_SOURCE_DIR}/storage/${ENGINE_DIR}/${rpath})
ENDFOREACH(rpath)
ENDFOREACH(ENGINE_LIB)
@ -120,6 +121,7 @@ SET(LIBMYSQLD_SOURCES emb_qcache.cc libmysqld.c lib_sql.cc
../sql/sql_list.cc ../sql/sql_load.cc ../sql/sql_locale.cc
../sql/sql_binlog.cc ../sql/sql_manager.cc ../sql/sql_map.cc
../sql/sql_parse.cc ../sql/sql_partition.cc ../sql/sql_plugin.cc
../sql/debug_sync.cc
../sql/sql_prepare.cc ../sql/sql_rename.cc ../sql/sql_repl.cc
../sql/sql_select.cc ../sql/sql_servers.cc
../sql/sql_show.cc ../sql/sql_state.c ../sql/sql_string.cc
@ -146,6 +148,14 @@ ADD_LIBRARY(mysqlserver STATIC ${LIBMYSQLD_SOURCES})
ADD_DEPENDENCIES(mysqlserver GenServerSource GenError)
TARGET_LINK_LIBRARIES(mysqlserver)
# Add any additional libraries requested by engine(s)
FOREACH (ENGINE_LIB ${MYSQLD_STATIC_ENGINE_LIBS})
STRING(TOUPPER ${ENGINE_LIB} ENGINE_LIB_UPPER)
IF(${ENGINE_LIB_UPPER}_LIBS)
TARGET_LINK_LIBRARIES(mysqlserver ${${ENGINE_LIB_UPPER}_LIBS})
ENDIF(${ENGINE_LIB_UPPER}_LIBS)
ENDFOREACH(ENGINE_LIB)
ADD_LIBRARY(libmysqld SHARED cmake_dummy.c libmysqld.def)
ADD_DEPENDENCIES(libmysqld mysqlserver)
TARGET_LINK_LIBRARIES(libmysqld mysqlserver wsock32)

View file

@ -75,6 +75,7 @@ sqlsources = derror.cc field.cc field_conv.cc strfunc.cc filesort.cc \
sp_head.cc sp_pcontext.cc sp.cc sp_cache.cc sp_rcontext.cc \
parse_file.cc sql_view.cc sql_trigger.cc my_decimal.cc \
rpl_filter.cc sql_partition.cc sql_builtin.cc sql_plugin.cc \
debug_sync.cc \
sql_tablespace.cc \
rpl_injector.cc my_user.c partition_info.cc \
sql_servers.cc event_parse_data.cc sql_signal.cc

View file

@ -142,6 +142,8 @@ emb_advanced_command(MYSQL *mysql, enum enum_server_command command,
if (!skip_check)
result= thd->is_error() ? -1 : 0;
thd->mysys_var= 0;
#if defined(ENABLED_PROFILING) && defined(COMMUNITY_SERVER)
thd->profiling.finish_current_query();
#endif
@ -634,6 +636,7 @@ void *create_embedded_thd(int client_flag)
thread_count++;
threads.append(thd);
thd->mysys_var= 0;
return thd;
err:
delete(thd);

View file

@ -164,6 +164,7 @@ mysql_real_connect(MYSQL *mysql,const char *host, const char *user,
port=0;
unix_socket=0;
client_flag|=mysql->options.client_flag;
/* Send client information for access check */
client_flag|=CLIENT_CAPABILITIES;
if (client_flag & CLIENT_MULTI_STATEMENTS)

View file

@ -2,6 +2,7 @@
# in alphabetical order. This also helps with merge conflict resolution.
binlog.binlog_tmp_table* # Bug#45578:2009-07-10 alik Test binlog_tmp_table fails ramdonly on PB2: Unknown table 't2'
binlog.binlog_multi_engine # joro : NDB tests marked as experimental as agreed with bochklin
funcs_1.charset_collation_1 # depends on compile-time decisions
@ -9,15 +10,14 @@ innodb.innodb_information_schema # Bug#47449 2009-09-19 alik main.inform
main.ctype_gbk_binlog @solaris # Bug#46010: main.ctype_gbk_binlog fails sporadically : Table 't2' already exists
main.information_schema # Bug#47449 2009-09-19 alik main.information_schema and innodb.innodb_information_schema fail sporadically
main.innodb-autoinc # Bug#44030 2009-09-24 alik Marking innodb-autoinc experimental while waiting for the patch to be merged
main.innodb-autoinc* # Bug#47809 2009-10-04 joro innodb-autoinc.test fails with valgrind errors with the innodb plugin
main.lock_multi_bug38499 # Bug#47448 2009-09-19 alik main.lock_multi_bug38499 times out sporadically
main.lock_multi_bug38691 @solaris # Bug#47792 2009-10-02 alik main.lock_multi_bug38691 times out sporadically on Solaris 10
main.log_tables # Bug#47924 2009-10-08 alik main.log_tables times out sporadically
main.plugin # Bug#47146 Linking problem with example plugin when dtrace enabled
main.plugin_load # Bug#47146
rpl.rpl_get_master_version_and_clock* # Bug#46931 2009-08-26 alik rpl.rpl_get_master_version_and_clock fails on hpux11.31
rpl.rpl_innodb_bug28430* @solaris # Bug#46029
rpl.rpl_innodb_bug28430* # Bug#46029
rpl.rpl_innodb_bug30888* @solaris # Bug#47646 2009-09-25 alik rpl.rpl_innodb_bug30888 fails sporadically on Solaris
rpl.rpl_plugin_load* @solaris # Bug#47146
rpl.rpl_row_create_table* # Bug#45576: rpl_row_create_table fails on PB2

View file

@ -1,5 +1,5 @@
perl mysql-test-run.pl --timer --force --parallel=auto --experimental=collections/default.experimental --comment=n_mix --mysqld=--binlog-format=mixed --suite=main,binlog,innodb,federated,rpl
perl mysql-test-run.pl --timer --force --parallel=auto --experimental=collections/default.experimental --comment=ps_row --ps-protocol --mysqld=--binlog-format=row --suite=main,binlog,innodb,federated,rpl
perl mysql-test-run.pl --timer --force --parallel=auto --experimental=collections/default.experimental --comment=embedded --embedded --suite=main,binlog,innodb,federated,rpl
perl mysql-test-run.pl --timer --force --parallel=auto --experimental=collections/default.experimental --comment=rpl_binlog_row --mysqld=--binlog-format=row --suite=rpl,binlog
perl mysql-test-run.pl --timer --force --parallel=auto --experimental=collections/default.experimental --comment=funcs_1 --suite=funcs_1
perl mysql-test-run.pl --timer --force --parallel=auto --experimental=collections/default.experimental --comment=n_mix --vardir=var-n_mix --mysqld=--binlog-format=mixed --suite=main,binlog,innodb,federated,rpl
perl mysql-test-run.pl --timer --force --parallel=auto --experimental=collections/default.experimental --comment=ps_row --vardir=var-ps_row --ps-protocol --mysqld=--binlog-format=row --suite=main,binlog,innodb,federated,rpl
perl mysql-test-run.pl --timer --force --parallel=auto --experimental=collections/default.experimental --comment=embedded --vardir=var-emebbed --embedded --suite=main,binlog,innodb,federated,rpl
perl mysql-test-run.pl --timer --force --parallel=auto --experimental=collections/default.experimental --comment=rpl_binlog_row --vardir=var-rpl_binlog_row --mysqld=--binlog-format=row --suite=rpl,binlog
perl mysql-test-run.pl --timer --force --parallel=auto --experimental=collections/default.experimental --comment=funcs_1 --vardir=var-funcs_1 --suite=funcs_1

View file

@ -1,5 +1,5 @@
perl mysql-test-run.pl --timer --force --parallel=auto --experimental=collections/default.experimental --comment=n_mix --mysqld=--binlog-format=mixed --suite=main,binlog,innodb,federated,rpl
perl mysql-test-run.pl --timer --force --parallel=auto --experimental=collections/default.experimental --comment=ps_row --ps-protocol --mysqld=--binlog-format=row --suite=main,binlog,innodb,federated,rpl
perl mysql-test-run.pl --timer --force --parallel=auto --experimental=collections/default.experimental --comment=embedded --embedded --suite=main,binlog,innodb,federated,rpl
perl mysql-test-run.pl --timer --force --parallel=auto --experimental=collections/default.experimental --comment=rpl_binlog_row --mysqld=--binlog-format=row --suite=rpl,binlog
perl mysql-test-run.pl --timer --force --parallel=auto --experimental=collections/default.experimental --comment=funcs_1 --suite=funcs_1
perl mysql-test-run.pl --timer --force --parallel=auto --experimental=collections/default.experimental --comment=n_mix --vardir=var-n_mix --mysqld=--binlog-format=mixed --suite=main,binlog,innodb,federated,rpl
perl mysql-test-run.pl --timer --force --parallel=auto --experimental=collections/default.experimental --comment=ps_row --vardir=var-ps_row --ps-protocol --mysqld=--binlog-format=row --suite=main,binlog,innodb,federated,rpl
perl mysql-test-run.pl --timer --force --parallel=auto --experimental=collections/default.experimental --comment=embedded --vardir=var-emebbed --embedded --suite=main,binlog,innodb,federated,rpl
perl mysql-test-run.pl --timer --force --parallel=auto --experimental=collections/default.experimental --comment=rpl_binlog_row --vardir=var-rpl_binlog_row --mysqld=--binlog-format=row --suite=rpl,binlog
perl mysql-test-run.pl --timer --force --parallel=auto --experimental=collections/default.experimental --comment=funcs_1 --vardir=var-funcs_1 --suite=funcs_1

View file

@ -270,3 +270,42 @@ INSERT INTO test.t1 VALUES (1), (2);
CREATE TABLE test.t2 SELECT * FROM test.t1;
USE test;
DROP TABLES t1, t2;
#
# Bug#46640
# This test verifies if the server_id stored in the "format
# description BINLOG statement" will override the server_id
# of the server executing the statements.
#
connect (fresh,localhost,root,,test);
connection fresh;
RESET MASTER;
CREATE TABLE t1 (a INT PRIMARY KEY);
# Format description event, with server_id = 10;
BINLOG '
3u9kSA8KAAAAZgAAAGoAAAABAAQANS4xLjM1LW1hcmlhLWJldGExLWRlYnVnLWxvZwAAAAAAAAAA
AAAAAAAAAAAAAAAAAADe72RIEzgNAAgAEgAEBAQEEgAAUwAEGggAAAAICAgC
';
# What server_id is logged for a statement? Should be our own, not the
# one from the format description event.
INSERT INTO t1 VALUES (1);
# INSERT INTO t1 VALUES (2), with server_id=20. Check that this is logged
# with our own server id, not the 20 from the BINLOG statement.
BINLOG '
3u9kSBMUAAAAKQAAAJEBAAAAABoAAAAAAAAABHRlc3QAAnQxAAEDAAA=
3u9kSBcUAAAAIgAAALMBAAAQABoAAAAAAAEAAf/+AgAAAA==
';
# Show binlog events to check that server ids are correct.
--replace_column 1 # 2 # 5 #
--replace_regex /Server ver: .*, Binlog ver: .*/Server ver: #, Binlog ver: #/ /table_id: [0-9]+/table_id: #/
SHOW BINLOG EVENTS;
DROP TABLE t1;
disconnect fresh;

View file

@ -0,0 +1,300 @@
################################################################################
# Let
# - B be begin, C commit and R rollback.
# - T a statement that accesses and changes only transactional tables, i.e.
# T-tables
# - N a statement that accesses and changes only non-transactional tables,
# i.e, N-tables.
# - M be a mixed statement, i.e. a statement that updates both T- and
# N-tables.
# - M* be a mixed statement that fails while updating either a T
# or N-table.
# - N* be a statement that fails while updating a N-table.
#
# In this test case, when changes are logged as rows either in the RBR or MIXED
# modes, we check if a M* statement that happens early in a transaction is
# written to the binary log outside the boundaries of the transaction and
# wrapped up in a BEGIN/ROLLBACK. This is done to keep the slave consistent with
# the master as the rollback will keep the changes on N-tables and undo them on
# T-tables. In particular, we expect the following behavior:
#
# 1. B M* T C would generate in the binlog B M* R B T C.
# 2. B M M* C would generate in the binlog B M M* C.
# 3. B M* M* T C would generate in the binlog B M* R B M* R B T C.
#
# SBR is not considered in this test because a failing statement is written to
# the binary along with the error code such that a slave executes and rolls it
# back, thus undoing the effects on T-tables.
#
# Note that, in the first case, we are not preserving history from the master as
# we are introducing a rollback that never happened. However, this seems to be
# more acceptable than making the slave diverge. In the second case, the slave
# will diverge as the changes on T-tables that originated from the M statement
# are rolled back on the master but not on the slave. Unfortunately, we cannot
# simply roll the transaction back as this would undo any uncommitted changes
# on T-tables.
#
# We check two more cases. First, INSERT...SELECT* which produces the following
# results:
#
# 1. B T INSERT M...SELECT* C" with an error in INSERT M...SELECT* generates in
# the binlog the following entries: "Nothing".
# 2. B INSERT M...SELECT* C" with an error in INSERT M...SELECT* generates in
# the binlog the following entries: B INSERT M...SELECT* R.
#
# Finally, we also check if any N statement that happens early in a transaction
# (i.e. before any T or M statement) is written to the binary log outside the
# boundaries of the transaction. In particular, we expect the following
# behavior:
#
# 1. B N N T C would generate in the binlog B N C B N C B T C.
# 2. B N N T R would generate in the binlog B N C B N C B T R.
# 3. B N* N* T C would generate in the binlog B N R B N R B T C.
# 4. B N* N* T R would generate in the binlog B N R B N R B T R.
# 5. B N N T N T C would generate in the binlog B N C B N C B T N T C.
# 6. B N N T N T R would generate in the binlog the B N C B N C B T N T R.
#
# Such issues do not happen in SBR. In RBR and MBR, a full-fledged fix will be
# pushed after the WL#2687.
#
# Please, remove this test case after pushing WL#2687.
################################################################################
--echo ###################################################################################
--echo # CONFIGURATION
--echo ###################################################################################
CREATE TABLE nt_1 (a text, b int PRIMARY KEY) ENGINE = MyISAM;
CREATE TABLE nt_2 (a text, b int PRIMARY KEY) ENGINE = MyISAM;
CREATE TABLE tt_1 (a text, b int PRIMARY KEY) ENGINE = Innodb;
CREATE TABLE tt_2 (a text, b int PRIMARY KEY) ENGINE = Innodb;
DELIMITER |;
CREATE TRIGGER tr_i_tt_1_to_nt_1 BEFORE INSERT ON tt_1 FOR EACH ROW
BEGIN
INSERT INTO nt_1 VALUES (NEW.a, NEW.b);
END|
CREATE TRIGGER tr_i_nt_2_to_tt_2 BEFORE INSERT ON nt_2 FOR EACH ROW
BEGIN
INSERT INTO tt_2 VALUES (NEW.a, NEW.b);
END|
DELIMITER ;|
--echo ###################################################################################
--echo # CHECK HISTORY IN BINLOG
--echo ###################################################################################
--echo
--echo
--echo
--echo *** "B M* T C" with error in M* generates in the binlog the "B M* R B T C" entries
--echo
let $binlog_start= query_get_value("SHOW MASTER STATUS", Position, 1);
INSERT INTO nt_1 VALUES ("new text 1", 1);
BEGIN;
--error ER_DUP_ENTRY
INSERT INTO tt_1 VALUES (USER(), 2), (USER(), 1);
INSERT INTO tt_2 VALUES ("new text 3", 3);
COMMIT;
--source include/show_binlog_events.inc
--echo
let $binlog_start= query_get_value("SHOW MASTER STATUS", Position, 1);
INSERT INTO tt_2 VALUES ("new text 4", 4);
BEGIN;
--error ER_DUP_ENTRY
INSERT INTO nt_2 VALUES (USER(), 5), (USER(), 4);
INSERT INTO tt_2 VALUES ("new text 6", 6);
COMMIT;
--source include/show_binlog_events.inc
--echo
--echo
--echo
--echo *** "B M M* T C" with error in M* generates in the binlog the "B M M* T C" entries
--echo
let $binlog_start= query_get_value("SHOW MASTER STATUS", Position, 1);
INSERT INTO nt_1 VALUES ("new text 10", 10);
BEGIN;
INSERT INTO tt_1 VALUES ("new text 7", 7), ("new text 8", 8);
--error ER_DUP_ENTRY
INSERT INTO tt_1 VALUES (USER(), 9), (USER(), 10);
INSERT INTO tt_2 VALUES ("new text 11", 11);
COMMIT;
--source include/show_binlog_events.inc
--echo
let $binlog_start= query_get_value("SHOW MASTER STATUS", Position, 1);
INSERT INTO tt_2 VALUES ("new text 15", 15);
BEGIN;
INSERT INTO nt_2 VALUES ("new text 12", 12), ("new text 13", 13);
--error ER_DUP_ENTRY
INSERT INTO nt_2 VALUES (USER(), 14), (USER(), 15);
INSERT INTO tt_2 VALUES ("new text 16", 16);
COMMIT;
--source include/show_binlog_events.inc
--echo
--echo
--echo
--echo *** "B M* M* T C" with error in M* generates in the binlog the "B M* R B M* R B T C" entries
--echo
let $binlog_start= query_get_value("SHOW MASTER STATUS", Position, 1);
INSERT INTO nt_1 VALUES ("new text 18", 18);
INSERT INTO nt_1 VALUES ("new text 20", 20);
BEGIN;
--error ER_DUP_ENTRY
INSERT INTO tt_1 VALUES (USER(), 17), (USER(), 18);
--error ER_DUP_ENTRY
INSERT INTO tt_1 VALUES (USER(), 19), (USER(), 20);
INSERT INTO tt_2 VALUES ("new text 21", 21);
COMMIT;
--source include/show_binlog_events.inc
--echo
let $binlog_start= query_get_value("SHOW MASTER STATUS", Position, 1);
INSERT INTO tt_2 VALUES ("new text 23", 23);
INSERT INTO tt_2 VALUES ("new text 25", 25);
BEGIN;
--error ER_DUP_ENTRY
INSERT INTO nt_2 VALUES (USER(), 22), (USER(), 23);
--error ER_DUP_ENTRY
INSERT INTO nt_2 VALUES (USER(), 24), (USER(), 25);
INSERT INTO tt_2 VALUES ("new text 26", 26);
COMMIT;
--source include/show_binlog_events.inc
--echo
--echo
--echo
--echo *** "B T INSERT M...SELECT* C" with an error in INSERT M...SELECT* generates
--echo *** in the binlog the following entries: "Nothing".
--echo *** There is a bug in that will be fixed after WL#2687. Please, check BUG#47175 for further details.
--echo
let $binlog_start= query_get_value("SHOW MASTER STATUS", Position, 1);
TRUNCATE TABLE nt_2;
TRUNCATE TABLE tt_2;
INSERT INTO tt_2 VALUES ("new text 7", 7);
BEGIN;
INSERT INTO tt_2 VALUES ("new text 27", 27);
--error ER_DUP_ENTRY
INSERT INTO nt_2(a, b) SELECT USER(), b FROM nt_1;
INSERT INTO tt_2 VALUES ("new text 28", 28);
ROLLBACK;
--source include/show_binlog_events.inc
--echo
--echo
--echo
--echo *** "B INSERT M..SELECT* C" with an error in INSERT M...SELECT* generates
--echo *** in the binlog the following entries: "B INSERT M..SELECT* R".
--echo
let $binlog_start= query_get_value("SHOW MASTER STATUS", Position, 1);
TRUNCATE TABLE nt_2;
TRUNCATE TABLE tt_2;
INSERT INTO tt_2 VALUES ("new text 7", 7);
BEGIN;
--error ER_DUP_ENTRY
INSERT INTO nt_2(a, b) SELECT USER(), b FROM nt_1;
COMMIT;
--source include/show_binlog_events.inc
--echo
--echo
--echo
--echo *** "B N N T C" generates in the binlog the "B N C B N C B T C" entries
--echo
let $binlog_start= query_get_value("SHOW MASTER STATUS", Position, 1);
TRUNCATE TABLE nt_1;
TRUNCATE TABLE tt_2;
BEGIN;
INSERT INTO nt_1 VALUES (USER(), 1);
INSERT INTO nt_1 VALUES (USER(), 2);
INSERT INTO tt_2 VALUES (USER(), 3);
COMMIT;
--source include/show_binlog_events.inc
--echo
--echo
--echo
--echo *** "B N N T R" generates in the binlog the "B N C B N C B T R" entries
--echo
let $binlog_start= query_get_value("SHOW MASTER STATUS", Position, 1);
BEGIN;
INSERT INTO nt_1 VALUES (USER(), 4);
INSERT INTO nt_1 VALUES (USER(), 5);
INSERT INTO tt_2 VALUES (USER(), 6);
ROLLBACK;
--source include/show_binlog_events.inc
--echo
--echo
--echo
--echo *** "B N* N* T C" with error in N* generates in the binlog the "B N R B N R B T C" entries
--echo
let $binlog_start= query_get_value("SHOW MASTER STATUS", Position, 1);
BEGIN;
--error ER_DUP_ENTRY
INSERT INTO nt_1 VALUES (USER(), 7), (USER(), 1);
--error ER_DUP_ENTRY
INSERT INTO nt_1 VALUES (USER(), 8), (USER(), 1);
INSERT INTO tt_2 VALUES (USER(), 9);
COMMIT;
--source include/show_binlog_events.inc
--echo
--echo
--echo
--echo *** "B N* N* T R" with error in N* generates in the binlog the "B N R B N R B T R" entries
--echo
let $binlog_start= query_get_value("SHOW MASTER STATUS", Position, 1);
BEGIN;
--error ER_DUP_ENTRY
INSERT INTO nt_1 VALUES (USER(), 10), (USER(), 1);
--error ER_DUP_ENTRY
INSERT INTO nt_1 VALUES (USER(), 11), (USER(), 1);
INSERT INTO tt_2 VALUES (USER(), 12);
ROLLBACK;
--source include/show_binlog_events.inc
--echo
--echo
--echo
--echo *** "B N N T N T C" generates in the binlog the "B N C B N C B T N T C" entries
--echo
let $binlog_start= query_get_value("SHOW MASTER STATUS", Position, 1);
BEGIN;
INSERT INTO nt_1 VALUES (USER(), 13);
INSERT INTO nt_1 VALUES (USER(), 14);
INSERT INTO tt_2 VALUES (USER(), 15);
INSERT INTO nt_1 VALUES (USER(), 16);
INSERT INTO tt_2 VALUES (USER(), 17);
COMMIT;
--source include/show_binlog_events.inc
--echo
--echo
--echo
--echo *** "B N N T N T R" generates in the binlog the "B N C B N C B T N T R" entries
--echo
let $binlog_start= query_get_value("SHOW MASTER STATUS", Position, 1);
BEGIN;
INSERT INTO nt_1 VALUES (USER(), 18);
INSERT INTO nt_1 VALUES (USER(), 19);
INSERT INTO tt_2 VALUES (USER(), 20);
INSERT INTO nt_1 VALUES (USER(), 21);
INSERT INTO tt_2 VALUES (USER(), 22);
ROLLBACK;
--source include/show_binlog_events.inc
--echo ###################################################################################
--echo # CLEAN
--echo ###################################################################################
DROP TABLE tt_1;
DROP TABLE tt_2;
DROP TABLE nt_1;
DROP TABLE nt_2;

View file

@ -1,27 +1,62 @@
--disable_warnings
drop database if exists `drop-temp+table-test`;
DROP DATABASE IF EXISTS `drop-temp+table-test`;
--enable_warnings
connect (con1,localhost,root,,);
connect (con2,localhost,root,,);
connection con1;
reset master;
create database `drop-temp+table-test`;
use `drop-temp+table-test`;
create temporary table shortn1 (a int);
create temporary table `table:name` (a int);
create temporary table shortn2 (a int);
select get_lock("a",10);
RESET MASTER;
CREATE DATABASE `drop-temp+table-test`;
USE `drop-temp+table-test`;
CREATE TEMPORARY TABLE shortn1 (a INT);
CREATE TEMPORARY TABLE `table:name` (a INT);
CREATE TEMPORARY TABLE shortn2 (a INT);
##############################################################################
# BUG#46572 DROP TEMPORARY table IF EXISTS does not have a consistent behavior
# in ROW mode
#
# In RBR, 'DROP TEMPORARY TABLE ...' statement should never be binlogged no
# matter if the tables exist or not. In contrast, both in SBR and MBR, the
# statement should be always binlogged no matter if the tables exist or not.
##############################################################################
CREATE TEMPORARY TABLE tmp(c1 int);
CREATE TEMPORARY TABLE tmp1(c1 int);
CREATE TEMPORARY TABLE tmp2(c1 int);
CREATE TEMPORARY TABLE tmp3(c1 int);
CREATE TABLE t(c1 int);
DROP TEMPORARY TABLE IF EXISTS tmp;
--disable_warnings
# Before fixing BUG#46572, 'DROP TEMPORARY TABLE IF EXISTS...' statement was
# binlogged when the table did not exist in RBR.
DROP TEMPORARY TABLE IF EXISTS tmp;
# In RBR, 'DROP TEMPORARY TABLE ...' statement is never binlogged no matter if
# the tables exist or not.
DROP TEMPORARY TABLE IF EXISTS tmp, tmp1;
DROP TEMPORARY TABLE tmp3;
#In RBR, tmp2 will NOT be binlogged, because it is a temporary table.
DROP TABLE IF EXISTS tmp2, t;
#In RBR, tmp2 will be binlogged, because it does not exist and master do not know
# whether it is a temporary table or not.
DROP TABLE IF EXISTS tmp2, t;
--enable_warnings
SELECT GET_LOCK("a",10);
disconnect con1;
connection con2;
# We want to SHOW BINLOG EVENTS, to know what was logged. But there is no
# guarantee that logging of the terminated con1 has been done yet.
# To be sure that logging has been done, we use a user lock.
select get_lock("a",10);
let $VERSION=`select version()`;
SELECT GET_LOCK("a",10);
let $VERSION=`SELECT VERSION()`;
source include/show_binlog_events.inc;
drop database `drop-temp+table-test`;
DROP DATABASE `drop-temp+table-test`;
# End of 4.1 tests

View file

@ -0,0 +1,44 @@
#
# This test verifies if inserting data into view that invokes a
# trigger will make the autoinc values become inconsistent on
# master and slave.
#
connection master;
CREATE TABLE t1(i1 int not null auto_increment, c1 INT, primary key(i1)) engine=innodb;
CREATE TABLE t2(i1 int not null auto_increment, c2 INT, primary key(i1)) engine=innodb;
CREATE TABLE t3(i1 int not null auto_increment, a int, primary key(i1)) engine=innodb;
eval create trigger tr16 $insert_action on t1 for each row insert into t3(a) values(new.c1);
eval create trigger tr17 $insert_action on t2 for each row insert into t3(a) values(new.c2);
begin;
INSERT INTO t1(c1) VALUES (11), (12);
INSERT INTO t2(c2) VALUES (13), (14);
CREATE VIEW v16 AS SELECT c1, c2 FROM t1, t2;
INSERT INTO v16(c1) VALUES (15),(16);
INSERT INTO v16(c2) VALUES (17),(18);
connection master1;
INSERT INTO v16(c1) VALUES (19),(20);
INSERT INTO v16(c2) VALUES (21),(22);
connection master;
INSERT INTO v16(c1) VALUES (23), (24);
INSERT INTO v16(c1) VALUES (25), (26);
commit;
sync_slave_with_master;
--echo #Test if the results are consistent on master and slave
--echo #for 'INSERT DATA INTO VIEW WHICH INVOKES TRIGGERS'
let $diff_table_1=master:test.t3;
let $diff_table_2=slave:test.t3;
source include/diff_tables.inc;
connection master;
DROP TABLE t1;
DROP TABLE t2;
DROP TABLE t3;
DROP VIEW v16;
sync_slave_with_master;

View file

@ -0,0 +1,82 @@
#
# This test verifies if concurrent transactions that invoke a
# trigger that inserts more than one values into one or more
# tables with an auto_increment column will make the autoinc
# values become inconsistent on master and slave.
#
connection master;
create table t1(a int, b int) engine=innodb;
create table t2(i1 int not null auto_increment, a int, primary key(i1)) engine=innodb;
eval create trigger tr1 $trigger_action on t1 for each row insert into t2(a) values(6);
create table t3(a int, b int) engine=innodb;
create table t4(i1 int not null auto_increment, a int, primary key(i1)) engine=innodb;
create table t5(a int) engine=innodb;
delimiter |;
eval create trigger tr2 $trigger_action on t3 for each row begin
insert into t4(a) values(f1_insert_triggered());
insert into t4(a) values(f1_insert_triggered());
insert into t5(a) values(8);
end |
delimiter ;|
create table t6(i1 int not null auto_increment, a int, primary key(i1)) engine=innodb;
delimiter //;
CREATE FUNCTION f1_insert_triggered() RETURNS INTEGER
BEGIN
INSERT INTO t6(a) values(2),(3);
RETURN 1;
END//
delimiter ;//
begin;
let $binlog_start= query_get_value("SHOW MASTER STATUS", Position, 1);
insert into t1(a,b) values(1,1),(2,1);
insert into t3(a,b) values(1,1),(2,1);
update t1 set a = a + 5 where b = 1;
update t3 set a = a + 5 where b = 1;
delete from t1 where b = 1;
delete from t3 where b = 1;
connection master1;
#The default autocommit is set to 1, so the statement is auto committed
insert into t2(a) values(3);
insert into t4(a) values(3);
connection master;
commit;
insert into t1(a,b) values(4,2);
insert into t3(a,b) values(4,2);
update t1 set a = a + 5 where b = 2;
update t3 set a = a + 5 where b = 2;
delete from t1 where b = 2;
delete from t3 where b = 2;
--echo # To verify if insert/update in an autoinc column causes statement to be logged in row format
source include/show_binlog_events.inc;
commit;
connection master;
sync_slave_with_master;
--echo #Test if the results are consistent on master and slave
--echo #for 'INVOKES A TRIGGER with $trigger_action action'
let $diff_table_1=master:test.t2;
let $diff_table_2=slave:test.t2;
source include/diff_tables.inc;
let $diff_table_1=master:test.t4;
let $diff_table_2=slave:test.t4;
source include/diff_tables.inc;
let $diff_table_1=master:test.t6;
let $diff_table_2=slave:test.t6;
source include/diff_tables.inc;
connection master;
DROP TABLE t1;
DROP TABLE t2;
DROP TABLE t3;
DROP TABLE t4;
DROP TABLE t5;
DROP TABLE t6;
DROP FUNCTION f1_insert_triggered;
sync_slave_with_master;

View file

@ -0,0 +1,57 @@
#
# This test verifies if concurrent transactions that call a
# function which invokes a 'after/before insert action' trigger
# that inserts more than one values into a table with autoinc
# column will make the autoinc values become inconsistent on
# master and slave.
#
connection master;
create table t1(a int) engine=innodb;
create table t2(i1 int not null auto_increment, a int, primary key(i1)) engine=innodb;
create table t3(i1 int not null auto_increment, a int, primary key(i1)) engine=innodb;
delimiter |;
CREATE FUNCTION f1_two_inserts_trigger() RETURNS INTEGER
BEGIN
INSERT INTO t2(a) values(2),(3);
INSERT INTO t2(a) values(2),(3);
RETURN 1;
END |
eval create trigger tr11 $insert_action on t2 for each row begin
insert into t3(a) values(new.a);
insert into t3(a) values(new.a);
end |
delimiter ;|
begin;
let $binlog_start= query_get_value("SHOW MASTER STATUS", Position, 1);
insert into t1(a) values(f1_two_inserts_trigger());
connection master1;
#The default autocommit is set to 1, so the statement is auto committed
insert into t2(a) values(4),(5);
connection master;
commit;
insert into t1(a) values(f1_two_inserts_trigger());
--echo # To verify if insert/update in an autoinc column causes statement to be logged in row format
source include/show_binlog_events.inc;
commit;
connection master;
sync_slave_with_master;
--echo #Test if the results are consistent on master and slave
--echo #for 'CALLS A FUNCTION which INVOKES A TRIGGER with $insert_action action'
let $diff_table_1=master:test.t2;
let $diff_table_2=slave:test.t2;
source include/diff_tables.inc;
let $diff_table_1=master:test.t3;
let $diff_table_2=slave:test.t3;
source include/diff_tables.inc;
connection master;
drop table t1;
drop table t2;
drop table t3;
drop function f1_two_inserts_trigger;
sync_slave_with_master;

View file

@ -22,3 +22,4 @@ connection master;
select * from t1;
commit;
drop table t1;
-- sync_slave_with_master

View file

@ -41,7 +41,17 @@ eval SELECT RELEASE_LOCK($debug_lock);
connection slave;
source include/wait_for_slave_io_error.inc;
let $last_io_errno= query_get_value("show slave status", Last_IO_Errno, 1);
echo Slave_IO_Errno= $last_io_errno;
--echo Check network error happened here
if (`SELECT '$last_io_errno' = '2013' || # CR_SERVER_LOST
'$last_io_errno' = '2003' || # CR_CONN_HOST_ERROR
'$last_io_errno' = '2002' || # CR_CONNECTION_ERROR
'$last_io_errno' = '2006' || # CR_SERVER_GONE_ERROR
'$last_io_errno' = '1040' || # ER_CON_COUNT_ERROR
'$last_io_errno' = '1053' # ER_SERVER_SHUTDOWN
`)
{
--echo NETWORK ERROR
}
# Write file to make mysql-test-run.pl start up the server again
--append_file $MYSQLTEST_VARDIR/tmp/mysqld.1.expect

View file

@ -25,8 +25,6 @@
# new wrapper t/concurrent_innodb_safelog.test
#
--source include/not_embedded.inc
connection default;
#
# Show prerequisites for this test.

View file

@ -0,0 +1,5 @@
--require r/have_debug_sync.require
disable_query_log;
let $value= query_get_value(SHOW VARIABLES LIKE 'debug_sync', Value, 1);
eval SELECT ('$value' LIKE 'ON %') AS debug_sync;
enable_query_log;

View file

@ -0,0 +1,4 @@
--require r/have_mysql_upgrade.result
--disable_query_log
select LENGTH("$MYSQL_UPGRADE")>0 as have_mysql_upgrade;
--enable_query_log

View file

@ -0,0 +1,4 @@
disable_query_log;
--require r/not_true.require
select (PLUGIN_LIBRARY LIKE 'ha_innodb_plugin%') as `TRUE` from information_schema.plugins where PLUGIN_NAME='InnoDB';
enable_query_log;

View file

@ -442,6 +442,8 @@ INSERT INTO t1(id, dept, age, name) VALUES
EXPLAIN SELECT DISTINCT t1.name, t1.dept FROM t1 WHERE t1.name='rs5';
SELECT DISTINCT t1.name, t1.dept FROM t1 WHERE t1.name='rs5';
DELETE FROM t1;
--echo # Masking (#) number in "rows" column of the following EXPLAIN output, as it may vary (bug#47746).
--replace_column 9 #
EXPLAIN SELECT DISTINCT t1.name, t1.dept FROM t1 WHERE t1.name='rs5';
SELECT DISTINCT t1.name, t1.dept FROM t1 WHERE t1.name='rs5';

View file

@ -173,6 +173,7 @@ INSERT INTO global_suppressions VALUES
this error message.
*/
("Can't find file: '.\\\\test\\\\\\?{8}.frm'"),
("Slave: Unknown table 't1' Error_code: 1051"),
/* Added 2009-08-XX after fixing Bug #42408 */

View file

@ -69,6 +69,10 @@ require "mtr_misc.pl";
my $do_test_reg;
my $skip_test_reg;
# Related to adding InnoDB plugin combinations
my $lib_innodb_plugin;
my $do_innodb_plugin;
# If "Quick collect", set to 1 once a test to run has been found.
my $some_test_found;
@ -103,6 +107,17 @@ sub collect_test_cases ($$) {
$do_test_reg= init_pattern($do_test, "--do-test");
$skip_test_reg= init_pattern($skip_test, "--skip-test");
$lib_innodb_plugin=
my_find_file($::basedir,
["storage/innodb_plugin", "storage/innodb_plugin/.libs",
"lib/mysql/plugin", "lib/plugin"],
["ha_innodb_plugin.dll", "ha_innodb_plugin.so",
"ha_innodb_plugin.sl"],
NOT_REQUIRED);
$do_innodb_plugin= ($::mysql_version_id >= 50100 &&
!(IS_WINDOWS && $::opt_embedded_server) &&
$lib_innodb_plugin);
foreach my $suite (split(",", $suites))
{
push(@$cases, collect_one_suite($suite, $opt_cases));
@ -915,8 +930,11 @@ sub collect_one_test_case {
{
# innodb is not supported, skip it
$tinfo->{'skip'}= 1;
# This comment is checked for running with innodb plugin (see above),
# please keep that in mind if changing the text.
$tinfo->{'comment'}= "No innodb support";
return $tinfo;
# But continue processing if we may run it with innodb plugin
return $tinfo unless $do_innodb_plugin;
}
}
else

View file

@ -14,17 +14,16 @@
#
# Design of stress script should allow one:
#
# - To stress test the mysqltest binary test engine.
# - To stress test the regular test suite and any additional test suites
# (such as mysql-test-extra-5.0).
# - To specify files with lists of tests both for initialization of
# stress db and for further testing itself.
# - To define the number of threads to be concurrently used in testing.
# - To define limitations for the test run. such as the number of tests or
# loops for execution or duration of testing, delay between test
# executions, and so forth.
# - To get a readable log file that can be used for identification of
# errors that occur during testing.
# - to use for stress testing mysqltest binary as test engine
# - to use for stress testing both regular test suite and any
# additional test suites (e.g. mysql-test-extra-5.0)
# - to specify files with lists of tests both for initialization of
# stress db and for further testing itself
# - to define number of threads that will be concurrently used in testing
# - to define limitations for test run. e.g. number of tests or loops
# for execution or duration of testing, delay between test executions, etc.
# - to get readable log file which can be used for identification of
# errors arose during testing
#
# Basic scenarios:
#
@ -58,6 +57,8 @@
# to reproduce and debug errors that was found in continued stress
# testing
#
# 2009-01-28 OBN Additions and modifications per WL#4685
#
########################################################################
use Config;
@ -114,13 +115,15 @@ $opt_stress_mode="random";
$opt_loop_count=0;
$opt_test_count=0;
$opt_test_duration=0;
$opt_abort_on_error=0;
# OBN: Changing abort-on-error default to -1 (for WL-4626/4685): -1 means no abort
$opt_abort_on_error=-1;
$opt_sleep_time = 0;
$opt_threads=1;
$pid_file="mysql_stress_test.pid";
$opt_mysqltest= ($^O =~ /mswin32/i) ? "mysqltest.exe" : "mysqltest";
$opt_check_tests_file="";
@mysqltest_args=("--silent", "-v", "--skip-safemalloc");
# OBM adding a setting for 'max-connect-retries=7' the default of 500 is to high
@mysqltest_args=("--silent", "-v", "--skip-safemalloc", "--max-connect-retries=7");
# Client ip address
$client_ip=inet_ntoa((gethostbyname(hostname()))[4]);
@ -133,24 +136,31 @@ $client_ip=~ s/\.//g;
#
# S1 - Critical errors - cause immediately abort of testing. These errors
# could be caused by server crash or impossibility
# of test execution
# of test execution.
#
# S2 - Serious errors - these errors are bugs for sure as it knowns that
# they shouldn't appear during stress testing
#
# S3 - Non-seriuos errros - these errors could be caused by fact that
# S3 - Unknown errors - Errors were returned but we don't know what they are
# so script can't determine if they are OK or not
#
# S4 - Non-seriuos errros - these errors could be caused by fact that
# we execute simultaneously statements that
# affect tests executed by other threads
%error_strings = ( 'Failed in mysql_real_connect()' => S1,
'Can\'t connect' => S1,
'not found (Errcode: 2)' => S1 );
%error_codes = ( 1012 => S2, 1015 => S2, 1021 => S2,
1027 => S2, 1037 => S2, 1038 => S2,
1039 => S2, 1040 => S2, 1046 => S2,
1180 => S2, 1181 => S2, 1203 => S2,
1205 => S2, 1206 => S2, 1207 => S2,
1223 => S2, 2013 => S1);
1053 => S2, 1180 => S2, 1181 => S2,
1203 => S2, 1205 => S4, 1206 => S2,
1207 => S2, 1213 => S4, 1223 => S2,
2002 => S1, 2003 => S1, 2006 => S1,
2013 => S1
);
share(%test_counters);
%test_counters=( loop_count => 0, test_count=>0);
@ -158,6 +168,35 @@ share(%test_counters);
share($exiting);
$exiting=0;
# OBN Code and 'set_exit_code' function added by ES to set an exit code based on the error category returned
# in combination with the --abort-on-error value see WL#4685)
use constant ABORT_MAKEWEIGHT => 20;
share($gExitCode);
$gExitCode = 0; # global exit code
sub set_exit_code {
my $severity = shift;
my $code = 0;
if ( $severity =~ /^S(\d+)/ ) {
$severity = $1;
$code = 11 - $severity; # S1=10, S2=9, ... -- as per WL
}
else {
# we know how we call the sub: severity should be S<num>; so, we should never be here...
print STDERR "Unknown severity format: $severity; setting to S1\n";
$severity = 1;
}
$abort = 0;
if ( $severity <= $opt_abort_on_error ) {
# the test finished with a failure severe enough to abort. We are adding the 'abort flag' to the exit code
$code += ABORT_MAKEWEIGHT;
# but are not exiting just yet -- we need to update global exit code first
$abort = 1;
}
lock $gExitCode; # we can use lock here because the script uses threads anyway
$gExitCode = $code if $code > $gExitCode;
kill INT, $$ if $abort; # this is just a way to call sig_INT_handler: it will set exiting flag, which should do the rest
}
share($test_counters_lock);
$test_counters_lock=0;
share($log_file_lock);
@ -176,7 +215,8 @@ GetOptions("server-host=s", "server-logs-dir=s", "server-port=s",
"threads=s", "sleep-time=s", "loop-count=i", "test-count=i",
"test-duration=i", "test-suffix=s", "check-tests-file",
"verbose", "log-error-details", "cleanup", "mysqltest=s",
"abort-on-error", "help") || usage();
# OBN: (changing 'abort-on-error' to numberic for WL-4626/4685)
"abort-on-error=i" => \$opt_abort_on_error, "help") || usage();
usage() if ($opt_help);
@ -563,7 +603,15 @@ EOF
if ($opt_test_duration)
{
sleep($opt_test_duration);
# OBN - At this point we need to wait for the duration of the test, hoever
# we need to be able to quit if an 'abort-on-error' condition has happend
# with one of the children (WL#4685). Using solution by ES and replacing
# the 'sleep' command with a loop checking the abort condition every second
foreach ( 1..$opt_test_duration ) {
last if $exiting;
sleep 1;
}
kill INT, $$; #Interrupt child threads
}
@ -580,6 +628,8 @@ EOF
print "EXIT\n";
}
exit $gExitCode; # ES WL#4685: script should return a meaningful exit code
sub test_init
{
my ($env)=@_;
@ -681,7 +731,9 @@ sub test_execute
{
if (!exists($error_codes{$err_code}))
{
$severity="S3";
# OBN Changing severity level to S4 from S3 as S3 now reserved
# for the case where the error is unknown (for WL#4626/4685
$severity="S4";
$err_code=0;
}
else
@ -734,6 +786,7 @@ sub test_execute
{
push @{$env->{test_status}}, "Severity $severity: $total";
$env->{errors}->{total}=+$total;
set_exit_code($severity);
}
}
@ -748,18 +801,20 @@ sub test_execute
log_session_errors($env, $test_file);
if (!$exiting && ($signal_num == 2 || $signal_num == 15 ||
($opt_abort_on_error && $env->{errors}->{S1} > 0)))
#OBN Removing the case of S1 and abort-on-error as that is now set
# inside the set_exit_code function (for WL#4626/4685)
#if (!$exiting && ($signal_num == 2 || $signal_num == 15 ||
# ($opt_abort_on_error && $env->{errors}->{S1} > 0)))
if (!$exiting && ($signal_num == 2 || $signal_num == 15))
{
#mysqltest was interrupted with INT or TERM signals or test was
#ran with --abort-on-error option and we got errors with severity S1
#mysqltest was interrupted with INT or TERM signals
#so we assume that we should cancel testing and exit
$exiting=1;
# OBN - Adjusted text to exclude case of S1 and abort-on-error that
# was mentioned (for WL#4626/4685)
print STDERR<<EOF;
WARNING:
mysqltest was interrupted with INT or TERM signals or test was
ran with --abort-on-error option and we got errors with severity S1
(test cann't connect to the server or server crashed) so we assume that
mysqltest was interrupted with INT or TERM signals so we assume that
we should cancel testing and exit. Please check log file for this thread
in $stress_log_file or
inspect below output of the last test case executed with mysqltest to
@ -840,12 +895,23 @@ LOOP:
$client_env{test_count}."]:".
" TID ".$client_env{thread_id}.
" test: '$test_name' ".
" Errors: ".join(" ",@{$client_env{test_status}}),"\n";
print "\n";
" Errors: ".join(" ",@{$client_env{test_status}}).
( $exiting ? " (thread aborting)" : "" )."\n";
}
sleep($opt_sleep_time) if($opt_sleep_time);
# OBN - At this point we need to wait until the 'wait' time between test
# executions passes (in case it is specifed) passes, hoever we need
# to be able to quit and break out of the test if an 'abort-on-error'
# condition has happend with one of the other children (WL#4685).
# Using solution by ES and replacing the 'sleep' command with a loop
# checking the abort condition every second
if ( $opt_sleep_time ) {
foreach ( 1..$opt_sleep_time ) {
last if $exiting;
sleep 1;
}
}
}
}
@ -1119,6 +1185,9 @@ mysql-stress-test.pl --stress-basedir=<dir> --stress-suite-basedir=<dir> --serve
--cleanup
Force to clean up working directory (specified with --stress-basedir)
--abort-on-error=<number>
Causes the script to abort if an error with severity <= number was encounterd
--log-error-details
Enable errors details in the global error log file. (Default: off)

View file

@ -226,6 +226,7 @@ my @default_valgrind_args= ("--show-reachable=yes");
my @valgrind_args;
my $opt_valgrind_path;
my $opt_callgrind;
my $opt_debug_sync_timeout= 300; # Default timeout for WAIT_FOR actions.
our $opt_warnings= 1;
@ -869,6 +870,7 @@ sub command_line_setup {
'valgrind-option=s' => \@valgrind_args,
'valgrind-path=s' => \$opt_valgrind_path,
'callgrind' => \$opt_callgrind,
'debug-sync-timeout=i' => \$opt_debug_sync_timeout,
# Directories
'tmpdir=s' => \$opt_tmpdir,
@ -1817,7 +1819,7 @@ sub environment_setup {
($lib_example_plugin ? dirname($lib_example_plugin) : "");
$ENV{'HA_EXAMPLE_SO'}="'".$plugin_filename."'";
$ENV{'EXAMPLE_PLUGIN_LOAD'}="--plugin_load=;EXAMPLE=".$plugin_filename.";";
$ENV{'EXAMPLE_PLUGIN_LOAD'}="--plugin_load=EXAMPLE=".$plugin_filename;
}
else
{
@ -4217,6 +4219,11 @@ sub mysqld_arguments ($$$) {
mtr_add_arg($args, "%s", "--core-file");
}
# Enable the debug sync facility, set default wait timeout.
# Facility stays disabled if timeout value is zero.
mtr_add_arg($args, "--loose-debug-sync-timeout=%s",
$opt_debug_sync_timeout);
return $args;
}
@ -5329,6 +5336,8 @@ Misc options
to turn off.
sleep=SECONDS Passed to mysqltest, will be used as fixed sleep time
debug-sync-timeout=NUM Set default timeout for WAIT_FOR debug sync
actions. Disable facility with NUM=0.
gcov Collect coverage information after the test.
The result is a gcov file per source and header file.
experimental=<file> Refer to list of tests considered experimental;

View file

@ -1268,4 +1268,66 @@ a b
4 b
5 a
DROP TABLE t1;
#
# Bug#45567: Fast ALTER TABLE broken for enum and set
#
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (a ENUM('a1','a2'));
INSERT INTO t1 VALUES ('a1'),('a2');
# No copy: No modification
ALTER TABLE t1 MODIFY COLUMN a ENUM('a1','a2');
affected rows: 0
info: Records: 0 Duplicates: 0 Warnings: 0
# No copy: Add new enumeration to the end
ALTER TABLE t1 MODIFY COLUMN a ENUM('a1','a2','a3');
affected rows: 0
info: Records: 0 Duplicates: 0 Warnings: 0
# Copy: Modify and add new to the end
ALTER TABLE t1 MODIFY COLUMN a ENUM('a1','a2','xx','a5');
affected rows: 2
info: Records: 2 Duplicates: 0 Warnings: 0
# Copy: Remove from the end
ALTER TABLE t1 MODIFY COLUMN a ENUM('a1','a2','xx');
affected rows: 2
info: Records: 2 Duplicates: 0 Warnings: 0
# Copy: Add new enumeration
ALTER TABLE t1 MODIFY COLUMN a ENUM('a1','a2','a0','xx');
affected rows: 2
info: Records: 2 Duplicates: 0 Warnings: 0
# No copy: Add new enumerations to the end
ALTER TABLE t1 MODIFY COLUMN a ENUM('a1','a2','a0','xx','a5','a6');
affected rows: 0
info: Records: 0 Duplicates: 0 Warnings: 0
DROP TABLE t1;
CREATE TABLE t1 (a SET('a1','a2'));
INSERT INTO t1 VALUES ('a1'),('a2');
# No copy: No modification
ALTER TABLE t1 MODIFY COLUMN a SET('a1','a2');
affected rows: 0
info: Records: 0 Duplicates: 0 Warnings: 0
# No copy: Add new to the end
ALTER TABLE t1 MODIFY COLUMN a SET('a1','a2','a3');
affected rows: 0
info: Records: 0 Duplicates: 0 Warnings: 0
# Copy: Modify and add new to the end
ALTER TABLE t1 MODIFY COLUMN a SET('a1','a2','xx','a5');
affected rows: 2
info: Records: 2 Duplicates: 0 Warnings: 0
# Copy: Remove from the end
ALTER TABLE t1 MODIFY COLUMN a SET('a1','a2','xx');
affected rows: 2
info: Records: 2 Duplicates: 0 Warnings: 0
# Copy: Add new member
ALTER TABLE t1 MODIFY COLUMN a SET('a1','a2','a0','xx');
affected rows: 2
info: Records: 2 Duplicates: 0 Warnings: 0
# No copy: Add new to the end
ALTER TABLE t1 MODIFY COLUMN a SET('a1','a2','a0','xx','a5','a6');
affected rows: 0
info: Records: 0 Duplicates: 0 Warnings: 0
# Copy: Numerical incrase (pack lenght)
ALTER TABLE t1 MODIFY COLUMN a SET('a1','a2','a0','xx','a5','a6','a7','a8','a9','a10');
affected rows: 2
info: Records: 2 Duplicates: 0 Warnings: 0
DROP TABLE t1;
End of 5.1 tests

View file

@ -0,0 +1,43 @@
#
# Bug#46760: Fast ALTER TABLE no longer works for InnoDB
#
CREATE TABLE t1 (a INT) ENGINE=InnoDB;
INSERT INTO t1 VALUES (1);
# By using --enable_info and verifying that number of affected
# rows is 0 we check that this ALTER TABLE is really carried
# out as "fast/online" operation, i.e. without full-blown data
# copying.
#
# I.e. info for the below statement should normally look like:
#
# affected rows: 0
# info: Records: 0 Duplicates: 0 Warnings: 0
ALTER TABLE t1 ALTER COLUMN a SET DEFAULT 10;
affected rows: 0
info: Records: 0 Duplicates: 0 Warnings: 0
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT '10'
) ENGINE=InnoDB DEFAULT CHARSET=latin1
DROP TABLE t1;
#
# MySQL Bug#39200: optimize table does not recognize
# ROW_FORMAT=COMPRESSED
#
CREATE TABLE t1 (a INT) ROW_FORMAT=compressed;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 ROW_FORMAT=COMPRESSED
OPTIMIZE TABLE t1;
Table Op Msg_type Msg_text
test.t1 optimize status Table is already up to date
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 ROW_FORMAT=COMPRESSED
DROP TABLE t1;
End of 5.1 tests

Binary file not shown.

View file

@ -0,0 +1,277 @@
SET DEBUG_SYNC= 'RESET';
DROP TABLE IF EXISTS t1;
SHOW VARIABLES LIKE 'DEBUG_SYNC';
Variable_name Value
debug_sync ON - current signal: ''
SET DEBUG_SYNC='p0 SIGNAL s1 WAIT_FOR s2 TIMEOUT 6 EXECUTE 2 HIT_LIMIT 3';
SET DEBUG_SYNC='p0 SIGNAL s1 WAIT_FOR s2 TIMEOUT 6 EXECUTE 2';
SET DEBUG_SYNC='p0 SIGNAL s1 WAIT_FOR s2 TIMEOUT 6 HIT_LIMIT 3';
SET DEBUG_SYNC='p0 SIGNAL s1 WAIT_FOR s2 TIMEOUT 6';
SET DEBUG_SYNC='p0 SIGNAL s1 WAIT_FOR s2 EXECUTE 2 HIT_LIMIT 3';
SET DEBUG_SYNC='p0 SIGNAL s1 WAIT_FOR s2 EXECUTE 2';
SET DEBUG_SYNC='p0 SIGNAL s1 WAIT_FOR s2 HIT_LIMIT 3';
SET DEBUG_SYNC='p0 SIGNAL s1 WAIT_FOR s2';
SET DEBUG_SYNC='p0 SIGNAL s1 EXECUTE 2 HIT_LIMIT 3';
SET DEBUG_SYNC='p0 SIGNAL s1 EXECUTE 2';
SET DEBUG_SYNC='p0 SIGNAL s1 HIT_LIMIT 3';
SET DEBUG_SYNC='p0 SIGNAL s1';
SET DEBUG_SYNC='p0 WAIT_FOR s2 TIMEOUT 6 EXECUTE 2 HIT_LIMIT 3';
SET DEBUG_SYNC='p0 WAIT_FOR s2 TIMEOUT 6 EXECUTE 2';
SET DEBUG_SYNC='p0 WAIT_FOR s2 TIMEOUT 6 HIT_LIMIT 3';
SET DEBUG_SYNC='p0 WAIT_FOR s2 TIMEOUT 6';
SET DEBUG_SYNC='p0 WAIT_FOR s2 EXECUTE 2 HIT_LIMIT 3';
SET DEBUG_SYNC='p0 WAIT_FOR s2 EXECUTE 2';
SET DEBUG_SYNC='p0 WAIT_FOR s2 HIT_LIMIT 3';
SET DEBUG_SYNC='p0 WAIT_FOR s2';
SET DEBUG_SYNC='p0 HIT_LIMIT 3';
SET DEBUG_SYNC='p0 CLEAR';
SET DEBUG_SYNC='p0 TEST';
SET DEBUG_SYNC='RESET';
set debug_sync='p0 signal s1 wait_for s2 timeout 6 execute 2 hit_limit 3';
set debug_sync='p0 signal s1 wait_for s2 timeout 6 execute 2';
set debug_sync='p0 signal s1 wait_for s2 timeout 6 hit_limit 3';
set debug_sync='p0 signal s1 wait_for s2 timeout 6';
set debug_sync='p0 signal s1 wait_for s2 execute 2 hit_limit 3';
set debug_sync='p0 signal s1 wait_for s2 execute 2';
set debug_sync='p0 signal s1 wait_for s2 hit_limit 3';
set debug_sync='p0 signal s1 wait_for s2';
set debug_sync='p0 signal s1 execute 2 hit_limit 3';
set debug_sync='p0 signal s1 execute 2';
set debug_sync='p0 signal s1 hit_limit 3';
set debug_sync='p0 signal s1';
set debug_sync='p0 wait_for s2 timeout 6 execute 2 hit_limit 3';
set debug_sync='p0 wait_for s2 timeout 6 execute 2';
set debug_sync='p0 wait_for s2 timeout 6 hit_limit 3';
set debug_sync='p0 wait_for s2 timeout 6';
set debug_sync='p0 wait_for s2 execute 2 hit_limit 3';
set debug_sync='p0 wait_for s2 execute 2';
set debug_sync='p0 wait_for s2 hit_limit 3';
set debug_sync='p0 wait_for s2';
set debug_sync='p0 hit_limit 3';
set debug_sync='p0 clear';
set debug_sync='p0 test';
set debug_sync='reset';
SET DEBUG_SYNC='p0 SIGNAL s1 WAIT_FOR s2 TIMEOUT 6
EXECUTE 2 HIT_LIMIT 3';
SET DEBUG_SYNC=' p0 SIGNAL s1 WAIT_FOR s2';
SET DEBUG_SYNC='p0 SIGNAL s1 WAIT_FOR s2';
SET DEBUG_SYNC='p0 SIGNAL s1 WAIT_FOR s2 ';
SET DEBUG_SYNC=' p0 SIGNAL s1 WAIT_FOR s2 ';
SET DEBUG_SYNC=' p0 SIGNAL s1 WAIT_FOR s2 ';
SET DEBUG_SYNC='';
ERROR 42000: Missing synchronization point name
SET DEBUG_SYNC=' ';
ERROR 42000: Missing synchronization point name
SET DEBUG_SYNC='p0';
ERROR 42000: Missing action after synchronization point name 'p0'
SET DEBUG_SYNC='p0 EXECUTE 2';
ERROR 42000: Missing action before EXECUTE
SET DEBUG_SYNC='p0 TIMEOUT 6 EXECUTE 2';
ERROR 42000: Illegal or out of order stuff: 'TIMEOUT'
SET DEBUG_SYNC='p0 TIMEOUT 6';
ERROR 42000: Illegal or out of order stuff: 'TIMEOUT'
SET DEBUG_SYNC='p0 WAIT_FOR s2 SIGNAL s1';
ERROR 42000: Illegal or out of order stuff: 'SIGNAL'
SET DEBUG_SYNC='p0 WAIT_FOR s2 SIGNAL s1 EXECUTE 2';
ERROR 42000: Illegal or out of order stuff: 'SIGNAL'
SET DEBUG_SYNC='p0 WAIT_FOR s2 SIGNAL s1 TIMEOUT 6 EXECUTE 2';
ERROR 42000: Illegal or out of order stuff: 'SIGNAL'
SET DEBUG_SYNC='p0 WAIT_FOR s2 SIGNAL s1 TIMEOUT 6';
ERROR 42000: Illegal or out of order stuff: 'SIGNAL'
SET DEBUG_SYNC='p0 WAIT_FOR s2 TIMEOUT 6 SIGNAL s1 EXECUTE 2';
ERROR 42000: Illegal or out of order stuff: 'SIGNAL'
SET DEBUG_SYNC='p0 WAIT_FOR s2 TIMEOUT 6 SIGNAL s1';
ERROR 42000: Illegal or out of order stuff: 'SIGNAL'
SET DEBUG_SYNC='p0 TIMEOUT 6 WAIT_FOR s2 EXECUTE 2';
ERROR 42000: Illegal or out of order stuff: 'TIMEOUT'
SET DEBUG_SYNC='p0 TIMEOUT 6 WAIT_FOR s2';
ERROR 42000: Illegal or out of order stuff: 'TIMEOUT'
SET DEBUG_SYNC='p0 SIGNAL s1 TIMEOUT 6 EXECUTE 2';
ERROR 42000: Illegal or out of order stuff: 'TIMEOUT'
SET DEBUG_SYNC='p0 SIGNAL s1 TIMEOUT 6';
ERROR 42000: Illegal or out of order stuff: 'TIMEOUT'
SET DEBUG_SYNC='p0 EXECUTE 2 SIGNAL s1 TIMEOUT 6';
ERROR 42000: Missing action before EXECUTE
SET DEBUG_SYNC='p0 TIMEOUT 6 SIGNAL s1';
ERROR 42000: Illegal or out of order stuff: 'TIMEOUT'
SET DEBUG_SYNC='p0 EXECUTE 2 TIMEOUT 6 SIGNAL s1';
ERROR 42000: Missing action before EXECUTE
SET DEBUG_SYNC='p0 CLEAR HIT_LIMIT 3';
ERROR 42000: Nothing must follow action CLEAR
SET DEBUG_SYNC='CLEAR';
ERROR 42000: Missing action after synchronization point name 'CLEAR'
SET DEBUG_SYNC='p0 CLEAR p0';
ERROR 42000: Nothing must follow action CLEAR
SET DEBUG_SYNC='TEST';
ERROR 42000: Missing action after synchronization point name 'TEST'
SET DEBUG_SYNC='p0 TEST p0';
ERROR 42000: Nothing must follow action TEST
SET DEBUG_SYNC='p0 RESET';
ERROR 42000: Illegal or out of order stuff: 'RESET'
SET DEBUG_SYNC='RESET p0';
ERROR 42000: Illegal or out of order stuff: 'p0'
SET DEBUG_SYNC='p0 RESET p0';
ERROR 42000: Illegal or out of order stuff: 'RESET'
SET DEBUG_SYNC='p0 SIGNAL ';
ERROR 42000: Missing signal name after action SIGNAL
SET DEBUG_SYNC='p0 WAIT_FOR ';
ERROR 42000: Missing signal name after action WAIT_FOR
SET DEBUG_SYNC='p0 SIGNAL s1 EXECUTE ';
ERROR 42000: Missing valid number after EXECUTE
SET DEBUG_SYNCx='p0 SIGNAL s1 WAIT_FOR s2 TIMEOUT 6 EXECUTE 2 HIT_LIMIT 3';
ERROR HY000: Unknown system variable 'DEBUG_SYNCx'
SET DEBUG_SYNC='p0 SIGNAx s1 WAIT_FOR s2 TIMEOUT 6 EXECUTE 2 HIT_LIMIT 3';
ERROR 42000: Illegal or out of order stuff: 'SIGNAx'
SET DEBUG_SYNC='p0 SIGNAL s1 WAIT_FOx s2 TIMEOUT 6 EXECUTE 2 HIT_LIMIT 3';
ERROR 42000: Illegal or out of order stuff: 'WAIT_FOx'
SET DEBUG_SYNC='p0 SIGNAL s1 WAIT_FOR s2 TIMEOUx 0 EXECUTE 2 HIT_LIMIT 3';
ERROR 42000: Illegal or out of order stuff: 'TIMEOUx'
SET DEBUG_SYNC='p0 SIGNAL s1 WAIT_FOR s2 TIMEOUT 6 EXECUTx 2 HIT_LIMIT 3';
ERROR 42000: Illegal or out of order stuff: 'EXECUTx'
SET DEBUG_SYNC='p0 SIGNAL s1 WAIT_FOR s2 TIMEOUT 6 EXECUTE 2 HIT_LIMIx 3';
ERROR 42000: Illegal or out of order stuff: 'HIT_LIMIx'
SET DEBUG_SYNC='p0 CLEARx';
ERROR 42000: Illegal or out of order stuff: 'CLEARx'
SET DEBUG_SYNC='p0 TESTx';
ERROR 42000: Illegal or out of order stuff: 'TESTx'
SET DEBUG_SYNC='RESETx';
ERROR 42000: Missing action after synchronization point name 'RESETx'
SET DEBUG_SYNC='p0 WAIT_FOR s2 TIMEOUT 0x6 EXECUTE 2 HIT_LIMIT 3';
ERROR 42000: Missing valid number after TIMEOUT
SET DEBUG_SYNC='p0 WAIT_FOR s2 TIMEOUT 6 EXECUTE 0x2 HIT_LIMIT 3';
ERROR 42000: Missing valid number after EXECUTE
SET DEBUG_SYNC='p0 WAIT_FOR s2 TIMEOUT 7 EXECUTE 2 HIT_LIMIT 0x3';
ERROR 42000: Missing valid number after HIT_LIMIT
SET DEBUG_SYNC= 7;
ERROR 42000: Incorrect argument type to variable 'debug_sync'
SET GLOBAL DEBUG_SYNC= 'p0 CLEAR';
ERROR HY000: Variable 'debug_sync' is a SESSION variable and can't be used with SET GLOBAL
SET @myvar= 'now SIGNAL from_myvar';
SET DEBUG_SYNC= @myvar;
SHOW VARIABLES LIKE 'DEBUG_SYNC';
Variable_name Value
debug_sync ON - current signal: 'from_myvar'
SET DEBUG_SYNC= LEFT('now SIGNAL from_function_cut_here', 24);
SHOW VARIABLES LIKE 'DEBUG_SYNC';
Variable_name Value
debug_sync ON - current signal: 'from_function'
SET DEBUG_SYNC= 'now SIGNAL something';
SHOW VARIABLES LIKE 'DEBUG_SYNC';
Variable_name Value
debug_sync ON - current signal: 'something'
SET DEBUG_SYNC= 'now WAIT_FOR nothing TIMEOUT 0';
Warnings:
Warning #### debug sync point wait timed out
SET DEBUG_SYNC= 'now SIGNAL nothing';
SHOW VARIABLES LIKE 'DEBUG_SYNC';
Variable_name Value
debug_sync ON - current signal: 'nothing'
SET DEBUG_SYNC= 'now WAIT_FOR nothing TIMEOUT 0';
SET DEBUG_SYNC= 'now SIGNAL something EXECUTE 0';
SHOW VARIABLES LIKE 'DEBUG_SYNC';
Variable_name Value
debug_sync ON - current signal: 'nothing'
SET DEBUG_SYNC= 'now WAIT_FOR anotherthing TIMEOUT 0 EXECUTE 0';
SET DEBUG_SYNC= 'now HIT_LIMIT 1';
ERROR HY000: debug sync point hit limit reached
SET DEBUG_SYNC= 'RESET';
SHOW VARIABLES LIKE 'DEBUG_SYNC';
Variable_name Value
debug_sync ON - current signal: ''
SET DEBUG_SYNC= 'p1abcd SIGNAL s1 EXECUTE 2';
SET DEBUG_SYNC= 'p2abc SIGNAL s2 EXECUTE 2';
SET DEBUG_SYNC= 'p9abcdef SIGNAL s9 EXECUTE 2';
SET DEBUG_SYNC= 'p4a SIGNAL s4 EXECUTE 2';
SET DEBUG_SYNC= 'p5abcde SIGNAL s5 EXECUTE 2';
SET DEBUG_SYNC= 'p6ab SIGNAL s6 EXECUTE 2';
SET DEBUG_SYNC= 'p7 SIGNAL s7 EXECUTE 2';
SET DEBUG_SYNC= 'p8abcdef SIGNAL s8 EXECUTE 2';
SET DEBUG_SYNC= 'p3abcdef SIGNAL s3 EXECUTE 2';
SET DEBUG_SYNC= 'p4a TEST';
SHOW VARIABLES LIKE 'DEBUG_SYNC';
Variable_name Value
debug_sync ON - current signal: 's4'
SET DEBUG_SYNC= 'p1abcd TEST';
SHOW VARIABLES LIKE 'DEBUG_SYNC';
Variable_name Value
debug_sync ON - current signal: 's1'
SET DEBUG_SYNC= 'p7 TEST';
SHOW VARIABLES LIKE 'DEBUG_SYNC';
Variable_name Value
debug_sync ON - current signal: 's7'
SET DEBUG_SYNC= 'p9abcdef TEST';
SHOW VARIABLES LIKE 'DEBUG_SYNC';
Variable_name Value
debug_sync ON - current signal: 's9'
SET DEBUG_SYNC= 'p3abcdef TEST';
SHOW VARIABLES LIKE 'DEBUG_SYNC';
Variable_name Value
debug_sync ON - current signal: 's3'
SET DEBUG_SYNC= 'p1abcd CLEAR';
SET DEBUG_SYNC= 'p2abc CLEAR';
SET DEBUG_SYNC= 'p5abcde CLEAR';
SET DEBUG_SYNC= 'p6ab CLEAR';
SET DEBUG_SYNC= 'p8abcdef CLEAR';
SET DEBUG_SYNC= 'p9abcdef CLEAR';
SET DEBUG_SYNC= 'p3abcdef CLEAR';
SET DEBUG_SYNC= 'p4a CLEAR';
SET DEBUG_SYNC= 'p7 CLEAR';
SET DEBUG_SYNC= 'p1abcd TEST';
SHOW VARIABLES LIKE 'DEBUG_SYNC';
Variable_name Value
debug_sync ON - current signal: 's3'
SET DEBUG_SYNC= 'p7 TEST';
SHOW VARIABLES LIKE 'DEBUG_SYNC';
Variable_name Value
debug_sync ON - current signal: 's3'
SET DEBUG_SYNC= 'p9abcdef TEST';
SHOW VARIABLES LIKE 'DEBUG_SYNC';
Variable_name Value
debug_sync ON - current signal: 's3'
SET DEBUG_SYNC= 'RESET';
SHOW VARIABLES LIKE 'DEBUG_SYNC';
Variable_name Value
debug_sync ON - current signal: ''
CREATE USER mysqltest_1@localhost;
GRANT SUPER ON *.* TO mysqltest_1@localhost;
connection con1, mysqltest_1
SET DEBUG_SYNC= 'RESET';
connection default
DROP USER mysqltest_1@localhost;
CREATE USER mysqltest_2@localhost;
GRANT ALL ON *.* TO mysqltest_2@localhost;
REVOKE SUPER ON *.* FROM mysqltest_2@localhost;
connection con1, mysqltest_2
SET DEBUG_SYNC= 'RESET';
ERROR 42000: Access denied; you need the SUPER privilege for this operation
connection default
DROP USER mysqltest_2@localhost;
SET DEBUG_SYNC= 'RESET';
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (c1 INT);
connection con1
SET DEBUG_SYNC= 'before_lock_tables_takes_lock
SIGNAL opened WAIT_FOR flushed';
INSERT INTO t1 VALUES(1);
connection default
SET DEBUG_SYNC= 'now WAIT_FOR opened';
SET DEBUG_SYNC= 'after_flush_unlock SIGNAL flushed';
FLUSH TABLE t1;
connection con1
connection default
DROP TABLE t1;
SET DEBUG_SYNC= 'RESET';
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (c1 INT);
LOCK TABLE t1 WRITE;
connection con1
SET DEBUG_SYNC= 'wait_for_lock SIGNAL locked EXECUTE 2';
INSERT INTO t1 VALUES (1);
connection default
SET DEBUG_SYNC= 'now WAIT_FOR locked';
UNLOCK TABLES;
connection con1
retrieve INSERT result.
connection default
DROP TABLE t1;
SET DEBUG_SYNC= 'RESET';

View file

@ -279,3 +279,48 @@ ERROR 42000: Incorrect number of arguments for FUNCTION test.f1; expected 0, got
DROP TABLE t1;
DROP FUNCTION f1;
End of 5.0 tests
#
# Bug#46958: Assertion in Diagnostics_area::set_ok_status, trigger,
# merge table
#
CREATE TABLE t1 ( a INT );
CREATE TABLE t2 ( a INT );
CREATE TABLE t3 ( a INT );
INSERT INTO t1 VALUES (1), (2);
INSERT INTO t2 VALUES (1), (2);
INSERT INTO t3 VALUES (1), (2);
CREATE TRIGGER tr1 BEFORE DELETE ON t2
FOR EACH ROW INSERT INTO no_such_table VALUES (1);
DELETE t1, t2, t3 FROM t1, t2, t3;
ERROR 42S02: Table 'test.no_such_table' doesn't exist
SELECT * FROM t1;
a
SELECT * FROM t2;
a
1
2
SELECT * FROM t3;
a
1
2
DROP TABLE t1, t2, t3;
CREATE TABLE t1 ( a INT );
CREATE TABLE t2 ( a INT );
CREATE TABLE t3 ( a INT );
INSERT INTO t1 VALUES (1), (2);
INSERT INTO t2 VALUES (1), (2);
INSERT INTO t3 VALUES (1), (2);
CREATE TRIGGER tr1 AFTER DELETE ON t2
FOR EACH ROW INSERT INTO no_such_table VALUES (1);
DELETE t1, t2, t3 FROM t1, t2, t3;
ERROR 42S02: Table 'test.no_such_table' doesn't exist
SELECT * FROM t1;
a
SELECT * FROM t2;
a
2
SELECT * FROM t3;
a
1
2
DROP TABLE t1, t2, t3;

View file

@ -1477,3 +1477,47 @@ COUNT(*)
SET SQL_MODE=default;
DROP TABLE t1;
End of 5.0 tests
#
# BUG#47280 - strange results from count(*) with order by multiple
# columns without where/group
#
#
# Initialize test
#
CREATE TABLE t1 (
pk INT NOT NULL,
i INT,
PRIMARY KEY (pk)
);
INSERT INTO t1 VALUES (1,11),(2,12),(3,13);
#
# Start test
# All the following queries shall return 1 record
#
# Masking all correct values {11...13} for column i in this result.
SELECT MAX(pk) as max, i
FROM t1
ORDER BY max;
max i
3 #
EXPLAIN
SELECT MAX(pk) as max, i
FROM t1
ORDER BY max;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 3 Using temporary
# Only 11 is correct for collumn i in this result
SELECT MAX(pk) as max, i
FROM t1
WHERE pk<2
ORDER BY max;
max i
1 11
#
# Cleanup
#
DROP TABLE t1;
End of 5.1 tests

View file

@ -608,4 +608,146 @@ SELECT SUM( DISTINCT e ) FROM t1 GROUP BY b,c,d HAVING (b,c,d) IN
((AVG( 1 ), 1 + c, 1 + d), (AVG( 1 ), 2 + c, 2 + d));
SUM( DISTINCT e )
DROP TABLE t1;
#
# Bug #44139: Table scan when NULL appears in IN clause
#
CREATE TABLE t1 (
c_int INT NOT NULL,
c_decimal DECIMAL(5,2) NOT NULL,
c_float FLOAT(5, 2) NOT NULL,
c_bit BIT(10) NOT NULL,
c_date DATE NOT NULL,
c_datetime DATETIME NOT NULL,
c_timestamp TIMESTAMP NOT NULL,
c_time TIME NOT NULL,
c_year YEAR NOT NULL,
c_char CHAR(10) NOT NULL,
INDEX(c_int), INDEX(c_decimal), INDEX(c_float), INDEX(c_bit), INDEX(c_date),
INDEX(c_datetime), INDEX(c_timestamp), INDEX(c_time), INDEX(c_year),
INDEX(c_char));
INSERT INTO t1 (c_int) VALUES (1), (2), (3), (4), (5);
INSERT INTO t1 (c_int) SELECT 0 FROM t1;
INSERT INTO t1 (c_int) SELECT 0 FROM t1;
EXPLAIN SELECT * FROM t1 WHERE c_int IN (1, 2, 3);
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 range c_int c_int 4 NULL 3 Using where
EXPLAIN SELECT * FROM t1 WHERE c_int IN (NULL, 1, 2, 3);
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 range c_int c_int 4 NULL 3 Using where
EXPLAIN SELECT * FROM t1 WHERE c_int IN (1, 2, 3);
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 range c_int c_int 4 NULL 3 Using where
EXPLAIN SELECT * FROM t1 WHERE c_int IN (1, NULL, 2, NULL, 3, NULL);
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 range c_int c_int 4 NULL 3 Using where
EXPLAIN SELECT * FROM t1 WHERE c_int IN (NULL);
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
EXPLAIN SELECT * FROM t1 WHERE c_int IN (NULL, NULL);
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
EXPLAIN SELECT * FROM t1 WHERE c_decimal IN (1, 2, 3);
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 range c_decimal c_decimal 3 NULL 3 Using where
EXPLAIN SELECT * FROM t1 WHERE c_decimal IN (NULL, 1, 2, 3);
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 range c_decimal c_decimal 3 NULL 3 Using where
EXPLAIN SELECT * FROM t1 WHERE c_decimal IN (NULL);
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
EXPLAIN SELECT * FROM t1 WHERE c_decimal IN (NULL, NULL);
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
EXPLAIN SELECT * FROM t1 WHERE c_float IN (1, 2, 3);
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 range c_float c_float 4 NULL 3 Using where
EXPLAIN SELECT * FROM t1 WHERE c_float IN (NULL, 1, 2, 3);
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 range c_float c_float 4 NULL 3 Using where
EXPLAIN SELECT * FROM t1 WHERE c_float IN (NULL);
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
EXPLAIN SELECT * FROM t1 WHERE c_float IN (NULL, NULL);
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
EXPLAIN SELECT * FROM t1 WHERE c_bit IN (1, 2, 3);
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 range c_bit c_bit 2 NULL 3 Using where
EXPLAIN SELECT * FROM t1 WHERE c_bit IN (NULL, 1, 2, 3);
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 range c_bit c_bit 2 NULL 3 Using where
EXPLAIN SELECT * FROM t1 WHERE c_bit IN (NULL);
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
EXPLAIN SELECT * FROM t1 WHERE c_bit IN (NULL, NULL);
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
EXPLAIN SELECT * FROM t1 WHERE c_date
IN ('2009-09-01', '2009-09-02', '2009-09-03');
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 range c_date c_date 3 NULL 3 Using where
EXPLAIN SELECT * FROM t1 WHERE c_date
IN (NULL, '2009-09-01', '2009-09-02', '2009-09-03');
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 range c_date c_date 3 NULL 3 Using where
EXPLAIN SELECT * FROM t1 WHERE c_date IN (NULL);
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
EXPLAIN SELECT * FROM t1 WHERE c_date IN (NULL, NULL);
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
EXPLAIN SELECT * FROM t1 WHERE c_datetime
IN ('2009-09-01 00:00:01', '2009-09-02 00:00:01', '2009-09-03 00:00:01');
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 range c_datetime c_datetime 8 NULL 3 Using where
EXPLAIN SELECT * FROM t1 WHERE c_datetime
IN (NULL, '2009-09-01 00:00:01', '2009-09-02 00:00:01', '2009-09-03 00:00:01');
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 range c_datetime c_datetime 8 NULL 3 Using where
EXPLAIN SELECT * FROM t1 WHERE c_datetime IN (NULL);
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
EXPLAIN SELECT * FROM t1 WHERE c_datetime IN (NULL, NULL);
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
EXPLAIN SELECT * FROM t1 WHERE c_timestamp
IN ('2009-09-01 00:00:01', '2009-09-01 00:00:02', '2009-09-01 00:00:03');
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 range c_timestamp c_timestamp 4 NULL 3 Using where
EXPLAIN SELECT * FROM t1 WHERE c_timestamp
IN (NULL, '2009-09-01 00:00:01', '2009-09-01 00:00:02', '2009-09-01 00:00:03');
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 range c_timestamp c_timestamp 4 NULL 3 Using where
EXPLAIN SELECT * FROM t1 WHERE c_timestamp IN (NULL);
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
EXPLAIN SELECT * FROM t1 WHERE c_timestamp IN (NULL, NULL);
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
EXPLAIN SELECT * FROM t1 WHERE c_year IN (1, 2, 3);
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 range c_year c_year 1 NULL 3 Using where
EXPLAIN SELECT * FROM t1 WHERE c_year IN (NULL, 1, 2, 3);
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 range c_year c_year 1 NULL 3 Using where
EXPLAIN SELECT * FROM t1 WHERE c_year IN (NULL);
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
EXPLAIN SELECT * FROM t1 WHERE c_year IN (NULL, NULL);
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
EXPLAIN SELECT * FROM t1 WHERE c_char IN ('1', '2', '3');
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 range c_char c_char 10 NULL 3 Using where
EXPLAIN SELECT * FROM t1 WHERE c_char IN (NULL, '1', '2', '3');
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 range c_char c_char 10 NULL 3 Using where
EXPLAIN SELECT * FROM t1 WHERE c_char IN (NULL);
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
EXPLAIN SELECT * FROM t1 WHERE c_char IN (NULL, NULL);
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
DROP TABLE t1;
#
End of 5.1 tests

View file

@ -2566,7 +2566,7 @@ SELECT format(12345678901234567890.123, 3, NULL);
format(12345678901234567890.123, 3, NULL)
12,345,678,901,234,567,890.123
Warnings:
Warning 1647 Unknown locale: 'NULL'
Warning 1649 Unknown locale: 'NULL'
SELECT format(12345678901234567890.123, 3, 'ar_AE');
format(12345678901234567890.123, 3, 'ar_AE')
12,345,678,901,234,567,890.123
@ -2686,5 +2686,5 @@ SELECT format(123, 1, 'Non-existent-locale');
format(123, 1, 'Non-existent-locale')
123.0
Warnings:
Warning 1647 Unknown locale: 'Non-existent-locale'
Warning 1649 Unknown locale: 'Non-existent-locale'
End of 5.4 tests

View file

@ -876,10 +876,10 @@ id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 range NULL idx_t1_1 163 NULL 17 Using where; Using index for group-by
explain select a1,a2,b, max(c) from t1 where (c > 'b1') or (c <= 'g1') group by a1,a2,b;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 range NULL idx_t1_1 147 NULL 17 Using where; Using index for group-by
1 SIMPLE t1 range NULL idx_t1_1 163 NULL 17 Using where; Using index for group-by
explain select a1,a2,b,min(c),max(c) from t1 where (c > 'b1') or (c <= 'g1') group by a1,a2,b;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 range NULL idx_t1_1 147 NULL 17 Using where; Using index for group-by
1 SIMPLE t1 range NULL idx_t1_1 163 NULL 17 Using where; Using index for group-by
explain select a1,a2,b,min(c),max(c) from t1 where (c > 'b111') and (c <= 'g112') group by a1,a2,b;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 range NULL idx_t1_1 163 NULL 17 Using where; Using index for group-by
@ -924,7 +924,7 @@ id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t2 range NULL idx_t2_1 163 NULL # Using where; Using index for group-by
explain select a1,a2,b, max(c) from t2 where (c > 'b1') or (c <= 'g1') group by a1,a2,b;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t2 range NULL idx_t2_1 146 NULL # Using where; Using index for group-by
1 SIMPLE t2 range NULL idx_t2_1 163 NULL # Using where; Using index for group-by
explain select a1,a2,b,min(c),max(c) from t2 where (c > 'b1') or (c <= 'g1') group by a1,a2,b;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t2 range NULL idx_t2_1 163 NULL # Using where; Using index for group-by

View file

@ -0,0 +1,2 @@
debug_sync
1

View file

@ -139,7 +139,7 @@ show create view testdb_1.v7;
View Create View character_set_client collation_connection
v7 CREATE ALGORITHM=UNDEFINED DEFINER=`no_such_user`@`no_such_host` SQL SECURITY DEFINER VIEW `v7` AS select `testdb_1`.`t2`.`f1` AS `f1` from `t2` latin1 latin1_swedish_ci
Warnings:
Warning 1356 View 'testdb_1.v7' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
Note 1449 The user specified as a definer ('no_such_user'@'no_such_host') does not exist
show fields from testdb_1.v7;
Field Type Null Key Default Extra
f1 char(4) YES NULL
@ -169,7 +169,7 @@ show create view testdb_1.v7;
View Create View character_set_client collation_connection
v7 CREATE ALGORITHM=UNDEFINED DEFINER=`no_such_user`@`no_such_host` SQL SECURITY DEFINER VIEW `v7` AS select `testdb_1`.`t2`.`f1` AS `f1` from `t2` latin1 latin1_swedish_ci
Warnings:
Warning 1356 View 'testdb_1.v7' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
Note 1449 The user specified as a definer ('no_such_user'@'no_such_host') does not exist
revoke insert(f1) on v3 from testdb_2@localhost;
revoke show view on v5 from testdb_2@localhost;
use testdb_1;
@ -187,7 +187,8 @@ ERROR 42000: SELECT command denied to user 'testdb_2'@'localhost' for table 'v7'
show create view testdb_1.v7;
ERROR 42000: SELECT command denied to user 'testdb_2'@'localhost' for table 'v7'
show create view v4;
ERROR HY000: EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
View Create View character_set_client collation_connection
v4 CREATE ALGORITHM=UNDEFINED DEFINER=`testdb_2`@`localhost` SQL SECURITY DEFINER VIEW `v4` AS select `v3`.`f1` AS `f1`,`v3`.`f2` AS `f2` from `testdb_1`.`v3` latin1 latin1_swedish_ci
show fields from v4;
Field Type Null Key Default Extra
f1 char(4) YES NULL

View file

@ -0,0 +1,35 @@
drop table if exists t1;
set session transaction isolation level read committed;
create table t1(a int not null) engine=innodb DEFAULT CHARSET=latin1;
create table t2 like t1;
insert into t2 values (1),(2),(3),(4),(5),(6),(7);
set autocommit=0;
begin;
replace into t1 select * from t2;
set session transaction isolation level read committed;
set autocommit=0;
delete from t2 where a=5;
commit;
delete from t2;
commit;
commit;
begin;
insert into t1 select * from t2;
set session transaction isolation level read committed;
set autocommit=0;
delete from t2 where a=5;
commit;
delete from t2;
commit;
commit;
select * from t1;
a
1
2
3
4
5
6
7
drop table t1;
drop table t2;

View file

@ -6,4 +6,5 @@ SELECT f4, f8 FROM bug34300;
f4 f8
xxx zzz
DROP TABLE bug34300;
SET @@global.max_allowed_packet=1048576;
SET @@global.max_allowed_packet=default;

View file

@ -0,0 +1,14 @@
create table bug44369 (DB_ROW_ID int) engine=innodb;
ERROR HY000: Can't create table 'test.bug44369' (errno: -1)
create table bug44369 (db_row_id int) engine=innodb;
ERROR HY000: Can't create table 'test.bug44369' (errno: -1)
show warnings;
Level Code Message
Warning 1005 Error creating table 'test/bug44369' with column name 'db_row_id'. 'db_row_id' is a reserved name. Please try to re-create the table with a different column name.
Error 1005 Can't create table 'test.bug44369' (errno: -1)
create table bug44369 (db_TRX_Id int) engine=innodb;
ERROR HY000: Can't create table 'test.bug44369' (errno: -1)
show warnings;
Level Code Message
Warning 1005 Error creating table 'test/bug44369' with column name 'db_TRX_Id'. 'db_TRX_Id' is a reserved name. Please try to re-create the table with a different column name.
Error 1005 Can't create table 'test.bug44369' (errno: -1)

View file

@ -0,0 +1,9 @@
CREATE TABLE bug44571 (foo INT) ENGINE=InnoDB;
ALTER TABLE bug44571 CHANGE foo bar INT;
ALTER TABLE bug44571 ADD INDEX bug44571b (foo);
ERROR 42000: Key column 'foo' doesn't exist in table
ALTER TABLE bug44571 ADD INDEX bug44571b (bar);
ERROR HY000: Incorrect key file for table 'bug44571'; try to repair it
CREATE INDEX bug44571b ON bug44571 (bar);
ERROR HY000: Incorrect key file for table 'bug44571'; try to repair it
DROP TABLE bug44571;

View file

@ -0,0 +1,17 @@
create table bug46000(`id` int,key `GEN_CLUST_INDEX`(`id`))engine=innodb;
ERROR HY000: Can't create table 'test.bug46000' (errno: -1)
create table bug46000(`id` int, key `GEN_clust_INDEX`(`id`))engine=innodb;
ERROR HY000: Can't create table 'test.bug46000' (errno: -1)
show errors;
Level Code Message
Error 1005 Cannot Create Index with name 'GEN_CLUST_INDEX'. The name is reserved for the system default primary index.
Error 1005 Can't create table 'test.bug46000' (errno: -1)
create table bug46000(id int) engine=innodb;
create index GEN_CLUST_INDEX on bug46000(id);
ERROR HY000: Can't create table '#sql-temporary' (errno: -1)
show errors;
Level Code Message
Error 1005 Cannot Create Index with name 'GEN_CLUST_INDEX'. The name is reserved for the system default primary index.
Error 1005 Can't create table '#sql-temporary' (errno: -1)
create index idx on bug46000(id);
drop table bug46000;

View file

@ -385,9 +385,10 @@ name dept
rs5 cs10
rs5 cs9
DELETE FROM t1;
# Masking (#) number in "rows" column of the following EXPLAIN output, as it may vary (bug#47746).
EXPLAIN SELECT DISTINCT t1.name, t1.dept FROM t1 WHERE t1.name='rs5';
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 range name name 44 NULL 2 Using where; Using index for group-by
1 SIMPLE t1 range name name 44 NULL # Using where; Using index for group-by
SELECT DISTINCT t1.name, t1.dept FROM t1 WHERE t1.name='rs5';
name dept
DROP TABLE t1;

View file

@ -1064,3 +1064,13 @@ a b c d
128 NULL 128 NULL
DROP TABLE IF EXISTS t1,t2;
End of 5.0 tests.
CREATE TABLE t1 (f1 int);
CREATE TABLE t2 (f1 int);
INSERT INTO t2 VALUES (1);
CREATE VIEW v1 AS SELECT * FROM t2;
PREPARE stmt FROM 'UPDATE t2 AS A NATURAL JOIN v1 B SET B.f1 = 1';
EXECUTE stmt;
EXECUTE stmt;
DEALLOCATE PREPARE stmt;
DROP VIEW v1;
DROP TABLE t1, t2;

View file

@ -2252,4 +2252,44 @@ h+0 d + 0 e g + 0
1 1 3 0
1 1 4 0
DROP TABLE t1;
#
# Test of BUG#35570 CHECKSUM TABLE unreliable if LINESTRING field
# (same content / differen checksum)
#
CREATE TABLE t1 (line LINESTRING NOT NULL) engine=myisam;
INSERT INTO t1 VALUES (GeomFromText("POINT(0 0)"));
checksum table t1;
Table Checksum
test.t1 326284887
CREATE TABLE t2 (line LINESTRING NOT NULL) engine=myisam;
INSERT INTO t2 VALUES (GeomFromText("POINT(0 0)"));
checksum table t2;
Table Checksum
test.t2 326284887
CREATE TABLE t3 select * from t1;
checksum table t3;
Table Checksum
test.t3 326284887
drop table t1,t2,t3;
CREATE TABLE t1(a INT, b CHAR(10), KEY(a), KEY(b));
INSERT INTO t1 VALUES(1,'0'),(2,'0'),(3,'0'),(4,'0'),(5,'0'),
(6,'0'),(7,'0');
INSERT INTO t1 SELECT a+10,b FROM t1;
INSERT INTO t1 SELECT a+20,b FROM t1;
INSERT INTO t1 SELECT a+40,b FROM t1;
INSERT INTO t1 SELECT a+80,b FROM t1;
INSERT INTO t1 SELECT a+160,b FROM t1;
INSERT INTO t1 SELECT a+320,b FROM t1;
INSERT INTO t1 SELECT a+640,b FROM t1;
INSERT INTO t1 SELECT a+1280,b FROM t1;
INSERT INTO t1 SELECT a+2560,b FROM t1;
INSERT INTO t1 SELECT a+5120,b FROM t1;
SET myisam_sort_buffer_size=4;
REPAIR TABLE t1;
Table Op Msg_type Msg_text
test.t1 repair error myisam_sort_buffer_size is too small
test.t1 repair warning Number of rows changed from 0 to 7168
test.t1 repair status OK
SET myisam_sort_buffer_size=@@global.myisam_sort_buffer_size;
DROP TABLE t1;
End of 5.1 tests

View file

@ -44,16 +44,16 @@ SET TIMESTAMP=1000000000/*!*/;
insert into t2 values ()
/*!*/;
SET TIMESTAMP=1000000000/*!*/;
load data LOCAL INFILE 'MYSQLTEST_VARDIR/tmp/SQL_LOAD_MB-#-#' INTO table t1
LOAD DATA LOCAL INFILE 'MYSQLTEST_VARDIR/tmp/SQL_LOAD_MB-#-#' INTO TABLE `t1` FIELDS TERMINATED BY '\t' ENCLOSED BY '' ESCAPED BY '\\' LINES TERMINATED BY '\n' (word)
/*!*/;
SET TIMESTAMP=1000000000/*!*/;
load data LOCAL INFILE 'MYSQLTEST_VARDIR/tmp/SQL_LOAD_MB-#-#' INTO table t1
LOAD DATA LOCAL INFILE 'MYSQLTEST_VARDIR/tmp/SQL_LOAD_MB-#-#' INTO TABLE `t1` FIELDS TERMINATED BY '\t' ENCLOSED BY '' ESCAPED BY '\\' LINES TERMINATED BY '\n' (word)
/*!*/;
SET TIMESTAMP=1000000000/*!*/;
load data LOCAL INFILE 'MYSQLTEST_VARDIR/tmp/SQL_LOAD_MB-#-#' INTO table t1
LOAD DATA LOCAL INFILE 'MYSQLTEST_VARDIR/tmp/SQL_LOAD_MB-#-#' INTO TABLE `t1` FIELDS TERMINATED BY '\t' ENCLOSED BY '' ESCAPED BY '\\' LINES TERMINATED BY '\n' (word)
/*!*/;
SET TIMESTAMP=1000000000/*!*/;
load data LOCAL INFILE 'MYSQLTEST_VARDIR/tmp/SQL_LOAD_MB-#-#' INTO table t1
LOAD DATA LOCAL INFILE 'MYSQLTEST_VARDIR/tmp/SQL_LOAD_MB-#-#' INTO TABLE `t1` FIELDS TERMINATED BY '\t' ENCLOSED BY '' ESCAPED BY '\\' LINES TERMINATED BY '\n' (word)
/*!*/;
DELIMITER ;
# End of log file
@ -144,16 +144,16 @@ SET TIMESTAMP=1000000000/*!*/;
insert into t2 values ()
/*!*/;
SET TIMESTAMP=1000000000/*!*/;
load data LOCAL INFILE 'MYSQLTEST_VARDIR/tmp/SQL_LOAD_MB-#-#' INTO table t1
LOAD DATA LOCAL INFILE 'MYSQLTEST_VARDIR/tmp/SQL_LOAD_MB-#-#' INTO TABLE `t1` FIELDS TERMINATED BY '\t' ENCLOSED BY '' ESCAPED BY '\\' LINES TERMINATED BY '\n' (word)
/*!*/;
SET TIMESTAMP=1000000000/*!*/;
load data LOCAL INFILE 'MYSQLTEST_VARDIR/tmp/SQL_LOAD_MB-#-#' INTO table t1
LOAD DATA LOCAL INFILE 'MYSQLTEST_VARDIR/tmp/SQL_LOAD_MB-#-#' INTO TABLE `t1` FIELDS TERMINATED BY '\t' ENCLOSED BY '' ESCAPED BY '\\' LINES TERMINATED BY '\n' (word)
/*!*/;
SET TIMESTAMP=1000000000/*!*/;
load data LOCAL INFILE 'MYSQLTEST_VARDIR/tmp/SQL_LOAD_MB-#-#' INTO table t1
LOAD DATA LOCAL INFILE 'MYSQLTEST_VARDIR/tmp/SQL_LOAD_MB-#-#' INTO TABLE `t1` FIELDS TERMINATED BY '\t' ENCLOSED BY '' ESCAPED BY '\\' LINES TERMINATED BY '\n' (word)
/*!*/;
SET TIMESTAMP=1000000000/*!*/;
load data LOCAL INFILE 'MYSQLTEST_VARDIR/tmp/SQL_LOAD_MB-#-#' INTO table t1
LOAD DATA LOCAL INFILE 'MYSQLTEST_VARDIR/tmp/SQL_LOAD_MB-#-#' INTO TABLE `t1` FIELDS TERMINATED BY '\t' ENCLOSED BY '' ESCAPED BY '\\' LINES TERMINATED BY '\n' (word)
/*!*/;
DELIMITER ;
# End of log file
@ -359,29 +359,29 @@ SET @@session.collation_database=DEFAULT/*!*/;
create table t1 (a varchar(64) character set utf8)
/*!*/;
SET TIMESTAMP=1000000000/*!*/;
load data LOCAL INFILE 'MYSQLTEST_VARDIR/tmp/SQL_LOAD_MB-#-#' INTO table t1
LOAD DATA LOCAL INFILE 'MYSQLTEST_VARDIR/tmp/SQL_LOAD_MB-#-#' INTO TABLE `t1` FIELDS TERMINATED BY '\t' ENCLOSED BY '' ESCAPED BY '\\' LINES TERMINATED BY '\n' (a)
/*!*/;
SET TIMESTAMP=1000000000/*!*/;
SET @@session.collation_database=7/*!*/;
load data LOCAL INFILE 'MYSQLTEST_VARDIR/tmp/SQL_LOAD_MB-#-#' INTO table t1
LOAD DATA LOCAL INFILE 'MYSQLTEST_VARDIR/tmp/SQL_LOAD_MB-#-#' INTO TABLE `t1` FIELDS TERMINATED BY '\t' ENCLOSED BY '' ESCAPED BY '\\' LINES TERMINATED BY '\n' (a)
/*!*/;
SET TIMESTAMP=1000000000/*!*/;
SET @@session.collation_database=DEFAULT/*!*/;
load data LOCAL INFILE 'MYSQLTEST_VARDIR/tmp/SQL_LOAD_MB-#-#' INTO table t1
LOAD DATA LOCAL INFILE 'MYSQLTEST_VARDIR/tmp/SQL_LOAD_MB-#-#' INTO TABLE `t1` FIELDS TERMINATED BY '\t' ENCLOSED BY '' ESCAPED BY '\\' LINES TERMINATED BY '\n' (a)
/*!*/;
SET TIMESTAMP=1000000000/*!*/;
load data LOCAL INFILE 'MYSQLTEST_VARDIR/tmp/SQL_LOAD_MB-#-#' INTO table t1
LOAD DATA LOCAL INFILE 'MYSQLTEST_VARDIR/tmp/SQL_LOAD_MB-#-#' INTO TABLE `t1` FIELDS TERMINATED BY '\t' ENCLOSED BY '' ESCAPED BY '\\' LINES TERMINATED BY '\n' (a)
/*!*/;
SET TIMESTAMP=1000000000/*!*/;
SET @@session.collation_database=7/*!*/;
load data LOCAL INFILE 'MYSQLTEST_VARDIR/tmp/SQL_LOAD_MB-a-0' INTO table t1
LOAD DATA LOCAL INFILE 'MYSQLTEST_VARDIR/tmp/SQL_LOAD_MB-a-0' INTO TABLE `t1` FIELDS TERMINATED BY '\t' ENCLOSED BY '' ESCAPED BY '\\' LINES TERMINATED BY '\n' (a)
/*!*/;
SET TIMESTAMP=1000000000/*!*/;
SET @@session.collation_database=DEFAULT/*!*/;
load data LOCAL INFILE 'MYSQLTEST_VARDIR/tmp/SQL_LOAD_MB-b-0' INTO table t1
LOAD DATA LOCAL INFILE 'MYSQLTEST_VARDIR/tmp/SQL_LOAD_MB-b-0' INTO TABLE `t1` FIELDS TERMINATED BY '\t' ENCLOSED BY '' ESCAPED BY '\\' LINES TERMINATED BY '\n' (a)
/*!*/;
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 FIELDS TERMINATED BY '\t' ENCLOSED BY '' ESCAPED BY '\\' LINES TERMINATED BY '\n' (a)
/*!*/;
SET TIMESTAMP=1000000000/*!*/;
drop table t1
@ -473,5 +473,94 @@ IS NOT NULL
SET @@global.server_id= 1;
RESET MASTER;
FLUSH LOGS;
RESET MASTER;
FLUSH LOGS;
#
# Test if the 'BEGIN', 'ROLLBACK' and 'COMMIT' are output if the database specified is exist
/*!40019 SET @@session.max_insert_delayed_threads=0*/;
/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;
DELIMITER /*!*/;
ROLLBACK/*!*/;
use test/*!*/;
SET TIMESTAMP=1253783037/*!*/;
SET @@session.pseudo_thread_id=999999999/*!*/;
SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
SET @@session.sql_mode=0/*!*/;
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
/*!\C latin1 *//*!*/;
SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/;
SET @@session.lc_time_names=0/*!*/;
SET @@session.collation_database=DEFAULT/*!*/;
create table t1(a int) engine= innodb
/*!*/;
SET TIMESTAMP=1253783037/*!*/;
BEGIN
/*!*/;
SET TIMESTAMP=1253783037/*!*/;
insert into t1 (a) values (1)
/*!*/;
COMMIT/*!*/;
SET TIMESTAMP=1253783037/*!*/;
create table t3(a int) engine= innodb
/*!*/;
SET TIMESTAMP=1253783037/*!*/;
BEGIN
/*!*/;
SET TIMESTAMP=1253783037/*!*/;
insert into t3 (a) values (2)
/*!*/;
SET TIMESTAMP=1253783037/*!*/;
ROLLBACK
/*!*/;
SET TIMESTAMP=1253783037/*!*/;
create table t5(a int) engine= NDB
/*!*/;
SET TIMESTAMP=1253783037/*!*/;
BEGIN
/*!*/;
SET TIMESTAMP=1253783037/*!*/;
insert into t5 (a) values (3)
/*!*/;
SET TIMESTAMP=1253783037/*!*/;
COMMIT
/*!*/;
DELIMITER ;
# End of log file
ROLLBACK /* added by mysqlbinlog */;
/*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/;
#
# Test if the 'BEGIN', 'ROLLBACK' and 'COMMIT' are output if the database specified is not exist
/*!40019 SET @@session.max_insert_delayed_threads=0*/;
/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;
DELIMITER /*!*/;
ROLLBACK/*!*/;
SET TIMESTAMP=1253783037/*!*/;
SET @@session.pseudo_thread_id=999999999/*!*/;
SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
SET @@session.sql_mode=0/*!*/;
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
/*!\C latin1 *//*!*/;
SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/;
SET @@session.lc_time_names=0/*!*/;
SET @@session.collation_database=DEFAULT/*!*/;
BEGIN
/*!*/;
COMMIT/*!*/;
SET TIMESTAMP=1253783037/*!*/;
BEGIN
/*!*/;
SET TIMESTAMP=1253783037/*!*/;
ROLLBACK
/*!*/;
SET TIMESTAMP=1253783037/*!*/;
BEGIN
/*!*/;
SET TIMESTAMP=1253783037/*!*/;
COMMIT
/*!*/;
DELIMITER ;
# End of log file
ROLLBACK /* added by mysqlbinlog */;
/*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/;
End of 5.0 tests
End of 5.1 tests

View file

@ -0,0 +1,2 @@
TRUE
NULL

View file

@ -1557,3 +1557,34 @@ a
2001
1991
DROP TABLE t1;
#
# Bug #43029: FORCE INDEX FOR ORDER BY is ignored when join buffering
# is used
#
CREATE TABLE t1 (a INT, b INT, KEY (a));
INSERT INTO t1 VALUES (0, NULL), (1, NULL), (2, NULL), (3, NULL);
INSERT INTO t1 SELECT a+4, b FROM t1;
INSERT INTO t1 SELECT a+8, b FROM t1;
CREATE TABLE t2 (a INT, b INT);
INSERT INTO t2 VALUES (0,NULL), (1,NULL), (2,NULL), (3,NULL), (4,NULL);
INSERT INTO t2 SELECT a+4, b FROM t2;
# shouldn't have "using filesort"
EXPLAIN
SELECT * FROM t1 FORCE INDEX FOR ORDER BY (a), t2 WHERE t1.a < 2 ORDER BY t1.a;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 range a a 5 NULL 2 Using where
1 SIMPLE t2 ALL NULL NULL NULL NULL 10
# should have "using filesort"
EXPLAIN
SELECT * FROM t1 USE INDEX FOR ORDER BY (a), t2 WHERE t1.a < 2 ORDER BY t1.a;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 range a a 5 NULL 2 Using where; Using temporary; Using filesort
1 SIMPLE t2 ALL NULL NULL NULL NULL 10 Using join buffer
# should have "using filesort"
EXPLAIN
SELECT * FROM t1 FORCE INDEX FOR JOIN (a), t2 WHERE t1.a < 2 ORDER BY t1.a;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 range a a 5 NULL 2 Using where; Using temporary; Using filesort
1 SIMPLE t2 ALL NULL NULL NULL NULL 10 Using join buffer
DROP TABLE t1, t2;
End of 5.1 tests

View file

@ -50,6 +50,21 @@ t1 CREATE TABLE `t1` (
PARTITION p3 VALUES LESS THAN (733969) ENGINE = MyISAM,
PARTITION pmax VALUES LESS THAN MAXVALUE ENGINE = MyISAM) */
DROP TABLE t1;
create table t1 (a int, b int, key(a))
partition by list (a)
( partition p0 values in (1),
partition p1 values in (2));
insert into t1 values (1,1),(2,1),(2,2),(2,3);
show indexes from t1;
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment
t1 1 a 1 a A NULL NULL NULL YES BTREE
analyze table t1;
Table Op Msg_type Msg_text
test.t1 analyze status OK
show indexes from t1;
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment
t1 1 a 1 a A 1 NULL NULL YES BTREE
drop table t1;
CREATE TABLE t1 (a INT, FOREIGN KEY (a) REFERENCES t0 (a))
ENGINE=MyISAM
PARTITION BY HASH (a);

View file

@ -0,0 +1,39 @@
SET NAMES utf8;
CREATE TABLE `t``\""e` (a INT, PRIMARY KEY (a))
ENGINE=InnoDB
PARTITION BY RANGE (a)
SUBPARTITION BY HASH (a)
(PARTITION `p0``\""e` VALUES LESS THAN (100)
(SUBPARTITION `sp0``\""e`,
SUBPARTITION `sp1``\""e`),
PARTITION `p1``\""e` VALUES LESS THAN (MAXVALUE)
(SUBPARTITION `sp2``\""e`,
SUBPARTITION `sp3``\""e`));
INSERT INTO `t``\""e` VALUES (0), (2), (6), (10), (14), (18), (22);
START TRANSACTION;
# con1
SET NAMES utf8;
START TRANSACTION;
# default connection
UPDATE `t``\""e` SET a = 16 WHERE a = 0;
# con1
UPDATE `t``\""e` SET a = 8 WHERE a = 22;
UPDATE `t``\""e` SET a = 12 WHERE a = 0;
# default connection
UPDATE `t``\""e` SET a = 4 WHERE a = 22;
ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
# First table reported in 'SHOW ENGINE InnoDB STATUS'
SHOW ENGINE InnoDB STATUS;
Type Name Status
InnoDB index `PRIMARY` of table `test`.`t``\""e` /* Partition `p0``\""e`, Subpartition `sp0``\""e` */
set @old_sql_mode = @@sql_mode;
set sql_mode = 'ANSI_QUOTES';
SHOW ENGINE InnoDB STATUS;
Type Name Status
InnoDB index `PRIMARY` of table `test`.`t``\""e` /* Partition `p0``\""e`, Subpartition `sp0``\""e` */
set @@sql_mode = @old_sql_mode;
# con1
ROLLBACK;
# default connection
DROP TABLE `t``\""e`;
SET NAMES DEFAULT;

View file

@ -0,0 +1,50 @@
SET NAMES utf8;
CREATE TABLE `t``\""e` (a INT, PRIMARY KEY (a))
ENGINE=InnoDB
PARTITION BY RANGE (a)
SUBPARTITION BY HASH (a)
(PARTITION `p0``\""e` VALUES LESS THAN (100)
(SUBPARTITION `sp0``\""e`,
SUBPARTITION `sp1``\""e`),
PARTITION `p1``\""e` VALUES LESS THAN (MAXVALUE)
(SUBPARTITION `sp2``\""e`,
SUBPARTITION `sp3``\""e`));
INSERT INTO `t``\""e` VALUES (0), (2), (6), (10), (14), (18), (22);
START TRANSACTION;
# con1
SET NAMES utf8;
START TRANSACTION;
# default connection
UPDATE `t``\""e` SET a = 16 WHERE a = 0;
# con1
UPDATE `t``\""e` SET a = 8 WHERE a = 22;
UPDATE `t``\""e` SET a = 12 WHERE a = 0;
# default connection
SELECT lock_table, COUNT(*) FROM INFORMATION_SCHEMA.INNODB_LOCKS
GROUP BY lock_table;
lock_table COUNT(*)
`test`.`t``\""e` /* Partition `p0``\""e`, Subpartition `sp0``\""e` */ 2
set @old_sql_mode = @@sql_mode;
set sql_mode = 'ANSI_QUOTES';
SELECT lock_table, COUNT(*) FROM INFORMATION_SCHEMA.INNODB_LOCKS
GROUP BY lock_table;
lock_table COUNT(*)
"test"."t`\""""e" /* Partition "p0`\""""e", Subpartition "sp0`\""""e" */ 2
set @@sql_mode = @old_sql_mode;
UPDATE `t``\""e` SET a = 4 WHERE a = 22;
ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
# First table reported in 'SHOW ENGINE InnoDB STATUS'
SHOW ENGINE InnoDB STATUS;
Type Name Status
InnoDB index `PRIMARY` of table `test`.`t``\""e` /* Partition `p0``\""e`, Subpartition `sp0``\""e` */
set @old_sql_mode = @@sql_mode;
set sql_mode = 'ANSI_QUOTES';
SHOW ENGINE InnoDB STATUS;
Type Name Status
InnoDB index `PRIMARY` of table `test`.`t``\""e` /* Partition `p0``\""e`, Subpartition `sp0``\""e` */
set @@sql_mode = @old_sql_mode;
# con1
ROLLBACK;
# default connection
DROP TABLE `t``\""e`;
SET NAMES DEFAULT;

View file

@ -0,0 +1,22 @@
DROP TABLE IF EXISTS `t1`;
# Bug#46922: crash when adding partitions and open_files_limit is reached
CREATE TABLE t1 (a INT PRIMARY KEY)
ENGINE=MyISAM PARTITION BY KEY () PARTITIONS 1;
INSERT INTO t1 VALUES (1), (2), (3), (4), (5), (6), (7), (8), (9), (10), (11);
# if the bug exists, then crash will happen here
ALTER TABLE t1 ADD PARTITION PARTITIONS 511;
ERROR HY000: Out of resources when opening file '<partition file>' (Errcode: 24)
SELECT * FROM t1;
a
1
10
11
2
3
4
5
6
7
8
9
DROP TABLE t1;

View file

@ -1219,3 +1219,182 @@ explain select * from t2 where a=1000 and b<11;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t2 ref a a 5 const 502 Using where
drop table t1, t2;
CREATE TABLE t1( a INT, b INT, KEY( a, b ) );
CREATE TABLE t2( a INT, b INT, KEY( a, b ) );
CREATE TABLE t3( a INT, b INT, KEY( a, b ) );
INSERT INTO t1( a, b )
VALUES (0, 1), (1, 2), (1, 4), (2, 3), (5, 0), (9, 7);
INSERT INTO t2( a, b )
VALUES ( 1, 1), ( 2, 1), ( 3, 1), ( 4, 1), ( 5, 1),
( 6, 1), ( 7, 1), ( 8, 1), ( 9, 1), (10, 1),
(11, 1), (12, 1), (13, 1), (14, 1), (15, 1),
(16, 1), (17, 1), (18, 1), (19, 1), (20, 1);
INSERT INTO t2 SELECT a, 2 FROM t2 WHERE b = 1;
INSERT INTO t2 SELECT a, 3 FROM t2 WHERE b = 1;
INSERT INTO t2 SELECT -1, -1 FROM t2;
INSERT INTO t2 SELECT -1, -1 FROM t2;
INSERT INTO t2 SELECT -1, -1 FROM t2;
INSERT INTO t3
VALUES (1, 0), (2, 0), (3, 0), (4, 0), (5, 0),
(6, 0), (7, 0), (8, 0), (9, 0), (10, 0);
INSERT INTO t3 SELECT * FROM t3 WHERE a = 10;
INSERT INTO t3 SELECT * FROM t3 WHERE a = 10;
SELECT * FROM t1 WHERE
3 <= a AND a < 5 OR
5 < a AND b = 3 OR
3 <= a;
a b
5 0
9 7
EXPLAIN
SELECT * FROM t1 WHERE
3 <= a AND a < 5 OR
5 < a AND b = 3 OR
3 <= a;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 range a a 5 NULL 3 Using where; Using index
SELECT * FROM t1 WHERE
3 <= a AND a < 5 OR
5 <= a AND b = 3 OR
3 <= a;
a b
5 0
9 7
EXPLAIN
SELECT * FROM t1 WHERE
3 <= a AND a < 5 OR
5 <= a AND b = 3 OR
3 <= a;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 range a a 5 NULL 4 Using where; Using index
SELECT * FROM t1 WHERE
3 <= a AND a <= 5 OR
5 <= a AND b = 3 OR
3 <= a;
a b
5 0
9 7
EXPLAIN
SELECT * FROM t1 WHERE
3 <= a AND a <= 5 OR
5 <= a AND b = 3 OR
3 <= a;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 range a a 5 NULL 3 Using where; Using index
SELECT * FROM t1 WHERE
3 <= a AND a <= 5 OR
3 <= a;
a b
5 0
9 7
EXPLAIN
SELECT * FROM t1 WHERE
3 <= a AND a <= 5 OR
3 <= a;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 range a a 5 NULL 3 Using where; Using index
SELECT * FROM t2 WHERE
5 <= a AND a < 10 AND b = 1 OR
15 <= a AND a < 20 AND b = 3
OR
1 <= a AND b = 1;
a b
1 1
2 1
3 1
4 1
5 1
6 1
7 1
8 1
9 1
10 1
11 1
12 1
13 1
14 1
15 1
15 3
16 1
16 3
17 1
17 3
18 1
18 3
19 1
19 3
20 1
EXPLAIN
SELECT * FROM t2 WHERE
5 <= a AND a < 10 AND b = 1 OR
15 <= a AND a < 20 AND b = 3
OR
1 <= a AND b = 1;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t2 range a a 10 NULL 50 Using where; Using index
SELECT * FROM t2 WHERE
5 <= a AND a < 10 AND b = 2 OR
15 <= a AND a < 20 AND b = 3
OR
1 <= a AND b = 1;
a b
1 1
2 1
3 1
4 1
5 1
5 2
6 1
6 2
7 1
7 2
8 1
8 2
9 1
9 2
10 1
11 1
12 1
13 1
14 1
15 1
15 3
16 1
16 3
17 1
17 3
18 1
18 3
19 1
19 3
20 1
EXPLAIN
SELECT * FROM t2 WHERE
5 <= a AND a < 10 AND b = 2 OR
15 <= a AND a < 20 AND b = 3
OR
1 <= a AND b = 1;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t2 range a a 10 NULL 50 Using where; Using index
SELECT * FROM t3 WHERE
5 <= a AND a < 10 AND b = 3 OR
a < 5 OR
a < 10;
a b
1 0
2 0
3 0
4 0
5 0
6 0
7 0
8 0
9 0
EXPLAIN
SELECT * FROM t3 WHERE
5 <= a AND a < 10 AND b = 3 OR
a < 5 OR
a < 10;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t3 range a a 5 NULL 8 Using where; Using index
DROP TABLE t1, t2, t3;

View file

@ -580,7 +580,7 @@ SIGNAL foo;
ERROR 42000: Undefined CONDITION: foo
SIGNAL SQLSTATE '01000';
Warnings:
Warning 1640 Unhandled user-defined warning condition
Warning 1642 Unhandled user-defined warning condition
SIGNAL SQLSTATE '02000';
ERROR 02000: Unhandled user-defined not found condition
SIGNAL SQLSTATE '23000';
@ -694,7 +694,7 @@ SIGNAL warn;
end $$
call test_signal() $$
Warnings:
Warning 1640 Unhandled user-defined warning condition
Warning 1642 Unhandled user-defined warning condition
drop procedure test_signal $$
create procedure test_signal()
begin
@ -704,7 +704,7 @@ SIGNAL warn;
end $$
call test_signal() $$
Warnings:
Warning 1640 Unhandled user-defined warning condition
Warning 1642 Unhandled user-defined warning condition
drop procedure test_signal $$
create procedure test_signal()
begin
@ -853,7 +853,7 @@ SIGNAL warn SET MESSAGE_TEXT = "Something bad happened";
end $$
call test_signal() $$
Warnings:
Warning 1640 Something bad happened
Warning 1642 Something bad happened
drop procedure test_signal $$
create procedure test_signal()
begin
@ -878,7 +878,7 @@ SIGNAL something SET MESSAGE_TEXT = _utf8 "This is a UTF8 text";
end $$
call test_signal() $$
Warnings:
Warning 1640 This is a UTF8 text
Warning 1642 This is a UTF8 text
drop procedure test_signal $$
create procedure test_signal()
begin
@ -887,7 +887,7 @@ SIGNAL something SET MESSAGE_TEXT = "";
end $$
call test_signal() $$
Warnings:
Warning 1640
Warning 1642
drop procedure test_signal $$
create procedure test_signal()
begin
@ -896,10 +896,10 @@ SIGNAL warn SET MESSAGE_TEXT = "á a";
end $$
call test_signal() $$
Warnings:
Warning 1640 á a
Warning 1642 á a
show warnings $$
Level Code Message
Warning 1640 á a
Warning 1642 á a
drop procedure test_signal $$
#
# Test SET complex expressions
@ -1162,17 +1162,17 @@ MYSQL_ERRNO = 10000;
end $$
call test_signal() $$
Warnings:
Warning 1645 Data truncated for condition item 'CLASS_ORIGIN'
Warning 1645 Data truncated for condition item 'SUBCLASS_ORIGIN'
Warning 1645 Data truncated for condition item 'CONSTRAINT_CATALOG'
Warning 1645 Data truncated for condition item 'CONSTRAINT_SCHEMA'
Warning 1645 Data truncated for condition item 'CONSTRAINT_NAME'
Warning 1645 Data truncated for condition item 'CATALOG_NAME'
Warning 1645 Data truncated for condition item 'SCHEMA_NAME'
Warning 1645 Data truncated for condition item 'TABLE_NAME'
Warning 1645 Data truncated for condition item 'COLUMN_NAME'
Warning 1645 Data truncated for condition item 'CURSOR_NAME'
Warning 1645 Data truncated for condition item 'MESSAGE_TEXT'
Warning 1647 Data truncated for condition item 'CLASS_ORIGIN'
Warning 1647 Data truncated for condition item 'SUBCLASS_ORIGIN'
Warning 1647 Data truncated for condition item 'CONSTRAINT_CATALOG'
Warning 1647 Data truncated for condition item 'CONSTRAINT_SCHEMA'
Warning 1647 Data truncated for condition item 'CONSTRAINT_NAME'
Warning 1647 Data truncated for condition item 'CATALOG_NAME'
Warning 1647 Data truncated for condition item 'SCHEMA_NAME'
Warning 1647 Data truncated for condition item 'TABLE_NAME'
Warning 1647 Data truncated for condition item 'COLUMN_NAME'
Warning 1647 Data truncated for condition item 'CURSOR_NAME'
Warning 1647 Data truncated for condition item 'MESSAGE_TEXT'
Warning 10000 11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111112222222222222222222288888888
drop procedure test_signal $$
create procedure test_signal()

View file

@ -78,15 +78,15 @@ ERROR 45000: Oops in proc_1
show warnings;
Level Code Message
Error 1051 Unknown table 'oops_it_is_not_here'
Error 1642 Oops in proc_9
Error 1642 Oops in proc_8
Error 1642 Oops in proc_7
Error 1642 Oops in proc_6
Error 1642 Oops in proc_5
Error 1642 Oops in proc_4
Error 1642 Oops in proc_3
Error 1642 Oops in proc_2
Error 1642 Oops in proc_1
Error 1644 Oops in proc_9
Error 1644 Oops in proc_8
Error 1644 Oops in proc_7
Error 1644 Oops in proc_6
Error 1644 Oops in proc_5
Error 1644 Oops in proc_4
Error 1644 Oops in proc_3
Error 1644 Oops in proc_2
Error 1644 Oops in proc_1
SET @@session.max_error_count = 5;
SELECT @@session.max_error_count;
@@session.max_error_count
@ -95,11 +95,11 @@ call proc_1();
ERROR 45000: Oops in proc_1
show warnings;
Level Code Message
Error 1642 Oops in proc_5
Error 1642 Oops in proc_4
Error 1642 Oops in proc_3
Error 1642 Oops in proc_2
Error 1642 Oops in proc_1
Error 1644 Oops in proc_5
Error 1644 Oops in proc_4
Error 1644 Oops in proc_3
Error 1644 Oops in proc_2
Error 1644 Oops in proc_1
SET @@session.max_error_count = 7;
SELECT @@session.max_error_count;
@@session.max_error_count
@ -108,13 +108,13 @@ call proc_1();
ERROR 45000: Oops in proc_1
show warnings;
Level Code Message
Error 1642 Oops in proc_7
Error 1642 Oops in proc_6
Error 1642 Oops in proc_5
Error 1642 Oops in proc_4
Error 1642 Oops in proc_3
Error 1642 Oops in proc_2
Error 1642 Oops in proc_1
Error 1644 Oops in proc_7
Error 1644 Oops in proc_6
Error 1644 Oops in proc_5
Error 1644 Oops in proc_4
Error 1644 Oops in proc_3
Error 1644 Oops in proc_2
Error 1644 Oops in proc_1
SET @@session.max_error_count = 9;
SELECT @@session.max_error_count;
@@session.max_error_count
@ -123,15 +123,15 @@ call proc_1();
ERROR 45000: Oops in proc_1
show warnings;
Level Code Message
Error 1642 Oops in proc_9
Error 1642 Oops in proc_8
Error 1642 Oops in proc_7
Error 1642 Oops in proc_6
Error 1642 Oops in proc_5
Error 1642 Oops in proc_4
Error 1642 Oops in proc_3
Error 1642 Oops in proc_2
Error 1642 Oops in proc_1
Error 1644 Oops in proc_9
Error 1644 Oops in proc_8
Error 1644 Oops in proc_7
Error 1644 Oops in proc_6
Error 1644 Oops in proc_5
Error 1644 Oops in proc_4
Error 1644 Oops in proc_3
Error 1644 Oops in proc_2
Error 1644 Oops in proc_1
drop database demo;
SET @@global.max_error_count = @start_global_value;
SELECT @@global.max_error_count;

View file

@ -27,4 +27,35 @@ SELECT 1;
1
1
DROP TABLE t1,t2,t3;
#
# Bug #47106: Crash / segfault on adding EXPLAIN to a non-crashing
# query
#
CREATE TABLE t1 (
a INT,
b INT,
PRIMARY KEY (a),
KEY b (b)
);
INSERT INTO t1 VALUES (1, 1), (2, 1);
CREATE TABLE t2 LIKE t1;
INSERT INTO t2 SELECT * FROM t1;
CREATE TABLE t3 LIKE t1;
INSERT INTO t3 SELECT * FROM t1;
# Should not crash.
# Should have 1 impossible where and 2 dependent subqs.
EXPLAIN
SELECT
(SELECT 1 FROM t1,t2 WHERE t2.b > t3.b)
FROM t3 WHERE 1 = 0 GROUP BY 1;
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE
2 DEPENDENT SUBQUERY t1 index NULL PRIMARY 4 NULL 2 Using index
2 DEPENDENT SUBQUERY t2 index b b 5 NULL 2 Using where; Using index; Using join buffer
# should return 0 rows
SELECT
(SELECT 1 FROM t1,t2 WHERE t2.b > t3.b)
FROM t3 WHERE 1 = 0 GROUP BY 1;
(SELECT 1 FROM t1,t2 WHERE t2.b > t3.b)
DROP TABLE t1,t2,t3;
End of 5.0 tests.

View file

@ -749,6 +749,16 @@ bin(a1)
110000111111111
110001011111111
drop table t1bit7, t2bit7;
#
# Bug42803: Field_bit does not have unsigned_flag field,
# can lead to bad memory access
#
CREATE TABLE t1 (a BIT(7), b BIT(9), KEY(a, b));
INSERT INTO t1 VALUES(0, 0), (5, 3), (5, 6), (6, 4), (7, 0);
EXPLAIN SELECT a+0, b+0 FROM t1 WHERE a > 4 and b < 7 ORDER BY 2;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 range a a 2 NULL 4 Using where; Using index; Using filesort
DROP TABLE t1;
End of 5.0 tests
create table t1(a bit(7));
insert into t1 values(0x40);

View file

@ -606,7 +606,7 @@ SHOW CREATE VIEW v;
View Create View character_set_client collation_connection
v CREATE ALGORITHM=UNDEFINED DEFINER=`no-such-user`@`localhost` SQL SECURITY DEFINER VIEW `v` AS select `test`.`t1`.`a` AS `a` from `t1` latin1 latin1_swedish_ci
Warnings:
Warning 1356 View 'test.v' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
Note 1449 The user specified as a definer ('no-such-user'@'localhost') does not exist
SELECT * FROM v;
ERROR HY000: The user specified as a definer ('no-such-user'@'localhost') does not exist
DROP VIEW v;
@ -963,7 +963,7 @@ SHOW CREATE VIEW v1;
View Create View character_set_client collation_connection
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`no_such`@`user_1` SQL SECURITY DEFINER VIEW `v1` AS select `test`.`t1`.`i` AS `i` from `t1` latin1 latin1_swedish_ci
Warnings:
Warning 1356 View 'test.v1' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
Note 1449 The user specified as a definer ('no_such'@'user_1') does not exist
ALTER ALGORITHM=MERGE VIEW v1 AS SELECT * FROM t1;
Warnings:
Note 1449 The user specified as a definer ('no_such'@'user_1') does not exist
@ -971,7 +971,7 @@ SHOW CREATE VIEW v1;
View Create View character_set_client collation_connection
v1 CREATE ALGORITHM=MERGE DEFINER=`no_such`@`user_1` SQL SECURITY DEFINER VIEW `v1` AS select `test`.`t1`.`i` AS `i` from `t1` latin1 latin1_swedish_ci
Warnings:
Warning 1356 View 'test.v1' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
Note 1449 The user specified as a definer ('no_such'@'user_1') does not exist
ALTER ALGORITHM=TEMPTABLE DEFINER=no_such@user_2 VIEW v1 AS SELECT * FROM t1;
Warnings:
Note 1449 The user specified as a definer ('no_such'@'user_2') does not exist
@ -979,7 +979,7 @@ SHOW CREATE VIEW v1;
View Create View character_set_client collation_connection
v1 CREATE ALGORITHM=TEMPTABLE DEFINER=`no_such`@`user_2` SQL SECURITY DEFINER VIEW `v1` AS select `test`.`t1`.`i` AS `i` from `t1` latin1 latin1_swedish_ci
Warnings:
Warning 1356 View 'test.v1' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
Note 1449 The user specified as a definer ('no_such'@'user_2') does not exist
DROP VIEW v1;
DROP TABLE t1;
CREATE USER mysqluser1@localhost;
@ -1044,3 +1044,177 @@ DROP DATABASE mysqltest1;
DROP VIEW test.v3;
DROP USER mysqluser1@localhost;
USE test;
#
# Bug#35996: SELECT + SHOW VIEW should be enough to display view
# definition
#
CREATE USER mysqluser1@localhost;
CREATE DATABASE mysqltest1;
CREATE DATABASE mysqltest2;
GRANT USAGE, SELECT, CREATE VIEW, SHOW VIEW
ON mysqltest2.* TO mysqluser1@localhost;
USE mysqltest1;
CREATE TABLE t1( a INT );
CREATE TABLE t2( a INT, b INT );
CREATE FUNCTION f1() RETURNS INT RETURN 1;
CREATE VIEW v1 AS SELECT 1 AS a;
CREATE VIEW v2 AS SELECT 1 AS a, 2 AS b;
GRANT SELECT ON TABLE t1 TO mysqluser1@localhost;
GRANT SELECT (a, b) ON TABLE t2 TO mysqluser1@localhost;
GRANT EXECUTE ON FUNCTION f1 TO mysqluser1@localhost;
GRANT SELECT ON TABLE v1 TO mysqluser1@localhost;
GRANT SELECT (a, b) ON TABLE v2 TO mysqluser1@localhost;
CREATE VIEW v_t1 AS SELECT * FROM t1;
CREATE VIEW v_t2 AS SELECT * FROM t2;
CREATE VIEW v_f1 AS SELECT f1() AS a;
CREATE VIEW v_v1 AS SELECT * FROM v1;
CREATE VIEW v_v2 AS SELECT * FROM v2;
GRANT SELECT, SHOW VIEW ON v_t1 TO mysqluser1@localhost;
GRANT SELECT, SHOW VIEW ON v_t2 TO mysqluser1@localhost;
GRANT SELECT, SHOW VIEW ON v_f1 TO mysqluser1@localhost;
GRANT SELECT, SHOW VIEW ON v_v1 TO mysqluser1@localhost;
GRANT SELECT, SHOW VIEW ON v_v2 TO mysqluser1@localhost;
CREATE VIEW v_mysqluser1_t1 AS SELECT * FROM mysqltest1.t1;
CREATE VIEW v_mysqluser1_t2 AS SELECT * FROM mysqltest1.t2;
CREATE VIEW v_mysqluser1_f1 AS SELECT mysqltest1.f1() AS a;
CREATE VIEW v_mysqluser1_v1 AS SELECT * FROM mysqltest1.v1;
CREATE VIEW v_mysqluser1_v2 AS SELECT * FROM mysqltest1.v2;
SHOW CREATE VIEW mysqltest1.v_t1;
View Create View character_set_client collation_connection
v_t1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `mysqltest1`.`v_t1` AS select `mysqltest1`.`t1`.`a` AS `a` from `mysqltest1`.`t1` latin1 latin1_swedish_ci
SHOW CREATE VIEW mysqltest1.v_t2;
View Create View character_set_client collation_connection
v_t2 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `mysqltest1`.`v_t2` AS select `mysqltest1`.`t2`.`a` AS `a`,`mysqltest1`.`t2`.`b` AS `b` from `mysqltest1`.`t2` latin1 latin1_swedish_ci
SHOW CREATE VIEW mysqltest1.v_f1;
View Create View character_set_client collation_connection
v_f1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `mysqltest1`.`v_f1` AS select `f1`() AS `a` latin1 latin1_swedish_ci
SHOW CREATE VIEW mysqltest1.v_v1;
View Create View character_set_client collation_connection
v_v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `mysqltest1`.`v_v1` AS select `v1`.`a` AS `a` from `mysqltest1`.`v1` latin1 latin1_swedish_ci
SHOW CREATE VIEW mysqltest1.v_v2;
View Create View character_set_client collation_connection
v_v2 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `mysqltest1`.`v_v2` AS select `v2`.`a` AS `a`,`v2`.`b` AS `b` from `mysqltest1`.`v2` latin1 latin1_swedish_ci
SHOW CREATE VIEW v_mysqluser1_t1;
View Create View character_set_client collation_connection
v_mysqluser1_t1 CREATE ALGORITHM=UNDEFINED DEFINER=`mysqluser1`@`localhost` SQL SECURITY DEFINER VIEW `v_mysqluser1_t1` AS select `mysqltest1`.`t1`.`a` AS `a` from `mysqltest1`.`t1` latin1 latin1_swedish_ci
SHOW CREATE VIEW v_mysqluser1_t2;
View Create View character_set_client collation_connection
v_mysqluser1_t2 CREATE ALGORITHM=UNDEFINED DEFINER=`mysqluser1`@`localhost` SQL SECURITY DEFINER VIEW `v_mysqluser1_t2` AS select `mysqltest1`.`t2`.`a` AS `a`,`mysqltest1`.`t2`.`b` AS `b` from `mysqltest1`.`t2` latin1 latin1_swedish_ci
SHOW CREATE VIEW v_mysqluser1_f1;
View Create View character_set_client collation_connection
v_mysqluser1_f1 CREATE ALGORITHM=UNDEFINED DEFINER=`mysqluser1`@`localhost` SQL SECURITY DEFINER VIEW `v_mysqluser1_f1` AS select `mysqltest1`.`f1`() AS `a` latin1 latin1_swedish_ci
SHOW CREATE VIEW v_mysqluser1_v1;
View Create View character_set_client collation_connection
v_mysqluser1_v1 CREATE ALGORITHM=UNDEFINED DEFINER=`mysqluser1`@`localhost` SQL SECURITY DEFINER VIEW `v_mysqluser1_v1` AS select `v1`.`a` AS `a` from `mysqltest1`.`v1` latin1 latin1_swedish_ci
SHOW CREATE VIEW v_mysqluser1_v2;
View Create View character_set_client collation_connection
v_mysqluser1_v2 CREATE ALGORITHM=UNDEFINED DEFINER=`mysqluser1`@`localhost` SQL SECURITY DEFINER VIEW `v_mysqluser1_v2` AS select `v2`.`a` AS `a`,`v2`.`b` AS `b` from `mysqltest1`.`v2` latin1 latin1_swedish_ci
REVOKE SELECT ON TABLE t1 FROM mysqluser1@localhost;
REVOKE SELECT (a) ON TABLE t2 FROM mysqluser1@localhost;
REVOKE EXECUTE ON FUNCTION f1 FROM mysqluser1@localhost;
REVOKE SELECT ON TABLE v1 FROM mysqluser1@localhost;
SHOW CREATE VIEW mysqltest1.v_t1;
View Create View character_set_client collation_connection
v_t1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `mysqltest1`.`v_t1` AS select `mysqltest1`.`t1`.`a` AS `a` from `mysqltest1`.`t1` latin1 latin1_swedish_ci
SHOW CREATE VIEW mysqltest1.v_t2;
View Create View character_set_client collation_connection
v_t2 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `mysqltest1`.`v_t2` AS select `mysqltest1`.`t2`.`a` AS `a`,`mysqltest1`.`t2`.`b` AS `b` from `mysqltest1`.`t2` latin1 latin1_swedish_ci
SHOW CREATE VIEW mysqltest1.v_f1;
View Create View character_set_client collation_connection
v_f1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `mysqltest1`.`v_f1` AS select `f1`() AS `a` latin1 latin1_swedish_ci
SHOW CREATE VIEW mysqltest1.v_v1;
View Create View character_set_client collation_connection
v_v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `mysqltest1`.`v_v1` AS select `v1`.`a` AS `a` from `mysqltest1`.`v1` latin1 latin1_swedish_ci
SHOW CREATE VIEW mysqltest1.v_v2;
View Create View character_set_client collation_connection
v_v2 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `mysqltest1`.`v_v2` AS select `v2`.`a` AS `a`,`v2`.`b` AS `b` from `mysqltest1`.`v2` latin1 latin1_swedish_ci
SHOW CREATE VIEW v_mysqluser1_t1;
View Create View character_set_client collation_connection
v_mysqluser1_t1 CREATE ALGORITHM=UNDEFINED DEFINER=`mysqluser1`@`localhost` SQL SECURITY DEFINER VIEW `v_mysqluser1_t1` AS select `mysqltest1`.`t1`.`a` AS `a` from `mysqltest1`.`t1` latin1 latin1_swedish_ci
SHOW CREATE VIEW v_mysqluser1_t2;
View Create View character_set_client collation_connection
v_mysqluser1_t2 CREATE ALGORITHM=UNDEFINED DEFINER=`mysqluser1`@`localhost` SQL SECURITY DEFINER VIEW `v_mysqluser1_t2` AS select `mysqltest1`.`t2`.`a` AS `a`,`mysqltest1`.`t2`.`b` AS `b` from `mysqltest1`.`t2` latin1 latin1_swedish_ci
SHOW CREATE VIEW v_mysqluser1_f1;
View Create View character_set_client collation_connection
v_mysqluser1_f1 CREATE ALGORITHM=UNDEFINED DEFINER=`mysqluser1`@`localhost` SQL SECURITY DEFINER VIEW `v_mysqluser1_f1` AS select `mysqltest1`.`f1`() AS `a` latin1 latin1_swedish_ci
SHOW CREATE VIEW v_mysqluser1_v1;
View Create View character_set_client collation_connection
v_mysqluser1_v1 CREATE ALGORITHM=UNDEFINED DEFINER=`mysqluser1`@`localhost` SQL SECURITY DEFINER VIEW `v_mysqluser1_v1` AS select `v1`.`a` AS `a` from `mysqltest1`.`v1` latin1 latin1_swedish_ci
SHOW CREATE VIEW v_mysqluser1_v2;
View Create View character_set_client collation_connection
v_mysqluser1_v2 CREATE ALGORITHM=UNDEFINED DEFINER=`mysqluser1`@`localhost` SQL SECURITY DEFINER VIEW `v_mysqluser1_v2` AS select `v2`.`a` AS `a`,`v2`.`b` AS `b` from `mysqltest1`.`v2` latin1 latin1_swedish_ci
# Testing the case when the views reference missing objects.
# Obviously, there are no privileges to check for, so we
# need only each object type once.
DROP TABLE t1;
DROP FUNCTION f1;
DROP VIEW v1;
SHOW CREATE VIEW mysqltest1.v_t1;
View Create View character_set_client collation_connection
v_t1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `mysqltest1`.`v_t1` AS select `mysqltest1`.`t1`.`a` AS `a` from `mysqltest1`.`t1` latin1 latin1_swedish_ci
Warnings:
Warning 1356 View 'mysqltest1.v_t1' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
SHOW CREATE VIEW mysqltest1.v_f1;
View Create View character_set_client collation_connection
v_f1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `mysqltest1`.`v_f1` AS select `f1`() AS `a` latin1 latin1_swedish_ci
Warnings:
Warning 1356 View 'mysqltest1.v_f1' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
SHOW CREATE VIEW mysqltest1.v_v1;
View Create View character_set_client collation_connection
v_v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `mysqltest1`.`v_v1` AS select `v1`.`a` AS `a` from `mysqltest1`.`v1` latin1 latin1_swedish_ci
Warnings:
Warning 1356 View 'mysqltest1.v_v1' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
SHOW CREATE VIEW v_mysqluser1_t1;
View Create View character_set_client collation_connection
v_mysqluser1_t1 CREATE ALGORITHM=UNDEFINED DEFINER=`mysqluser1`@`localhost` SQL SECURITY DEFINER VIEW `v_mysqluser1_t1` AS select `mysqltest1`.`t1`.`a` AS `a` from `mysqltest1`.`t1` latin1 latin1_swedish_ci
Warnings:
Warning 1356 View 'mysqltest2.v_mysqluser1_t1' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
SHOW CREATE VIEW v_mysqluser1_f1;
View Create View character_set_client collation_connection
v_mysqluser1_f1 CREATE ALGORITHM=UNDEFINED DEFINER=`mysqluser1`@`localhost` SQL SECURITY DEFINER VIEW `v_mysqluser1_f1` AS select `mysqltest1`.`f1`() AS `a` latin1 latin1_swedish_ci
Warnings:
Warning 1356 View 'mysqltest2.v_mysqluser1_f1' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
SHOW CREATE VIEW v_mysqluser1_v1;
View Create View character_set_client collation_connection
v_mysqluser1_v1 CREATE ALGORITHM=UNDEFINED DEFINER=`mysqluser1`@`localhost` SQL SECURITY DEFINER VIEW `v_mysqluser1_v1` AS select `v1`.`a` AS `a` from `mysqltest1`.`v1` latin1 latin1_swedish_ci
Warnings:
Warning 1356 View 'mysqltest2.v_mysqluser1_v1' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
REVOKE SHOW VIEW ON v_t1 FROM mysqluser1@localhost;
REVOKE SHOW VIEW ON v_f1 FROM mysqluser1@localhost;
REVOKE SHOW VIEW ON v_v1 FROM mysqluser1@localhost;
SHOW CREATE VIEW mysqltest1.v_t1;
ERROR 42000: SHOW VIEW command denied to user 'mysqluser1'@'localhost' for table 'v_t1'
SHOW CREATE VIEW mysqltest1.v_f1;
ERROR 42000: SHOW VIEW command denied to user 'mysqluser1'@'localhost' for table 'v_f1'
SHOW CREATE VIEW mysqltest1.v_v1;
ERROR 42000: SHOW VIEW command denied to user 'mysqluser1'@'localhost' for table 'v_v1'
SHOW CREATE VIEW v_mysqluser1_t1;
View Create View character_set_client collation_connection
v_mysqluser1_t1 CREATE ALGORITHM=UNDEFINED DEFINER=`mysqluser1`@`localhost` SQL SECURITY DEFINER VIEW `v_mysqluser1_t1` AS select `mysqltest1`.`t1`.`a` AS `a` from `mysqltest1`.`t1` latin1 latin1_swedish_ci
Warnings:
Warning 1356 View 'mysqltest2.v_mysqluser1_t1' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
SHOW CREATE VIEW v_mysqluser1_f1;
View Create View character_set_client collation_connection
v_mysqluser1_f1 CREATE ALGORITHM=UNDEFINED DEFINER=`mysqluser1`@`localhost` SQL SECURITY DEFINER VIEW `v_mysqluser1_f1` AS select `mysqltest1`.`f1`() AS `a` latin1 latin1_swedish_ci
Warnings:
Warning 1356 View 'mysqltest2.v_mysqluser1_f1' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
SHOW CREATE VIEW v_mysqluser1_v1;
View Create View character_set_client collation_connection
v_mysqluser1_v1 CREATE ALGORITHM=UNDEFINED DEFINER=`mysqluser1`@`localhost` SQL SECURITY DEFINER VIEW `v_mysqluser1_v1` AS select `v1`.`a` AS `a` from `mysqltest1`.`v1` latin1 latin1_swedish_ci
Warnings:
Warning 1356 View 'mysqltest2.v_mysqluser1_v1' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
DROP USER mysqluser1@localhost;
DROP DATABASE mysqltest1;
DROP DATABASE mysqltest2;
USE test;
CREATE TABLE t1( a INT );
CREATE DEFINER = no_such_user@no_such_host VIEW v1 AS SELECT * FROM t1;
Warnings:
Note 1449 The user specified as a definer ('no_such_user'@'no_such_host') does not exist
SHOW CREATE VIEW v1;
View Create View character_set_client collation_connection
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`no_such_user`@`no_such_host` SQL SECURITY DEFINER VIEW `v1` AS select `test`.`t1`.`a` AS `a` from `t1` latin1 latin1_swedish_ci
Warnings:
Note 1449 The user specified as a definer ('no_such_user'@'no_such_host') does not exist
DROP TABLE t1;
DROP VIEW v1;

View file

@ -53,3 +53,10 @@ ERROR HY000: No paths allowed for shared library
execute abc;
ERROR HY000: No paths allowed for shared library
deallocate prepare abc;
#
# Bug#45498: Socket variable not available on Windows
#
SELECT VARIABLE_NAME FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
WHERE VARIABLE_NAME = 'socket';
VARIABLE_NAME
SOCKET

View file

@ -74,4 +74,17 @@
</charset>
<charset name="latin1">
<family>Western</family>
<description>cp1252 West European</description>
<alias>csisolatin1</alias>
<alias>iso-8859-1</alias>
<alias>iso-ir-100</alias>
<alias>iso_8859-1</alias>
<alias>iso_8859-1:1987</alias>
<alias>l1</alias>
<alias>latin1</alias>
<collation name="latin1_test" id="99" order="test"/>
</charset>
</charsets>

Binary file not shown.

View file

@ -0,0 +1,135 @@
<?xml version='1.0' encoding="utf-8"?>
<charsets>
<copyright>
Copyright (C) 2009 Sun Microsystems, Inc
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; version 2 of the License.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
</copyright>
<charset name="latin1">
<ctype>
<map>
00
20 20 20 20 20 20 20 20 20 28 28 28 28 28 20 20
20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
48 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10
84 84 84 84 84 84 84 84 84 84 10 10 10 10 10 10
10 81 81 81 81 81 81 01 01 01 01 01 01 01 01 01
01 01 01 01 01 01 01 01 01 01 01 10 10 10 10 10
10 82 82 82 82 82 82 02 02 02 02 02 02 02 02 02
02 02 02 02 02 02 02 02 02 02 02 10 10 10 10 20
10 00 10 02 10 10 10 10 10 10 01 10 01 00 01 00
00 10 10 10 10 10 10 10 10 10 02 10 02 00 02 01
48 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10
10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10
01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01
01 01 01 01 01 01 01 10 01 01 01 01 01 01 01 02
02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02
02 02 02 02 02 02 02 10 02 02 02 02 02 02 02 02
</map>
</ctype>
<lower>
<map>
00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F
10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F
20 21 22 23 24 25 26 27 28 29 2A 2B 2C 2D 2E 2F
30 31 32 33 34 35 36 37 38 39 3A 3B 3C 3D 3E 3F
40 61 62 63 64 65 66 67 68 69 6A 6B 6C 6D 6E 6F
70 71 72 73 74 75 76 77 78 79 7A 5B 5C 5D 5E 5F
60 61 62 63 64 65 66 67 68 69 6A 6B 6C 6D 6E 6F
70 71 72 73 74 75 76 77 78 79 7A 7B 7C 7D 7E 7F
80 81 82 83 84 85 86 87 88 89 8A 8B 8C 8D 8E 8F
90 91 92 93 94 95 96 97 98 99 9A 9B 9C 9D 9E 9F
A0 A1 A2 A3 A4 A5 A6 A7 A8 A9 AA AB AC AD AE AF
B0 B1 B2 B3 B4 B5 B6 B7 B8 B9 BA BB BC BD BE BF
E0 E1 E2 E3 E4 E5 E6 E7 E8 E9 EA EB EC ED EE EF
F0 F1 F2 F3 F4 F5 F6 D7 F8 F9 FA FB FC FD FE DF
E0 E1 E2 E3 E4 E5 E6 E7 E8 E9 EA EB EC ED EE EF
F0 F1 F2 F3 F4 F5 F6 F7 F8 F9 FA FB FC FD FE FF
</map>
</lower>
<upper>
<map>
00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F
10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F
20 21 22 23 24 25 26 27 28 29 2A 2B 2C 2D 2E 2F
30 31 32 33 34 35 36 37 38 39 3A 3B 3C 3D 3E 3F
40 41 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F
50 51 52 53 54 55 56 57 58 59 5A 5B 5C 5D 5E 5F
60 41 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F
50 51 52 53 54 55 56 57 58 59 5A 7B 7C 7D 7E 7F
80 81 82 83 84 85 86 87 88 89 8A 8B 8C 8D 8E 8F
90 91 92 93 94 95 96 97 98 99 9A 9B 9C 9D 9E 9F
A0 A1 A2 A3 A4 A5 A6 A7 A8 A9 AA AB AC AD AE AF
B0 B1 B2 B3 B4 B5 B6 B7 B8 B9 BA BB BC BD BE BF
C0 C1 C2 C3 C4 C5 C6 C7 C8 C9 CA CB CC CD CE CF
D0 D1 D2 D3 D4 D5 D6 D7 D8 D9 DA DB DC DD DE DF
C0 C1 C2 C3 C4 C5 C6 C7 C8 C9 CA CB CC CD CE CF
D0 D1 D2 D3 D4 D5 D6 F7 D8 D9 DA DB DC DD DE FF
</map>
</upper>
<unicode>
<map>
0000 0001 0002 0003 0004 0005 0006 0007 0008 0009 000A 000B 000C 000D 000E 000F
0010 0011 0012 0013 0014 0015 0016 0017 0018 0019 001A 001B 001C 001D 001E 001F
0020 0021 0022 0023 0024 0025 0026 0027 0028 0029 002A 002B 002C 002D 002E 002F
0030 0031 0032 0033 0034 0035 0036 0037 0038 0039 003A 003B 003C 003D 003E 003F
0040 0041 0042 0043 0044 0045 0046 0047 0048 0049 004A 004B 004C 004D 004E 004F
0050 0051 0052 0053 0054 0055 0056 0057 0058 0059 005A 005B 005C 005D 005E 005F
0060 0061 0062 0063 0064 0065 0066 0067 0068 0069 006A 006B 006C 006D 006E 006F
0070 0071 0072 0073 0074 0075 0076 0077 0078 0079 007A 007B 007C 007D 007E 007F
20AC 0081 201A 0192 201E 2026 2020 2021 02C6 2030 0160 2039 0152 008D 017D 008F
0090 2018 2019 201C 201D 2022 2013 2014 02DC 2122 0161 203A 0153 009D 017E 0178
00A0 00A1 00A2 00A3 00A4 00A5 00A6 00A7 00A8 00A9 00AA 00AB 00AC 00AD 00AE 00AF
00B0 00B1 00B2 00B3 00B4 00B5 00B6 00B7 00B8 00B9 00BA 00BB 00BC 00BD 00BE 00BF
00C0 00C1 00C2 00C3 00C4 00C5 00C6 00C7 00C8 00C9 00CA 00CB 00CC 00CD 00CE 00CF
00D0 00D1 00D2 00D3 00D4 00D5 00D6 00D7 00D8 00D9 00DA 00DB 00DC 00DD 00DE 00DF
00E0 00E1 00E2 00E3 00E4 00E5 00E6 00E7 00E8 00E9 00EA 00EB 00EC 00ED 00EE 00EF
00F0 00F1 00F2 00F3 00F4 00F5 00F6 00F7 00F8 00F9 00FA 00FB 00FC 00FD 00FE 00FF
</map>
</unicode>
<collation name="latin1_test">
<map>
00 01 02 03 37 2D 2E 2F 16 05 25 0B 0C 0D 0E 0F
10 11 12 13 3C 3D 32 26 18 19 3F 27 1C 1D 1E 1F
40 4F 7F 7B 5B 6C 50 7D 4D 5D 5C 4E 6B 60 4B 61
F0 F1 F2 F3 F4 F5 F6 F7 F8 F9 7A 5E 4C 7E 6E 6F
7C C1 C2 C3 C4 C5 C6 C7 C8 C9 D1 D2 D3 D4 D5 D6
D7 D8 D9 E2 E3 E4 E5 E6 E7 E8 E9 4A E0 5A 5F 6D
79 81 82 83 84 85 86 87 88 89 91 92 93 94 95 96
97 98 99 A2 A3 A4 A5 A6 A7 A8 A9 C0 6A D0 A1 07
20 21 22 23 24 15 06 17 28 29 2A 2B 2C 09 0A 1B
30 31 1A 33 34 35 36 08 38 39 3A 3B 04 14 3E E1
41 42 43 44 45 46 47 48 49 51 52 53 54 55 56 57
58 59 62 63 64 65 66 67 68 69 70 71 72 73 74 75
76 77 78 80 8A 8B 8C 8D 8E 8F 90 9A 9B 9C 9D 9E
9F A0 AA AB AC AD AE AF B0 B1 B2 B3 B4 B5 B6 B7
B8 B9 BA BB BC BD BE BF CA CB CC CD CE CF DA DB
DC DD DE DF EA EB EC ED EE EF FA FB FC FD FE FF
</map>
</collation>
</charset>
</charsets>

View file

@ -19,7 +19,7 @@ ERROR 70100: Query execution was interrupted
show binlog events from <binlog_start>;
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # Begin_load_query # # ;file_id=#;block_len=#
master-bin.000001 # Execute_load_query # # use `test`; load data infile '../../std_data/rpl_loaddata.dat' into table t2 /* will be "killed" in the middle */ ;file_id=#
master-bin.000001 # Execute_load_query # # use `test`; LOAD DATA INFILE '../../std_data/rpl_loaddata.dat' INTO TABLE `t2` FIELDS TERMINATED BY '\t' ENCLOSED BY '' ESCAPED BY '\\' LINES TERMINATED BY '\n' (a, b) ;file_id=#
select
(@a:=load_file("MYSQLTEST_VARDIR/tmp/binlog_killed_bug27571.binlog"))
is not null;

View file

@ -0,0 +1,406 @@
###################################################################################
# CONFIGURATION
###################################################################################
CREATE TABLE nt_1 (a text, b int PRIMARY KEY) ENGINE = MyISAM;
CREATE TABLE nt_2 (a text, b int PRIMARY KEY) ENGINE = MyISAM;
CREATE TABLE tt_1 (a text, b int PRIMARY KEY) ENGINE = Innodb;
CREATE TABLE tt_2 (a text, b int PRIMARY KEY) ENGINE = Innodb;
CREATE TRIGGER tr_i_tt_1_to_nt_1 BEFORE INSERT ON tt_1 FOR EACH ROW
BEGIN
INSERT INTO nt_1 VALUES (NEW.a, NEW.b);
END|
CREATE TRIGGER tr_i_nt_2_to_tt_2 BEFORE INSERT ON nt_2 FOR EACH ROW
BEGIN
INSERT INTO tt_2 VALUES (NEW.a, NEW.b);
END|
###################################################################################
# CHECK HISTORY IN BINLOG
###################################################################################
*** "B M* T C" with error in M* generates in the binlog the "B M* R B T C" entries
INSERT INTO nt_1 VALUES ("new text 1", 1);
BEGIN;
INSERT INTO tt_1 VALUES (USER(), 2), (USER(), 1);
ERROR 23000: Duplicate entry '1' for key 'PRIMARY'
INSERT INTO tt_2 VALUES ("new text 3", 3);
COMMIT;
show binlog events from <binlog_start>;
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # Query # # use `test`; INSERT INTO nt_1 VALUES ("new text 1", 1)
master-bin.000001 # Query # # BEGIN
master-bin.000001 # Table_map # # table_id: # (test.tt_1)
master-bin.000001 # Table_map # # table_id: # (test.nt_1)
master-bin.000001 # Write_rows # # table_id: #
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
master-bin.000001 # Query # # ROLLBACK
master-bin.000001 # Query # # BEGIN
master-bin.000001 # Query # # use `test`; INSERT INTO tt_2 VALUES ("new text 3", 3)
master-bin.000001 # Xid # # COMMIT /* XID */
INSERT INTO tt_2 VALUES ("new text 4", 4);
BEGIN;
INSERT INTO nt_2 VALUES (USER(), 5), (USER(), 4);
ERROR 23000: Duplicate entry '4' for key 'PRIMARY'
INSERT INTO tt_2 VALUES ("new text 6", 6);
COMMIT;
show binlog events from <binlog_start>;
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # Query # # BEGIN
master-bin.000001 # Query # # use `test`; INSERT INTO tt_2 VALUES ("new text 4", 4)
master-bin.000001 # Xid # # COMMIT /* XID */
master-bin.000001 # Query # # BEGIN
master-bin.000001 # Table_map # # table_id: # (test.nt_2)
master-bin.000001 # Table_map # # table_id: # (test.tt_2)
master-bin.000001 # Write_rows # # table_id: #
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
master-bin.000001 # Query # # ROLLBACK
master-bin.000001 # Query # # BEGIN
master-bin.000001 # Query # # use `test`; INSERT INTO tt_2 VALUES ("new text 6", 6)
master-bin.000001 # Xid # # COMMIT /* XID */
*** "B M M* T C" with error in M* generates in the binlog the "B M M* T C" entries
INSERT INTO nt_1 VALUES ("new text 10", 10);
BEGIN;
INSERT INTO tt_1 VALUES ("new text 7", 7), ("new text 8", 8);
INSERT INTO tt_1 VALUES (USER(), 9), (USER(), 10);
ERROR 23000: Duplicate entry '10' for key 'PRIMARY'
INSERT INTO tt_2 VALUES ("new text 11", 11);
COMMIT;
show binlog events from <binlog_start>;
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # Query # # use `test`; INSERT INTO nt_1 VALUES ("new text 10", 10)
master-bin.000001 # Query # # BEGIN
master-bin.000001 # Query # # use `test`; INSERT INTO tt_1 VALUES ("new text 7", 7), ("new text 8", 8)
master-bin.000001 # Table_map # # table_id: # (test.tt_1)
master-bin.000001 # Table_map # # table_id: # (test.nt_1)
master-bin.000001 # Write_rows # # table_id: #
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
master-bin.000001 # Query # # use `test`; INSERT INTO tt_2 VALUES ("new text 11", 11)
master-bin.000001 # Xid # # COMMIT /* XID */
INSERT INTO tt_2 VALUES ("new text 15", 15);
BEGIN;
INSERT INTO nt_2 VALUES ("new text 12", 12), ("new text 13", 13);
INSERT INTO nt_2 VALUES (USER(), 14), (USER(), 15);
ERROR 23000: Duplicate entry '15' for key 'PRIMARY'
INSERT INTO tt_2 VALUES ("new text 16", 16);
COMMIT;
show binlog events from <binlog_start>;
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # Query # # BEGIN
master-bin.000001 # Query # # use `test`; INSERT INTO tt_2 VALUES ("new text 15", 15)
master-bin.000001 # Xid # # COMMIT /* XID */
master-bin.000001 # Query # # BEGIN
master-bin.000001 # Query # # use `test`; INSERT INTO nt_2 VALUES ("new text 12", 12), ("new text 13", 13)
master-bin.000001 # Table_map # # table_id: # (test.nt_2)
master-bin.000001 # Table_map # # table_id: # (test.tt_2)
master-bin.000001 # Write_rows # # table_id: #
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
master-bin.000001 # Query # # use `test`; INSERT INTO tt_2 VALUES ("new text 16", 16)
master-bin.000001 # Xid # # COMMIT /* XID */
*** "B M* M* T C" with error in M* generates in the binlog the "B M* R B M* R B T C" entries
INSERT INTO nt_1 VALUES ("new text 18", 18);
INSERT INTO nt_1 VALUES ("new text 20", 20);
BEGIN;
INSERT INTO tt_1 VALUES (USER(), 17), (USER(), 18);
ERROR 23000: Duplicate entry '18' for key 'PRIMARY'
INSERT INTO tt_1 VALUES (USER(), 19), (USER(), 20);
ERROR 23000: Duplicate entry '20' for key 'PRIMARY'
INSERT INTO tt_2 VALUES ("new text 21", 21);
COMMIT;
show binlog events from <binlog_start>;
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # Query # # use `test`; INSERT INTO nt_1 VALUES ("new text 18", 18)
master-bin.000001 # Query # # use `test`; INSERT INTO nt_1 VALUES ("new text 20", 20)
master-bin.000001 # Query # # BEGIN
master-bin.000001 # Table_map # # table_id: # (test.tt_1)
master-bin.000001 # Table_map # # table_id: # (test.nt_1)
master-bin.000001 # Write_rows # # table_id: #
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
master-bin.000001 # Query # # ROLLBACK
master-bin.000001 # Query # # BEGIN
master-bin.000001 # Table_map # # table_id: # (test.tt_1)
master-bin.000001 # Table_map # # table_id: # (test.nt_1)
master-bin.000001 # Write_rows # # table_id: #
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
master-bin.000001 # Query # # ROLLBACK
master-bin.000001 # Query # # BEGIN
master-bin.000001 # Query # # use `test`; INSERT INTO tt_2 VALUES ("new text 21", 21)
master-bin.000001 # Xid # # COMMIT /* XID */
INSERT INTO tt_2 VALUES ("new text 23", 23);
INSERT INTO tt_2 VALUES ("new text 25", 25);
BEGIN;
INSERT INTO nt_2 VALUES (USER(), 22), (USER(), 23);
ERROR 23000: Duplicate entry '23' for key 'PRIMARY'
INSERT INTO nt_2 VALUES (USER(), 24), (USER(), 25);
ERROR 23000: Duplicate entry '25' for key 'PRIMARY'
INSERT INTO tt_2 VALUES ("new text 26", 26);
COMMIT;
show binlog events from <binlog_start>;
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # Query # # BEGIN
master-bin.000001 # Query # # use `test`; INSERT INTO tt_2 VALUES ("new text 23", 23)
master-bin.000001 # Xid # # COMMIT /* XID */
master-bin.000001 # Query # # BEGIN
master-bin.000001 # Query # # use `test`; INSERT INTO tt_2 VALUES ("new text 25", 25)
master-bin.000001 # Xid # # COMMIT /* XID */
master-bin.000001 # Query # # BEGIN
master-bin.000001 # Table_map # # table_id: # (test.nt_2)
master-bin.000001 # Table_map # # table_id: # (test.tt_2)
master-bin.000001 # Write_rows # # table_id: #
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
master-bin.000001 # Query # # ROLLBACK
master-bin.000001 # Query # # BEGIN
master-bin.000001 # Table_map # # table_id: # (test.nt_2)
master-bin.000001 # Table_map # # table_id: # (test.tt_2)
master-bin.000001 # Write_rows # # table_id: #
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
master-bin.000001 # Query # # ROLLBACK
master-bin.000001 # Query # # BEGIN
master-bin.000001 # Query # # use `test`; INSERT INTO tt_2 VALUES ("new text 26", 26)
master-bin.000001 # Xid # # COMMIT /* XID */
*** "B T INSERT M...SELECT* C" with an error in INSERT M...SELECT* generates
*** in the binlog the following entries: "Nothing".
*** There is a bug in that will be fixed after WL#2687. Please, check BUG#47175 for further details.
TRUNCATE TABLE nt_2;
TRUNCATE TABLE tt_2;
INSERT INTO tt_2 VALUES ("new text 7", 7);
BEGIN;
INSERT INTO tt_2 VALUES ("new text 27", 27);
INSERT INTO nt_2(a, b) SELECT USER(), b FROM nt_1;
ERROR 23000: Duplicate entry '7' for key 'PRIMARY'
INSERT INTO tt_2 VALUES ("new text 28", 28);
ROLLBACK;
show binlog events from <binlog_start>;
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # Query # # use `test`; TRUNCATE TABLE nt_2
master-bin.000001 # Query # # BEGIN
master-bin.000001 # Query # # use `test`; TRUNCATE TABLE tt_2
master-bin.000001 # Xid # # COMMIT /* XID */
master-bin.000001 # Query # # BEGIN
master-bin.000001 # Query # # use `test`; INSERT INTO tt_2 VALUES ("new text 7", 7)
master-bin.000001 # Xid # # COMMIT /* XID */
*** "B INSERT M..SELECT* C" with an error in INSERT M...SELECT* generates
*** in the binlog the following entries: "B INSERT M..SELECT* R".
TRUNCATE TABLE nt_2;
TRUNCATE TABLE tt_2;
INSERT INTO tt_2 VALUES ("new text 7", 7);
BEGIN;
INSERT INTO nt_2(a, b) SELECT USER(), b FROM nt_1;
ERROR 23000: Duplicate entry '7' for key 'PRIMARY'
COMMIT;
show binlog events from <binlog_start>;
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # Query # # use `test`; TRUNCATE TABLE nt_2
master-bin.000001 # Query # # BEGIN
master-bin.000001 # Query # # use `test`; TRUNCATE TABLE tt_2
master-bin.000001 # Xid # # COMMIT /* XID */
master-bin.000001 # Query # # BEGIN
master-bin.000001 # Query # # use `test`; INSERT INTO tt_2 VALUES ("new text 7", 7)
master-bin.000001 # Xid # # COMMIT /* XID */
master-bin.000001 # Query # # BEGIN
master-bin.000001 # Table_map # # table_id: # (test.nt_2)
master-bin.000001 # Table_map # # table_id: # (test.tt_2)
master-bin.000001 # Write_rows # # table_id: #
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 # # ROLLBACK
*** "B N N T C" generates in the binlog the "B N C B N C B T C" entries
TRUNCATE TABLE nt_1;
TRUNCATE TABLE tt_2;
BEGIN;
INSERT INTO nt_1 VALUES (USER(), 1);
INSERT INTO nt_1 VALUES (USER(), 2);
INSERT INTO tt_2 VALUES (USER(), 3);
COMMIT;
show binlog events from <binlog_start>;
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # Query # # use `test`; TRUNCATE TABLE nt_1
master-bin.000001 # Query # # BEGIN
master-bin.000001 # Query # # use `test`; TRUNCATE TABLE tt_2
master-bin.000001 # Xid # # COMMIT /* XID */
master-bin.000001 # Query # # BEGIN
master-bin.000001 # Table_map # # table_id: # (test.nt_1)
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
master-bin.000001 # Query # # COMMIT
master-bin.000001 # Query # # BEGIN
master-bin.000001 # Table_map # # table_id: # (test.nt_1)
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
master-bin.000001 # Query # # COMMIT
master-bin.000001 # Query # # BEGIN
master-bin.000001 # Table_map # # table_id: # (test.tt_2)
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
master-bin.000001 # Xid # # COMMIT /* XID */
*** "B N N T R" generates in the binlog the "B N C B N C B T R" entries
BEGIN;
INSERT INTO nt_1 VALUES (USER(), 4);
INSERT INTO nt_1 VALUES (USER(), 5);
INSERT INTO tt_2 VALUES (USER(), 6);
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 # # BEGIN
master-bin.000001 # Table_map # # table_id: # (test.nt_1)
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
master-bin.000001 # Query # # COMMIT
master-bin.000001 # Query # # BEGIN
master-bin.000001 # Table_map # # table_id: # (test.nt_1)
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
master-bin.000001 # Query # # COMMIT
master-bin.000001 # Query # # BEGIN
master-bin.000001 # Table_map # # table_id: # (test.tt_2)
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
master-bin.000001 # Query # # ROLLBACK
*** "B N* N* T C" with error in N* generates in the binlog the "B N R B N R B T C" entries
BEGIN;
INSERT INTO nt_1 VALUES (USER(), 7), (USER(), 1);
ERROR 23000: Duplicate entry '1' for key 'PRIMARY'
INSERT INTO nt_1 VALUES (USER(), 8), (USER(), 1);
ERROR 23000: Duplicate entry '1' for key 'PRIMARY'
INSERT INTO tt_2 VALUES (USER(), 9);
COMMIT;
show binlog events from <binlog_start>;
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # Query # # BEGIN
master-bin.000001 # Table_map # # table_id: # (test.nt_1)
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
master-bin.000001 # Query # # ROLLBACK
master-bin.000001 # Query # # BEGIN
master-bin.000001 # Table_map # # table_id: # (test.nt_1)
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
master-bin.000001 # Query # # ROLLBACK
master-bin.000001 # Query # # BEGIN
master-bin.000001 # Table_map # # table_id: # (test.tt_2)
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
master-bin.000001 # Xid # # COMMIT /* XID */
*** "B N* N* T R" with error in N* generates in the binlog the "B N R B N R B T R" entries
BEGIN;
INSERT INTO nt_1 VALUES (USER(), 10), (USER(), 1);
ERROR 23000: Duplicate entry '1' for key 'PRIMARY'
INSERT INTO nt_1 VALUES (USER(), 11), (USER(), 1);
ERROR 23000: Duplicate entry '1' for key 'PRIMARY'
INSERT INTO tt_2 VALUES (USER(), 12);
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 # # BEGIN
master-bin.000001 # Table_map # # table_id: # (test.nt_1)
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
master-bin.000001 # Query # # ROLLBACK
master-bin.000001 # Query # # BEGIN
master-bin.000001 # Table_map # # table_id: # (test.nt_1)
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
master-bin.000001 # Query # # ROLLBACK
master-bin.000001 # Query # # BEGIN
master-bin.000001 # Table_map # # table_id: # (test.tt_2)
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
master-bin.000001 # Query # # ROLLBACK
*** "B N N T N T C" generates in the binlog the "B N C B N C B T N T C" entries
BEGIN;
INSERT INTO nt_1 VALUES (USER(), 13);
INSERT INTO nt_1 VALUES (USER(), 14);
INSERT INTO tt_2 VALUES (USER(), 15);
INSERT INTO nt_1 VALUES (USER(), 16);
INSERT INTO tt_2 VALUES (USER(), 17);
COMMIT;
show binlog events from <binlog_start>;
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # Query # # BEGIN
master-bin.000001 # Table_map # # table_id: # (test.nt_1)
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
master-bin.000001 # Query # # COMMIT
master-bin.000001 # Query # # BEGIN
master-bin.000001 # Table_map # # table_id: # (test.nt_1)
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
master-bin.000001 # Query # # COMMIT
master-bin.000001 # Query # # BEGIN
master-bin.000001 # Table_map # # table_id: # (test.tt_2)
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
master-bin.000001 # Table_map # # table_id: # (test.nt_1)
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
master-bin.000001 # Table_map # # table_id: # (test.tt_2)
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
master-bin.000001 # Xid # # COMMIT /* XID */
*** "B N N T N T R" generates in the binlog the "B N C B N C B T N T R" entries
BEGIN;
INSERT INTO nt_1 VALUES (USER(), 18);
INSERT INTO nt_1 VALUES (USER(), 19);
INSERT INTO tt_2 VALUES (USER(), 20);
INSERT INTO nt_1 VALUES (USER(), 21);
INSERT INTO tt_2 VALUES (USER(), 22);
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 # # BEGIN
master-bin.000001 # Table_map # # table_id: # (test.nt_1)
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
master-bin.000001 # Query # # COMMIT
master-bin.000001 # Query # # BEGIN
master-bin.000001 # Table_map # # table_id: # (test.nt_1)
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
master-bin.000001 # Query # # COMMIT
master-bin.000001 # Query # # BEGIN
master-bin.000001 # Table_map # # table_id: # (test.tt_2)
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
master-bin.000001 # Table_map # # table_id: # (test.nt_1)
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
master-bin.000001 # Table_map # # table_id: # (test.tt_2)
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
master-bin.000001 # Query # # ROLLBACK
###################################################################################
# CLEAN
###################################################################################
DROP TABLE tt_1;
DROP TABLE tt_2;
DROP TABLE nt_1;
DROP TABLE nt_2;

View file

@ -1309,3 +1309,27 @@ INSERT INTO test.t1 VALUES (1), (2);
CREATE TABLE test.t2 SELECT * FROM test.t1;
USE test;
DROP TABLES t1, t2;
RESET MASTER;
CREATE TABLE t1 (a INT PRIMARY KEY);
BINLOG '
3u9kSA8KAAAAZgAAAGoAAAABAAQANS4xLjM1LW1hcmlhLWJldGExLWRlYnVnLWxvZwAAAAAAAAAA
AAAAAAAAAAAAAAAAAADe72RIEzgNAAgAEgAEBAQEEgAAUwAEGggAAAAICAgC
';
INSERT INTO t1 VALUES (1);
BINLOG '
3u9kSBMUAAAAKQAAAJEBAAAAABoAAAAAAAAABHRlc3QAAnQxAAEDAAA=
3u9kSBcUAAAAIgAAALMBAAAQABoAAAAAAAEAAf/+AgAAAA==
';
SHOW BINLOG EVENTS;
Log_name Pos Event_type Server_id End_log_pos Info
# # Format_desc 1 # Server ver: #, Binlog ver: #
# # Query 1 # use `test`; CREATE TABLE t1 (a INT PRIMARY KEY)
# # Query 1 # BEGIN
# # Table_map 1 # table_id: # (test.t1)
# # Write_rows 1 # table_id: # flags: STMT_END_F
# # Query 1 # COMMIT
# # Query 1 # BEGIN
# # Table_map 1 # table_id: # (test.t1)
# # Write_rows 1 # table_id: # flags: STMT_END_F
# # Query 1 # COMMIT
DROP TABLE t1;

View file

@ -1,17 +1,31 @@
drop database if exists `drop-temp+table-test`;
reset master;
create database `drop-temp+table-test`;
use `drop-temp+table-test`;
create temporary table shortn1 (a int);
create temporary table `table:name` (a int);
create temporary table shortn2 (a int);
select get_lock("a",10);
get_lock("a",10)
DROP DATABASE IF EXISTS `drop-temp+table-test`;
RESET MASTER;
CREATE DATABASE `drop-temp+table-test`;
USE `drop-temp+table-test`;
CREATE TEMPORARY TABLE shortn1 (a INT);
CREATE TEMPORARY TABLE `table:name` (a INT);
CREATE TEMPORARY TABLE shortn2 (a INT);
CREATE TEMPORARY TABLE tmp(c1 int);
CREATE TEMPORARY TABLE tmp1(c1 int);
CREATE TEMPORARY TABLE tmp2(c1 int);
CREATE TEMPORARY TABLE tmp3(c1 int);
CREATE TABLE t(c1 int);
DROP TEMPORARY TABLE IF EXISTS tmp;
DROP TEMPORARY TABLE IF EXISTS tmp;
DROP TEMPORARY TABLE IF EXISTS tmp, tmp1;
DROP TEMPORARY TABLE tmp3;
DROP TABLE IF EXISTS tmp2, t;
DROP TABLE IF EXISTS tmp2, t;
SELECT GET_LOCK("a",10);
GET_LOCK("a",10)
1
select get_lock("a",10);
get_lock("a",10)
SELECT GET_LOCK("a",10);
GET_LOCK("a",10)
1
show binlog events from <binlog_start>;
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # Query # # create database `drop-temp+table-test`
drop database `drop-temp+table-test`;
master-bin.000001 # Query # # CREATE DATABASE `drop-temp+table-test`
master-bin.000001 # Query # # use `drop-temp+table-test`; CREATE TABLE t(c1 int)
master-bin.000001 # Query # # use `drop-temp+table-test`; DROP TABLE IF EXISTS `t` /* generated by server */
master-bin.000001 # Query # # use `drop-temp+table-test`; DROP TABLE IF EXISTS tmp2, t
DROP DATABASE `drop-temp+table-test`;

View file

@ -0,0 +1,440 @@
###################################################################################
# CONFIGURATION
###################################################################################
CREATE TABLE nt_1 (a text, b int PRIMARY KEY) ENGINE = MyISAM;
CREATE TABLE nt_2 (a text, b int PRIMARY KEY) ENGINE = MyISAM;
CREATE TABLE tt_1 (a text, b int PRIMARY KEY) ENGINE = Innodb;
CREATE TABLE tt_2 (a text, b int PRIMARY KEY) ENGINE = Innodb;
CREATE TRIGGER tr_i_tt_1_to_nt_1 BEFORE INSERT ON tt_1 FOR EACH ROW
BEGIN
INSERT INTO nt_1 VALUES (NEW.a, NEW.b);
END|
CREATE TRIGGER tr_i_nt_2_to_tt_2 BEFORE INSERT ON nt_2 FOR EACH ROW
BEGIN
INSERT INTO tt_2 VALUES (NEW.a, NEW.b);
END|
###################################################################################
# CHECK HISTORY IN BINLOG
###################################################################################
*** "B M* T C" with error in M* generates in the binlog the "B M* R B T C" entries
INSERT INTO nt_1 VALUES ("new text 1", 1);
BEGIN;
INSERT INTO tt_1 VALUES (USER(), 2), (USER(), 1);
ERROR 23000: Duplicate entry '1' for key 'PRIMARY'
INSERT INTO tt_2 VALUES ("new text 3", 3);
COMMIT;
show binlog events from <binlog_start>;
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # Query # # BEGIN
master-bin.000001 # Table_map # # table_id: # (test.nt_1)
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
master-bin.000001 # Query # # COMMIT
master-bin.000001 # Query # # BEGIN
master-bin.000001 # Table_map # # table_id: # (test.tt_1)
master-bin.000001 # Table_map # # table_id: # (test.nt_1)
master-bin.000001 # Write_rows # # table_id: #
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
master-bin.000001 # Query # # ROLLBACK
master-bin.000001 # Query # # BEGIN
master-bin.000001 # Table_map # # table_id: # (test.tt_2)
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
master-bin.000001 # Xid # # COMMIT /* XID */
INSERT INTO tt_2 VALUES ("new text 4", 4);
BEGIN;
INSERT INTO nt_2 VALUES (USER(), 5), (USER(), 4);
ERROR 23000: Duplicate entry '4' for key 'PRIMARY'
INSERT INTO tt_2 VALUES ("new text 6", 6);
COMMIT;
show binlog events from <binlog_start>;
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # Query # # BEGIN
master-bin.000001 # Table_map # # table_id: # (test.tt_2)
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
master-bin.000001 # Xid # # COMMIT /* XID */
master-bin.000001 # Query # # BEGIN
master-bin.000001 # Table_map # # table_id: # (test.nt_2)
master-bin.000001 # Table_map # # table_id: # (test.tt_2)
master-bin.000001 # Write_rows # # table_id: #
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
master-bin.000001 # Query # # ROLLBACK
master-bin.000001 # Query # # BEGIN
master-bin.000001 # Table_map # # table_id: # (test.tt_2)
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
master-bin.000001 # Xid # # COMMIT /* XID */
*** "B M M* T C" with error in M* generates in the binlog the "B M M* T C" entries
INSERT INTO nt_1 VALUES ("new text 10", 10);
BEGIN;
INSERT INTO tt_1 VALUES ("new text 7", 7), ("new text 8", 8);
INSERT INTO tt_1 VALUES (USER(), 9), (USER(), 10);
ERROR 23000: Duplicate entry '10' for key 'PRIMARY'
INSERT INTO tt_2 VALUES ("new text 11", 11);
COMMIT;
show binlog events from <binlog_start>;
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # Query # # BEGIN
master-bin.000001 # Table_map # # table_id: # (test.nt_1)
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
master-bin.000001 # Query # # COMMIT
master-bin.000001 # Query # # BEGIN
master-bin.000001 # Table_map # # table_id: # (test.tt_1)
master-bin.000001 # Table_map # # table_id: # (test.nt_1)
master-bin.000001 # Write_rows # # table_id: #
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 # Table_map # # table_id: # (test.tt_1)
master-bin.000001 # Table_map # # table_id: # (test.nt_1)
master-bin.000001 # Write_rows # # table_id: #
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
master-bin.000001 # Table_map # # table_id: # (test.tt_2)
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
master-bin.000001 # Xid # # COMMIT /* XID */
INSERT INTO tt_2 VALUES ("new text 15", 15);
BEGIN;
INSERT INTO nt_2 VALUES ("new text 12", 12), ("new text 13", 13);
INSERT INTO nt_2 VALUES (USER(), 14), (USER(), 15);
ERROR 23000: Duplicate entry '15' for key 'PRIMARY'
INSERT INTO tt_2 VALUES ("new text 16", 16);
COMMIT;
show binlog events from <binlog_start>;
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # Query # # BEGIN
master-bin.000001 # Table_map # # table_id: # (test.tt_2)
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
master-bin.000001 # Xid # # COMMIT /* XID */
master-bin.000001 # Query # # BEGIN
master-bin.000001 # Table_map # # table_id: # (test.nt_2)
master-bin.000001 # Table_map # # table_id: # (test.tt_2)
master-bin.000001 # Write_rows # # table_id: #
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 # Table_map # # table_id: # (test.nt_2)
master-bin.000001 # Table_map # # table_id: # (test.tt_2)
master-bin.000001 # Write_rows # # table_id: #
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
master-bin.000001 # Table_map # # table_id: # (test.tt_2)
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
master-bin.000001 # Xid # # COMMIT /* XID */
*** "B M* M* T C" with error in M* generates in the binlog the "B M* R B M* R B T C" entries
INSERT INTO nt_1 VALUES ("new text 18", 18);
INSERT INTO nt_1 VALUES ("new text 20", 20);
BEGIN;
INSERT INTO tt_1 VALUES (USER(), 17), (USER(), 18);
ERROR 23000: Duplicate entry '18' for key 'PRIMARY'
INSERT INTO tt_1 VALUES (USER(), 19), (USER(), 20);
ERROR 23000: Duplicate entry '20' for key 'PRIMARY'
INSERT INTO tt_2 VALUES ("new text 21", 21);
COMMIT;
show binlog events from <binlog_start>;
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # Query # # BEGIN
master-bin.000001 # Table_map # # table_id: # (test.nt_1)
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
master-bin.000001 # Query # # COMMIT
master-bin.000001 # Query # # BEGIN
master-bin.000001 # Table_map # # table_id: # (test.nt_1)
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
master-bin.000001 # Query # # COMMIT
master-bin.000001 # Query # # BEGIN
master-bin.000001 # Table_map # # table_id: # (test.tt_1)
master-bin.000001 # Table_map # # table_id: # (test.nt_1)
master-bin.000001 # Write_rows # # table_id: #
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
master-bin.000001 # Query # # ROLLBACK
master-bin.000001 # Query # # BEGIN
master-bin.000001 # Table_map # # table_id: # (test.tt_1)
master-bin.000001 # Table_map # # table_id: # (test.nt_1)
master-bin.000001 # Write_rows # # table_id: #
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
master-bin.000001 # Query # # ROLLBACK
master-bin.000001 # Query # # BEGIN
master-bin.000001 # Table_map # # table_id: # (test.tt_2)
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
master-bin.000001 # Xid # # COMMIT /* XID */
INSERT INTO tt_2 VALUES ("new text 23", 23);
INSERT INTO tt_2 VALUES ("new text 25", 25);
BEGIN;
INSERT INTO nt_2 VALUES (USER(), 22), (USER(), 23);
ERROR 23000: Duplicate entry '23' for key 'PRIMARY'
INSERT INTO nt_2 VALUES (USER(), 24), (USER(), 25);
ERROR 23000: Duplicate entry '25' for key 'PRIMARY'
INSERT INTO tt_2 VALUES ("new text 26", 26);
COMMIT;
show binlog events from <binlog_start>;
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # Query # # BEGIN
master-bin.000001 # Table_map # # table_id: # (test.tt_2)
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
master-bin.000001 # Xid # # COMMIT /* XID */
master-bin.000001 # Query # # BEGIN
master-bin.000001 # Table_map # # table_id: # (test.tt_2)
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
master-bin.000001 # Xid # # COMMIT /* XID */
master-bin.000001 # Query # # BEGIN
master-bin.000001 # Table_map # # table_id: # (test.nt_2)
master-bin.000001 # Table_map # # table_id: # (test.tt_2)
master-bin.000001 # Write_rows # # table_id: #
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
master-bin.000001 # Query # # ROLLBACK
master-bin.000001 # Query # # BEGIN
master-bin.000001 # Table_map # # table_id: # (test.nt_2)
master-bin.000001 # Table_map # # table_id: # (test.tt_2)
master-bin.000001 # Write_rows # # table_id: #
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
master-bin.000001 # Query # # ROLLBACK
master-bin.000001 # Query # # BEGIN
master-bin.000001 # Table_map # # table_id: # (test.tt_2)
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
master-bin.000001 # Xid # # COMMIT /* XID */
*** "B T INSERT M...SELECT* C" with an error in INSERT M...SELECT* generates
*** in the binlog the following entries: "Nothing".
*** There is a bug in that will be fixed after WL#2687. Please, check BUG#47175 for further details.
TRUNCATE TABLE nt_2;
TRUNCATE TABLE tt_2;
INSERT INTO tt_2 VALUES ("new text 7", 7);
BEGIN;
INSERT INTO tt_2 VALUES ("new text 27", 27);
INSERT INTO nt_2(a, b) SELECT USER(), b FROM nt_1;
ERROR 23000: Duplicate entry '7' for key 'PRIMARY'
INSERT INTO tt_2 VALUES ("new text 28", 28);
ROLLBACK;
show binlog events from <binlog_start>;
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # Query # # use `test`; TRUNCATE TABLE nt_2
master-bin.000001 # Query # # BEGIN
master-bin.000001 # Query # # use `test`; TRUNCATE TABLE tt_2
master-bin.000001 # Xid # # COMMIT /* XID */
master-bin.000001 # Query # # BEGIN
master-bin.000001 # Table_map # # table_id: # (test.tt_2)
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
master-bin.000001 # Xid # # COMMIT /* XID */
*** "B INSERT M..SELECT* C" with an error in INSERT M...SELECT* generates
*** in the binlog the following entries: "B INSERT M..SELECT* R".
TRUNCATE TABLE nt_2;
TRUNCATE TABLE tt_2;
INSERT INTO tt_2 VALUES ("new text 7", 7);
BEGIN;
INSERT INTO nt_2(a, b) SELECT USER(), b FROM nt_1;
ERROR 23000: Duplicate entry '7' for key 'PRIMARY'
COMMIT;
show binlog events from <binlog_start>;
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # Query # # use `test`; TRUNCATE TABLE nt_2
master-bin.000001 # Query # # BEGIN
master-bin.000001 # Query # # use `test`; TRUNCATE TABLE tt_2
master-bin.000001 # Xid # # COMMIT /* XID */
master-bin.000001 # Query # # BEGIN
master-bin.000001 # Table_map # # table_id: # (test.tt_2)
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
master-bin.000001 # Xid # # COMMIT /* XID */
master-bin.000001 # Query # # BEGIN
master-bin.000001 # Table_map # # table_id: # (test.nt_2)
master-bin.000001 # Table_map # # table_id: # (test.tt_2)
master-bin.000001 # Write_rows # # table_id: #
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 # # ROLLBACK
*** "B N N T C" generates in the binlog the "B N C B N C B T C" entries
TRUNCATE TABLE nt_1;
TRUNCATE TABLE tt_2;
BEGIN;
INSERT INTO nt_1 VALUES (USER(), 1);
INSERT INTO nt_1 VALUES (USER(), 2);
INSERT INTO tt_2 VALUES (USER(), 3);
COMMIT;
show binlog events from <binlog_start>;
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # Query # # use `test`; TRUNCATE TABLE nt_1
master-bin.000001 # Query # # BEGIN
master-bin.000001 # Query # # use `test`; TRUNCATE TABLE tt_2
master-bin.000001 # Xid # # COMMIT /* XID */
master-bin.000001 # Query # # BEGIN
master-bin.000001 # Table_map # # table_id: # (test.nt_1)
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
master-bin.000001 # Query # # COMMIT
master-bin.000001 # Query # # BEGIN
master-bin.000001 # Table_map # # table_id: # (test.nt_1)
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
master-bin.000001 # Query # # COMMIT
master-bin.000001 # Query # # BEGIN
master-bin.000001 # Table_map # # table_id: # (test.tt_2)
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
master-bin.000001 # Xid # # COMMIT /* XID */
*** "B N N T R" generates in the binlog the "B N C B N C B T R" entries
BEGIN;
INSERT INTO nt_1 VALUES (USER(), 4);
INSERT INTO nt_1 VALUES (USER(), 5);
INSERT INTO tt_2 VALUES (USER(), 6);
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 # # BEGIN
master-bin.000001 # Table_map # # table_id: # (test.nt_1)
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
master-bin.000001 # Query # # COMMIT
master-bin.000001 # Query # # BEGIN
master-bin.000001 # Table_map # # table_id: # (test.nt_1)
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
master-bin.000001 # Query # # COMMIT
master-bin.000001 # Query # # BEGIN
master-bin.000001 # Table_map # # table_id: # (test.tt_2)
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
master-bin.000001 # Query # # ROLLBACK
*** "B N* N* T C" with error in N* generates in the binlog the "B N R B N R B T C" entries
BEGIN;
INSERT INTO nt_1 VALUES (USER(), 7), (USER(), 1);
ERROR 23000: Duplicate entry '1' for key 'PRIMARY'
INSERT INTO nt_1 VALUES (USER(), 8), (USER(), 1);
ERROR 23000: Duplicate entry '1' for key 'PRIMARY'
INSERT INTO tt_2 VALUES (USER(), 9);
COMMIT;
show binlog events from <binlog_start>;
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # Query # # BEGIN
master-bin.000001 # Table_map # # table_id: # (test.nt_1)
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
master-bin.000001 # Query # # ROLLBACK
master-bin.000001 # Query # # BEGIN
master-bin.000001 # Table_map # # table_id: # (test.nt_1)
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
master-bin.000001 # Query # # ROLLBACK
master-bin.000001 # Query # # BEGIN
master-bin.000001 # Table_map # # table_id: # (test.tt_2)
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
master-bin.000001 # Xid # # COMMIT /* XID */
*** "B N* N* T R" with error in N* generates in the binlog the "B N R B N R B T R" entries
BEGIN;
INSERT INTO nt_1 VALUES (USER(), 10), (USER(), 1);
ERROR 23000: Duplicate entry '1' for key 'PRIMARY'
INSERT INTO nt_1 VALUES (USER(), 11), (USER(), 1);
ERROR 23000: Duplicate entry '1' for key 'PRIMARY'
INSERT INTO tt_2 VALUES (USER(), 12);
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 # # BEGIN
master-bin.000001 # Table_map # # table_id: # (test.nt_1)
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
master-bin.000001 # Query # # ROLLBACK
master-bin.000001 # Query # # BEGIN
master-bin.000001 # Table_map # # table_id: # (test.nt_1)
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
master-bin.000001 # Query # # ROLLBACK
master-bin.000001 # Query # # BEGIN
master-bin.000001 # Table_map # # table_id: # (test.tt_2)
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
master-bin.000001 # Query # # ROLLBACK
*** "B N N T N T C" generates in the binlog the "B N C B N C B T N T C" entries
BEGIN;
INSERT INTO nt_1 VALUES (USER(), 13);
INSERT INTO nt_1 VALUES (USER(), 14);
INSERT INTO tt_2 VALUES (USER(), 15);
INSERT INTO nt_1 VALUES (USER(), 16);
INSERT INTO tt_2 VALUES (USER(), 17);
COMMIT;
show binlog events from <binlog_start>;
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # Query # # BEGIN
master-bin.000001 # Table_map # # table_id: # (test.nt_1)
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
master-bin.000001 # Query # # COMMIT
master-bin.000001 # Query # # BEGIN
master-bin.000001 # Table_map # # table_id: # (test.nt_1)
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
master-bin.000001 # Query # # COMMIT
master-bin.000001 # Query # # BEGIN
master-bin.000001 # Table_map # # table_id: # (test.tt_2)
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
master-bin.000001 # Table_map # # table_id: # (test.nt_1)
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
master-bin.000001 # Table_map # # table_id: # (test.tt_2)
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
master-bin.000001 # Xid # # COMMIT /* XID */
*** "B N N T N T R" generates in the binlog the "B N C B N C B T N T R" entries
BEGIN;
INSERT INTO nt_1 VALUES (USER(), 18);
INSERT INTO nt_1 VALUES (USER(), 19);
INSERT INTO tt_2 VALUES (USER(), 20);
INSERT INTO nt_1 VALUES (USER(), 21);
INSERT INTO tt_2 VALUES (USER(), 22);
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 # # BEGIN
master-bin.000001 # Table_map # # table_id: # (test.nt_1)
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
master-bin.000001 # Query # # COMMIT
master-bin.000001 # Query # # BEGIN
master-bin.000001 # Table_map # # table_id: # (test.nt_1)
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
master-bin.000001 # Query # # COMMIT
master-bin.000001 # Query # # BEGIN
master-bin.000001 # Table_map # # table_id: # (test.tt_2)
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
master-bin.000001 # Table_map # # table_id: # (test.nt_1)
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
master-bin.000001 # Table_map # # table_id: # (test.tt_2)
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
master-bin.000001 # Query # # ROLLBACK
###################################################################################
# CLEAN
###################################################################################
DROP TABLE tt_1;
DROP TABLE tt_2;
DROP TABLE nt_1;
DROP TABLE nt_2;

View file

@ -133,6 +133,10 @@ master-bin.000001 # Query # # BEGIN
master-bin.000001 # Table_map # # table_id: # (test.t1)
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
master-bin.000001 # Xid # # COMMIT /* XID */
master-bin.000001 # Query # # BEGIN
master-bin.000001 # Table_map # # table_id: # (test.t2)
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
master-bin.000001 # Query # # COMMIT
insert into t1 values(11);
commit;
show binlog events from <binlog_start>;
@ -144,6 +148,8 @@ master-bin.000001 # Xid # # COMMIT /* XID */
master-bin.000001 # Query # # BEGIN
master-bin.000001 # Table_map # # table_id: # (test.t2)
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
master-bin.000001 # Query # # COMMIT
master-bin.000001 # Query # # BEGIN
master-bin.000001 # Table_map # # table_id: # (test.t1)
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
master-bin.000001 # Xid # # COMMIT /* XID */
@ -272,6 +278,10 @@ master-bin.000001 # Query # # BEGIN
master-bin.000001 # Table_map # # table_id: # (test.t1)
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
master-bin.000001 # Xid # # COMMIT /* XID */
master-bin.000001 # Query # # BEGIN
master-bin.000001 # Table_map # # table_id: # (test.t2)
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
master-bin.000001 # Query # # COMMIT
master-bin.000001 # Query # # use `test`; drop table t1,t2
master-bin.000001 # Query # # use `test`; create table t0 (n int)
master-bin.000001 # Query # # BEGIN
@ -372,7 +382,7 @@ master-bin.000001 # Query # # use `test`; DROP TABLE if exists t2
master-bin.000001 # Query # # BEGIN
master-bin.000001 # Table_map # # table_id: # (test.t1)
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
master-bin.000001 # Query # # ROLLBACK
master-bin.000001 # Query # # COMMIT
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 # # BEGIN
@ -390,9 +400,7 @@ master-bin.000001 # Query # # use `test`; DROP TABLE t2
master-bin.000001 # Query # # BEGIN
master-bin.000001 # Table_map # # table_id: # (test.t1)
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
master-bin.000001 # Table_map # # table_id: # (test.t1)
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
master-bin.000001 # Query # # ROLLBACK
master-bin.000001 # Query # # COMMIT
master-bin.000001 # Query # # BEGIN
master-bin.000001 # Table_map # # table_id: # (test.t1)
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
@ -400,7 +408,11 @@ master-bin.000001 # Query # # COMMIT
master-bin.000001 # Query # # BEGIN
master-bin.000001 # Table_map # # table_id: # (test.t1)
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
master-bin.000001 # Query # # ROLLBACK
master-bin.000001 # Query # # COMMIT
master-bin.000001 # Query # # BEGIN
master-bin.000001 # Table_map # # table_id: # (test.t1)
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
master-bin.000001 # Query # # COMMIT
master-bin.000001 # Query # # use `test`; TRUNCATE table t2
master-bin.000001 # Query # # BEGIN
master-bin.000001 # Table_map # # table_id: # (test.t1)
@ -917,7 +929,7 @@ master-bin.000001 # User var # # @`b`=_latin1 0x3135 COLLATE latin1_swedish_ci
master-bin.000001 # Begin_load_query # # ;file_id=#;block_len=#
master-bin.000001 # Intvar # # INSERT_ID=10
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/rpl_loaddata.dat' into table t4 (a, @b) set b= @b + bug27417(2) ;file_id=#
master-bin.000001 # Execute_load_query # # use `test`; LOAD DATA INFILE '../../std_data/rpl_loaddata.dat' INTO TABLE `t4` FIELDS TERMINATED BY '\t' ENCLOSED BY '' ESCAPED BY '\\' LINES TERMINATED BY '\n' (a, @b) SET b=((@b) + `bug27417`(2)) ;file_id=#
master-bin.000001 # Query # # ROLLBACK
drop trigger trg_del_t2;
drop table t1,t2,t3,t4,t5;

View file

@ -0,0 +1,161 @@
Verbose statements from : write-partial-row.binlog
select replace(txt,'\r', '') as stmt from raw_binlog_rows where txt like '###%';
stmt
### INSERT INTO mysql.ndb_apply_status
### SET
### @1=1
### @2=25769803786
### @3=''
### @4=0
### @5=0
### INSERT INTO test.ba
### SET
### @1=3
### @2=3
### @3=3
### INSERT INTO test.ba
### SET
### @1=1
### @2=1
### @3=1
### INSERT INTO test.ba
### SET
### @1=2
### @2=2
### @3=2
### INSERT INTO test.ba
### SET
### @1=4
### @2=4
### @3=4
### INSERT INTO test.ba
### SET
### @1=4
### @3=40
### DELETE FROM test.ba
### WHERE
### @1=2
drop table raw_binlog_rows;
Verbose statements from : write-full-row.binlog
select replace(txt,'\r', '') as stmt from raw_binlog_rows where txt like '###%';
stmt
### INSERT INTO mysql.ndb_apply_status
### SET
### @1=2
### @2=25769803786
### @3=''
### @4=0
### @5=0
### INSERT INTO test.ba
### SET
### @1=3
### @2=3
### @3=3
### INSERT INTO test.ba
### SET
### @1=1
### @2=1
### @3=1
### INSERT INTO test.ba
### SET
### @1=2
### @2=2
### @3=2
### INSERT INTO test.ba
### SET
### @1=4
### @2=4
### @3=4
### INSERT INTO test.ba
### SET
### @1=4
### @2=4
### @3=40
### DELETE FROM test.ba
### WHERE
### @1=2
drop table raw_binlog_rows;
Verbose statements from : update-partial-row.binlog
select replace(txt,'\r', '') as stmt from raw_binlog_rows where txt like '###%';
stmt
### INSERT INTO mysql.ndb_apply_status
### SET
### @1=3
### @2=25769803786
### @3=''
### @4=0
### @5=0
### INSERT INTO test.ba
### SET
### @1=3
### @2=3
### @3=3
### INSERT INTO test.ba
### SET
### @1=1
### @2=1
### @3=1
### INSERT INTO test.ba
### SET
### @1=2
### @2=2
### @3=2
### INSERT INTO test.ba
### SET
### @1=4
### @2=4
### @3=4
### UPDATE test.ba
### WHERE
### @1=4
### @3=4
### SET
### @1=4
### @3=40
### DELETE FROM test.ba
### WHERE
### @1=2
drop table raw_binlog_rows;
Verbose statements from : update-full-row.binlog
select replace(txt,'\r', '') as stmt from raw_binlog_rows where txt like '###%';
stmt
### INSERT INTO mysql.ndb_apply_status
### SET
### @1=4
### @2=25769803786
### @3=''
### @4=0
### @5=0
### INSERT INTO test.ba
### SET
### @1=3
### @2=3
### @3=3
### INSERT INTO test.ba
### SET
### @1=1
### @2=1
### @3=1
### INSERT INTO test.ba
### SET
### @1=2
### @2=2
### @3=2
### INSERT INTO test.ba
### SET
### @1=4
### @2=4
### @3=4
### UPDATE test.ba
### WHERE
### @1=4
### @2=4
### @3=4
### SET
### @1=4
### @2=4
### @3=40
### DELETE FROM test.ba
### WHERE
### @1=2
drop table raw_binlog_rows;

View file

@ -784,3 +784,24 @@ INSERT INTO test.t1 VALUES (1), (2);
CREATE TABLE test.t2 SELECT * FROM test.t1;
USE test;
DROP TABLES t1, t2;
RESET MASTER;
CREATE TABLE t1 (a INT PRIMARY KEY);
BINLOG '
3u9kSA8KAAAAZgAAAGoAAAABAAQANS4xLjM1LW1hcmlhLWJldGExLWRlYnVnLWxvZwAAAAAAAAAA
AAAAAAAAAAAAAAAAAADe72RIEzgNAAgAEgAEBAQEEgAAUwAEGggAAAAICAgC
';
INSERT INTO t1 VALUES (1);
BINLOG '
3u9kSBMUAAAAKQAAAJEBAAAAABoAAAAAAAAABHRlc3QAAnQxAAEDAAA=
3u9kSBcUAAAAIgAAALMBAAAQABoAAAAAAAEAAf/+AgAAAA==
';
SHOW BINLOG EVENTS;
Log_name Pos Event_type Server_id End_log_pos Info
# # Format_desc 1 # Server ver: #, Binlog ver: #
# # Query 1 # use `test`; CREATE TABLE t1 (a INT PRIMARY KEY)
# # Query 1 # use `test`; INSERT INTO t1 VALUES (1)
# # Query 1 # BEGIN
# # Table_map 1 # table_id: # (test.t1)
# # Write_rows 1 # table_id: # flags: STMT_END_F
# # Query 1 # COMMIT
DROP TABLE t1;

View file

@ -127,7 +127,7 @@ master-bin.000001 # Query # # COMMIT
master-bin.000001 # Query # # use `test`; create table t2 (a varchar(200)) engine=blackhole
master-bin.000001 # Query # # BEGIN
master-bin.000001 # Begin_load_query # # ;file_id=#;block_len=581
master-bin.000001 # Execute_load_query # # use `test`; load data infile '../../std_data/words.dat' into table t2 ;file_id=#
master-bin.000001 # Execute_load_query # # use `test`; LOAD DATA INFILE '../../std_data/words.dat' INTO TABLE `t2` FIELDS TERMINATED BY '\t' ENCLOSED BY '' ESCAPED BY '\\' LINES TERMINATED BY '\n' (a) ;file_id=#
master-bin.000001 # Query # # COMMIT
master-bin.000001 # Query # # use `test`; alter table t1 add b int
master-bin.000001 # Query # # use `test`; alter table t1 drop b

View file

@ -1,21 +1,43 @@
drop database if exists `drop-temp+table-test`;
reset master;
create database `drop-temp+table-test`;
use `drop-temp+table-test`;
create temporary table shortn1 (a int);
create temporary table `table:name` (a int);
create temporary table shortn2 (a int);
select get_lock("a",10);
get_lock("a",10)
DROP DATABASE IF EXISTS `drop-temp+table-test`;
RESET MASTER;
CREATE DATABASE `drop-temp+table-test`;
USE `drop-temp+table-test`;
CREATE TEMPORARY TABLE shortn1 (a INT);
CREATE TEMPORARY TABLE `table:name` (a INT);
CREATE TEMPORARY TABLE shortn2 (a INT);
CREATE TEMPORARY TABLE tmp(c1 int);
CREATE TEMPORARY TABLE tmp1(c1 int);
CREATE TEMPORARY TABLE tmp2(c1 int);
CREATE TEMPORARY TABLE tmp3(c1 int);
CREATE TABLE t(c1 int);
DROP TEMPORARY TABLE IF EXISTS tmp;
DROP TEMPORARY TABLE IF EXISTS tmp;
DROP TEMPORARY TABLE IF EXISTS tmp, tmp1;
DROP TEMPORARY TABLE tmp3;
DROP TABLE IF EXISTS tmp2, t;
DROP TABLE IF EXISTS tmp2, t;
SELECT GET_LOCK("a",10);
GET_LOCK("a",10)
1
select get_lock("a",10);
get_lock("a",10)
SELECT GET_LOCK("a",10);
GET_LOCK("a",10)
1
show binlog events from <binlog_start>;
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # Query # # create database `drop-temp+table-test`
master-bin.000001 # Query # # use `drop-temp+table-test`; create temporary table shortn1 (a int)
master-bin.000001 # Query # # use `drop-temp+table-test`; create temporary table `table:name` (a int)
master-bin.000001 # Query # # use `drop-temp+table-test`; create temporary table shortn2 (a int)
master-bin.000001 # Query # # CREATE DATABASE `drop-temp+table-test`
master-bin.000001 # Query # # use `drop-temp+table-test`; CREATE TEMPORARY TABLE shortn1 (a INT)
master-bin.000001 # Query # # use `drop-temp+table-test`; CREATE TEMPORARY TABLE `table:name` (a INT)
master-bin.000001 # Query # # use `drop-temp+table-test`; CREATE TEMPORARY TABLE shortn2 (a INT)
master-bin.000001 # Query # # use `drop-temp+table-test`; CREATE TEMPORARY TABLE tmp(c1 int)
master-bin.000001 # Query # # use `drop-temp+table-test`; CREATE TEMPORARY TABLE tmp1(c1 int)
master-bin.000001 # Query # # use `drop-temp+table-test`; CREATE TEMPORARY TABLE tmp2(c1 int)
master-bin.000001 # Query # # use `drop-temp+table-test`; CREATE TEMPORARY TABLE tmp3(c1 int)
master-bin.000001 # Query # # use `drop-temp+table-test`; CREATE TABLE t(c1 int)
master-bin.000001 # Query # # use `drop-temp+table-test`; DROP TEMPORARY TABLE IF EXISTS tmp
master-bin.000001 # Query # # use `drop-temp+table-test`; DROP TEMPORARY TABLE IF EXISTS tmp
master-bin.000001 # Query # # use `drop-temp+table-test`; DROP TEMPORARY TABLE IF EXISTS tmp, tmp1
master-bin.000001 # Query # # use `drop-temp+table-test`; DROP TEMPORARY TABLE tmp3
master-bin.000001 # Query # # use `drop-temp+table-test`; DROP TABLE IF EXISTS tmp2, t
master-bin.000001 # Query # # use `drop-temp+table-test`; DROP TABLE IF EXISTS tmp2, t
master-bin.000001 # Query # # use `drop-temp+table-test`; DROP /*!40005 TEMPORARY */ TABLE IF EXISTS `shortn2`,`table:name`,`shortn1`
drop database `drop-temp+table-test`;
DROP DATABASE `drop-temp+table-test`;

View file

@ -625,7 +625,7 @@ master-bin.000001 # Query # # BEGIN
master-bin.000001 # Intvar # # INSERT_ID=10
master-bin.000001 # Begin_load_query # # ;file_id=#;block_len=#
master-bin.000001 # Intvar # # INSERT_ID=10
master-bin.000001 # Execute_load_query # # use `test`; load data infile '../../std_data/rpl_loaddata.dat' into table t4 (a, @b) set b= @b + bug27417(2) ;file_id=#
master-bin.000001 # Execute_load_query # # use `test`; LOAD DATA INFILE '../../std_data/rpl_loaddata.dat' INTO TABLE `t4` FIELDS TERMINATED BY '\t' ENCLOSED BY '' ESCAPED BY '\\' LINES TERMINATED BY '\n' (a, @b) SET b=((@b) + `bug27417`(2)) ;file_id=#
master-bin.000001 # Query # # ROLLBACK
/* the output must denote there is the query */;
drop trigger trg_del_t2;
@ -863,7 +863,7 @@ master-bin.000001 # User var # # @`b`=_latin1 0x3135 COLLATE latin1_swedish_ci
master-bin.000001 # Begin_load_query # # ;file_id=#;block_len=#
master-bin.000001 # Intvar # # INSERT_ID=10
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/rpl_loaddata.dat' into table t4 (a, @b) set b= @b + bug27417(2) ;file_id=#
master-bin.000001 # Execute_load_query # # use `test`; LOAD DATA INFILE '../../std_data/rpl_loaddata.dat' INTO TABLE `t4` FIELDS TERMINATED BY '\t' ENCLOSED BY '' ESCAPED BY '\\' LINES TERMINATED BY '\n' (a, @b) SET b=((@b) + `bug27417`(2)) ;file_id=#
master-bin.000001 # Query # # ROLLBACK
drop trigger trg_del_t2;
drop table t1,t2,t3,t4,t5;

Binary file not shown.

View file

@ -0,0 +1,4 @@
--source include/have_binlog_format_mixed.inc
--source include/have_innodb.inc
--source extra/binlog_tests/binlog_failure_mixing_engines.test

View file

@ -0,0 +1,4 @@
--source include/have_binlog_format_row.inc
--source include/have_innodb.inc
--source extra/binlog_tests/binlog_failure_mixing_engines.test

View file

@ -112,17 +112,22 @@ while($i)
# remove unecessary files
-- remove_file $outfile.1
-- remove_file $outfile.2
#
# The two tests are canceled since we introduced the patch of bug#46998,
# which will make mydsqlbinlog output the 'BEGIN', 'COMMIT' and 'ROLLBACK'
# in regardless of database filtering
#
# assertion: events for database test are filtered
if (`SELECT INSTR(@b42941_output.1, 'test')`)
{
-- echo **** ERROR **** Database name 'test' FOUND in mysqlbinlog output ($flags $outfile.1).
}
#if (`SELECT INSTR(@b42941_output.1, 'test')`)
#{
#-- echo **** ERROR **** Database name 'test' FOUND in mysqlbinlog output ($flags $outfile.1).
#}
if (`SELECT INSTR(@b42941_output.2, 'test')`)
{
-- echo **** ERROR **** Database name 'test' FOUND in mysqlbinlog output ($flags $outfile.2).
}
#if (`SELECT INSTR(@b42941_output.2, 'test')`)
#{
#-- echo **** ERROR **** Database name 'test' FOUND in mysqlbinlog output ($flags $outfile.2).
#}
# assertion: events for database b42941 are not filtered
if (!`SELECT INSTR(@b42941_output.1, 'b42941')`)

View file

@ -0,0 +1,86 @@
########################################################
# Test mysqlbinlog command with Ndb produced Binlog
# variants
#
# WHAT
# ====
# This test aims to check that the mysqlbinlog --verbose
# command can output binlogs in 4 format variants, currently
# used by Ndb
#
# 1) Updates logged as write_row events
# Only primary key and updated columns included in the
# event
# 2) Updates logged as write_row_events
# All columns included in the event
# 3) Updates logged as update_row events
# Only primary key and updated columns included in the
# event
# 4) Updates logged as update_row events
# All columns included in the event
#
# Format variant (1) is the Ndb default.
# Bug#47323 resulted in binlogs generated in format (1)
# being incorrectly parsed by the mysqlbinlog --verbose
# option
#
# HOW
# ===
# Row-based binlog files in each format have been
# captured from an Ndb cluster
# These are output using the mysqlbinlog --verbose
# tool and the output is checked.
#
########################################################
# We require binlog_format_row as we're independent of binlog format
# and there's no point running the same test 3 times
-- source include/have_binlog_format_row.inc
--disable_query_log
--let $binlog_file=write-partial-row.binlog
--exec $MYSQL_BINLOG --verbose suite/binlog/std_data/$binlog_file > $MYSQLTEST_VARDIR/tmp/mysqlbinlog_verbose.sql
create table raw_binlog_rows (txt varchar(1000));
--eval load data local infile '$MYSQLTEST_VARDIR/tmp/mysqlbinlog_verbose.sql' into table raw_binlog_rows columns terminated by '\n';
--remove_file $MYSQLTEST_VARDIR/tmp/mysqlbinlog_verbose.sql
--enable_query_log
--echo Verbose statements from : $binlog_file
# Output --verbose lines, with extra Windows CR's trimmed
select replace(txt,'\r', '') as stmt from raw_binlog_rows where txt like '###%';
drop table raw_binlog_rows;
--disable_query_log
--let $binlog_file=write-full-row.binlog
--exec $MYSQL_BINLOG --verbose suite/binlog/std_data/$binlog_file > $MYSQLTEST_VARDIR/tmp/mysqlbinlog_verbose.sql
create table raw_binlog_rows (txt varchar(1000));
--eval load data local infile '$MYSQLTEST_VARDIR/tmp/mysqlbinlog_verbose.sql' into table raw_binlog_rows columns terminated by '\n';
--remove_file $MYSQLTEST_VARDIR/tmp/mysqlbinlog_verbose.sql
--enable_query_log
--echo Verbose statements from : $binlog_file
# Output --verbose lines, with extra Windows CR's trimmed
select replace(txt,'\r', '') as stmt from raw_binlog_rows where txt like '###%';
drop table raw_binlog_rows;
--disable_query_log
--let $binlog_file=update-partial-row.binlog
--exec $MYSQL_BINLOG --verbose suite/binlog/std_data/$binlog_file > $MYSQLTEST_VARDIR/tmp/mysqlbinlog_verbose.sql
create table raw_binlog_rows (txt varchar(1000));
--eval load data local infile '$MYSQLTEST_VARDIR/tmp/mysqlbinlog_verbose.sql' into table raw_binlog_rows columns terminated by '\n';
--remove_file $MYSQLTEST_VARDIR/tmp/mysqlbinlog_verbose.sql
--enable_query_log
--echo Verbose statements from : $binlog_file
# Output --verbose lines, with extra Windows CR's trimmed
select replace(txt,'\r', '') as stmt from raw_binlog_rows where txt like '###%';
drop table raw_binlog_rows;
--disable_query_log
--let $binlog_file=update-full-row.binlog
--exec $MYSQL_BINLOG --verbose suite/binlog/std_data/$binlog_file > $MYSQLTEST_VARDIR/tmp/mysqlbinlog_verbose.sql
create table raw_binlog_rows (txt varchar(1000));
--eval load data local infile '$MYSQLTEST_VARDIR/tmp/mysqlbinlog_verbose.sql' into table raw_binlog_rows columns terminated by '\n';
--remove_file $MYSQLTEST_VARDIR/tmp/mysqlbinlog_verbose.sql
--enable_query_log
--echo Verbose statements from : $binlog_file
# Output --verbose lines, with extra Windows CR's trimmed
select replace(txt,'\r', '') as stmt from raw_binlog_rows where txt like '###%';
drop table raw_binlog_rows;

View file

@ -94,15 +94,24 @@ DROP TABLE t1;
SET GLOBAL log_warnings = @old_log_warnings;
let LOG_ERROR= `SELECT @@GLOBAL.log_error`;
let $log_error_= `SELECT @@GLOBAL.log_error`;
if(!`select LENGTH('$log_error_')`)
{
# MySQL Server on windows is started with --console and thus
# does not know the location of its .err log, use default location
let $log_error_ = $MYSQLTEST_VARDIR/log/mysqld.1.err;
}
# Assign env variable LOG_ERROR
let LOG_ERROR=$log_error_;
--echo # Count the number of times the "Unsafe" message was printed
--echo # to the error log.
perl;
$log_error= $ENV{'LOG_ERROR'};
use strict;
my $log_error= $ENV{'LOG_ERROR'} or die "LOG_ERROR not set";
open(FILE, "$log_error") or die("Unable to open $log_error: $!\n");
$count = () = grep(/Bug#46265/g,<FILE>);
my $count = () = grep(/Bug#46265/g,<FILE>);
print "Occurrences: $count\n";
close(FILE);
EOF

View file

@ -0,0 +1 @@
--loose-debug=d,simulate_detached_thread_refresh

View file

@ -0,0 +1,28 @@
CREATE DATABASE federated;
CREATE DATABASE federated;
#
# Bug#47525: MySQL crashed (Federated)
#
# Switch to slave
CREATE TABLE t1(a INT);
INSERT INTO t1 VALUES (1);
# Switch to master
CREATE TABLE t1(a INT) ENGINE=FEDERATED
CONNECTION='mysql://root@127.0.0.1:SLAVE_PORT/test/t1';
SELECT * FROM t1;
a
1
# Start a asynchronous reload
# Wait for tables to be closed
# Ensure that the server didn't crash
SELECT * FROM t1;
a
1
# Drop tables on master and slave
DROP TABLE t1;
DROP TABLE t1;
# Federated cleanup
DROP TABLE IF EXISTS federated.t1;
DROP DATABASE federated;
DROP TABLE IF EXISTS federated.t1;
DROP DATABASE federated;

View file

@ -0,0 +1,39 @@
--source include/have_debug.inc
--source federated.inc
--echo #
--echo # Bug#47525: MySQL crashed (Federated)
--echo #
connection slave;
--echo # Switch to slave
CREATE TABLE t1(a INT);
INSERT INTO t1 VALUES (1);
connection master;
--echo # Switch to master
--replace_result $SLAVE_MYPORT SLAVE_PORT
eval CREATE TABLE t1(a INT) ENGINE=FEDERATED
CONNECTION='mysql://root@127.0.0.1:$SLAVE_MYPORT/test/t1';
SELECT * FROM t1;
--echo # Start a asynchronous reload
--exec $MYSQLADMIN --no-defaults -S $MASTER_MYSOCK -P $MASTER_MYPORT -u root --password= refresh 2>&1
--echo # Wait for tables to be closed
let $show_statement= SHOW STATUS LIKE 'Open_tables';
let $field= Value;
let $condition= = '0';
--source include/wait_show_condition.inc
--echo # Ensure that the server didn't crash
SELECT * FROM t1;
--echo # Drop tables on master and slave
DROP TABLE t1;
connection slave;
DROP TABLE t1;
connection default;
--echo # Federated cleanup
source federated_cleanup.inc;

View file

@ -9,4 +9,7 @@ log-bin= master-bin
[ENV]
MASTER_MYPORT= @mysqld.1.port
MASTER_MYSOCK= @mysqld.1.socket
SLAVE_MYPORT= @mysqld.2.port
SLAVE_MYSOCK= @mysqld.2.socket

View file

@ -1 +1,2 @@
innodb-index : Bug#47563 2009-06-11 svoj InnoDB: Error: table `test`.`t1#1` already exists in InnoDB internal
innodb-index : Bug#47563 2009-06-11 svoj InnoDB: Error: table `test`.`t1#1` already exists in InnoDB internal
innodb_information_schema : Bug#47808 joro : innodb_information_schema.test fails when run under valgrind

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