Merge three Percona patches into mariadb-5.2-rpl:

- MWL#47, allowing to annotate row-based binlog events with the SQL test of
   the originating query (eg. in mysqlbinlog output).

 - row_based_replication_without_primary_key.patch, providing more intelligent
   selection of index to use on slave when applying row-based binlog events
   for tables with no primary key.

 - Make mysqlbinlog omit redundant `use` around BEGIN/SAVEPOINT/COMMIT/
   ROLLBACK in 5.0 binlogs.
This commit is contained in:
unknown 2011-01-26 15:35:03 +01:00
commit 6dbd796074
154 changed files with 3403 additions and 491 deletions

View file

@ -67,6 +67,15 @@ IF(EXTRA_DEBUG)
ADD_DEFINITIONS(-D EXTRA_DEBUG) ADD_DEFINITIONS(-D EXTRA_DEBUG)
ENDIF(EXTRA_DEBUG) ENDIF(EXTRA_DEBUG)
SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DSAFE_MUTEX")
SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DSAFE_MUTEX")
OPTION (WITH_DEBUG_FULL "Enable malloc debug library (only debug builds)" OFF)
IF(WITH_DEBUG_FULL)
SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DSAFEMALLOC")
SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DSAFEMALLOC")
ENDIF()
IF(ENABLED_DEBUG_SYNC) IF(ENABLED_DEBUG_SYNC)
ADD_DEFINITIONS(-D ENABLED_DEBUG_SYNC) ADD_DEFINITIONS(-D ENABLED_DEBUG_SYNC)
ENDIF(ENABLED_DEBUG_SYNC) ENDIF(ENABLED_DEBUG_SYNC)

View file

@ -18,8 +18,6 @@ INCLUDE("${PROJECT_SOURCE_DIR}/win/mysql_manifest.cmake")
# any of the clients here would go beyond the client API and access the # any of the clients here would go beyond the client API and access the
# Thread Local Storage directly. # Thread Local Storage directly.
SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX")
SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX")
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include
${CMAKE_SOURCE_DIR}/zlib ${CMAKE_SOURCE_DIR}/zlib

View file

@ -95,5 +95,6 @@ enum options_client
OPT_REWRITE_DB, OPT_REWRITE_DB,
OPT_PLUGIN_DIR, OPT_PLUGIN_DIR,
OPT_DEFAULT_PLUGIN, OPT_DEFAULT_PLUGIN,
OPT_SKIP_ANNOTATE_ROWS_EVENTS,
OPT_MAX_CLIENT_OPTION /* should be always the last */ OPT_MAX_CLIENT_OPTION /* should be always the last */
}; };

View file

@ -107,6 +107,7 @@ static ulonglong rec_count= 0;
static short binlog_flags = 0; static short binlog_flags = 0;
static MYSQL* mysql = NULL; static MYSQL* mysql = NULL;
static const char* dirname_for_local_load= 0; static const char* dirname_for_local_load= 0;
static bool opt_skip_annotate_rows_events= 0;
/** /**
Pointer to the Format_description_log_event of the currently active binlog. Pointer to the Format_description_log_event of the currently active binlog.
@ -128,6 +129,70 @@ enum Exit_status {
OK_STOP OK_STOP
}; };
/**
Pointer to the last read Annotate_rows_log_event. Having read an
Annotate_rows event, we should not print it immediatedly because all
subsequent rbr events can be filtered away, and have to keep it for a while.
Also because of that when reading a remote Annotate event we have to keep
its binary log representation in a separately allocated buffer.
*/
static Annotate_rows_log_event *annotate_event= NULL;
void free_annotate_event()
{
if (annotate_event)
{
delete annotate_event;
annotate_event= 0;
}
}
Log_event* read_remote_annotate_event(uchar* net_buf, ulong event_len,
const char **error_msg)
{
uchar *event_buf;
Log_event* event;
if (!(event_buf= (uchar*) my_malloc(event_len + 1, MYF(MY_WME))))
{
error("Out of memory");
return 0;
}
memcpy(event_buf, net_buf, event_len);
event_buf[event_len]= 0;
if (!(event= Log_event::read_log_event((const char*) event_buf, event_len,
error_msg, glob_description_event)))
{
my_free(event_buf, MYF(0));
return 0;
}
/*
Ensure the event->temp_buf is pointing to the allocated buffer.
(TRUE = free temp_buf on the event deletion)
*/
event->register_temp_buf((char*)event_buf, TRUE);
return event;
}
void keep_annotate_event(Annotate_rows_log_event* event)
{
free_annotate_event();
annotate_event= event;
}
void print_annotate_event(PRINT_EVENT_INFO *print_event_info)
{
if (annotate_event)
{
annotate_event->print(result_file, print_event_info);
delete annotate_event; // the event should not be printed more than once
annotate_event= 0;
}
}
static Exit_status dump_local_log_entries(PRINT_EVENT_INFO *print_event_info, static Exit_status dump_local_log_entries(PRINT_EVENT_INFO *print_event_info,
const char* logname); const char* logname);
static Exit_status dump_remote_log_entries(PRINT_EVENT_INFO *print_event_info, static Exit_status dump_remote_log_entries(PRINT_EVENT_INFO *print_event_info,
@ -777,8 +842,19 @@ Exit_status process_event(PRINT_EVENT_INFO *print_event_info, Log_event *ev,
case QUERY_EVENT: case QUERY_EVENT:
{ {
Query_log_event *qe= (Query_log_event*)ev; Query_log_event *qe= (Query_log_event*)ev;
if (!qe->is_trans_keyword() && shall_skip_database(qe->db)) if (!qe->is_trans_keyword())
goto end; {
if (shall_skip_database(qe->db))
goto end;
}
else
{
/*
In case the event for one of these statements is obtained
from binary log 5.0, make it compatible with 5.1
*/
qe->flags|= LOG_EVENT_SUPPRESS_USE_F;
}
print_use_stmt(print_event_info, qe->db, qe->db_len); print_use_stmt(print_event_info, qe->db, qe->db_len);
if (opt_base64_output_mode == BASE64_OUTPUT_ALWAYS) if (opt_base64_output_mode == BASE64_OUTPUT_ALWAYS)
{ {
@ -927,6 +1003,19 @@ Exit_status process_event(PRINT_EVENT_INFO *print_event_info, Log_event *ev,
my_free(fname, MYF(MY_WME)); my_free(fname, MYF(MY_WME));
break; break;
} }
case ANNOTATE_ROWS_EVENT:
if (!opt_skip_annotate_rows_events)
{
/*
We don't print Annotate event just now because all subsequent
rbr-events can be filtered away. Instead we'll keep the event
till it will be printed together with the first not filtered
away Table map or the last rbr will be processed.
*/
keep_annotate_event((Annotate_rows_log_event*) ev);
destroy_evt= FALSE;
}
break;
case TABLE_MAP_EVENT: case TABLE_MAP_EVENT:
{ {
Table_map_log_event *map= ((Table_map_log_event *)ev); Table_map_log_event *map= ((Table_map_log_event *)ev);
@ -936,6 +1025,13 @@ Exit_status process_event(PRINT_EVENT_INFO *print_event_info, Log_event *ev,
destroy_evt= FALSE; destroy_evt= FALSE;
goto end; goto end;
} }
/*
The Table map is to be printed, so it's just the time when we may
print the kept Annotate event (if there is any).
print_annotate_event() also deletes the kept Annotate event.
*/
print_annotate_event(print_event_info);
size_t len_to= 0; size_t len_to= 0;
const char* db_to= binlog_filter->get_rewrite_db(map->get_db_name(), &len_to); const char* db_to= binlog_filter->get_rewrite_db(map->get_db_name(), &len_to);
if (len_to && map->rewrite_db(db_to, len_to, glob_description_event)) if (len_to && map->rewrite_db(db_to, len_to, glob_description_event))
@ -972,6 +1068,13 @@ Exit_status process_event(PRINT_EVENT_INFO *print_event_info, Log_event *ev,
if (print_event_info->m_table_map_ignored.count() > 0) if (print_event_info->m_table_map_ignored.count() > 0)
print_event_info->m_table_map_ignored.clear_tables(); print_event_info->m_table_map_ignored.clear_tables();
/*
If there is a kept Annotate event and all corresponding
rbr-events were filtered away, the Annotate event was not
freed and it is just the time to do it.
*/
free_annotate_event();
/* /*
One needs to take into account an event that gets One needs to take into account an event that gets
filtered but was last event in the statement. If this is filtered but was last event in the statement. If this is
@ -1206,6 +1309,11 @@ that may lead to an endless loop.",
"Updates to a database with a different name than the original. \ "Updates to a database with a different name than the original. \
Example: rewrite-db='from->to'.", Example: rewrite-db='from->to'.",
0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, 0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"skip-annotate-rows-events", OPT_SKIP_ANNOTATE_ROWS_EVENTS,
"Don't print Annotate_rows events stored in the binary log.",
(uchar**) &opt_skip_annotate_rows_events,
(uchar**) &opt_skip_annotate_rows_events,
0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0} {0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}
}; };
@ -1677,6 +1785,8 @@ static Exit_status dump_remote_log_entries(PRINT_EVENT_INFO *print_event_info,
cast to uint32. cast to uint32.
*/ */
int4store(buf, (uint32)start_position); int4store(buf, (uint32)start_position);
if (!opt_skip_annotate_rows_events)
binlog_flags|= BINLOG_SEND_ANNOTATE_ROWS_EVENT;
int2store(buf + BIN_LOG_HEADER_SIZE, binlog_flags); int2store(buf + BIN_LOG_HEADER_SIZE, binlog_flags);
size_t tlen = strlen(logname); size_t tlen = strlen(logname);
@ -1709,18 +1819,30 @@ static Exit_status dump_remote_log_entries(PRINT_EVENT_INFO *print_event_info,
break; // end of data break; // end of data
DBUG_PRINT("info",( "len: %lu net->read_pos[5]: %d\n", DBUG_PRINT("info",( "len: %lu net->read_pos[5]: %d\n",
len, net->read_pos[5])); len, net->read_pos[5]));
if (!(ev= Log_event::read_log_event((const char*) net->read_pos + 1 , if (net->read_pos[5] == ANNOTATE_ROWS_EVENT)
len - 1, &error_msg,
glob_description_event)))
{ {
error("Could not construct log event object: %s", error_msg); if (!(ev= read_remote_annotate_event(net->read_pos + 1, len - 1,
DBUG_RETURN(ERROR_STOP); &error_msg)))
} {
/* error("Could not construct annotate event object: %s", error_msg);
If reading from a remote host, ensure the temp_buf for the DBUG_RETURN(ERROR_STOP);
Log_event class is pointing to the incoming stream. }
*/ }
ev->register_temp_buf((char *) net->read_pos + 1, FALSE); else
{
if (!(ev= Log_event::read_log_event((const char*) net->read_pos + 1 ,
len - 1, &error_msg,
glob_description_event)))
{
error("Could not construct log event object: %s", error_msg);
DBUG_RETURN(ERROR_STOP);
}
/*
If reading from a remote host, ensure the temp_buf for the
Log_event class is pointing to the incoming stream.
*/
ev->register_temp_buf((char *) net->read_pos + 1, FALSE);
}
Log_event_type type= ev->get_type_code(); Log_event_type type= ev->get_type_code();
if (glob_description_event->binlog_version >= 3 || if (glob_description_event->binlog_version >= 3 ||
@ -2230,6 +2352,7 @@ int main(int argc, char** argv)
if (result_file != stdout) if (result_file != stdout)
my_fclose(result_file, MYF(0)); my_fclose(result_file, MYF(0));
cleanup(); cleanup();
free_annotate_event();
delete binlog_filter; delete binlog_filter;
free_root(&s_mem_root, MYF(0)); free_root(&s_mem_root, MYF(0));
free_defaults(defaults_argv); free_defaults(defaults_argv);

View file

@ -12,7 +12,7 @@ dnl
dnl When changing the major version number please also check the switch dnl When changing the major version number please also check the switch
dnl statement in mysqlbinlog::check_master_version(). You may also need dnl statement in mysqlbinlog::check_master_version(). You may also need
dnl to update version.c in ndb. dnl to update version.c in ndb.
AC_INIT([MariaDB Server], [5.2.4-MariaDB], [], [mysql]) AC_INIT([MariaDB Server], [5.2.5-MariaDB], [], [mysql])
AC_CONFIG_SRCDIR([sql/mysqld.cc]) AC_CONFIG_SRCDIR([sql/mysqld.cc])
AC_CANONICAL_SYSTEM AC_CANONICAL_SYSTEM

View file

@ -18,7 +18,6 @@ INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/dbug)
SET(DBUG_SOURCES dbug.c factorial.c sanity.c) SET(DBUG_SOURCES dbug.c factorial.c sanity.c)
IF(NOT SOURCE_SUBLIBS) IF(NOT SOURCE_SUBLIBS)
SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX")
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include) INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include)
ADD_LIBRARY(dbug ${DBUG_SOURCES}) ADD_LIBRARY(dbug ${DBUG_SOURCES})
ENDIF(NOT SOURCE_SUBLIBS) ENDIF(NOT SOURCE_SUBLIBS)

View file

@ -14,8 +14,6 @@
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
INCLUDE("${PROJECT_SOURCE_DIR}/win/mysql_manifest.cmake") INCLUDE("${PROJECT_SOURCE_DIR}/win/mysql_manifest.cmake")
SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX")
SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX")
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include) INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include)

View file

@ -197,7 +197,7 @@ extern void my_large_free(uchar * ptr, myf my_flags);
#define my_large_free(A,B) my_free_lock((A),(B)) #define my_large_free(A,B) my_free_lock((A),(B))
#endif /* HAVE_LARGE_PAGES */ #endif /* HAVE_LARGE_PAGES */
#ifdef HAVE_ALLOCA #if defined(HAVE_ALLOCA) && !defined(HAVE_valgrind)
#if defined(_AIX) && !defined(__GNUC__) && !defined(_AIX43) #if defined(_AIX) && !defined(__GNUC__) && !defined(_AIX43)
#pragma alloca #pragma alloca
#endif /* _AIX */ #endif /* _AIX */

View file

@ -14,9 +14,6 @@
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
INCLUDE("${PROJECT_SOURCE_DIR}/win/mysql_manifest.cmake") INCLUDE("${PROJECT_SOURCE_DIR}/win/mysql_manifest.cmake")
SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX")
SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX")
# Note that we don't link with the libraries "strings" or "mysys" # Note that we don't link with the libraries "strings" or "mysys"
# here, instead we recompile the files needed and include them # here, instead we recompile the files needed and include them
# directly. This means we don't have to worry here about if these # directly. This means we don't have to worry here about if these

View file

@ -13,8 +13,6 @@
# along with this program; if not, write to the Free Software # along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX")
SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX")
# Need to set USE_TLS, since __declspec(thread) approach to thread local # Need to set USE_TLS, since __declspec(thread) approach to thread local
# storage does not work properly in DLLs. # storage does not work properly in DLLs.

View file

@ -321,14 +321,19 @@ let $MYSQLD_DATADIR= `select @@datadir`;
# we check that the error code of the "ROLLBACK" event is 0 and not # we check that the error code of the "ROLLBACK" event is 0 and not
# ER_SERVER_SHUTDOWN (i.e. disconnection just rolls back transaction # ER_SERVER_SHUTDOWN (i.e. disconnection just rolls back transaction
# and does not make slave to stop) # and does not make slave to stop)
-- source include/binlog_start_pos.inc
if (`select @@binlog_format = 'ROW'`) if (`select @@binlog_format = 'ROW'`)
{ {
--exec $MYSQL_BINLOG --start-position=524 $MYSQLD_DATADIR/master-bin.000001 > $MYSQLTEST_VARDIR/tmp/mix_innodb_myisam_binlog.output let $start_pos= `select @binlog_start_pos + 418`;
--exec $MYSQL_BINLOG --start-position=$start_pos $MYSQLD_DATADIR/master-bin.000001 > $MYSQLTEST_VARDIR/tmp/mix_innodb_myisam_binlog.output
} }
if (`select @@binlog_format = 'STATEMENT' || @@binlog_format = 'MIXED'`) if (`select @@binlog_format = 'STATEMENT' || @@binlog_format = 'MIXED'`)
{ {
--exec $MYSQL_BINLOG --start-position=555 $MYSQLD_DATADIR/master-bin.000001 > $MYSQLTEST_VARDIR/tmp/mix_innodb_myisam_binlog.output let $start_pos= `select @binlog_start_pos + 449`;
--exec $MYSQL_BINLOG --start-position=$start_pos $MYSQLD_DATADIR/master-bin.000001 > $MYSQLTEST_VARDIR/tmp/mix_innodb_myisam_binlog.output
} }
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR --replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR

View file

@ -72,7 +72,7 @@ connection slave;
--source include/stop_slave.inc --source include/stop_slave.inc
DELETE FROM t2; DELETE FROM t2;
# Set slave position to the BEGIN log event # Set slave position to the BEGIN log event
--replace_result $master_pos_begin MASTER_POS_BEGIN --replace_result $master_pos_begin <master_pos_begin>
eval CHANGE MASTER TO MASTER_LOG_POS=$master_pos_begin; eval CHANGE MASTER TO MASTER_LOG_POS=$master_pos_begin;
BEGIN; BEGIN;
# Hold lock # Hold lock
@ -103,7 +103,7 @@ SET global max_relay_log_size=0;
--source include/stop_slave.inc --source include/stop_slave.inc
DELETE FROM t2; DELETE FROM t2;
# Set slave position to the BEGIN log event # Set slave position to the BEGIN log event
--replace_result $master_pos_begin MASTER_POS_BEGIN --replace_result $master_pos_begin <master_pos_begin>
eval CHANGE MASTER TO MASTER_LOG_POS=$master_pos_begin; eval CHANGE MASTER TO MASTER_LOG_POS=$master_pos_begin;
BEGIN; BEGIN;
# Hold lock # Hold lock

View file

@ -14,6 +14,7 @@ source include/stop_slave.inc;
reset master; reset master;
reset slave; reset slave;
source include/start_slave.inc; source include/start_slave.inc;
source include/binlog_start_pos.inc;
let $VERSION=`select version()`; let $VERSION=`select version()`;

View file

@ -0,0 +1,155 @@
########################################################################
# WL47: Store in binlog text of statements that caused RBR events
# new event : ANNOTATE_ROWS_EVENT
# new master option : --binlog-annotate-rows-events
# new slave option : --replicate-annotate-rows-events
########################################################################
--source include/master-slave.inc
connect (master2,127.0.0.1,root,,test,$MASTER_MYPORT,);
connection master;
--disable_query_log
--disable_warnings
DROP DATABASE IF EXISTS test1;
--enable_warnings
CREATE DATABASE test1;
USE test1;
CREATE TABLE t1(a int primary key, b int);
CREATE TABLE t2(a int, b int);
CREATE TABLE t3(a int, b int);
CREATE TABLE t4(a int, b int);
CREATE TABLE xt1(a int, b int);
CREATE TABLE xt2(a int, b int);
CREATE TABLE t5 (
a INT PRIMARY KEY AUTO_INCREMENT,
b VARCHAR(10) CHARACTER SET utf8 COLLATE utf8_bin
);
SET SESSION binlog_annotate_rows_events = OFF;
INSERT INTO t1 VALUES (0,0), (1,1);
SET SESSION binlog_annotate_rows_events = ON;
UPDATE t1 SET b = b + 1;
REPLACE t1 VALUES (1,1), (2,2), (3,3);
INSERT INTO t2 VALUES (1,1), (2,2), (3,3);
INSERT INTO t3 VALUES (1,1), (2,2), (3,3);
DELETE t1, t2 FROM t1 INNER JOIN t2 INNER JOIN t3 WHERE t1.a=t2.a AND t2.a=t3.a;
INSERT INTO xt1 VALUES (1,1), (2,2), (3,3);
INSERT INTO t2 VALUES (1,1), (2,2), (3,3);
DELETE xt1, t2 FROM xt1 INNER JOIN t2 INNER JOIN t3 WHERE xt1.a=t2.a AND t2.a=t3.a;
INSERT INTO xt1 VALUES (1,1), (2,2), (3,3);
INSERT INTO xt2 VALUES (1,1), (2,2), (3,3);
DELETE xt1, xt2 FROM xt1 INNER JOIN xt2 INNER JOIN t3 WHERE xt1.a=xt2.a AND xt2.a=t3.a;
INSERT INTO t5(b) VALUES ('foo'), ('bar'), ('baz');
SET NAMES latin1;
INSERT INTO t5(b) VALUES ('gås');
SET NAMES utf8;
INSERT INTO t5(b) VALUES ('gås');
SET NAMES latin1;
FLUSH LOGS;
--echo ########################################################################
--echo # TABLES ON MASTER
--echo ########################################################################
--enable_query_log
SELECT * FROM t1 ORDER BY a;
SELECT * FROM t2 ORDER BY a;
SELECT * FROM t3 ORDER BY a;
SELECT * FROM t5 ORDER BY a;
sync_slave_with_master;
--echo ########################################################################
--echo # TABLES ON SLAVE: should be the same as on master
--echo ########################################################################
--disable_query_log
USE test1;
--enable_query_log
SELECT * FROM t1 ORDER BY a;
SELECT * FROM t2 ORDER BY a;
SELECT * FROM t3 ORDER BY a;
SELECT * FROM t5 ORDER BY a;
--echo ########################################################################
--echo # EVENTS ON SLAVE
let $annotate= `select @@global.replicate_annotate_rows_events`;
if ($annotate)
{
--echo # The following Annotate_rows events should appear below:
--echo # - UPDATE t1 SET b = b + 1;
--echo # - REPLACE t1 VALUES (1,1), (2,2), (3,3);
--echo # - INSERT INTO t2 VALUES (1,1), (2,2), (3,3)
--echo # - INSERT INTO t3 VALUES (1,1), (2,2), (3,3)
--echo # - DELETE t1, t2 FROM <...>
--echo # - INSERT INTO t2 VALUES (1,1), (2,2), (3,3)
--echo # - DELETE xt1, t2 FROM <...>
--echo # - INSERT INTO t5(b) VALUES <...> (3 instances)
}
if (!$annotate)
{
--echo # No Annotate_rows events should appear below
}
--echo ########################################################################
FLUSH LOGS;
--source include/binlog_start_pos.inc
let $start_pos= `select @binlog_start_pos`;
--replace_column 2 # 5 #
--replace_result $start_pos <start_pos>
--replace_regex /table_id: [0-9]+/table_id: #/ /\/\* xid=.* \*\//\/* xid= *\//
--eval show binlog events in 'slave-bin.000001' from $start_pos
--echo #
--echo ########################################################################
--echo # INSERTs DELAYED ON MASTERs
--echo ########################################################################
connection master;
SET SESSION binlog_annotate_rows_events = ON;
INSERT DELAYED INTO test1.t4 VALUES (1,1);
FLUSH TABLES;
SELECT * FROM test1.t4 ORDER BY a;
sync_slave_with_master;
connection master;
sync_slave_with_master;
--echo ########################################################################
--echo # ON SLAVE
--echo # No Annotate_rows events should appear below
--echo ########################################################################
FLUSH LOGS;
--exec $MYSQL --host=127.0.0.1 --port=$SLAVE_MYPORT test -e "show binlog events in 'slave-bin.000002'" > $MYSQLTEST_VARDIR/tmp/annotated_events.txt
perl;
open F, '<', "$ENV{MYSQLTEST_VARDIR}/tmp/annotated_events.txt" or die;
binmode STDOUT;
while (defined ($_ = <F>)) {
if (/Annotate_rows/) {
s/[0-9]+\sAnnotate_rows\s[0-9]+\s[0-9]+/# Annotate_rows # #/;
print($_);
$_ = <F>;
s/[0-9]+\sTable_map\s[0-9]+\s[0-9]+\stable_id:\s[0-9]+/# Table_map # # table_id: #/;
print($_);
}
}
EOF
# Clean-up
connection master;
--disable_query_log
DROP DATABASE test1;
sync_slave_with_master;
--enable_query_log

View file

@ -0,0 +1,26 @@
##############################################################################
#
# binlog_start_pos is the postion of the the first event in the binary log
# which follows the Format description event. Intended to reduce test suite
# dependance on the Format description event length changes (e.g. in case
# of adding new events). Evaluated as:
#
# binlog_start_pos = 4 /* binlog header */ +
# (Format_description_log_event length)
#
# Format_description_log_event length =
# 19 /* event common header */ +
# 57 /* misc stuff in the Format description header */ +
# number of events.
#
# With current number of events = 160,
#
# binlog_start_pos = 4 + 19 + 57 + 160 = 240.
#
##############################################################################
let $binlog_start_pos=240;
--disable_query_log
SET @binlog_start_pos=240;
--enable_query_log

View file

@ -1,4 +1,5 @@
disable_query_log; if (!`SELECT count(*) FROM information_schema.plugins WHERE
--require r/true.require plugin_name = 'innodb' AND plugin_status = 'active' AND
SELECT (plugin_description LIKE '%xtradb%') AS `TRUE` FROM information_schema.plugins WHERE LOWER(plugin_name) = 'innodb' AND LOWER(plugin_status) = 'active'; plugin_description LIKE '%xtradb%'`){
enable_query_log; skip Need XtraDB engine;
}

View file

@ -0,0 +1,2 @@
--loose-innodb
--plugin-load=$HA_XTRADB_SO

View file

@ -1359,7 +1359,17 @@ INSERT INTO t1 VALUES (1,'init');
DELIMITER |; DELIMITER |;
CREATE PROCEDURE p1() CREATE PROCEDURE p1()
BEGIN BEGIN
UPDATE t1 SET b = CONCAT(b, '+con2') WHERE a = 1; # retry the UPDATE in case it times out the lock before con1 has time
# to COMMIT.
DECLARE do_retry INT DEFAULT 0;
DECLARE CONTINUE HANDLER FOR SQLEXCEPTION SET do_retry = 1;
retry_loop:LOOP
UPDATE t1 SET b = CONCAT(b, '+con2') WHERE a = 1;
IF do_retry = 0 THEN
LEAVE retry_loop;
END IF;
SET do_retry = 0;
END LOOP;
INSERT INTO t2 VALUES (); INSERT INTO t2 VALUES ();
END| END|
DELIMITER ;| DELIMITER ;|

View file

@ -3,7 +3,7 @@
# #
# Useage: # Useage:
# let $binlog_file= master-bin.000002; # let $binlog_file= master-bin.000002;
# let $binlog_start= 106; # let $binlog_start= 240;
# let $binlog_limit= 1, 3; # let $binlog_limit= 1, 3;
# source include/show_binlog_events.inc; # source include/show_binlog_events.inc;
# #

View file

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

View file

@ -12717,6 +12717,7 @@ COUNT(t1.a)
729 729
DROP TABLE t1; DROP TABLE t1;
SET @@join_buffer_size= @save_join_buffer_size; SET @@join_buffer_size= @save_join_buffer_size;
flush tables;
SHOW CREATE TABLE t1; SHOW CREATE TABLE t1;
ERROR HY000: Table upgrade required. Please do "REPAIR TABLE `t1`" or dump/reload to fix it! ERROR HY000: Table upgrade required. Please do "REPAIR TABLE `t1`" or dump/reload to fix it!
SELECT * FROM t1; SELECT * FROM t1;

View file

@ -237,5 +237,9 @@ ERROR 28000: Access denied for user 'mysqltest_up2'@'localhost' (using password:
select user(), current_user(); select user(), current_user();
user() current_user() user() current_user()
mysqltest_up2@localhost mysqltest_up2@% mysqltest_up2@localhost mysqltest_up2@%
connect(localhost,mysqltest_nouser,newpw,test,MASTER_PORT,MASTER_SOCKET);
ERROR 28000: Access denied for user 'mysqltest_nouser'@'localhost' (using password: YES)
connect(localhost,mysqltest_nouser,,test,MASTER_PORT,MASTER_SOCKET);
ERROR 28000: Access denied for user 'mysqltest_nouser'@'localhost' (using password: NO)
DROP USER mysqltest_up1@'%'; DROP USER mysqltest_up1@'%';
DROP USER mysqltest_up2@'%'; DROP USER mysqltest_up2@'%';

View file

@ -44,8 +44,6 @@ master-bin.000001 # Query # # use `test`; INSERT INTO t4 VALUES ( NAME_CONST('in
master-bin.000001 # Query # # use `test`; DROP PROCEDURE bug18293 master-bin.000001 # Query # # use `test`; DROP PROCEDURE bug18293
master-bin.000001 # Query # # use `test`; DROP TABLE t4 master-bin.000001 # Query # # use `test`; DROP TABLE t4
End of 5.0 tests End of 5.0 tests
SHOW BINLOG EVENTS FROM 365;
ERROR HY000: Error when executing command SHOW BINLOG EVENTS: Wrong offset or I/O error
Bug#44352 UPPER/LOWER function doesn't work correctly on cp932 and sjis environment. Bug#44352 UPPER/LOWER function doesn't work correctly on cp932 and sjis environment.
CREATE TABLE t1 (a varchar(16)) character set cp932; CREATE TABLE t1 (a varchar(16)) character set cp932;
INSERT INTO t1 VALUES (0x8372835E),(0x8352835E); INSERT INTO t1 VALUES (0x8372835E),(0x8352835E);

View file

@ -686,13 +686,13 @@ INSERT INTO t1 VALUES (1000000, 0, 0);
SET SESSION sort_buffer_size = 1024*36; SET SESSION sort_buffer_size = 1024*36;
EXPLAIN EXPLAIN
SELECT COUNT(*) FROM SELECT COUNT(*) FROM
(SELECT * FROM t1 (SELECT * FROM t1 FORCE INDEX(primary,idx)
WHERE a BETWEEN 2 AND 7 OR pk=1000000) AS t; WHERE a BETWEEN 2 AND 7 OR pk=1000000) AS t;
id select_type table type possible_keys key key_len ref rows Extra id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Select tables optimized away 1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Select tables optimized away
2 DERIVED t1 index_merge PRIMARY,idx idx,PRIMARY 5,4 NULL 11419 Using sort_union(idx,PRIMARY); Using where 2 DERIVED t1 index_merge PRIMARY,idx idx,PRIMARY 5,4 NULL 11419 Using sort_union(idx,PRIMARY); Using where
SELECT COUNT(*) FROM SELECT COUNT(*) FROM
(SELECT * FROM t1 (SELECT * FROM t1 FORCE INDEX(primary,idx)
WHERE a BETWEEN 2 AND 7 OR pk=1000000) AS t; WHERE a BETWEEN 2 AND 7 OR pk=1000000) AS t;
COUNT(*) COUNT(*)
6145 6145

View file

@ -248,13 +248,13 @@ set global slow_query_log='OFF';
set @save_storage_engine= @@session.storage_engine; set @save_storage_engine= @@session.storage_engine;
set storage_engine= MEMORY; set storage_engine= MEMORY;
alter table mysql.slow_log engine=ndb; alter table mysql.slow_log engine=ndb;
ERROR HY000: This storage engine cannot be used for log tables" ERROR HY000: This storage engine cannot be used for log tables
alter table mysql.slow_log engine=innodb; alter table mysql.slow_log engine=innodb;
ERROR HY000: This storage engine cannot be used for log tables" ERROR HY000: This storage engine cannot be used for log tables
alter table mysql.slow_log engine=archive; alter table mysql.slow_log engine=archive;
ERROR HY000: This storage engine cannot be used for log tables" ERROR HY000: This storage engine cannot be used for log tables
alter table mysql.slow_log engine=blackhole; alter table mysql.slow_log engine=blackhole;
ERROR HY000: This storage engine cannot be used for log tables" ERROR HY000: This storage engine cannot be used for log tables
set storage_engine= @save_storage_engine; set storage_engine= @save_storage_engine;
drop table mysql.slow_log; drop table mysql.slow_log;
drop table mysql.general_log; drop table mysql.general_log;

View file

@ -1,15 +1,17 @@
reset master; reset master;
SET @save_binlog_size= @@global.max_binlog_size;
SET @@global.max_binlog_size= 4096;
set timestamp=1000000000; set timestamp=1000000000;
drop table if exists t1,t2,t3,t4,t5,t03,t04; drop table if exists t1,t2,t3,t4,t5,t03,t04;
create table t1 (word varchar(20)); create table t1 (word varchar(20));
create table t2 (id int auto_increment not null primary key); create table t2 (id int auto_increment not null primary key);
insert into t1 values ("abirvalg"); insert into t1 values ("abirvalg");
insert into t2 values (); insert into t2 values ();
load data infile '../../std_data/words.dat' into table t1; load data infile '../../std_data/words3.dat' into table t1;
load data infile '../../std_data/words.dat' into table t1; load data infile '../../std_data/words3.dat' into table t1;
load data infile '../../std_data/words.dat' into table t1; load data infile '../../std_data/words3.dat' into table t1;
load data infile '../../std_data/words.dat' into table t1; load data infile '../../std_data/words3.dat' into table t1;
load data infile '../../std_data/words.dat' into table t1; load data infile '../../std_data/words3.dat' into table t1;
insert into t1 values ("Alas"); insert into t1 values ("Alas");
flush logs; flush logs;
@ -220,7 +222,6 @@ ROLLBACK /* added by mysqlbinlog */;
/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/; /*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;
DELIMITER /*!*/; DELIMITER /*!*/;
ROLLBACK/*!*/; ROLLBACK/*!*/;
use test/*!*/;
SET TIMESTAMP=1108844556/*!*/; SET TIMESTAMP=1108844556/*!*/;
SET @@session.pseudo_thread_id=999999999/*!*/; SET @@session.pseudo_thread_id=999999999/*!*/;
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/; SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
@ -228,6 +229,7 @@ SET @@session.lc_time_names=0/*!*/;
SET @@session.collation_database=DEFAULT/*!*/; SET @@session.collation_database=DEFAULT/*!*/;
BEGIN BEGIN
/*!*/; /*!*/;
use test/*!*/;
SET TIMESTAMP=1108844555/*!*/; SET TIMESTAMP=1108844555/*!*/;
insert t1 values (1) insert t1 values (1)
/*!*/; /*!*/;
@ -239,7 +241,6 @@ Warning: The option '--position' is deprecated and will be removed in a future r
/*!40019 SET @@session.max_insert_delayed_threads=0*/; /*!40019 SET @@session.max_insert_delayed_threads=0*/;
/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/; /*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;
DELIMITER /*!*/; DELIMITER /*!*/;
use test/*!*/;
SET TIMESTAMP=1108844556/*!*/; SET TIMESTAMP=1108844556/*!*/;
SET @@session.pseudo_thread_id=999999999/*!*/; SET @@session.pseudo_thread_id=999999999/*!*/;
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/; SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
@ -247,6 +248,7 @@ SET @@session.lc_time_names=0/*!*/;
SET @@session.collation_database=DEFAULT/*!*/; SET @@session.collation_database=DEFAULT/*!*/;
BEGIN BEGIN
/*!*/; /*!*/;
use test/*!*/;
SET TIMESTAMP=1108844555/*!*/; SET TIMESTAMP=1108844555/*!*/;
insert t1 values (1) insert t1 values (1)
/*!*/; /*!*/;
@ -255,6 +257,7 @@ DELIMITER ;
ROLLBACK /* added by mysqlbinlog */; ROLLBACK /* added by mysqlbinlog */;
/*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/; /*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/;
drop table t1,t2; drop table t1,t2;
SET @@global.max_binlog_size= @save_binlog_size;
flush logs; flush logs;
flush logs; flush logs;
select * from t5 /* must be (1),(1) */; select * from t5 /* must be (1),(1) */;
@ -377,14 +380,14 @@ LOAD DATA LOCAL INFILE 'MYSQLTEST_VARDIR/tmp/SQL_LOAD_MB-#-#' INTO TABLE `t1` FI
/*!*/; /*!*/;
SET TIMESTAMP=1000000000/*!*/; SET TIMESTAMP=1000000000/*!*/;
SET @@session.collation_database=7/*!*/; SET @@session.collation_database=7/*!*/;
LOAD DATA LOCAL INFILE 'MYSQLTEST_VARDIR/tmp/SQL_LOAD_MB-a-0' INTO TABLE `t1` FIELDS TERMINATED BY '\t' ENCLOSED BY '' ESCAPED BY '\\' LINES TERMINATED BY '\n' (`a`) 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 TIMESTAMP=1000000000/*!*/;
SET @@session.collation_database=DEFAULT/*!*/; SET @@session.collation_database=DEFAULT/*!*/;
LOAD DATA LOCAL INFILE 'MYSQLTEST_VARDIR/tmp/SQL_LOAD_MB-b-0' INTO TABLE `t1` FIELDS TERMINATED BY '\t' ENCLOSED BY '' ESCAPED BY '\\' LINES TERMINATED BY '\n' (`a`) 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 TIMESTAMP=1000000000/*!*/;
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`) LOAD DATA LOCAL INFILE 'MYSQLTEST_VARDIR/tmp/SQL_LOAD_MB-#-#' INTO TABLE `t1` CHARACTER SET koi8r FIELDS TERMINATED BY '\t' ENCLOSED BY '' ESCAPED BY '\\' LINES TERMINATED BY '\n' (`a`)
/*!*/; /*!*/;
SET TIMESTAMP=1000000000/*!*/; SET TIMESTAMP=1000000000/*!*/;
drop table t1 drop table t1
@ -581,7 +584,6 @@ SET @@session.lc_time_names=0/*!*/;
SET @@session.collation_database=DEFAULT/*!*/; SET @@session.collation_database=DEFAULT/*!*/;
BEGIN BEGIN
/*!*/; /*!*/;
use test/*!*/;
SET TIMESTAMP=1266652094/*!*/; SET TIMESTAMP=1266652094/*!*/;
SavePoint mixed_cases SavePoint mixed_cases
/*!*/; /*!*/;
@ -592,11 +594,9 @@ INSERT INTO db1.t2 VALUES("in savepoint mixed_cases")
SET TIMESTAMP=1266652094/*!*/; SET TIMESTAMP=1266652094/*!*/;
INSERT INTO db1.t1 VALUES(40) INSERT INTO db1.t1 VALUES(40)
/*!*/; /*!*/;
use test/*!*/;
SET TIMESTAMP=1266652094/*!*/; SET TIMESTAMP=1266652094/*!*/;
ROLLBACK TO mixed_cases ROLLBACK TO mixed_cases
/*!*/; /*!*/;
use db1/*!*/;
SET TIMESTAMP=1266652094/*!*/; SET TIMESTAMP=1266652094/*!*/;
INSERT INTO db1.t2 VALUES("after rollback to") INSERT INTO db1.t2 VALUES("after rollback to")
/*!*/; /*!*/;
@ -624,7 +624,6 @@ SET @@session.lc_time_names=0/*!*/;
SET @@session.collation_database=DEFAULT/*!*/; SET @@session.collation_database=DEFAULT/*!*/;
BEGIN BEGIN
/*!*/; /*!*/;
use test/*!*/;
SET TIMESTAMP=1266652094/*!*/; SET TIMESTAMP=1266652094/*!*/;
SavePoint mixed_cases SavePoint mixed_cases
/*!*/; /*!*/;

View file

@ -75,7 +75,17 @@ TRUNCATE t1;
INSERT INTO t1 VALUES (1,'init'); INSERT INTO t1 VALUES (1,'init');
CREATE PROCEDURE p1() CREATE PROCEDURE p1()
BEGIN BEGIN
# retry the UPDATE in case it times out the lock before con1 has time
# to COMMIT.
DECLARE do_retry INT DEFAULT 0;
DECLARE CONTINUE HANDLER FOR SQLEXCEPTION SET do_retry = 1;
retry_loop:LOOP
UPDATE t1 SET b = CONCAT(b, '+con2') WHERE a = 1; UPDATE t1 SET b = CONCAT(b, '+con2') WHERE a = 1;
IF do_retry = 0 THEN
LEAVE retry_loop;
END IF;
SET do_retry = 0;
END LOOP;
INSERT INTO t2 VALUES (); INSERT INTO t2 VALUES ();
END| END|
BEGIN; BEGIN;

View file

@ -75,9 +75,9 @@ SET SQL_MODE='IGNORE_BAD_TABLE_OPTIONS';
#illegal value fixed #illegal value fixed
CREATE TABLE t1 (a int) ENGINE=example ULL=10000000000000000000 one_or_two='ttt' YESNO=SSS; CREATE TABLE t1 (a int) ENGINE=example ULL=10000000000000000000 one_or_two='ttt' YESNO=SSS;
Warnings: Warnings:
Warning 1652 Incorrect value '10000000000000000000' for option 'ULL' Warning 1653 Incorrect value '10000000000000000000' for option 'ULL'
Warning 1652 Incorrect value 'ttt' for option 'one_or_two' Warning 1653 Incorrect value 'ttt' for option 'one_or_two'
Warning 1652 Incorrect value 'SSS' for option 'YESNO' Warning 1653 Incorrect value 'SSS' for option 'YESNO'
show create table t1; show create table t1;
Table Create Table Table Create Table
t1 CREATE TABLE `t1` ( t1 CREATE TABLE `t1` (

View file

@ -3,9 +3,9 @@ SET @OLD_SQL_MODE=@@SQL_MODE;
SET SQL_MODE='IGNORE_BAD_TABLE_OPTIONS'; SET SQL_MODE='IGNORE_BAD_TABLE_OPTIONS';
create table t1 (a int fkey=vvv, key akey (a) dff=vvv) tkey1='1v1'; create table t1 (a int fkey=vvv, key akey (a) dff=vvv) tkey1='1v1';
Warnings: Warnings:
Warning 1651 Unknown option 'fkey' Warning 1652 Unknown option 'fkey'
Warning 1651 Unknown option 'dff' Warning 1652 Unknown option 'dff'
Warning 1651 Unknown option 'tkey1' Warning 1652 Unknown option 'tkey1'
show create table t1; show create table t1;
Table Create Table Table Create Table
t1 CREATE TABLE `t1` ( t1 CREATE TABLE `t1` (
@ -16,10 +16,10 @@ drop table t1;
#reassiginig options in the same line #reassiginig options in the same line
create table t1 (a int fkey=vvv, key akey (a) dff=vvv) tkey1=1v1 TKEY1=DEFAULT tkey1=1v2 tkey2=2v1; create table t1 (a int fkey=vvv, key akey (a) dff=vvv) tkey1=1v1 TKEY1=DEFAULT tkey1=1v2 tkey2=2v1;
Warnings: Warnings:
Warning 1651 Unknown option 'fkey' Warning 1652 Unknown option 'fkey'
Warning 1651 Unknown option 'dff' Warning 1652 Unknown option 'dff'
Warning 1651 Unknown option 'tkey1' Warning 1652 Unknown option 'tkey1'
Warning 1651 Unknown option 'tkey2' Warning 1652 Unknown option 'tkey2'
show create table t1; show create table t1;
Table Create Table Table Create Table
t1 CREATE TABLE `t1` ( t1 CREATE TABLE `t1` (
@ -29,7 +29,7 @@ t1 CREATE TABLE `t1` (
#add option #add option
alter table t1 tkey4=4v1; alter table t1 tkey4=4v1;
Warnings: Warnings:
Warning 1651 Unknown option 'tkey4' Warning 1652 Unknown option 'tkey4'
show create table t1; show create table t1;
Table Create Table Table Create Table
t1 CREATE TABLE `t1` ( t1 CREATE TABLE `t1` (
@ -39,8 +39,8 @@ t1 CREATE TABLE `t1` (
#remove options #remove options
alter table t1 tkey3=DEFAULT tkey4=DEFAULT; alter table t1 tkey3=DEFAULT tkey4=DEFAULT;
Warnings: Warnings:
Warning 1651 Unknown option 'tkey3' Warning 1652 Unknown option 'tkey3'
Warning 1651 Unknown option 'tkey4' Warning 1652 Unknown option 'tkey4'
show create table t1; show create table t1;
Table Create Table Table Create Table
t1 CREATE TABLE `t1` ( t1 CREATE TABLE `t1` (
@ -50,11 +50,11 @@ t1 CREATE TABLE `t1` (
drop table t1; drop table t1;
create table t1 (a int fkey1=v1, key akey (a) kkey1=v1) tkey1=1v1 tkey1=1v2 TKEY1=DEFAULT tkey2=2v1 tkey3=3v1; create table t1 (a int fkey1=v1, key akey (a) kkey1=v1) tkey1=1v1 tkey1=1v2 TKEY1=DEFAULT tkey2=2v1 tkey3=3v1;
Warnings: Warnings:
Warning 1651 Unknown option 'fkey1' Warning 1652 Unknown option 'fkey1'
Warning 1651 Unknown option 'kkey1' Warning 1652 Unknown option 'kkey1'
Warning 1651 Unknown option 'TKEY1' Warning 1652 Unknown option 'TKEY1'
Warning 1651 Unknown option 'tkey2' Warning 1652 Unknown option 'tkey2'
Warning 1651 Unknown option 'tkey3' Warning 1652 Unknown option 'tkey3'
show create table t1; show create table t1;
Table Create Table Table Create Table
t1 CREATE TABLE `t1` ( t1 CREATE TABLE `t1` (
@ -64,7 +64,7 @@ t1 CREATE TABLE `t1` (
#change field with option with the same value #change field with option with the same value
alter table t1 change a a int `FKEY1`='v1'; alter table t1 change a a int `FKEY1`='v1';
Warnings: Warnings:
Warning 1651 Unknown option 'FKEY1' Warning 1652 Unknown option 'FKEY1'
show create table t1; show create table t1;
Table Create Table Table Create Table
t1 CREATE TABLE `t1` ( t1 CREATE TABLE `t1` (
@ -74,7 +74,7 @@ t1 CREATE TABLE `t1` (
#change field with option with a different value #change field with option with a different value
alter table t1 change a a int fkey1=v2; alter table t1 change a a int fkey1=v2;
Warnings: Warnings:
Warning 1651 Unknown option 'fkey1' Warning 1652 Unknown option 'fkey1'
show create table t1; show create table t1;
Table Create Table Table Create Table
t1 CREATE TABLE `t1` ( t1 CREATE TABLE `t1` (
@ -93,7 +93,7 @@ t1 CREATE TABLE `t1` (
#new key with options #new key with options
alter table t1 add key bkey (b) kkey2=v1; alter table t1 add key bkey (b) kkey2=v1;
Warnings: Warnings:
Warning 1651 Unknown option 'kkey2' Warning 1652 Unknown option 'kkey2'
show create table t1; show create table t1;
Table Create Table Table Create Table
t1 CREATE TABLE `t1` ( t1 CREATE TABLE `t1` (
@ -105,8 +105,8 @@ t1 CREATE TABLE `t1` (
#new column with options #new column with options
alter table t1 add column c int fkey1=v1 fkey2=v2; alter table t1 add column c int fkey1=v1 fkey2=v2;
Warnings: Warnings:
Warning 1651 Unknown option 'fkey1' Warning 1652 Unknown option 'fkey1'
Warning 1651 Unknown option 'fkey2' Warning 1652 Unknown option 'fkey2'
show create table t1; show create table t1;
Table Create Table Table Create Table
t1 CREATE TABLE `t1` ( t1 CREATE TABLE `t1` (
@ -141,7 +141,7 @@ t1 CREATE TABLE `t1` (
#add column with options after delete #add column with options after delete
alter table t1 add column b int fkey2=v1; alter table t1 add column b int fkey2=v1;
Warnings: Warnings:
Warning 1651 Unknown option 'fkey2' Warning 1652 Unknown option 'fkey2'
show create table t1; show create table t1;
Table Create Table Table Create Table
t1 CREATE TABLE `t1` ( t1 CREATE TABLE `t1` (
@ -154,7 +154,7 @@ t1 CREATE TABLE `t1` (
#add key #add key
alter table t1 add key bkey (b) kkey2=v2; alter table t1 add key bkey (b) kkey2=v2;
Warnings: Warnings:
Warning 1651 Unknown option 'kkey2' Warning 1652 Unknown option 'kkey2'
show create table t1; show create table t1;
Table Create Table Table Create Table
t1 CREATE TABLE `t1` ( t1 CREATE TABLE `t1` (
@ -168,7 +168,7 @@ t1 CREATE TABLE `t1` (
drop table t1; drop table t1;
create table t1 (a int) tkey1=100; create table t1 (a int) tkey1=100;
Warnings: Warnings:
Warning 1651 Unknown option 'tkey1' Warning 1652 Unknown option 'tkey1'
show create table t1; show create table t1;
Table Create Table Table Create Table
t1 CREATE TABLE `t1` ( t1 CREATE TABLE `t1` (

View file

@ -0,0 +1,66 @@
Aarhus
Aaron
Ababa
aback
abaft
abandon
abandoned
abandoning
abandonment
abandons
Aarhus
Aaron
Ababa
aback
abaft
abandon
abandoned
abandoning
abandonment
abandons
abase
abased
abasement
abasements
abases
abash
abashed
abashes
abashing
abasing
abate
abated
abatement
abatements
abater
abates
abating
Abba
abbe
abbey
abbeys
abbot
abbots
Abbott
abbreviate
abbreviated
abbreviates
abbreviating
abbreviation
abbreviations
Abby
abdomen
abdomens
abdominal
abduct
abducted
abduction
abductions
abductor
abductors
abducts
Abe
abed
Abel
Abelian
Abelson

File diff suppressed because it is too large Load diff

View file

@ -333,7 +333,7 @@ master-bin.000001 # Query # # use `test`; insert into t1 values( 244 )
master-bin.000001 # Query # # use `test`; insert into t1 values( 243 ) master-bin.000001 # Query # # use `test`; insert into t1 values( 243 )
master-bin.000001 # Query # # use `test`; insert into t1 values( 242 ) master-bin.000001 # Query # # use `test`; insert into t1 values( 242 )
master-bin.000001 # Query # # use `test`; insert into t1 values( 241 ) master-bin.000001 # Query # # use `test`; insert into t1 values( 241 )
master-bin.000001 # Query # # use `test`; insert into t1 values( 240 ) master-bin.000001 # Query # # use `test`; insert into t1 values( <binlog_start> )
master-bin.000001 # Query # # use `test`; insert into t1 values( 239 ) master-bin.000001 # Query # # use `test`; insert into t1 values( 239 )
master-bin.000001 # Query # # use `test`; insert into t1 values( 238 ) master-bin.000001 # Query # # use `test`; insert into t1 values( 238 )
master-bin.000001 # Query # # use `test`; insert into t1 values( 237 ) master-bin.000001 # Query # # use `test`; insert into t1 values( 237 )
@ -467,7 +467,7 @@ master-bin.000001 # Query # # use `test`; insert into t1 values( 110 )
master-bin.000001 # Query # # use `test`; insert into t1 values( 109 ) master-bin.000001 # Query # # use `test`; insert into t1 values( 109 )
master-bin.000001 # Query # # use `test`; insert into t1 values( 108 ) master-bin.000001 # Query # # use `test`; insert into t1 values( 108 )
master-bin.000001 # Query # # use `test`; insert into t1 values( 107 ) master-bin.000001 # Query # # use `test`; insert into t1 values( 107 )
master-bin.000001 # Query # # use `test`; insert into t1 values( <binlog_start> ) master-bin.000001 # Query # # use `test`; insert into t1 values( 106 )
master-bin.000001 # Query # # use `test`; insert into t1 values( 105 ) master-bin.000001 # Query # # use `test`; insert into t1 values( 105 )
master-bin.000001 # Query # # use `test`; insert into t1 values( 104 ) master-bin.000001 # Query # # use `test`; insert into t1 values( 104 )
master-bin.000001 # Query # # use `test`; insert into t1 values( 103 ) master-bin.000001 # Query # # use `test`; insert into t1 values( 103 )

View file

@ -4,6 +4,7 @@
source include/have_log_bin.inc; source include/have_log_bin.inc;
source include/have_debug.inc; source include/have_debug.inc;
source include/binlog_start_pos.inc;
let $MYSQLD_DATADIR= `select @@datadir`; let $MYSQLD_DATADIR= `select @@datadir`;
RESET MASTER; RESET MASTER;
@ -20,7 +21,7 @@ REPLACE INTO t1 VALUES (4);
DROP TABLE t1; DROP TABLE t1;
FLUSH LOGS; FLUSH LOGS;
exec $MYSQL_BINLOG --start-position=106 $MYSQLD_DATADIR/master-bin.000001 >$MYSQLTEST_VARDIR/tmp/binlog_incident-bug44442.sql; exec $MYSQL_BINLOG --start-position=$binlog_start_pos $MYSQLD_DATADIR/master-bin.000001 >$MYSQLTEST_VARDIR/tmp/binlog_incident-bug44442.sql;
--disable_query_log --disable_query_log
eval SELECT cont LIKE '%RELOAD DATABASE; # Shall generate syntax error%' AS `Contain RELOAD DATABASE` FROM (SELECT load_file('$MYSQLTEST_VARDIR/tmp/binlog_incident-bug44442.sql') AS cont) AS tbl; eval SELECT cont LIKE '%RELOAD DATABASE; # Shall generate syntax error%' AS `Contain RELOAD DATABASE` FROM (SELECT load_file('$MYSQLTEST_VARDIR/tmp/binlog_incident-bug44442.sql') AS cont) AS tbl;
--enable_query_log --enable_query_log

View file

@ -1,5 +1,6 @@
-- source include/have_innodb.inc -- source include/have_innodb.inc
-- source include/have_binlog_format_statement.inc -- source include/have_binlog_format_statement.inc
-- source include/binlog_start_pos.inc
# You cannot use `KILL' with the Embedded MySQL Server library, # You cannot use `KILL' with the Embedded MySQL Server library,
# because the embedded server merely runs inside the threads of the host # because the embedded server merely runs inside the threads of the host
@ -51,7 +52,8 @@ reap;
let $rows= `select count(*) from t2 /* must be 2 or 0 */`; let $rows= `select count(*) from t2 /* must be 2 or 0 */`;
let $MYSQLD_DATADIR= `select @@datadir`; let $MYSQLD_DATADIR= `select @@datadir`;
--exec $MYSQL_BINLOG --force-if-open --start-position=134 $MYSQLD_DATADIR/master-bin.000001 > $MYSQLTEST_VARDIR/tmp/kill_query_calling_sp.binlog let $start_pos= `select @binlog_start_pos + 28`;
--exec $MYSQL_BINLOG --force-if-open --start-position=$start_pos $MYSQLD_DATADIR/master-bin.000001 > $MYSQLTEST_VARDIR/tmp/kill_query_calling_sp.binlog
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR --replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
eval select eval select
(@a:=load_file("$MYSQLTEST_VARDIR/tmp/kill_query_calling_sp.binlog")) (@a:=load_file("$MYSQLTEST_VARDIR/tmp/kill_query_calling_sp.binlog"))

View file

@ -1,5 +1,6 @@
-- source include/have_debug.inc -- source include/have_debug.inc
-- source include/have_binlog_format_statement.inc -- source include/have_binlog_format_statement.inc
-- source include/binlog_start_pos.inc
# #
# bug#27571 asynchronous setting mysql_$query()'s local error and # bug#27571 asynchronous setting mysql_$query()'s local error and
# Query_log_event::error_code # Query_log_event::error_code
@ -24,7 +25,7 @@ update t1 set a=2 /* will be "killed" after work has been done */;
# for some constants like the offset of the first real event # for some constants like the offset of the first real event
# that is different between severs versions. # that is different between severs versions.
let $MYSQLD_DATADIR= `select @@datadir`; let $MYSQLD_DATADIR= `select @@datadir`;
--exec $MYSQL_BINLOG --force-if-open --start-position=106 $MYSQLD_DATADIR/master-bin.000001 > $MYSQLTEST_VARDIR/tmp/binlog_killed_bug27571.binlog --exec $MYSQL_BINLOG --force-if-open --start-position=$binlog_start_pos $MYSQLD_DATADIR/master-bin.000001 > $MYSQLTEST_VARDIR/tmp/binlog_killed_bug27571.binlog
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR --replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
eval select eval select
(@a:=load_file("$MYSQLTEST_VARDIR/tmp/binlog_killed_bug27571.binlog")) (@a:=load_file("$MYSQLTEST_VARDIR/tmp/binlog_killed_bug27571.binlog"))

View file

@ -0,0 +1 @@
--timezone=GMT-3 --binlog-do-db=test1 --binlog-do-db=test2 --binlog-do-db=test3

View file

@ -0,0 +1,189 @@
###############################################################################
# WL47: Store in binlog text of statements that caused RBR events
# new event: ANNOTATE_ROWS_EVENT
# new master option: --binlog-annotate-rows-events
# new mysqlbinlog option: --skip-annotate-rows-events
#
# Intended to test that:
# *** If the --binlog-annotate-rows-events option is switched on on master
# then Annotate_rows events:
# - are generated;
# - are genrated only once for "multi-table-maps" rbr queries;
# - are not generated when the corresponding queries are filtered away;
# - are generated when the corresponding queries are filtered away partialy
# (e.g. in case of multi-delete).
# *** Annotate_rows events are printed by mysqlbinlog started without
# --skip-annotate-rows-events options both in remote and local cases.
# *** Annotate_rows events are not printed by mysqlbinlog started with
# --skip-annotate-rows-events options both in remote and local cases.
###############################################################################
--source include/have_log_bin.inc
--source include/have_binlog_format_row.inc
--source include/binlog_start_pos.inc
--disable_query_log
# Fix timestamp to avoid varying results
SET timestamp=1000000000;
# Delete all existing binary logs
RESET MASTER;
--disable_warnings
DROP DATABASE IF EXISTS test1;
DROP DATABASE IF EXISTS test2;
DROP DATABASE IF EXISTS test3;
DROP DATABASE IF EXISTS xtest1;
DROP DATABASE IF EXISTS xtest2;
--enable_warnings
CREATE DATABASE test1;
CREATE TABLE test1.t1(a int);
CREATE DATABASE test2;
CREATE TABLE test2.t2(a int);
CREATE VIEW test2.v2 AS SELECT * FROM test2.t2;
CREATE DATABASE test3;
CREATE TABLE test3.t3(a int);
CREATE DATABASE xtest1;
CREATE TABLE xtest1.xt1(a int);
CREATE DATABASE xtest2;
CREATE TABLE xtest2.xt2(a int);
# By default SESSION binlog_annotate_rows_events = OFF
INSERT INTO test1.t1 VALUES (1), (2), (3);
SET SESSION binlog_annotate_rows_events = ON;
INSERT INTO test2.t2 VALUES (1), (2), (3);
INSERT INTO test3.t3 VALUES (1), (2), (3);
# This query generates two Table maps but the Annotate
# event should appear only once before the first Table map
DELETE test1.t1, test2.t2
FROM test1.t1 INNER JOIN test2.t2 INNER JOIN test3.t3
WHERE test1.t1.a=test2.t2.a AND test2.t2.a=test3.t3.a;
# This event should be filtered out together with Annotate event
INSERT INTO xtest1.xt1 VALUES (1), (2), (3);
# This event should pass the filter
INSERT INTO test2.v2 VALUES (1), (2), (3);
# This event should pass the filter only for test2.t2 part
DELETE xtest1.xt1, test2.t2
FROM xtest1.xt1 INNER JOIN test2.t2 INNER JOIN test3.t3
WHERE xtest1.xt1.a=test2.t2.a AND test2.t2.a=test3.t3.a;
# These events should be filtered out together with Annotate events
INSERT INTO xtest1.xt1 VALUES (1), (2), (3);
INSERT INTO xtest2.xt2 VALUES (1), (2), (3);
DELETE xtest1.xt1, xtest2.xt2
FROM xtest1.xt1 INNER JOIN xtest2.xt2 INNER JOIN test3.t3
WHERE xtest1.xt1.a=xtest2.xt2.a AND xtest2.xt2.a=test3.t3.a;
FLUSH LOGS;
--enable_query_log
--echo #####################################################################################
--echo # The following Annotate_rows events should appear below:
--echo # - INSERT INTO test2.t2 VALUES (1), (2), (3)
--echo # - INSERT INTO test3.t3 VALUES (1), (2), (3)
--echo # - DELETE test1.t1, test2.t2 FROM <...>
--echo # - INSERT INTO test2.t2 VALUES (1), (2), (3)
--echo # - DELETE xtest1.xt1, test2.t2 FROM <...>
--echo #####################################################################################
let $start_pos= `select @binlog_start_pos`;
--replace_column 2 # 5 #
--replace_result $start_pos <start_pos>
--replace_regex /table_id: [0-9]+/table_id: #/ /\/\* xid=.* \*\//\/* xid= *\//
--eval show binlog events in 'master-bin.000001' from $start_pos
--echo #
--echo #####################################################################################
--echo # mysqlbinlog
--echo # The following Annotates should appear in this output:
--echo # - INSERT INTO test2.t2 VALUES (1), (2), (3)
--echo # - INSERT INTO test3.t3 VALUES (1), (2), (3)
--echo # - DELETE test1.t1, test2.t2 FROM <...> (with two subsequent Table maps)
--echo # - INSERT INTO test2.t2 VALUES (1), (2), (3)
--echo # - DELETE xtest1.xt1, test2.t2 FROM <...> (with one subsequent Table map)
--echo #####################################################################################
let $MYSQLD_DATADIR= `select @@datadir`;
--replace_regex /server id [0-9]*/server id #/ /server v [^ ]*/server v #.##.##/ /exec_time=[0-9]*/exec_time=#/ /thread_id=[0-9]*/thread_id=#/ /table id [0-9]*/table id #/ /mapped to number [0-9]*/mapped to number #/ /end_log_pos [0-9]*/end_log_pos #/ /# at [0-9]*/# at #/
--exec $MYSQL_BINLOG --base64-output=decode-rows -v -v $MYSQLD_DATADIR/master-bin.000001
--echo #
--echo #####################################################################################
--echo # mysqlbinlog --database=test1
--echo # The following Annotate should appear in this output:
--echo # - DELETE test1.t1, test2.t2 FROM <...>
--echo #####################################################################################
let $MYSQLD_DATADIR= `select @@datadir`;
--replace_regex /server id [0-9]*/server id #/ /server v [^ ]*/server v #.##.##/ /exec_time=[0-9]*/exec_time=#/ /thread_id=[0-9]*/thread_id=#/ /table id [0-9]*/table id #/ /mapped to number [0-9]*/mapped to number #/ /end_log_pos [0-9]*/end_log_pos #/ /# at [0-9]*/# at #/
--exec $MYSQL_BINLOG --base64-output=decode-rows --database=test1 -v -v $MYSQLD_DATADIR/master-bin.000001
--echo #
--echo #####################################################################################
--echo # mysqlbinlog --skip-annotate-rows-events
--echo # No Annotates should appear in this output
--echo #####################################################################################
let $MYSQLD_DATADIR= `select @@datadir`;
--replace_regex /server id [0-9]*/server id #/ /server v [^ ]*/server v #.##.##/ /exec_time=[0-9]*/exec_time=#/ /thread_id=[0-9]*/thread_id=#/ /table id [0-9]*/table id #/ /mapped to number [0-9]*/mapped to number #/ /end_log_pos [0-9]*/end_log_pos #/ /# at [0-9]*/# at #/
--exec $MYSQL_BINLOG --base64-output=decode-rows --skip-annotate-rows-events -v -v $MYSQLD_DATADIR/master-bin.000001
--echo #
--echo #####################################################################################
--echo # mysqlbinlog --read-from-remote-server
--echo # The following Annotates should appear in this output:
--echo # - INSERT INTO test2.t2 VALUES (1), (2), (3)
--echo # - INSERT INTO test3.t3 VALUES (1), (2), (3)
--echo # - DELETE test1.t1, test2.t2 FROM <...> (with two subsequent Table maps)
--echo # - INSERT INTO test2.t2 VALUES (1), (2), (3)
--echo # - DELETE xtest1.xt1, test2.t2 FROM <...> (with one subsequent Table map)
--echo #####################################################################################
let $MYSQLD_DATADIR= `select @@datadir`;
--replace_regex /server id [0-9]*/server id #/ /server v [^ ]*/server v #.##.##/ /exec_time=[0-9]*/exec_time=#/ /thread_id=[0-9]*/thread_id=#/ /table id [0-9]*/table id #/ /mapped to number [0-9]*/mapped to number #/ /end_log_pos [0-9]*/end_log_pos #/ /# at [0-9]*/# at #/
--exec $MYSQL_BINLOG --base64-output=decode-rows -v -v --read-from-remote-server --user=root --host=localhost --port=$MASTER_MYPORT master-bin.000001
--echo #
--echo #####################################################################################
--echo # mysqlbinlog --read-from-remote-server --database=test1
--echo # The following Annotate should appear in this output:
--echo # - DELETE test1.t1, test2.t2 FROM <...>
--echo #####################################################################################
let $MYSQLD_DATADIR= `select @@datadir`;
--replace_regex /server id [0-9]*/server id #/ /server v [^ ]*/server v #.##.##/ /exec_time=[0-9]*/exec_time=#/ /thread_id=[0-9]*/thread_id=#/ /table id [0-9]*/table id #/ /mapped to number [0-9]*/mapped to number #/ /end_log_pos [0-9]*/end_log_pos #/ /# at [0-9]*/# at #/
--exec $MYSQL_BINLOG --base64-output=decode-rows --database=test1 -v -v --read-from-remote-server --user=root --host=localhost --port=$MASTER_MYPORT master-bin.000001
--echo #
--echo #####################################################################################
--echo # mysqlbinlog --read-from-remote-server --skip-annotate-rows-events
--echo # No Annotates should appear in this output
--echo #####################################################################################
let $MYSQLD_DATADIR= `select @@datadir`;
--replace_regex /server id [0-9]*/server id #/ /server v [^ ]*/server v #.##.##/ /exec_time=[0-9]*/exec_time=#/ /thread_id=[0-9]*/thread_id=#/ /table id [0-9]*/table id #/ /mapped to number [0-9]*/mapped to number #/ /end_log_pos [0-9]*/end_log_pos #/ /# at [0-9]*/# at #/
--exec $MYSQL_BINLOG --base64-output=decode-rows --skip-annotate-rows-events -v -v --read-from-remote-server --user=root --host=localhost --port=$MASTER_MYPORT master-bin.000001
# Clean-up
--disable_query_log
DROP DATABASE test1;
DROP DATABASE test2;
DROP DATABASE test3;
DROP DATABASE xtest1;
DROP DATABASE xtest2;
--enable_query_log

View file

@ -1594,7 +1594,17 @@ TRUNCATE t1;
INSERT INTO t1 VALUES (1,'init'); INSERT INTO t1 VALUES (1,'init');
CREATE PROCEDURE p1() CREATE PROCEDURE p1()
BEGIN BEGIN
# retry the UPDATE in case it times out the lock before con1 has time
# to COMMIT.
DECLARE do_retry INT DEFAULT 0;
DECLARE CONTINUE HANDLER FOR SQLEXCEPTION SET do_retry = 1;
retry_loop:LOOP
UPDATE t1 SET b = CONCAT(b, '+con2') WHERE a = 1; UPDATE t1 SET b = CONCAT(b, '+con2') WHERE a = 1;
IF do_retry = 0 THEN
LEAVE retry_loop;
END IF;
SET do_retry = 0;
END LOOP;
INSERT INTO t2 VALUES (); INSERT INTO t2 VALUES ();
END| END|
BEGIN; BEGIN;

View file

@ -12,6 +12,7 @@ create table C(id int not null auto_increment primary key, f1 int not null, fore
insert into A values(1), (2); insert into A values(1), (2);
--disable_query_log --disable_query_log
begin;
let $i=257; let $i=257;
while ($i) while ($i)
{ {
@ -24,6 +25,7 @@ while ($i)
insert into C(f1) values(2); insert into C(f1) values(2);
dec $i; dec $i;
} }
commit;
--enable_query_log --enable_query_log
# Following Deletes should not report error # Following Deletes should not report error

View file

@ -1594,7 +1594,17 @@ TRUNCATE t1;
INSERT INTO t1 VALUES (1,'init'); INSERT INTO t1 VALUES (1,'init');
CREATE PROCEDURE p1() CREATE PROCEDURE p1()
BEGIN BEGIN
# retry the UPDATE in case it times out the lock before con1 has time
# to COMMIT.
DECLARE do_retry INT DEFAULT 0;
DECLARE CONTINUE HANDLER FOR SQLEXCEPTION SET do_retry = 1;
retry_loop:LOOP
UPDATE t1 SET b = CONCAT(b, '+con2') WHERE a = 1; UPDATE t1 SET b = CONCAT(b, '+con2') WHERE a = 1;
IF do_retry = 0 THEN
LEAVE retry_loop;
END IF;
SET do_retry = 0;
END LOOP;
INSERT INTO t2 VALUES (); INSERT INTO t2 VALUES ();
END| END|
BEGIN; BEGIN;

View file

@ -12,6 +12,7 @@ create table C(id int not null auto_increment primary key, f1 int not null, fore
insert into A values(1), (2); insert into A values(1), (2);
--disable_query_log --disable_query_log
begin;
let $i=257; let $i=257;
while ($i) while ($i)
{ {
@ -24,6 +25,7 @@ while ($i)
insert into C(f1) values(2); insert into C(f1) values(2);
dec $i; dec $i;
} }
commit;
--enable_query_log --enable_query_log
# Following Deletes should not report error # Following Deletes should not report error

View file

@ -14,10 +14,10 @@ a
2 2
3 3
4 4
SHOW BINLOG EVENTS FROM 106; SHOW BINLOG EVENTS FROM <start_pos>;
Log_name Pos Event_type Server_id End_log_pos Info Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 106 Query 1 204 use `test`; CREATE TABLE t1 (a int primary key) master-bin.000001 # Query 1 # use `test`; CREATE TABLE t1 (a int primary key)
master-bin.000001 204 Query 1 295 use `test`; insert t1 values (1),(2),(3) master-bin.000001 # Query 1 # use `test`; insert t1 values (1),(2),(3)
master-bin.000001 295 Query 1 386 use `test`; insert t1 values (4),(2),(5) master-bin.000001 # Query 1 # use `test`; insert t1 values (4),(2),(5)
drop table t1; drop table t1;
set binlog_format=default; set binlog_format=default;

View file

@ -1,6 +1,6 @@
select * from INFORMATION_SCHEMA.ENGINES where ENGINE="ARIA"; select * from INFORMATION_SCHEMA.ENGINES where ENGINE="ARIA";
ENGINE SUPPORT COMMENT TRANSACTIONS XA SAVEPOINTS ENGINE SUPPORT COMMENT TRANSACTIONS XA SAVEPOINTS
Aria YES Crash-safe tables with MyISAM heritage YES NO NO Aria YES Crash-safe tables with MyISAM heritage NO NO NO
set global storage_engine=aria; set global storage_engine=aria;
set session storage_engine=aria; set session storage_engine=aria;
set global aria_page_checksum=0; set global aria_page_checksum=0;

View file

@ -1,6 +1,6 @@
select * from INFORMATION_SCHEMA.ENGINES where ENGINE="ARIA"; select * from INFORMATION_SCHEMA.ENGINES where ENGINE="ARIA";
ENGINE SUPPORT COMMENT TRANSACTIONS XA SAVEPOINTS ENGINE SUPPORT COMMENT TRANSACTIONS XA SAVEPOINTS
Aria YES Crash-safe tables with MyISAM heritage YES NO NO Aria YES Crash-safe tables with MyISAM heritage NO NO NO
set global storage_engine=aria; set global storage_engine=aria;
set session storage_engine=aria; set session storage_engine=aria;
set global aria_page_checksum=0; set global aria_page_checksum=0;

View file

@ -4,6 +4,9 @@
-- source include/have_maria.inc -- source include/have_maria.inc
-- source include/have_log_bin.inc -- source include/have_log_bin.inc
-- source include/binlog_start_pos.inc
let $start_pos= `select @binlog_start_pos`;
let $default=`select @@global.storage_engine`; let $default=`select @@global.storage_engine`;
set global storage_engine=aria; set global storage_engine=aria;
@ -27,7 +30,9 @@ insert t1 values (1),(2),(3);
--error ER_DUP_ENTRY --error ER_DUP_ENTRY
insert t1 values (4),(2),(5); insert t1 values (4),(2),(5);
select * from t1; select * from t1;
SHOW BINLOG EVENTS FROM 106; --replace_result $start_pos <start_pos>
--replace_column 2 # 5 #
eval SHOW BINLOG EVENTS FROM $start_pos;
drop table t1; drop table t1;
set binlog_format=default; set binlog_format=default;

View file

@ -55,7 +55,7 @@ Checking that both slave threads are running.
*** Test lock wait timeout *** *** Test lock wait timeout ***
include/stop_slave.inc include/stop_slave.inc
DELETE FROM t2; DELETE FROM t2;
CHANGE MASTER TO MASTER_LOG_POS=MASTER_POS_BEGIN; CHANGE MASTER TO MASTER_LOG_POS=<master_pos_begin>;
BEGIN; BEGIN;
SELECT * FROM t1 FOR UPDATE; SELECT * FROM t1 FOR UPDATE;
a a
@ -81,7 +81,7 @@ SET @my_max_relay_log_size= @@global.max_relay_log_size;
SET global max_relay_log_size=0; SET global max_relay_log_size=0;
include/stop_slave.inc include/stop_slave.inc
DELETE FROM t2; DELETE FROM t2;
CHANGE MASTER TO MASTER_LOG_POS=MASTER_POS_BEGIN; CHANGE MASTER TO MASTER_LOG_POS=<master_pos_begin>;
BEGIN; BEGIN;
SELECT * FROM t1 FOR UPDATE; SELECT * FROM t1 FOR UPDATE;
a a

View file

@ -0,0 +1,144 @@
stop slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
reset master;
reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
########################################################################
# TABLES ON MASTER
########################################################################
SELECT * FROM t1 ORDER BY a;
a b
0 1
SELECT * FROM t2 ORDER BY a;
a b
SELECT * FROM t3 ORDER BY a;
a b
1 1
2 2
3 3
SELECT * FROM t5 ORDER BY a;
a b
1 foo
2 bar
3 baz
4 gås
5 gås
########################################################################
# TABLES ON SLAVE: should be the same as on master
########################################################################
SELECT * FROM t1 ORDER BY a;
a b
0 1
SELECT * FROM t2 ORDER BY a;
a b
SELECT * FROM t3 ORDER BY a;
a b
1 1
2 2
3 3
SELECT * FROM t5 ORDER BY a;
a b
1 foo
2 bar
3 baz
4 gås
5 gås
########################################################################
# EVENTS ON SLAVE
# The following Annotate_rows events should appear below:
# - UPDATE t1 SET b = b + 1;
# - REPLACE t1 VALUES (1,1), (2,2), (3,3);
# - INSERT INTO t2 VALUES (1,1), (2,2), (3,3)
# - INSERT INTO t3 VALUES (1,1), (2,2), (3,3)
# - DELETE t1, t2 FROM <...>
# - INSERT INTO t2 VALUES (1,1), (2,2), (3,3)
# - DELETE xt1, t2 FROM <...>
# - INSERT INTO t5(b) VALUES <...> (3 instances)
########################################################################
FLUSH LOGS;
show binlog events in 'slave-bin.000001' from <start_pos>;
Log_name Pos Event_type Server_id End_log_pos Info
slave-bin.000001 # Query 1 # DROP DATABASE IF EXISTS test1
slave-bin.000001 # Query 1 # CREATE DATABASE test1
slave-bin.000001 # Query 1 # use `test1`; CREATE TABLE t1(a int primary key, b int)
slave-bin.000001 # Query 1 # use `test1`; CREATE TABLE t2(a int, b int)
slave-bin.000001 # Query 1 # use `test1`; CREATE TABLE t3(a int, b int)
slave-bin.000001 # Query 1 # use `test1`; CREATE TABLE t4(a int, b int)
slave-bin.000001 # Query 1 # use `test1`; CREATE TABLE t5 (
a INT PRIMARY KEY AUTO_INCREMENT,
b VARCHAR(10) CHARACTER SET utf8 COLLATE utf8_bin
)
slave-bin.000001 # Query 1 # BEGIN
slave-bin.000001 # Table_map 1 # table_id: # (test1.t1)
slave-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
slave-bin.000001 # Query 1 # COMMIT
slave-bin.000001 # Query 1 # BEGIN
slave-bin.000001 # Annotate_rows 1 # UPDATE t1 SET b = b + 1
slave-bin.000001 # Table_map 1 # table_id: # (test1.t1)
slave-bin.000001 # Update_rows 1 # table_id: # flags: STMT_END_F
slave-bin.000001 # Query 1 # COMMIT
slave-bin.000001 # Query 1 # BEGIN
slave-bin.000001 # Annotate_rows 1 # REPLACE t1 VALUES (1,1), (2,2), (3,3)
slave-bin.000001 # Table_map 1 # table_id: # (test1.t1)
slave-bin.000001 # Update_rows 1 # table_id: #
slave-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
slave-bin.000001 # Query 1 # COMMIT
slave-bin.000001 # Query 1 # BEGIN
slave-bin.000001 # Annotate_rows 1 # INSERT INTO t2 VALUES (1,1), (2,2), (3,3)
slave-bin.000001 # Table_map 1 # table_id: # (test1.t2)
slave-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
slave-bin.000001 # Query 1 # COMMIT
slave-bin.000001 # Query 1 # BEGIN
slave-bin.000001 # Annotate_rows 1 # INSERT INTO t3 VALUES (1,1), (2,2), (3,3)
slave-bin.000001 # Table_map 1 # table_id: # (test1.t3)
slave-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
slave-bin.000001 # Query 1 # COMMIT
slave-bin.000001 # Query 1 # BEGIN
slave-bin.000001 # Annotate_rows 1 # DELETE t1, t2 FROM t1 INNER JOIN t2 INNER JOIN t3 WHERE t1.a=t2.a AND t2.a=t3.a
slave-bin.000001 # Table_map 1 # table_id: # (test1.t2)
slave-bin.000001 # Table_map 1 # table_id: # (test1.t1)
slave-bin.000001 # Delete_rows 1 # table_id: #
slave-bin.000001 # Delete_rows 1 # table_id: # flags: STMT_END_F
slave-bin.000001 # Query 1 # COMMIT
slave-bin.000001 # Query 1 # BEGIN
slave-bin.000001 # Annotate_rows 1 # INSERT INTO t2 VALUES (1,1), (2,2), (3,3)
slave-bin.000001 # Table_map 1 # table_id: # (test1.t2)
slave-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
slave-bin.000001 # Query 1 # COMMIT
slave-bin.000001 # Query 1 # BEGIN
slave-bin.000001 # Annotate_rows 1 # DELETE xt1, t2 FROM xt1 INNER JOIN t2 INNER JOIN t3 WHERE xt1.a=t2.a AND t2.a=t3.a
slave-bin.000001 # Table_map 1 # table_id: # (test1.t2)
slave-bin.000001 # Delete_rows 1 # table_id: # flags: STMT_END_F
slave-bin.000001 # Query 1 # COMMIT
slave-bin.000001 # Query 1 # BEGIN
slave-bin.000001 # Annotate_rows 1 # INSERT INTO t5(b) VALUES ('foo'), ('bar'), ('baz')
slave-bin.000001 # Table_map 1 # table_id: # (test1.t5)
slave-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
slave-bin.000001 # Query 1 # COMMIT
slave-bin.000001 # Query 1 # BEGIN
slave-bin.000001 # Annotate_rows 1 # INSERT INTO t5(b) VALUES ('gås')
slave-bin.000001 # Table_map 1 # table_id: # (test1.t5)
slave-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
slave-bin.000001 # Query 1 # COMMIT
slave-bin.000001 # Query 1 # BEGIN
slave-bin.000001 # Annotate_rows 1 # INSERT INTO t5(b) VALUES ('gås')
slave-bin.000001 # Table_map 1 # table_id: # (test1.t5)
slave-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
slave-bin.000001 # Query 1 # COMMIT
slave-bin.000001 # Rotate 2 # slave-bin.000002;pos=4
#
########################################################################
# INSERTs DELAYED ON MASTERs
########################################################################
SET SESSION binlog_annotate_rows_events = ON;
INSERT DELAYED INTO test1.t4 VALUES (1,1);
FLUSH TABLES;
SELECT * FROM test1.t4 ORDER BY a;
a b
1 1
########################################################################
# ON SLAVE
# No Annotate_rows events should appear below
########################################################################
FLUSH LOGS;

View file

@ -0,0 +1,126 @@
stop slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
reset master;
reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
########################################################################
# TABLES ON MASTER
########################################################################
SELECT * FROM t1 ORDER BY a;
a b
0 1
SELECT * FROM t2 ORDER BY a;
a b
SELECT * FROM t3 ORDER BY a;
a b
1 1
2 2
3 3
SELECT * FROM t5 ORDER BY a;
a b
1 foo
2 bar
3 baz
4 gås
5 gås
########################################################################
# TABLES ON SLAVE: should be the same as on master
########################################################################
SELECT * FROM t1 ORDER BY a;
a b
0 1
SELECT * FROM t2 ORDER BY a;
a b
SELECT * FROM t3 ORDER BY a;
a b
1 1
2 2
3 3
SELECT * FROM t5 ORDER BY a;
a b
1 foo
2 bar
3 baz
4 gås
5 gås
########################################################################
# EVENTS ON SLAVE
# No Annotate_rows events should appear below
########################################################################
FLUSH LOGS;
show binlog events in 'slave-bin.000001' from <start_pos>;
Log_name Pos Event_type Server_id End_log_pos Info
slave-bin.000001 # Query 1 # DROP DATABASE IF EXISTS test1
slave-bin.000001 # Query 1 # CREATE DATABASE test1
slave-bin.000001 # Query 1 # use `test1`; CREATE TABLE t1(a int primary key, b int)
slave-bin.000001 # Query 1 # use `test1`; CREATE TABLE t2(a int, b int)
slave-bin.000001 # Query 1 # use `test1`; CREATE TABLE t3(a int, b int)
slave-bin.000001 # Query 1 # use `test1`; CREATE TABLE t4(a int, b int)
slave-bin.000001 # Query 1 # use `test1`; CREATE TABLE t5 (
a INT PRIMARY KEY AUTO_INCREMENT,
b VARCHAR(10) CHARACTER SET utf8 COLLATE utf8_bin
)
slave-bin.000001 # Query 1 # BEGIN
slave-bin.000001 # Table_map 1 # table_id: # (test1.t1)
slave-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
slave-bin.000001 # Query 1 # COMMIT
slave-bin.000001 # Query 1 # BEGIN
slave-bin.000001 # Table_map 1 # table_id: # (test1.t1)
slave-bin.000001 # Update_rows 1 # table_id: # flags: STMT_END_F
slave-bin.000001 # Query 1 # COMMIT
slave-bin.000001 # Query 1 # BEGIN
slave-bin.000001 # Table_map 1 # table_id: # (test1.t1)
slave-bin.000001 # Update_rows 1 # table_id: #
slave-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
slave-bin.000001 # Query 1 # COMMIT
slave-bin.000001 # Query 1 # BEGIN
slave-bin.000001 # Table_map 1 # table_id: # (test1.t2)
slave-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
slave-bin.000001 # Query 1 # COMMIT
slave-bin.000001 # Query 1 # BEGIN
slave-bin.000001 # Table_map 1 # table_id: # (test1.t3)
slave-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
slave-bin.000001 # Query 1 # COMMIT
slave-bin.000001 # Query 1 # BEGIN
slave-bin.000001 # Table_map 1 # table_id: # (test1.t2)
slave-bin.000001 # Table_map 1 # table_id: # (test1.t1)
slave-bin.000001 # Delete_rows 1 # table_id: #
slave-bin.000001 # Delete_rows 1 # table_id: # flags: STMT_END_F
slave-bin.000001 # Query 1 # COMMIT
slave-bin.000001 # Query 1 # BEGIN
slave-bin.000001 # Table_map 1 # table_id: # (test1.t2)
slave-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
slave-bin.000001 # Query 1 # COMMIT
slave-bin.000001 # Query 1 # BEGIN
slave-bin.000001 # Table_map 1 # table_id: # (test1.t2)
slave-bin.000001 # Delete_rows 1 # table_id: # flags: STMT_END_F
slave-bin.000001 # Query 1 # COMMIT
slave-bin.000001 # Query 1 # BEGIN
slave-bin.000001 # Table_map 1 # table_id: # (test1.t5)
slave-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
slave-bin.000001 # Query 1 # COMMIT
slave-bin.000001 # Query 1 # BEGIN
slave-bin.000001 # Table_map 1 # table_id: # (test1.t5)
slave-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
slave-bin.000001 # Query 1 # COMMIT
slave-bin.000001 # Query 1 # BEGIN
slave-bin.000001 # Table_map 1 # table_id: # (test1.t5)
slave-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
slave-bin.000001 # Query 1 # COMMIT
slave-bin.000001 # Rotate 2 # slave-bin.000002;pos=4
#
########################################################################
# INSERTs DELAYED ON MASTERs
########################################################################
SET SESSION binlog_annotate_rows_events = ON;
INSERT DELAYED INTO test1.t4 VALUES (1,1);
FLUSH TABLES;
SELECT * FROM test1.t4 ORDER BY a;
a b
1 1
########################################################################
# ON SLAVE
# No Annotate_rows events should appear below
########################################################################
FLUSH LOGS;

View file

@ -24,7 +24,7 @@ a
1 1
[on slave] [on slave]
---- Wait until slave stops with an error ---- ---- Wait until slave stops with an error ----
Last_SQL_Error = Could not execute Write_rows event on table test.t1; Duplicate entry '1' for key 'PRIMARY', Error_code: 1062; handler error HA_ERR_FOUND_DUPP_KEY; the event's master log master-bin.000001, end_log_pos 346 (expected "duplicate key" error) Last_SQL_Error = Could not execute Write_rows event on table test.t1; Duplicate entry '1' for key 'PRIMARY', Error_code: 1062; handler error HA_ERR_FOUND_DUPP_KEY; the event's master log master-bin.000001, end_log_pos 480 (expected "duplicate key" error)
SELECT * FROM t1; SELECT * FROM t1;
a a
1 1
@ -50,7 +50,7 @@ SELECT * FROM t1;
a a
[on slave] [on slave]
---- Wait until slave stops with an error ---- ---- Wait until slave stops with an error ----
Last_SQL_Error = Could not execute Delete_rows event on table test.t1; Can't find record in 't1', Error_code: 1032; handler error HA_ERR_KEY_NOT_FOUND; the event's master log master-bin.000001, end_log_pos 982 (expected "can't find record" error) Last_SQL_Error = Could not execute Delete_rows event on table test.t1; Can't find record in 't1', Error_code: 1032; handler error HA_ERR_KEY_NOT_FOUND; the event's master log master-bin.000001, end_log_pos 1116 (expected "can't find record" error)
SELECT * FROM t1; SELECT * FROM t1;
a a
---- Resolve the conflict on the slave and restart SQL thread ---- ---- Resolve the conflict on the slave and restart SQL thread ----

View file

@ -0,0 +1,143 @@
stop slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
reset master;
reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
CREATE TABLE t1 (a int, b varchar(100), fulltext(b)) engine=MyISAM;
INSERT INTO t1 VALUES (1,"a"), (2,"b");
UPDATE t1 SET b='A' WHERE a=1;
DELETE FROM t1 WHERE a=2;
SELECT * FROM t1 ORDER BY a;
a b
1 A
DROP TABLE t1;
CREATE TABLE t1 (d INT PRIMARY KEY) ENGINE=myisam;
INSERT INTO t1 VALUES (0);
INSERT INTO t1 SELECT d+1 FROM t1;
INSERT INTO t1 SELECT d+2 FROM t1;
INSERT INTO t1 SELECT d+4 FROM t1;
INSERT INTO t1 SELECT d+8 FROM t1;
INSERT INTO t1 SELECT d+16 FROM t1;
INSERT INTO t1 SELECT d+32 FROM t1;
INSERT INTO t1 SELECT d+64 FROM t1;
INSERT INTO t1 SELECT d+128 FROM t1;
INSERT INTO t1 SELECT d+256 FROM t1;
INSERT INTO t1 SELECT d+512 FROM t1;
CREATE TABLE t2 (a INT, b INT, c INT, d INT,
KEY wrong_key(a),
KEY expected_key(b,c),
KEY wrong_key2(c)) ENGINE=myisam;
INSERT INTO t2 SELECT d DIV 10, d MOD 41, d MOD 37, d FROM t1;
ANALYZE TABLE t2;
Table Op Msg_type Msg_text
test.t2 analyze status OK
# Slave will crash if using the wrong or no index
SET GLOBAL debug="+d,slave_crash_if_wrong_index,slave_crash_if_table_scan";
UPDATE t2 SET d=10042 WHERE d=42;
DELETE FROM t2 WHERE d=53;
SET GLOBAL debug="";
SELECT * FROM t2 WHERE d IN (10042,53);
a b c d
4 1 5 10042
DROP TABLE t2;
CREATE TABLE t2 (a INT, b INT, c INT, d INT NOT NULL, e INT,
UNIQUE wrong_key3(a,e),
KEY wrong_key4(b,c),
UNIQUE expected_key(d)) ENGINE=myisam;
INSERT INTO t2 SELECT d DIV 10, d MOD 41, d MOD 37, d, NULL FROM t1;
ANALYZE TABLE t2;
Table Op Msg_type Msg_text
test.t2 analyze status OK
# Slave will crash if using the wrong or no index
SET GLOBAL debug="+d,slave_crash_if_wrong_index,slave_crash_if_table_scan";
UPDATE t2 SET d=10042 WHERE d=42;
DELETE FROM t2 WHERE d=53;
SET GLOBAL debug="";
SELECT * FROM t2 WHERE d IN (10042,53);
a b c d e
4 1 5 10042 NULL
DROP TABLE t2;
CREATE TABLE t2 (a INT NOT NULL, b INT NOT NULL, c INT NOT NULL, d INT NOT NULL,
KEY wrong_key5(b),
UNIQUE expected_key(d),
KEY wrong_key6(c)) ENGINE=myisam;
INSERT INTO t2 SELECT d DIV 10, d MOD 41, d MOD 37, d FROM t1;
# Slave will crash if using the wrong or no index
SET GLOBAL debug="+d,slave_crash_if_wrong_index,slave_crash_if_table_scan";
UPDATE t2 SET d=10042 WHERE d=42;
DELETE FROM t2 WHERE d=53;
SET GLOBAL debug="";
SELECT * FROM t2 WHERE d IN (10042,53);
a b c d
4 1 5 10042
DROP TABLE t2;
CREATE TABLE t2 (a INT NOT NULL, b INT NOT NULL, c INT NOT NULL, d INT NOT NULL,
KEY expected_key(b),
KEY wrong_key7(d),
KEY wrong_key8(c)) ENGINE=myisam;
INSERT INTO t2 SELECT d DIV 10, d MOD 41, d MOD 37, d FROM t1;
# Slave will crash if using the wrong or no index
SET GLOBAL debug="+d,slave_crash_if_wrong_index,slave_crash_if_table_scan";
UPDATE t2 SET d=10042 WHERE d=42;
DELETE FROM t2 WHERE d=53;
SET GLOBAL debug="";
SELECT * FROM t2 WHERE d IN (10042,53);
a b c d
4 1 5 10042
DROP TABLE t2;
CREATE TABLE t2 (a INT NOT NULL, b INT NOT NULL, c INT NOT NULL, d INT,
UNIQUE wrong_key9(d),
KEY wrong_key10(a),
PRIMARY KEY expected_key(c,b)) ENGINE=innodb;
INSERT INTO t2 SELECT d DIV 10, d MOD 41, d MOD 37, d FROM t1;
# Slave will crash if using the wrong or no index
SET GLOBAL debug="+d,slave_crash_if_wrong_index,slave_crash_if_table_scan,slave_crash_if_index_scan";
UPDATE t2 SET d=10042 WHERE d=42;
DELETE FROM t2 WHERE d=53;
SET GLOBAL debug="";
SELECT * FROM t2 WHERE d IN (10042,53);
a b c d
4 1 5 10042
DROP TABLE t2;
CREATE TABLE t2 (a INT NOT NULL, b INT NOT NULL, c INT NOT NULL, d INT, e INT,
UNIQUE wrong_key11(e),
KEY wrong_key12(a),
KEY expected_key(c,b)) ENGINE=innodb;
INSERT INTO t2 SELECT d DIV 10, d MOD 41, d MOD 37, d, IF(d<10, d, NULL) FROM t1;
ANALYZE TABLE t2;
Table Op Msg_type Msg_text
test.t2 analyze status OK
# Slave will crash if using the wrong or no index
SET GLOBAL debug="+d,slave_crash_if_wrong_index,slave_crash_if_table_scan";
UPDATE t2 SET d=10042 WHERE d=42;
DELETE FROM t2 WHERE d=53;
SET GLOBAL debug="";
SELECT * FROM t2 WHERE d IN (10042,53);
a b c d e
4 1 5 10042 NULL
DROP TABLE t2;
CREATE TABLE t2 (a INT NOT NULL, b INT NOT NULL, c INT NOT NULL, d INT, e INT,
KEY wrong_key13(a),
UNIQUE expected_key(e),
KEY wrong_key14(c,b)) ENGINE=innodb;
INSERT INTO t2 SELECT d DIV 10, d MOD 41, d MOD 37, d, IF(d<10, d, NULL) FROM t1;
# Slave will crash if using the wrong or no index
SET GLOBAL debug="+d,slave_crash_if_wrong_index,slave_crash_if_table_scan";
UPDATE t2 SET d=10042 WHERE d=42;
DELETE FROM t2 WHERE d=53;
SET GLOBAL debug="";
SELECT * FROM t2 WHERE d IN (10042,53);
a b c d e
4 1 5 10042 NULL
DROP TABLE t2;
CREATE TABLE t2 (a INT NOT NULL, d INT) ENGINE=innodb;
INSERT INTO t2 SELECT d DIV 10, d FROM t1;
UPDATE t2 SET d=10042 WHERE d=42;
DELETE FROM t2 WHERE d=53;
SELECT * FROM t2 WHERE d IN (10042,53);
a d
4 10042
DROP TABLE t2;
DROP TABLE t1;
SET GLOBAL debug="";

View file

@ -0,0 +1 @@
--log-slave-updates --replicate-annotate-rows-events --replicate-ignore-table=test1.xt1 --replicate-ignore-table=test1.xt2

View file

@ -0,0 +1,16 @@
###############################################################################
# WL47: Store in binlog text of statements that caused RBR events
# Wrapper for extra/rpl/rpl_row_annotate.test.
# Intended to test that if the --replicate-annotate-rows-events option
# is switched on on slave then Annotate_events:
# - are reproduced on slave
# - are reproduced only once for "multi-table-maps" rbr queries
# - are not reproduced when the corresponding queries are filtered away
# on replication
# - are reproduced when the corresponding queries are filtered away partialy
# (e.g. in case of multi-delete)
# - are not generated on slave for queries that are not annotated on master.
###############################################################################
--source include/have_binlog_format_row.inc
--source extra/rpl_tests/rpl_row_annotate.test

View file

@ -0,0 +1 @@
--log-slave-updates --replicate-ignore-table=test1.xt1 --replicate-ignore-table=test1.xt2

View file

@ -0,0 +1,9 @@
###############################################################################
# WL47: Store in binlog text of statements that caused RBR events
# Wrapper for extra/rpl/rpl_row_annotate.test.
# Intended to test that if the --replicate-annotate-rows-events option
# is switched off on slave then Annotate_events are not reproduced.
###############################################################################
--source include/have_binlog_format_row.inc
--source extra/rpl_tests/rpl_row_annotate.test

View file

@ -1,7 +1,8 @@
# depends on the binlog output # depends on the binlog output
-- source include/have_binlog_format_row.inc -- source include/have_binlog_format_row.inc
--source include/binlog_start_pos.inc
let $rename_event_pos= 925; let $rename_event_pos= `select @binlog_start_pos + 819`;
# Bug#18326: Do not lock table for writing during prepare of statement # Bug#18326: Do not lock table for writing during prepare of statement
# The use of the ps protocol causes extra table maps in the binlog, so # The use of the ps protocol causes extra table maps in the binlog, so

View file

@ -0,0 +1,241 @@
--source include/have_binlog_format_row.inc
--source include/master-slave.inc
--source include/have_debug.inc
--source include/have_innodb.inc
# Bug#58997: Row-based replication breaks on table with only fulltext index:
connection master;
CREATE TABLE t1 (a int, b varchar(100), fulltext(b)) engine=MyISAM;
INSERT INTO t1 VALUES (1,"a"), (2,"b");
UPDATE t1 SET b='A' WHERE a=1;
DELETE FROM t1 WHERE a=2;
sync_slave_with_master;
connection slave;
SELECT * FROM t1 ORDER BY a;
connection master;
DROP TABLE t1;
# A utility table used to populate subsequent tables in various ways.
connection master;
CREATE TABLE t1 (d INT PRIMARY KEY) ENGINE=myisam;
INSERT INTO t1 VALUES (0);
INSERT INTO t1 SELECT d+1 FROM t1;
INSERT INTO t1 SELECT d+2 FROM t1;
INSERT INTO t1 SELECT d+4 FROM t1;
INSERT INTO t1 SELECT d+8 FROM t1;
INSERT INTO t1 SELECT d+16 FROM t1;
INSERT INTO t1 SELECT d+32 FROM t1;
INSERT INTO t1 SELECT d+64 FROM t1;
INSERT INTO t1 SELECT d+128 FROM t1;
INSERT INTO t1 SELECT d+256 FROM t1;
INSERT INTO t1 SELECT d+512 FROM t1;
# Test that we pick the better multi-column index, even if the
# single-column index is more selective in the first column.
CREATE TABLE t2 (a INT, b INT, c INT, d INT,
KEY wrong_key(a),
KEY expected_key(b,c),
KEY wrong_key2(c)) ENGINE=myisam;
INSERT INTO t2 SELECT d DIV 10, d MOD 41, d MOD 37, d FROM t1;
sync_slave_with_master;
connection slave;
ANALYZE TABLE t2;
--echo # Slave will crash if using the wrong or no index
SET GLOBAL debug="+d,slave_crash_if_wrong_index,slave_crash_if_table_scan";
connection master;
UPDATE t2 SET d=10042 WHERE d=42;
DELETE FROM t2 WHERE d=53;
sync_slave_with_master;
connection slave;
SET GLOBAL debug="";
SELECT * FROM t2 WHERE d IN (10042,53);
# Test that we don't pick a unique index with NULLS over a more selective
# non-unique index.
connection master;
DROP TABLE t2;
CREATE TABLE t2 (a INT, b INT, c INT, d INT NOT NULL, e INT,
UNIQUE wrong_key3(a,e),
KEY wrong_key4(b,c),
UNIQUE expected_key(d)) ENGINE=myisam;
INSERT INTO t2 SELECT d DIV 10, d MOD 41, d MOD 37, d, NULL FROM t1;
sync_slave_with_master;
connection slave;
ANALYZE TABLE t2;
--echo # Slave will crash if using the wrong or no index
SET GLOBAL debug="+d,slave_crash_if_wrong_index,slave_crash_if_table_scan";
connection master;
UPDATE t2 SET d=10042 WHERE d=42;
DELETE FROM t2 WHERE d=53;
sync_slave_with_master;
connection slave;
SET GLOBAL debug="";
SELECT * FROM t2 WHERE d IN (10042,53);
connection master;
DROP TABLE t2;
# Test that we pick a reasonable index when there is no rec_per_key[]
# information (no ANALYZE TABLE).
CREATE TABLE t2 (a INT NOT NULL, b INT NOT NULL, c INT NOT NULL, d INT NOT NULL,
KEY wrong_key5(b),
UNIQUE expected_key(d),
KEY wrong_key6(c)) ENGINE=myisam;
INSERT INTO t2 SELECT d DIV 10, d MOD 41, d MOD 37, d FROM t1;
sync_slave_with_master;
connection slave;
--echo # Slave will crash if using the wrong or no index
SET GLOBAL debug="+d,slave_crash_if_wrong_index,slave_crash_if_table_scan";
connection master;
UPDATE t2 SET d=10042 WHERE d=42;
DELETE FROM t2 WHERE d=53;
sync_slave_with_master;
connection slave;
SET GLOBAL debug="";
SELECT * FROM t2 WHERE d IN (10042,53);
connection master;
DROP TABLE t2;
# Also test without ANALYZE when we pick the sub-optimal index.
# In this case the key on (d) is the best one, but without ANALYZE TABLE we
# have no information and will pick the first one on (b).
# (This test should be updated if we improve the index selection, of course).
CREATE TABLE t2 (a INT NOT NULL, b INT NOT NULL, c INT NOT NULL, d INT NOT NULL,
KEY expected_key(b),
KEY wrong_key7(d),
KEY wrong_key8(c)) ENGINE=myisam;
INSERT INTO t2 SELECT d DIV 10, d MOD 41, d MOD 37, d FROM t1;
sync_slave_with_master;
connection slave;
--echo # Slave will crash if using the wrong or no index
SET GLOBAL debug="+d,slave_crash_if_wrong_index,slave_crash_if_table_scan";
connection master;
UPDATE t2 SET d=10042 WHERE d=42;
DELETE FROM t2 WHERE d=53;
sync_slave_with_master;
connection slave;
SET GLOBAL debug="";
SELECT * FROM t2 WHERE d IN (10042,53);
connection master;
DROP TABLE t2;
# Test that we pick the primary key for InnoDB, if available.
CREATE TABLE t2 (a INT NOT NULL, b INT NOT NULL, c INT NOT NULL, d INT,
UNIQUE wrong_key9(d),
KEY wrong_key10(a),
PRIMARY KEY expected_key(c,b)) ENGINE=innodb;
INSERT INTO t2 SELECT d DIV 10, d MOD 41, d MOD 37, d FROM t1;
sync_slave_with_master;
connection slave;
--echo # Slave will crash if using the wrong or no index
SET GLOBAL debug="+d,slave_crash_if_wrong_index,slave_crash_if_table_scan,slave_crash_if_index_scan";
connection master;
UPDATE t2 SET d=10042 WHERE d=42;
DELETE FROM t2 WHERE d=53;
sync_slave_with_master;
connection slave;
SET GLOBAL debug="";
SELECT * FROM t2 WHERE d IN (10042,53);
connection master;
DROP TABLE t2;
# Test that we pick a good index for InnoDB when primary key is not available.
CREATE TABLE t2 (a INT NOT NULL, b INT NOT NULL, c INT NOT NULL, d INT, e INT,
UNIQUE wrong_key11(e),
KEY wrong_key12(a),
KEY expected_key(c,b)) ENGINE=innodb;
INSERT INTO t2 SELECT d DIV 10, d MOD 41, d MOD 37, d, IF(d<10, d, NULL) FROM t1;
sync_slave_with_master;
connection slave;
ANALYZE TABLE t2;
--echo # Slave will crash if using the wrong or no index
SET GLOBAL debug="+d,slave_crash_if_wrong_index,slave_crash_if_table_scan";
connection master;
UPDATE t2 SET d=10042 WHERE d=42;
DELETE FROM t2 WHERE d=53;
sync_slave_with_master;
connection slave;
SET GLOBAL debug="";
SELECT * FROM t2 WHERE d IN (10042,53);
connection master;
DROP TABLE t2;
# When there is no ANALYZE TABLE, InnoDB will just report "1" for index
# cardinality for all indexes in rec_per_key. So currently we cannot choose
# index to use intelligently. Just test that we work as expected (select
# first index, remember that unique keys are sorted first by server).
CREATE TABLE t2 (a INT NOT NULL, b INT NOT NULL, c INT NOT NULL, d INT, e INT,
KEY wrong_key13(a),
UNIQUE expected_key(e),
KEY wrong_key14(c,b)) ENGINE=innodb;
INSERT INTO t2 SELECT d DIV 10, d MOD 41, d MOD 37, d, IF(d<10, d, NULL) FROM t1;
sync_slave_with_master;
connection slave;
--echo # Slave will crash if using the wrong or no index
SET GLOBAL debug="+d,slave_crash_if_wrong_index,slave_crash_if_table_scan";
connection master;
UPDATE t2 SET d=10042 WHERE d=42;
DELETE FROM t2 WHERE d=53;
sync_slave_with_master;
connection slave;
SET GLOBAL debug="";
SELECT * FROM t2 WHERE d IN (10042,53);
connection master;
DROP TABLE t2;
# Finally, test behaviour when no indexes are available at all.
CREATE TABLE t2 (a INT NOT NULL, d INT) ENGINE=innodb;
INSERT INTO t2 SELECT d DIV 10, d FROM t1;
UPDATE t2 SET d=10042 WHERE d=42;
DELETE FROM t2 WHERE d=53;
sync_slave_with_master;
connection slave;
SELECT * FROM t2 WHERE d IN (10042,53);
connection master;
DROP TABLE t2;
connection master;
DROP TABLE t1;
sync_slave_with_master;
connection slave;
SET GLOBAL debug="";

View file

@ -164,15 +164,18 @@ connection master;
remove_file $MYSQLTEST_VARDIR/tmp/master.sql; remove_file $MYSQLTEST_VARDIR/tmp/master.sql;
--source include/binlog_start_pos.inc
# this test for position option # this test for position option
# By setting this position to 416, we should only get the create of t3 # By setting this position to start_binlog_pos + 310, we should only get the create of t3
let $start_pos= `select @binlog_start_pos + 310`;
let $stop_pos= `select @binlog_start_pos + 463`;
--disable_query_log --disable_query_log
select "--- Test 2 position test --" as ""; select "--- Test 2 position test --" as "";
--enable_query_log --enable_query_log
let $MYSQLD_DATADIR= `select @@datadir;`; let $MYSQLD_DATADIR= `select @@datadir;`;
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR --replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
--exec $MYSQL_BINLOG --short-form --local-load=$MYSQLTEST_VARDIR/tmp/ --position=416 --stop-position=569 $MYSQLD_DATADIR/master-bin.000001 --exec $MYSQL_BINLOG --short-form --local-load=$MYSQLTEST_VARDIR/tmp/ --position=$start_pos --stop-position=$stop_pos $MYSQLD_DATADIR/master-bin.000001
# These are tests for remote binlog. # These are tests for remote binlog.
# They should return the same as previous test. # They should return the same as previous test.
@ -183,7 +186,7 @@ select "--- Test 3 First Remote test --" as "";
# This is broken now # This is broken now
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR --replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
--exec $MYSQL_BINLOG --short-form --local-load=$MYSQLTEST_VARDIR/tmp/ --stop-position=569 --read-from-remote-server --user=root --host=127.0.0.1 --port=$MASTER_MYPORT master-bin.000001 --exec $MYSQL_BINLOG --short-form --local-load=$MYSQLTEST_VARDIR/tmp/ --stop-position=$stop_pos --read-from-remote-server --user=root --host=127.0.0.1 --port=$MASTER_MYPORT master-bin.000001
# This part is disabled due to bug #17654 # This part is disabled due to bug #17654
@ -259,7 +262,7 @@ connection master;
select "--- Test 5 LOAD DATA --" as ""; select "--- Test 5 LOAD DATA --" as "";
--enable_query_log --enable_query_log
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR --replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
--exec $MYSQL_BINLOG --short-form --local-load=$MYSQLTEST_VARDIR/tmp/ --stop-position=106 --read-from-remote-server --user=root --host=127.0.0.1 --port=$MASTER_MYPORT master-bin.000002 --exec $MYSQL_BINLOG --short-form --local-load=$MYSQLTEST_VARDIR/tmp/ --stop-position=$binlog_start_pos --read-from-remote-server --user=root --host=127.0.0.1 --port=$MASTER_MYPORT master-bin.000002
# Bug#7853 (mysqlbinlog does not accept input from stdin) # Bug#7853 (mysqlbinlog does not accept input from stdin)
@ -267,14 +270,17 @@ select "--- Test 5 LOAD DATA --" as "";
select "--- Test 6 reading stdin --" as ""; select "--- Test 6 reading stdin --" as "";
--enable_query_log --enable_query_log
let $MYSQLD_DATADIR= `select @@datadir;`; let $MYSQLD_DATADIR= `select @@datadir;`;
let $stop_pos= `select @binlog_start_pos + 463`;
--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR --replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR
--exec $MYSQL_BINLOG --short-form --stop-position=569 - < $MYSQLD_DATADIR/master-bin.000001 --exec $MYSQL_BINLOG --short-form --stop-position=$stop_pos - < $MYSQLD_DATADIR/master-bin.000001
--disable_query_log --disable_query_log
select "--- Test 7 reading stdin w/position --" as ""; select "--- Test 7 reading stdin w/position --" as "";
--enable_query_log --enable_query_log
let $start_pos= `select @binlog_start_pos + 310`;
let $stop_pos= `select @binlog_start_pos + 463`;
--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR --replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR
--exec $MYSQL_BINLOG --short-form --position=416 --stop-position=569 - < $MYSQLD_DATADIR/master-bin.000001 --exec $MYSQL_BINLOG --short-form --position=$start_pos --stop-position=$stop_pos - < $MYSQLD_DATADIR/master-bin.000001
# Bug#16217 (mysql client did not know how not switch its internal charset) # Bug#16217 (mysql client did not know how not switch its internal charset)
--disable_query_log --disable_query_log

View file

@ -1,7 +1,8 @@
# depends on the binlog output # depends on the binlog output
--source include/have_binlog_format_mixed_or_statement.inc --source include/have_binlog_format_mixed_or_statement.inc
--source include/binlog_start_pos.inc
let $rename_event_pos= 684; let $rename_event_pos= `select @binlog_start_pos + 578`;
-- source extra/rpl_tests/rpl_flsh_tbls.test -- source extra/rpl_tests/rpl_flsh_tbls.test
# End of 4.1 tests # End of 4.1 tests

View file

@ -13,9 +13,9 @@
# Change: Syntax changed # Change: Syntax changed
################################################################################ ################################################################################
--error ER_UNSUPPORTED_ACTION_ON_VIRTUAL_COLUMN --error ER_UNSUPPORTED_ENGINE_FOR_VIRTUAL_COLUMNS
create table t1 (a int, b int as (a+1)); create table t1 (a int, b int as (a+1));
create table t1 (a int); create table t1 (a int not null);
--error ER_UNSUPPORTED_ACTION_ON_VIRTUAL_COLUMN --error ER_UNSUPPORTED_ENGINE_FOR_VIRTUAL_COLUMNS
alter table t1 add column b int as (a+1); alter table t1 add column b int as (a+1);
drop table t1; drop table t1;

View file

@ -1,7 +1,7 @@
SET @@session.storage_engine = 'archive'; SET @@session.storage_engine = 'archive';
create table t1 (a int, b int as (a+1)); create table t1 (a int, b int as (a+1));
ERROR HY000: 'Specified storage engine' is not yet supported for computed columns ERROR HY000: ARCHIVE storage engine does not support computed columns
create table t1 (a int); create table t1 (a int not null);
alter table t1 add column b int as (a+1); alter table t1 add column b int as (a+1);
ERROR HY000: 'Specified storage engine' is not yet supported for computed columns ERROR HY000: ARCHIVE storage engine does not support computed columns
drop table t1; drop table t1;

View file

@ -1,7 +1,7 @@
SET @@session.storage_engine = 'blackhole'; SET @@session.storage_engine = 'blackhole';
create table t1 (a int, b int as (a+1)); create table t1 (a int, b int as (a+1));
ERROR HY000: 'Specified storage engine' is not yet supported for computed columns ERROR HY000: BLACKHOLE storage engine does not support computed columns
create table t1 (a int); create table t1 (a int not null);
alter table t1 add column b int as (a+1); alter table t1 add column b int as (a+1);
ERROR HY000: 'Specified storage engine' is not yet supported for computed columns ERROR HY000: BLACKHOLE storage engine does not support computed columns
drop table t1; drop table t1;

View file

@ -1,7 +1,7 @@
SET @@session.storage_engine = 'CSV'; SET @@session.storage_engine = 'CSV';
create table t1 (a int, b int as (a+1)); create table t1 (a int, b int as (a+1));
ERROR HY000: 'Specified storage engine' is not yet supported for computed columns ERROR HY000: CSV storage engine does not support computed columns
create table t1 (a int not null); create table t1 (a int not null);
alter table t1 add column b int as (a+1); alter table t1 add column b int as (a+1);
ERROR HY000: 'Specified storage engine' is not yet supported for computed columns ERROR HY000: CSV storage engine does not support computed columns
drop table t1; drop table t1;

View file

@ -1,7 +1,7 @@
SET @@session.storage_engine = 'memory'; SET @@session.storage_engine = 'memory';
create table t1 (a int, b int as (a+1)); create table t1 (a int, b int as (a+1));
ERROR HY000: 'Specified storage engine' is not yet supported for computed columns ERROR HY000: MEMORY storage engine does not support computed columns
create table t1 (a int); create table t1 (a int not null);
alter table t1 add column b int as (a+1); alter table t1 add column b int as (a+1);
ERROR HY000: 'Specified storage engine' is not yet supported for computed columns ERROR HY000: MEMORY storage engine does not support computed columns
drop table t1; drop table t1;

View file

@ -4,5 +4,5 @@ create table t2 (a int, b int as (a % 10));
insert into t1 values (1,default); insert into t1 values (1,default);
insert into t2 values (2,default); insert into t2 values (2,default);
create table t3 (a int, b int as (a % 10)) engine=MERGE UNION=(t1,t2); create table t3 (a int, b int as (a % 10)) engine=MERGE UNION=(t1,t2);
ERROR HY000: 'Specified storage engine' is not yet supported for computed columns ERROR HY000: MRG_MYISAM storage engine does not support computed columns
drop table t1,t2; drop table t1,t2;

View file

@ -76,7 +76,7 @@ drop table t1;
# Case 7. ALTER. Modify virtual stored -> virtual non-stored # Case 7. ALTER. Modify virtual stored -> virtual non-stored
create table t1 (a int, b int as (a % 2) persistent); create table t1 (a int, b int as (a % 2) persistent);
alter table t1 modify b int as (a % 2); alter table t1 modify b int as (a % 2);
ERROR HY000: 'Changing the STORED status' is not yet supported for computed columns ERROR HY000: This is not yet supported for computed columns
show create table t1; show create table t1;
Table Create Table Table Create Table
t1 CREATE TABLE `t1` ( t1 CREATE TABLE `t1` (
@ -87,7 +87,7 @@ drop table t1;
# Case 8. ALTER. Modify virtual non-stored -> virtual stored # Case 8. ALTER. Modify virtual non-stored -> virtual stored
create table t1 (a int, b int as (a % 2)); create table t1 (a int, b int as (a % 2));
alter table t1 modify b int as (a % 2) persistent; alter table t1 modify b int as (a % 2) persistent;
ERROR HY000: 'Changing the STORED status' is not yet supported for computed columns ERROR HY000: This is not yet supported for computed columns
show create table t1; show create table t1;
Table Create Table Table Create Table
t1 CREATE TABLE `t1` ( t1 CREATE TABLE `t1` (

View file

@ -76,7 +76,7 @@ drop table t1;
# Case 7. ALTER. Modify virtual stored -> virtual non-stored # Case 7. ALTER. Modify virtual stored -> virtual non-stored
create table t1 (a int, b int as (a % 2) persistent); create table t1 (a int, b int as (a % 2) persistent);
alter table t1 modify b int as (a % 2); alter table t1 modify b int as (a % 2);
ERROR HY000: 'Changing the STORED status' is not yet supported for computed columns ERROR HY000: This is not yet supported for computed columns
show create table t1; show create table t1;
Table Create Table Table Create Table
t1 CREATE TABLE `t1` ( t1 CREATE TABLE `t1` (
@ -87,7 +87,7 @@ drop table t1;
# Case 8. ALTER. Modify virtual non-stored -> virtual stored # Case 8. ALTER. Modify virtual non-stored -> virtual stored
create table t1 (a int, b int as (a % 2)); create table t1 (a int, b int as (a % 2));
alter table t1 modify b int as (a % 2) persistent; alter table t1 modify b int as (a % 2) persistent;
ERROR HY000: 'Changing the STORED status' is not yet supported for computed columns ERROR HY000: This is not yet supported for computed columns
show create table t1; show create table t1;
Table Create Table Table Create Table
t1 CREATE TABLE `t1` ( t1 CREATE TABLE `t1` (

View file

@ -27,7 +27,7 @@
##### Storage engine to be tested ##### Storage engine to be tested
# Set the session storage engine # Set the session storage engine
--source include/have_innodb.inc --source include/have_xtradb.inc
SET @@session.storage_engine = 'InnoDB'; SET @@session.storage_engine = 'InnoDB';
#------------------------------------------------------------------------------# #------------------------------------------------------------------------------#

View file

@ -32,7 +32,7 @@
##### Storage engine to be tested ##### Storage engine to be tested
# Set the session storage engine # Set the session storage engine
--source include/have_innodb.inc --source include/have_xtradb.inc
eval SET @@session.storage_engine = 'InnoDB'; eval SET @@session.storage_engine = 'InnoDB';
let $skip_full_text_checks = 1; let $skip_full_text_checks = 1;

View file

@ -33,7 +33,7 @@
##### Storage engine to be tested ##### Storage engine to be tested
# Set the session storage engine # Set the session storage engine
--source include/have_innodb.inc --source include/have_xtradb.inc
eval SET @@session.storage_engine = 'InnoDB'; eval SET @@session.storage_engine = 'InnoDB';
##### Workarounds for known open engine specific bugs ##### Workarounds for known open engine specific bugs

View file

@ -41,13 +41,7 @@ SET @@session.storage_engine = 'CSV';
# Execute the tests to be applied to all storage engines # Execute the tests to be applied to all storage engines
#------------------------------------------------------------------------------# #------------------------------------------------------------------------------#
# Execute storage engine specific tests --source suite/vcol/inc/vcol_unsupported_storage_engines.inc
--error ER_UNSUPPORTED_ACTION_ON_VIRTUAL_COLUMN
create table t1 (a int, b int as (a+1));
create table t1 (a int not null);
--error ER_UNSUPPORTED_ACTION_ON_VIRTUAL_COLUMN
alter table t1 add column b int as (a+1);
drop table t1;
#------------------------------------------------------------------------------# #------------------------------------------------------------------------------#
# Cleanup # Cleanup

View file

@ -33,7 +33,7 @@
##### Storage engine to be tested ##### Storage engine to be tested
# Set the session storage engine # Set the session storage engine
--source include/have_innodb.inc --source include/have_xtradb.inc
eval SET @@session.storage_engine = 'InnoDB'; eval SET @@session.storage_engine = 'InnoDB';
##### Workarounds for known open engine specific bugs ##### Workarounds for known open engine specific bugs

View file

@ -33,7 +33,7 @@
##### Storage engine to be tested ##### Storage engine to be tested
# Set the session storage engine # Set the session storage engine
--source include/have_innodb.inc --source include/have_xtradb.inc
eval SET @@session.storage_engine = 'InnoDB'; eval SET @@session.storage_engine = 'InnoDB';
##### Workarounds for known open engine specific bugs ##### Workarounds for known open engine specific bugs

View file

@ -33,7 +33,7 @@
##### Storage engine to be tested ##### Storage engine to be tested
# Set the session storage engine # Set the session storage engine
--source include/have_innodb.inc --source include/have_xtradb.inc
eval SET @@session.storage_engine = 'InnoDB'; eval SET @@session.storage_engine = 'InnoDB';
##### Workarounds for known open engine specific bugs ##### Workarounds for known open engine specific bugs

View file

@ -48,7 +48,7 @@ create table t1 (a int, b int as (a % 10));
create table t2 (a int, b int as (a % 10)); create table t2 (a int, b int as (a % 10));
insert into t1 values (1,default); insert into t1 values (1,default);
insert into t2 values (2,default); insert into t2 values (2,default);
--error ER_UNSUPPORTED_ACTION_ON_VIRTUAL_COLUMN --error ER_UNSUPPORTED_ENGINE_FOR_VIRTUAL_COLUMNS
create table t3 (a int, b int as (a % 10)) engine=MERGE UNION=(t1,t2); create table t3 (a int, b int as (a % 10)) engine=MERGE UNION=(t1,t2);
drop table t1,t2; drop table t1,t2;

View file

@ -35,7 +35,7 @@
##### Storage engine to be tested ##### Storage engine to be tested
# Set the session storage engine # Set the session storage engine
--source include/have_innodb.inc --source include/have_xtradb.inc
eval SET @@session.storage_engine = 'InnoDB'; eval SET @@session.storage_engine = 'InnoDB';
##### Workarounds for known open engine specific bugs ##### Workarounds for known open engine specific bugs

View file

@ -34,7 +34,7 @@
##### Storage engine to be tested ##### Storage engine to be tested
# Set the session storage engine # Set the session storage engine
--source include/have_innodb.inc --source include/have_xtradb.inc
eval SET @@session.storage_engine = 'InnoDB'; eval SET @@session.storage_engine = 'InnoDB';
##### Workarounds for known open engine specific bugs ##### Workarounds for known open engine specific bugs

View file

@ -33,7 +33,7 @@
##### Storage engine to be tested ##### Storage engine to be tested
# Set the session storage engine # Set the session storage engine
--source include/have_innodb.inc --source include/have_xtradb.inc
eval SET @@session.storage_engine = 'InnoDB'; eval SET @@session.storage_engine = 'InnoDB';
##### Workarounds for known open engine specific bugs ##### Workarounds for known open engine specific bugs

View file

@ -32,7 +32,7 @@
##### Storage engine to be tested ##### Storage engine to be tested
# Set the session storage engine # Set the session storage engine
--source include/have_innodb.inc --source include/have_xtradb.inc
SET @@session.storage_engine = 'InnoDB'; SET @@session.storage_engine = 'InnoDB';
##### Workarounds for known open engine specific bugs ##### Workarounds for known open engine specific bugs

View file

@ -34,7 +34,7 @@
##### Storage engine to be tested ##### Storage engine to be tested
# Set the session storage engine # Set the session storage engine
--source include/have_innodb.inc --source include/have_xtradb.inc
eval SET @@session.storage_engine = 'InnoDB'; eval SET @@session.storage_engine = 'InnoDB';
##### Workarounds for known open engine specific bugs ##### Workarounds for known open engine specific bugs

View file

@ -33,7 +33,7 @@
##### Storage engine to be tested ##### Storage engine to be tested
# Set the session storage engine # Set the session storage engine
--source include/have_innodb.inc --source include/have_xtradb.inc
eval SET @@session.storage_engine = 'InnoDB'; eval SET @@session.storage_engine = 'InnoDB';
##### Workarounds for known open engine specific bugs ##### Workarounds for known open engine specific bugs

View file

@ -1630,6 +1630,11 @@ SET @@join_buffer_size= @save_join_buffer_size;
# BUG#47012 archive tables are not upgradeable, and server crashes on any access # BUG#47012 archive tables are not upgradeable, and server crashes on any access
# #
let $MYSQLD_DATADIR= `SELECT @@datadir`; let $MYSQLD_DATADIR= `SELECT @@datadir`;
# Remove files to handle possible restart of test
flush tables;
remove_files_wildcard $MYSQLD_DATADIR/test t1.*;
copy_file std_data/bug47012.frm $MYSQLD_DATADIR/test/t1.frm; copy_file std_data/bug47012.frm $MYSQLD_DATADIR/test/t1.frm;
copy_file std_data/bug47012.ARZ $MYSQLD_DATADIR/test/t1.ARZ; copy_file std_data/bug47012.ARZ $MYSQLD_DATADIR/test/t1.ARZ;
copy_file std_data/bug47012.ARM $MYSQLD_DATADIR/test/t1.ARM; copy_file std_data/bug47012.ARM $MYSQLD_DATADIR/test/t1.ARM;

View file

@ -352,6 +352,19 @@ connection pcon4;
select user(), current_user(); select user(), current_user();
disconnect pcon4; disconnect pcon4;
#
# lpbug#683112 Maria 5.2 incorrectly reports "(using password: NO)"
# even when password is specified
#
# test "access denied" error for nonexisting user with and without a password
#
--replace_result $MASTER_MYSOCK MASTER_SOCKET $MASTER_MYPORT MASTER_PORT
--error ER_ACCESS_DENIED_ERROR
connect(pcon5,localhost,mysqltest_nouser,newpw,,$MASTER_MYPORT,);
--replace_result $MASTER_MYSOCK MASTER_SOCKET $MASTER_MYPORT MASTER_PORT
--error ER_ACCESS_DENIED_ERROR
connect(pcon5,localhost,mysqltest_nouser,,,$MASTER_MYPORT,);
connection default; connection default;
DROP USER mysqltest_up1@'%'; DROP USER mysqltest_up1@'%';
DROP USER mysqltest_up2@'%'; DROP USER mysqltest_up2@'%';

View file

@ -28,14 +28,6 @@ delimiter ;|
--echo End of 5.0 tests --echo End of 5.0 tests
#
# #28436: Incorrect position in SHOW BINLOG EVENTS causes server coredump
# Note: 364 is a magic position (found experimentally, depends on
# the log's contents) that caused the server crash.
--error 1220
SHOW BINLOG EVENTS FROM 365;
--echo Bug#44352 UPPER/LOWER function doesn't work correctly on cp932 and sjis environment. --echo Bug#44352 UPPER/LOWER function doesn't work correctly on cp932 and sjis environment.
CREATE TABLE t1 (a varchar(16)) character set cp932; CREATE TABLE t1 (a varchar(16)) character set cp932;
INSERT INTO t1 VALUES (0x8372835E),(0x8352835E); INSERT INTO t1 VALUES (0x8372835E),(0x8352835E);

View file

@ -64,12 +64,14 @@ INSERT INTO t1 VALUES (1000000, 0, 0);
SET SESSION sort_buffer_size = 1024*36; SET SESSION sort_buffer_size = 1024*36;
# We have to use FORCE INDEX here as Innodb gives inconsistent estimates
# which causes different query plans.
EXPLAIN EXPLAIN
SELECT COUNT(*) FROM SELECT COUNT(*) FROM
(SELECT * FROM t1 (SELECT * FROM t1 FORCE INDEX(primary,idx)
WHERE a BETWEEN 2 AND 7 OR pk=1000000) AS t; WHERE a BETWEEN 2 AND 7 OR pk=1000000) AS t;
SELECT COUNT(*) FROM SELECT COUNT(*) FROM
(SELECT * FROM t1 (SELECT * FROM t1 FORCE INDEX(primary,idx)
WHERE a BETWEEN 2 AND 7 OR pk=1000000) AS t; WHERE a BETWEEN 2 AND 7 OR pk=1000000) AS t;
--replace_column 9 # --replace_column 9 #

View file

@ -1 +0,0 @@
--max-binlog-size=4096

View file

@ -3,10 +3,18 @@
-- source include/have_binlog_format_statement.inc -- source include/have_binlog_format_statement.inc
-- source include/have_log_bin.inc -- source include/have_log_bin.inc
-- source include/binlog_start_pos.inc
# Deletes all the binary logs # Deletes all the binary logs
reset master; reset master;
# We need small binlog size to break the last LOAD DATA INFILE below so that
# the corresponding Begin_load_query will be written to master-bin.000001
# while the Execute_load_query will be written to master-bin.000002.
SET @save_binlog_size= @@global.max_binlog_size;
SET @@global.max_binlog_size= 4096;
# we need this for getting fixed timestamps inside of this test # we need this for getting fixed timestamps inside of this test
set timestamp=1000000000; set timestamp=1000000000;
@ -26,13 +34,15 @@ insert into t2 values ();
# test for load data and load data distributed among the several # test for load data and load data distributed among the several
# files (we need to fill up first binlog) # files (we need to fill up first binlog)
load data infile '../../std_data/words.dat' into table t1; load data infile '../../std_data/words3.dat' into table t1;
load data infile '../../std_data/words.dat' into table t1; load data infile '../../std_data/words3.dat' into table t1;
load data infile '../../std_data/words.dat' into table t1; load data infile '../../std_data/words3.dat' into table t1;
load data infile '../../std_data/words.dat' into table t1; load data infile '../../std_data/words3.dat' into table t1;
load data infile '../../std_data/words.dat' into table t1; load data infile '../../std_data/words3.dat' into table t1;
# simple query to show more in second binlog # simple query to show more in second binlog
insert into t1 values ("Alas"); insert into t1 values ("Alas");
### Starting master-bin.000003
flush logs; flush logs;
# delimiters are for easier debugging in future # delimiters are for easier debugging in future
@ -46,7 +56,7 @@ select "--- Local --" as "";
# #
let $MYSQLD_DATADIR= `select @@datadir`; let $MYSQLD_DATADIR= `select @@datadir`;
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR --replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
--replace_regex /SQL_LOAD_MB-[0-9]-[0-9]/SQL_LOAD_MB-#-#/ --replace_regex /SQL_LOAD_MB-[0-9a-f]+-[0-9a-f]+/SQL_LOAD_MB-#-#/
--exec $MYSQL_BINLOG --short-form --local-load=$MYSQLTEST_VARDIR/tmp/ $MYSQLD_DATADIR/master-bin.000001 --exec $MYSQL_BINLOG --short-form --local-load=$MYSQLTEST_VARDIR/tmp/ $MYSQLD_DATADIR/master-bin.000001
# this should not fail but shouldn't produce any working statements # this should not fail but shouldn't produce any working statements
@ -54,7 +64,7 @@ let $MYSQLD_DATADIR= `select @@datadir`;
select "--- Broken LOAD DATA --" as ""; select "--- Broken LOAD DATA --" as "";
--enable_query_log --enable_query_log
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR --replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
--replace_regex /SQL_LOAD_MB-[0-9]-[0-9]/SQL_LOAD_MB-#-#/ --replace_regex /SQL_LOAD_MB-[0-9a-f]+-[0-9a-f]+/SQL_LOAD_MB-#-#/
--exec $MYSQL_BINLOG --short-form --local-load=$MYSQLTEST_VARDIR/tmp/ $MYSQLD_DATADIR/master-bin.000002 2> /dev/null --exec $MYSQL_BINLOG --short-form --local-load=$MYSQLTEST_VARDIR/tmp/ $MYSQLD_DATADIR/master-bin.000002 2> /dev/null
# this should show almost nothing # this should show almost nothing
@ -62,17 +72,17 @@ select "--- Broken LOAD DATA --" as "";
select "--- --database --" as ""; select "--- --database --" as "";
--enable_query_log --enable_query_log
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR --replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
--replace_regex /SQL_LOAD_MB-[0-9]-[0-9]/SQL_LOAD_MB-#-#/ --replace_regex /SQL_LOAD_MB-[0-9a-f]+-[0-9a-f]+/SQL_LOAD_MB-#-#/
--exec $MYSQL_BINLOG --short-form --local-load=$MYSQLTEST_VARDIR/tmp/ --database=nottest $MYSQLD_DATADIR/master-bin.000001 2> /dev/null --exec $MYSQL_BINLOG --short-form --local-load=$MYSQLTEST_VARDIR/tmp/ --database=nottest $MYSQLD_DATADIR/master-bin.000001 2> /dev/null
# this test for position option # this test for position option
--disable_query_log --disable_query_log
select "--- --position --" as ""; select "--- --position --" as "";
--enable_query_log --enable_query_log
let $start_pos= `select @binlog_start_pos + 227`;
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR --replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
--replace_regex /SQL_LOAD_MB-[0-9]-[0-9]/SQL_LOAD_MB-#-#/ --replace_regex /SQL_LOAD_MB-[0-9a-f]+-[0-9a-f]+/SQL_LOAD_MB-#-#/
--exec $MYSQL_BINLOG --short-form --local-load=$MYSQLTEST_VARDIR/tmp/ --position=332 $MYSQLD_DATADIR/master-bin.000002 --exec $MYSQL_BINLOG --short-form --local-load=$MYSQLTEST_VARDIR/tmp/ --position=$start_pos $MYSQLD_DATADIR/master-bin.000002
# These are tests for remote binlog. # These are tests for remote binlog.
# They should return the same as previous test. # They should return the same as previous test.
@ -83,7 +93,7 @@ select "--- Remote --" as "";
# This is broken now # This is broken now
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR --replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
--replace_regex /SQL_LOAD_MB-[0-9]-[0-9]/SQL_LOAD_MB-#-#/ --replace_regex /SQL_LOAD_MB-[0-9a-f]+-[0-9a-f]+/SQL_LOAD_MB-#-#/
--exec $MYSQL_BINLOG --short-form --local-load=$MYSQLTEST_VARDIR/tmp/ --read-from-remote-server --user=root --host=127.0.0.1 --port=$MASTER_MYPORT master-bin.000001 --exec $MYSQL_BINLOG --short-form --local-load=$MYSQLTEST_VARDIR/tmp/ --read-from-remote-server --user=root --host=127.0.0.1 --port=$MASTER_MYPORT master-bin.000001
# This is broken too # This is broken too
@ -91,7 +101,7 @@ select "--- Remote --" as "";
select "--- Broken LOAD DATA --" as ""; select "--- Broken LOAD DATA --" as "";
--enable_query_log --enable_query_log
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR --replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
--replace_regex /SQL_LOAD_MB-[0-9]-[0-9]/SQL_LOAD_MB-#-#/ --replace_regex /SQL_LOAD_MB-[0-9a-f]+-[0-9a-f]+/SQL_LOAD_MB-#-#/
--exec $MYSQL_BINLOG --short-form --local-load=$MYSQLTEST_VARDIR/tmp/ --read-from-remote-server --user=root --host=127.0.0.1 --port=$MASTER_MYPORT master-bin.000002 2> /dev/null --exec $MYSQL_BINLOG --short-form --local-load=$MYSQLTEST_VARDIR/tmp/ --read-from-remote-server --user=root --host=127.0.0.1 --port=$MASTER_MYPORT master-bin.000002 2> /dev/null
# And this too ! (altough it is documented) # And this too ! (altough it is documented)
@ -99,34 +109,39 @@ select "--- Broken LOAD DATA --" as "";
select "--- --database --" as ""; select "--- --database --" as "";
--enable_query_log --enable_query_log
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR --replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
--replace_regex /SQL_LOAD_MB-[0-9]-[0-9]/SQL_LOAD_MB-#-#/ --replace_regex /SQL_LOAD_MB-[0-9a-f]+-[0-9a-f]+/SQL_LOAD_MB-#-#/
--exec $MYSQL_BINLOG --short-form --local-load=$MYSQLTEST_VARDIR/tmp/ --read-from-remote-server --user=root --host=127.0.0.1 --port=$MASTER_MYPORT --database=nottest master-bin.000001 2> /dev/null --exec $MYSQL_BINLOG --short-form --local-load=$MYSQLTEST_VARDIR/tmp/ --read-from-remote-server --user=root --host=127.0.0.1 --port=$MASTER_MYPORT --database=nottest master-bin.000001 2> /dev/null
# Strangely but this works # Strangely but this works
--disable_query_log --disable_query_log
select "--- --position --" as ""; select "--- --position --" as "";
--enable_query_log --enable_query_log
let $start_pos= `select @binlog_start_pos + 227`;
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR --replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
--replace_regex /SQL_LOAD_MB-[0-9]-[0-9]/SQL_LOAD_MB-#-#/ --replace_regex /SQL_LOAD_MB-[0-9a-f]+-[0-9a-f]+/SQL_LOAD_MB-#-#/
--exec $MYSQL_BINLOG --short-form --local-load=$MYSQLTEST_VARDIR/tmp/ --read-from-remote-server --position=332 --user=root --host=127.0.0.1 --port=$MASTER_MYPORT master-bin.000002 --exec $MYSQL_BINLOG --short-form --local-load=$MYSQLTEST_VARDIR/tmp/ --read-from-remote-server --position=$start_pos --user=root --host=127.0.0.1 --port=$MASTER_MYPORT master-bin.000002
# Bug#7853 mysqlbinlog does not accept input from stdin # Bug#7853 mysqlbinlog does not accept input from stdin
--disable_query_log --disable_query_log
select "--- reading stdin --" as ""; select "--- reading stdin --" as "";
--enable_query_log --enable_query_log
--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR --replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR
--replace_regex /SQL_LOAD_MB-[0-9]-[0-9]/SQL_LOAD_MB-#-#/ --replace_regex /SQL_LOAD_MB-[0-9a-f]+-[0-9a-f]+/SQL_LOAD_MB-#-#/
--exec $MYSQL_BINLOG --short-form - < $MYSQL_TEST_DIR/std_data/trunc_binlog.000001 --exec $MYSQL_BINLOG --short-form - < $MYSQL_TEST_DIR/std_data/trunc_binlog.000001
--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR --replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR
--replace_regex /SQL_LOAD_MB-[0-9]-[0-9]/SQL_LOAD_MB-#-#/ --replace_regex /SQL_LOAD_MB-[0-9a-f]+-[0-9a-f]+/SQL_LOAD_MB-#-#/
--exec $MYSQL_BINLOG --short-form --position=79 - < $MYSQL_TEST_DIR/std_data/trunc_binlog.000001 --exec $MYSQL_BINLOG --short-form --position=79 - < $MYSQL_TEST_DIR/std_data/trunc_binlog.000001
drop table t1,t2; drop table t1,t2;
SET @@global.max_binlog_size= @save_binlog_size;
# #
# Bug#14157 utf8 encoding in binlog without set character_set_client # Bug#14157 utf8 encoding in binlog without set character_set_client
# #
### Starting master-bin.000004
flush logs; flush logs;
--write_file $MYSQLTEST_VARDIR/tmp/bug14157.sql --write_file $MYSQLTEST_VARDIR/tmp/bug14157.sql
create table if not exists t5 (a int); create table if not exists t5 (a int);
set names latin1; set names latin1;
@ -140,6 +155,8 @@ EOF
# resulted binlog, parly consisting of multi-byte utf8 chars, # resulted binlog, parly consisting of multi-byte utf8 chars,
# must be digestable for both client and server. In 4.1 the client # must be digestable for both client and server. In 4.1 the client
# should use default-character-set same as the server. # should use default-character-set same as the server.
### Starting master-bin.000005
flush logs; flush logs;
--exec $MYSQL_BINLOG --short-form $MYSQLD_DATADIR/master-bin.000004 | $MYSQL --exec $MYSQL_BINLOG --short-form $MYSQLD_DATADIR/master-bin.000004 | $MYSQL
select * from t5 /* must be (1),(1) */; select * from t5 /* must be (1),(1) */;
@ -150,6 +167,8 @@ drop table t5;
# Check that a dump created by mysqlbinlog reproduces # Check that a dump created by mysqlbinlog reproduces
# lc_time_names dependent values correctly # lc_time_names dependent values correctly
# #
### Starting master-bin.000006
flush logs; flush logs;
create table t5 (c1 int, c2 varchar(128) character set latin1 not null); create table t5 (c1 int, c2 varchar(128) character set latin1 not null);
insert into t5 values (1, date_format('2001-01-01','%W')); insert into t5 values (1, date_format('2001-01-01','%W'));
@ -158,7 +177,10 @@ insert into t5 values (2, date_format('2001-01-01','%W'));
set lc_time_names=en_US; set lc_time_names=en_US;
insert into t5 values (3, date_format('2001-01-01','%W')); insert into t5 values (3, date_format('2001-01-01','%W'));
select * from t5 order by c1; select * from t5 order by c1;
### Starting master-bin.000007
flush logs; flush logs;
drop table t5; drop table t5;
--exec $MYSQL_BINLOG --short-form $MYSQLD_DATADIR/master-bin.000006 | $MYSQL --exec $MYSQL_BINLOG --short-form $MYSQLD_DATADIR/master-bin.000006 | $MYSQL
select * from t5 order by c1; select * from t5 order by c1;
@ -170,7 +192,10 @@ drop table t5;
--disable_warnings --disable_warnings
drop procedure if exists p1; drop procedure if exists p1;
--enable_warnings --enable_warnings
### Starting master-bin.000008
flush logs; flush logs;
delimiter //; delimiter //;
create procedure p1() create procedure p1()
begin begin
@ -178,12 +203,15 @@ select 1;
end; end;
// //
delimiter ;// delimiter ;//
### Starting master-bin.000009
flush logs; flush logs;
call p1(); call p1();
drop procedure p1; drop procedure p1;
--error ER_SP_DOES_NOT_EXIST --error ER_SP_DOES_NOT_EXIST
call p1(); call p1();
--replace_regex /SQL_LOAD_MB-[0-9]-[0-9]/SQL_LOAD_MB-#-#/ --replace_regex /SQL_LOAD_MB-[0-9a-f]+-[0-9a-f]+/SQL_LOAD_MB-#-#/
--exec $MYSQL_BINLOG --short-form $MYSQLD_DATADIR/master-bin.000008 --exec $MYSQL_BINLOG --short-form $MYSQLD_DATADIR/master-bin.000008
--exec $MYSQL_BINLOG --short-form $MYSQLD_DATADIR/master-bin.000008 | $MYSQL --exec $MYSQL_BINLOG --short-form $MYSQLD_DATADIR/master-bin.000008 | $MYSQL
call p1(); call p1();
@ -202,7 +230,9 @@ drop procedure p1;
# (LOAD DATA INFILE need it) # (LOAD DATA INFILE need it)
# #
### Starting master-bin.000010
flush logs; flush logs;
create table t1 (a varchar(64) character set utf8); create table t1 (a varchar(64) character set utf8);
load data infile '../../std_data/loaddata6.dat' into table t1; load data infile '../../std_data/loaddata6.dat' into table t1;
set character_set_database=koi8r; set character_set_database=koi8r;
@ -217,9 +247,12 @@ load data infile '../../std_data/loaddata6.dat' into table t1;
load data infile '../../std_data/loaddata6.dat' into table t1 character set koi8r; load data infile '../../std_data/loaddata6.dat' into table t1 character set koi8r;
select hex(a) from t1; select hex(a) from t1;
drop table t1; drop table t1;
### Starting master-bin.000011
flush logs; flush logs;
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR --replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
--replace_regex /SQL_LOAD_MB-[0-9]-[0-9]/SQL_LOAD_MB-#-#/ --replace_regex /SQL_LOAD_MB-[0-9a-f]+-[0-9a-f]+/SQL_LOAD_MB-#-#/
--exec $MYSQL_BINLOG --short-form --local-load=$MYSQLTEST_VARDIR/tmp/ $MYSQLD_DATADIR/master-bin.000010 --exec $MYSQL_BINLOG --short-form --local-load=$MYSQLTEST_VARDIR/tmp/ $MYSQLD_DATADIR/master-bin.000010
# #
@ -229,9 +262,14 @@ flush logs;
CREATE TABLE t1 (c1 CHAR(10)); CREATE TABLE t1 (c1 CHAR(10));
# we need this for getting fixed timestamps inside of this test # we need this for getting fixed timestamps inside of this test
### Starting master-bin.000012
FLUSH LOGS; FLUSH LOGS;
INSERT INTO t1 VALUES ('0123456789'); INSERT INTO t1 VALUES ('0123456789');
### Starting master-bin.000013
FLUSH LOGS; FLUSH LOGS;
DROP TABLE t1; DROP TABLE t1;
# We create a table, patch, and load the output into it # We create a table, patch, and load the output into it
@ -257,11 +295,16 @@ DROP TABLE patch;
# #
# Bug#29928 incorrect connection_id() restoring from mysqlbinlog out # Bug#29928 incorrect connection_id() restoring from mysqlbinlog out
# #
### Starting master-bin.000014
FLUSH LOGS; FLUSH LOGS;
CREATE TABLE t1(a INT); CREATE TABLE t1(a INT);
INSERT INTO t1 VALUES(connection_id()); INSERT INTO t1 VALUES(connection_id());
let $a= `SELECT a FROM t1`; let $a= `SELECT a FROM t1`;
### Starting master-bin.000015
FLUSH LOGS; FLUSH LOGS;
let $outfile= $MYSQLTEST_VARDIR/tmp/bug29928.sql; let $outfile= $MYSQLTEST_VARDIR/tmp/bug29928.sql;
--exec $MYSQL_BINLOG $MYSQLD_DATADIR/master-bin.000014 > $outfile --exec $MYSQL_BINLOG $MYSQLD_DATADIR/master-bin.000014 > $outfile
DROP TABLE t1; DROP TABLE t1;
@ -281,11 +324,12 @@ error 1;
exec $MYSQL_BINLOG $MYSQL_TEST_DIR/std_data/corrupt-relay-bin.000624 > $MYSQLTEST_VARDIR/tmp/bug31793.sql; exec $MYSQL_BINLOG $MYSQL_TEST_DIR/std_data/corrupt-relay-bin.000624 > $MYSQLTEST_VARDIR/tmp/bug31793.sql;
--remove_file $MYSQLTEST_VARDIR/tmp/bug31793.sql --remove_file $MYSQLTEST_VARDIR/tmp/bug31793.sql
# #
# Test --disable-force-if-open and --force-if-open # Test --disable-force-if-open and --force-if-open
# #
### Starting master-bin.000016
FLUSH LOGS; FLUSH LOGS;
--error 1 --error 1
--exec $MYSQL_BINLOG $MYSQLD_DATADIR/master-bin.000016 >/dev/null 2>/dev/null --exec $MYSQL_BINLOG $MYSQLD_DATADIR/master-bin.000016 >/dev/null 2>/dev/null
--exec $MYSQL_BINLOG --force-if-open $MYSQLD_DATADIR/master-bin.000016 >/dev/null 2>/dev/null --exec $MYSQL_BINLOG --force-if-open $MYSQLD_DATADIR/master-bin.000016 >/dev/null 2>/dev/null
@ -300,9 +344,15 @@ GRANT SELECT ON mysqltest1.* TO untrusted@localhost;
SHOW GRANTS FOR untrusted@localhost; SHOW GRANTS FOR untrusted@localhost;
USE mysqltest1; USE mysqltest1;
CREATE TABLE t1 (a INT, b CHAR(64)); CREATE TABLE t1 (a INT, b CHAR(64));
### Starting master-bin.000017
flush logs; flush logs;
INSERT INTO t1 VALUES (1,USER()); INSERT INTO t1 VALUES (1,USER());
### Starting master-bin.000018
flush logs; flush logs;
echo mysqlbinlog var/log/master-bin.000017 > var/tmp/bug31611.sql; echo mysqlbinlog var/log/master-bin.000017 > var/tmp/bug31611.sql;
exec $MYSQL_BINLOG $MYSQLD_DATADIR/master-bin.000017 > $MYSQLTEST_VARDIR/tmp/bug31611.sql; exec $MYSQL_BINLOG $MYSQLD_DATADIR/master-bin.000017 > $MYSQLTEST_VARDIR/tmp/bug31611.sql;
connect (unsecure,localhost,untrusted,,mysqltest1); connect (unsecure,localhost,untrusted,,mysqltest1);
@ -326,14 +376,20 @@ DROP USER untrusted@localhost;
connection default; connection default;
USE test; USE test;
SET BINLOG_FORMAT = STATEMENT; SET BINLOG_FORMAT = STATEMENT;
### Starting master-bin.000019
FLUSH LOGS; FLUSH LOGS;
CREATE TABLE t1 (a_real FLOAT, an_int INT, a_decimal DECIMAL(5,2), a_string CHAR(32)); CREATE TABLE t1 (a_real FLOAT, an_int INT, a_decimal DECIMAL(5,2), a_string CHAR(32));
SET @a_real = rand(20) * 1000; SET @a_real = rand(20) * 1000;
SET @an_int = 1000; SET @an_int = 1000;
SET @a_decimal = CAST(rand(19) * 999 AS DECIMAL(5,2)); SET @a_decimal = CAST(rand(19) * 999 AS DECIMAL(5,2));
SET @a_string = 'Just a test'; SET @a_string = 'Just a test';
INSERT INTO t1 VALUES (@a_real, @an_int, @a_decimal, @a_string); INSERT INTO t1 VALUES (@a_real, @an_int, @a_decimal, @a_string);
### Starting master-bin.000020
FLUSH LOGS; FLUSH LOGS;
query_vertical SELECT * FROM t1; query_vertical SELECT * FROM t1;
DROP TABLE t1; DROP TABLE t1;
@ -357,6 +413,7 @@ eval SET @@global.server_id= $s_id_max;
RESET MASTER; RESET MASTER;
FLUSH LOGS; FLUSH LOGS;
--exec $MYSQL_BINLOG $MYSQLD_DATADIR/master-bin.000001 > $binlog_file --exec $MYSQL_BINLOG $MYSQLD_DATADIR/master-bin.000001 > $binlog_file
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR --replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
eval SELECT eval SELECT

View file

@ -3,7 +3,7 @@
# TODO: Need to look at making row based version once new binlog client is complete. # TODO: Need to look at making row based version once new binlog client is complete.
-- source include/have_binlog_format_mixed_or_statement.inc -- source include/have_binlog_format_mixed_or_statement.inc
-- source include/binlog_start_pos.inc
--disable_warnings --disable_warnings
drop table if exists t1; drop table if exists t1;
@ -50,15 +50,19 @@ select "--- offset --" as "";
--disable_query_log --disable_query_log
select "--- start-position --" as ""; select "--- start-position --" as "";
--enable_query_log --enable_query_log
--exec $MYSQL_BINLOG --short-form --start-position=608 $MYSQLD_DATADIR/master-bin.000001 let $start_pos= `select @binlog_start_pos + 502`;
--exec $MYSQL_BINLOG --short-form --start-position=$start_pos $MYSQLD_DATADIR/master-bin.000001
--disable_query_log --disable_query_log
select "--- stop-position --" as ""; select "--- stop-position --" as "";
--enable_query_log --enable_query_log
--exec $MYSQL_BINLOG --short-form --stop-position=608 $MYSQLD_DATADIR/master-bin.000001 let $stop_pos= `select @binlog_start_pos + 502`;
--exec $MYSQL_BINLOG --short-form --stop-position=$stop_pos $MYSQLD_DATADIR/master-bin.000001
--disable_query_log --disable_query_log
select "--- start and stop positions ---" as ""; select "--- start and stop positions ---" as "";
--enable_query_log --enable_query_log
--exec $MYSQL_BINLOG --short-form --start-position=608 --stop-position 725 $MYSQLD_DATADIR/master-bin.000001 let $start_pos= `select @binlog_start_pos + 502`;
let $stop_pos= `select @binlog_start_pos + 619`;
--exec $MYSQL_BINLOG --short-form --start-position=$start_pos --stop-position $stop_pos $MYSQLD_DATADIR/master-bin.000001
--disable_query_log --disable_query_log
select "--- start-datetime --" as ""; select "--- start-datetime --" as "";
--enable_query_log --enable_query_log
@ -84,11 +88,13 @@ select "--- offset --" as "";
--disable_query_log --disable_query_log
select "--- start-position --" as ""; select "--- start-position --" as "";
--enable_query_log --enable_query_log
--exec $MYSQL_BINLOG --short-form --start-position=608 $MYSQLD_DATADIR/master-bin.000001 $MYSQLD_DATADIR/master-bin.000002 let $start_pos= `select @binlog_start_pos + 502`;
--exec $MYSQL_BINLOG --short-form --start-position=$start_pos $MYSQLD_DATADIR/master-bin.000001 $MYSQLD_DATADIR/master-bin.000002
--disable_query_log --disable_query_log
select "--- stop-position --" as ""; select "--- stop-position --" as "";
--enable_query_log --enable_query_log
--exec $MYSQL_BINLOG --short-form --stop-position=134 $MYSQLD_DATADIR/master-bin.000001 $MYSQLD_DATADIR/master-bin.000002 let $stop_pos= `select @binlog_start_pos + 28`;
--exec $MYSQL_BINLOG --short-form --stop-position=$stop_pos $MYSQLD_DATADIR/master-bin.000001 $MYSQLD_DATADIR/master-bin.000002
--disable_query_log --disable_query_log
select "--- start-datetime --" as ""; select "--- start-datetime --" as "";
--enable_query_log --enable_query_log
@ -111,15 +117,19 @@ select "--- offset --" as "";
--disable_query_log --disable_query_log
select "--- start-position --" as ""; select "--- start-position --" as "";
--enable_query_log --enable_query_log
--exec $MYSQL_BINLOG --short-form --start-position=608 --read-from-remote-server --user=root --host=127.0.0.1 --port=$MASTER_MYPORT master-bin.000001 let $start_pos= `select @binlog_start_pos + 502`;
--exec $MYSQL_BINLOG --short-form --start-position=$start_pos --read-from-remote-server --user=root --host=127.0.0.1 --port=$MASTER_MYPORT master-bin.000001
--disable_query_log --disable_query_log
select "--- stop-position --" as ""; select "--- stop-position --" as "";
--enable_query_log --enable_query_log
--exec $MYSQL_BINLOG --short-form --stop-position=608 --read-from-remote-server --user=root --host=127.0.0.1 --port=$MASTER_MYPORT master-bin.000001 let $stop_pos= `select @binlog_start_pos + 502`;
--exec $MYSQL_BINLOG --short-form --stop-position=$stop_pos --read-from-remote-server --user=root --host=127.0.0.1 --port=$MASTER_MYPORT master-bin.000001
--disable_query_log --disable_query_log
select "--- start and stop positions ---" as ""; select "--- start and stop positions ---" as "";
--enable_query_log --enable_query_log
--exec $MYSQL_BINLOG --short-form --start-position=608 --stop-position 725 --read-from-remote-server --user=root --host=127.0.0.1 --port=$MASTER_MYPORT master-bin.000001 let $start_pos= `select @binlog_start_pos + 502`;
let $stop_pos= `select @binlog_start_pos + 619`;
--exec $MYSQL_BINLOG --short-form --start-position=$start_pos --stop-position $stop_pos --read-from-remote-server --user=root --host=127.0.0.1 --port=$MASTER_MYPORT master-bin.000001
--disable_query_log --disable_query_log
select "--- start-datetime --" as ""; select "--- start-datetime --" as "";
--enable_query_log --enable_query_log
@ -142,11 +152,13 @@ select "--- offset --" as "";
--disable_query_log --disable_query_log
select "--- start-position --" as ""; select "--- start-position --" as "";
--enable_query_log --enable_query_log
--exec $MYSQL_BINLOG --short-form --start-position=608 --read-from-remote-server --user=root --host=127.0.0.1 --port=$MASTER_MYPORT master-bin.000001 master-bin.000002 let $start_pos= `select @binlog_start_pos + 502`;
--exec $MYSQL_BINLOG --short-form --start-position=$start_pos --read-from-remote-server --user=root --host=127.0.0.1 --port=$MASTER_MYPORT master-bin.000001 master-bin.000002
--disable_query_log --disable_query_log
select "--- stop-position --" as ""; select "--- stop-position --" as "";
--enable_query_log --enable_query_log
--exec $MYSQL_BINLOG --short-form --stop-position=134 --read-from-remote-server --user=root --host=127.0.0.1 --port=$MASTER_MYPORT master-bin.000001 master-bin.000002 let $stop_pos= `select @binlog_start_pos + 28`;
--exec $MYSQL_BINLOG --short-form --stop-position=$stop_pos --read-from-remote-server --user=root --host=127.0.0.1 --port=$MASTER_MYPORT master-bin.000001 master-bin.000002
--disable_query_log --disable_query_log
select "--- start-datetime --" as ""; select "--- start-datetime --" as "";
--enable_query_log --enable_query_log

View file

@ -117,7 +117,17 @@ INSERT INTO t1 VALUES (1,'init');
DELIMITER |; DELIMITER |;
CREATE PROCEDURE p1() CREATE PROCEDURE p1()
BEGIN BEGIN
UPDATE t1 SET b = CONCAT(b, '+con2') WHERE a = 1; # retry the UPDATE in case it times out the lock before con1 has time
# to COMMIT.
DECLARE do_retry INT DEFAULT 0;
DECLARE CONTINUE HANDLER FOR SQLEXCEPTION SET do_retry = 1;
retry_loop:LOOP
UPDATE t1 SET b = CONCAT(b, '+con2') WHERE a = 1;
IF do_retry = 0 THEN
LEAVE retry_loop;
END IF;
SET do_retry = 0;
END LOOP;
INSERT INTO t2 VALUES (); INSERT INTO t2 VALUES ();
END| END|
DELIMITER ;| DELIMITER ;|

View file

@ -13,7 +13,6 @@
# along with this program; if not, write to the Free Software # along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX")
# Only the server link with this library, the client libraries and the client # Only the server link with this library, the client libraries and the client
# executables all link with recompiles of source found in the "mysys" directory. # executables all link with recompiles of source found in the "mysys" directory.

View file

@ -158,15 +158,13 @@ static int check_lock(struct st_lock_list *list, const char* lock_type,
{ {
THR_LOCK_DATA *data,**prev; THR_LOCK_DATA *data,**prev;
uint count=0; uint count=0;
THR_LOCK_OWNER *UNINIT_VAR(first_owner);
prev= &list->data; prev= &list->data;
if (list->data) if (list->data)
{ {
enum thr_lock_type last_lock_type=list->data->type; enum thr_lock_type last_lock_type= list->data->type;
THR_LOCK_OWNER *first_owner= list->data->owner;
if (same_owner && list->data)
first_owner= list->data->owner;
for (data=list->data; data && count++ < MAX_LOCKS ; data=data->next) for (data=list->data; data && count++ < MAX_LOCKS ; data=data->next)
{ {
if (data->type != last_lock_type) if (data->type != last_lock_type)
@ -184,8 +182,8 @@ static int check_lock(struct st_lock_list *list, const char* lock_type,
last_lock_type != TL_WRITE_CONCURRENT_INSERT) last_lock_type != TL_WRITE_CONCURRENT_INSERT)
{ {
fprintf(stderr, fprintf(stderr,
"Warning: Found locks from different threads in %s: %s\n", "Warning: Found locks from different threads in %s at '%s'. org_lock_type: %d last_lock_type: %d new_lock_type: %d\n",
lock_type,where); lock_type, where, list->data->type, last_lock_type, data->type);
return 1; return 1;
} }
if (no_cond && data->cond) if (no_cond && data->cond)

View file

@ -13,8 +13,6 @@
# along with this program; if not, write to the Free Software # along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -D_DEBUG -DSAFEMALLOC -DSAFE_MUTEX")
SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -D_DEBUG -DSAFEMALLOC -DSAFE_MUTEX")
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include) INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include)

View file

@ -13,8 +13,6 @@
# along with this program; if not, write to the Free Software # along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX")
SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX")
ADD_DEFINITIONS(-DMYSQL_SERVER -DMYSQL_INSTANCE_MANAGER) ADD_DEFINITIONS(-DMYSQL_SERVER -DMYSQL_INSTANCE_MANAGER)
INCLUDE_DIRECTORIES(${PROJECT_SOURCE_DIR}/include ${PROJECT_SOURCE_DIR}/sql INCLUDE_DIRECTORIES(${PROJECT_SOURCE_DIR}/include ${PROJECT_SOURCE_DIR}/sql

View file

@ -14,8 +14,6 @@
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
INCLUDE("${PROJECT_SOURCE_DIR}/win/mysql_manifest.cmake") INCLUDE("${PROJECT_SOURCE_DIR}/win/mysql_manifest.cmake")
SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX")
SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX")
ADD_DEFINITIONS(-DMYSQL_SERVER -DMYSQL_INSTANCE_MANAGER) ADD_DEFINITIONS(-DMYSQL_SERVER -DMYSQL_INSTANCE_MANAGER)
INCLUDE_DIRECTORIES(${PROJECT_SOURCE_DIR}/include ${PROJECT_SOURCE_DIR}/sql INCLUDE_DIRECTORIES(${PROJECT_SOURCE_DIR}/include ${PROJECT_SOURCE_DIR}/sql

View file

@ -1978,7 +1978,7 @@ static int send_change_user_packet(MCPVIO_EXT *mpvio,
char *buff, *end; char *buff, *end;
int res= 1; int res= 1;
buff= my_alloca(USERNAME_LENGTH + data_len + 1 + NAME_LEN + 2 + NAME_LEN); buff= my_alloca(USERNAME_LENGTH+1 + data_len+1 + NAME_LEN+1 + 2 + NAME_LEN+1);
end= strmake(buff, mysql->user, USERNAME_LENGTH) + 1; end= strmake(buff, mysql->user, USERNAME_LENGTH) + 1;

View file

@ -14,11 +14,7 @@
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
INCLUDE("${PROJECT_SOURCE_DIR}/win/mysql_manifest.cmake") INCLUDE("${PROJECT_SOURCE_DIR}/win/mysql_manifest.cmake")
SET(CMAKE_CXX_FLAGS_DEBUG ADD_DEFINITIONS(-DUSE_SYMDIR)
"${CMAKE_CXX_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX -DUSE_SYMDIR /Zi")
SET(CMAKE_C_FLAGS_DEBUG
"${CMAKE_C_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX -DUSE_SYMDIR /Zi")
SET(CMAKE_EXE_LINKER_FLAGS_DEBUG "${CMAKE_EXE_LINKER_FLAGS_DEBUG}")
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include
${CMAKE_SOURCE_DIR}/extra/yassl/include ${CMAKE_SOURCE_DIR}/extra/yassl/include

View file

@ -13,9 +13,6 @@
# along with this program; if not, write to the Free Software # along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX")
SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX")
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include ${CMAKE_SOURCE_DIR}/sql INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include ${CMAKE_SOURCE_DIR}/sql
${CMAKE_SOURCE_DIR}/extra/yassl/include ${CMAKE_SOURCE_DIR}/extra/yassl/include
${CMAKE_SOURCE_DIR}/regex) ${CMAKE_SOURCE_DIR}/regex)

View file

@ -2432,7 +2432,7 @@ bool ha_partition::get_from_handler_file(const char *name, MEM_ROOT *mem_root)
for (i= 0; i < m_tot_parts; i++) for (i= 0; i < m_tot_parts; i++)
m_engine_array[i]= ha_lock_engine(NULL, engine_array[i]); m_engine_array[i]= ha_lock_engine(NULL, engine_array[i]);
my_afree((gptr) engine_array); my_afree(engine_array);
if (!m_file && create_handlers(mem_root)) if (!m_file && create_handlers(mem_root))
{ {
@ -2442,7 +2442,7 @@ bool ha_partition::get_from_handler_file(const char *name, MEM_ROOT *mem_root)
DBUG_RETURN(FALSE); DBUG_RETURN(FALSE);
err3: err3:
my_afree((gptr) engine_array); my_afree(engine_array);
err2: err2:
my_free(file_buffer, MYF(0)); my_free(file_buffer, MYF(0));
err1: err1:
@ -4640,19 +4640,6 @@ int ha_partition::handle_unordered_scan_next_partition(uchar * buf)
break; break;
case partition_index_first: case partition_index_first:
DBUG_PRINT("info", ("index_first on partition %d", i)); DBUG_PRINT("info", ("index_first on partition %d", i));
/*
MyISAM engine can fail if we call index_first() when indexes disabled
that happens if the table is empty.
Here we use file->stats.records instead of file->records() because
file->records() is supposed to return an EXACT count, and it can be
possibly slow. We don't need an exact number, an approximate one- from
the last ::info() call - is sufficient.
*/
if (file->stats.records == 0)
{
error= HA_ERR_END_OF_FILE;
break;
}
error= file->ha_index_first(buf); error= file->ha_index_first(buf);
break; break;
case partition_index_first_unordered: case partition_index_first_unordered:
@ -4740,36 +4727,10 @@ int ha_partition::handle_ordered_index_scan(uchar *buf, bool reverse_order)
m_start_key.flag); m_start_key.flag);
break; break;
case partition_index_first: case partition_index_first:
/*
MyISAM engine can fail if we call index_first() when indexes disabled
that happens if the table is empty.
Here we use file->stats.records instead of file->records() because
file->records() is supposed to return an EXACT count, and it can be
possibly slow. We don't need an exact number, an approximate one- from
the last ::info() call - is sufficient.
*/
if (file->stats.records == 0)
{
error= HA_ERR_END_OF_FILE;
break;
}
error= file->ha_index_first(rec_buf_ptr); error= file->ha_index_first(rec_buf_ptr);
reverse_order= FALSE; reverse_order= FALSE;
break; break;
case partition_index_last: case partition_index_last:
/*
MyISAM engine can fail if we call index_last() when indexes disabled
that happens if the table is empty.
Here we use file->stats.records instead of file->records() because
file->records() is supposed to return an EXACT count, and it can be
possibly slow. We don't need an exact number, an approximate one- from
the last ::info() call - is sufficient.
*/
if (file->stats.records == 0)
{
error= HA_ERR_END_OF_FILE;
break;
}
error= file->ha_index_last(rec_buf_ptr); error= file->ha_index_last(rec_buf_ptr);
reverse_order= TRUE; reverse_order= TRUE;
break; break;

View file

@ -253,7 +253,6 @@ public:
DBUG_RETURN(0); DBUG_RETURN(0);
} }
virtual void change_table_ptr(TABLE *table_arg, TABLE_SHARE *share); virtual void change_table_ptr(TABLE *table_arg, TABLE_SHARE *share);
bool check_if_supported_virtual_columns(void) { return TRUE;}
virtual bool check_if_incompatible_data(HA_CREATE_INFO *create_info, virtual bool check_if_incompatible_data(HA_CREATE_INFO *create_info,
uint table_changes); uint table_changes);
private: private:

View file

@ -4742,7 +4742,8 @@ static bool check_table_binlog_row_based(THD *thd, TABLE *table)
/** @brief /** @brief
Write table maps for all (manually or automatically) locked tables Write table maps for all (manually or automatically) locked tables
to the binary log. to the binary log. Also, if binlog_annotate_rows_events is ON,
write Annotate_rows event before the first table map.
SYNOPSIS SYNOPSIS
write_locked_table_maps() write_locked_table_maps()
@ -4779,6 +4780,9 @@ static int write_locked_table_maps(THD *thd)
locks[0]= thd->extra_lock; locks[0]= thd->extra_lock;
locks[1]= thd->lock; locks[1]= thd->lock;
locks[2]= thd->locked_tables; locks[2]= thd->locked_tables;
my_bool with_annotate= thd->variables.binlog_annotate_rows_events &&
thd->query() && thd->query_length();
for (uint i= 0 ; i < sizeof(locks)/sizeof(*locks) ; ++i ) for (uint i= 0 ; i < sizeof(locks)/sizeof(*locks) ; ++i )
{ {
MYSQL_LOCK const *const lock= locks[i]; MYSQL_LOCK const *const lock= locks[i];
@ -4796,7 +4800,8 @@ static int write_locked_table_maps(THD *thd)
check_table_binlog_row_based(thd, table)) check_table_binlog_row_based(thd, table))
{ {
int const has_trans= table->file->has_transactions(); int const has_trans= table->file->has_transactions();
int const error= thd->binlog_write_table_map(table, has_trans); int const error= thd->binlog_write_table_map(table, has_trans,
&with_annotate);
/* /*
If an error occurs, it is the responsibility of the caller to If an error occurs, it is the responsibility of the caller to
roll back the transaction. roll back the transaction.

View file

@ -137,6 +137,7 @@
#define HA_BINLOG_STMT_CAPABLE (LL(1) << 35) #define HA_BINLOG_STMT_CAPABLE (LL(1) << 35)
/* Has automatic checksums and uses the new checksum format */ /* Has automatic checksums and uses the new checksum format */
#define HA_HAS_NEW_CHECKSUM (LL(1) << 36) #define HA_HAS_NEW_CHECKSUM (LL(1) << 36)
#define HA_CAN_VIRTUAL_COLUMNS (LL(1) << 37)
/* /*
Set of all binlog flags. Currently only contain the capabilities Set of all binlog flags. Currently only contain the capabilities
@ -2044,17 +2045,6 @@ public:
LEX_STRING *engine_name() { return hton_name(ht); } LEX_STRING *engine_name() { return hton_name(ht); }
/*
@brief
Check whether the engine supports virtual columns
@retval
FALSE if the engine does not support virtual columns
@retval
TRUE if the engine supports virtual columns
*/
virtual bool check_if_supported_virtual_columns(void) { return FALSE;}
protected: protected:
/* deprecated, don't use in new engines */ /* deprecated, don't use in new engines */
inline void ha_statistic_increment(ulong SSV::*offset) const { } inline void ha_statistic_increment(ulong SSV::*offset) const { }

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