From 6b97512b2170fc6a77288cef6e5a85cad773ae4e Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 24 Apr 2013 13:05:40 +0200 Subject: [PATCH 1/9] Add missing check for thd->killed in mysql_binlog_send(). The slave dump thread running on the master only checked thd->killed whenever it reached the end of a binlog file, not between events. This could unnecessarily delay server shutdown. This was found by code inspection while tracking down some occasional "forcing close of thread..." errors in Buildbot. Hopefully this will fix the failures, but the fix is correct in any case. Also increase the wait during server shutdown, 2 seconds is a bit tight in case of heavy I/O stall, and it seems better to delay shutdown a bit than force-kill threads unnecessarily. Also fix some races in test cases that restart the mysqld server. The .expect file should be changed with --append_file, --remove_file + --write_file creates a short window where mysqld can error out due to .expect file missing. --- mysql-test/suite/binlog/t/binlog_mdev342.test | 3 +-- .../suite/binlog/t/binlog_xa_recover.test | 9 +++----- mysql-test/suite/rpl/t/rpl_gtid_crash.test | 21 +++++++------------ .../suite/rpl/t/rpl_gtid_stop_start.test | 6 ++---- mysql-test/suite/rpl/t/rpl_mdev382.test | 3 +-- .../storage_engine/alter_tablespace.test | 3 +-- sql/mysqld.cc | 17 +++++++++++++-- sql/sql_repl.cc | 6 +++++- 8 files changed, 35 insertions(+), 33 deletions(-) diff --git a/mysql-test/suite/binlog/t/binlog_mdev342.test b/mysql-test/suite/binlog/t/binlog_mdev342.test index 02310b87a76..024fa884f91 100644 --- a/mysql-test/suite/binlog/t/binlog_mdev342.test +++ b/mysql-test/suite/binlog/t/binlog_mdev342.test @@ -44,8 +44,7 @@ connection con1; --error 2006,2013 reap; ---remove_file $MYSQLTEST_VARDIR/tmp/mysqld.1.expect ---write_file $MYSQLTEST_VARDIR/tmp/mysqld.1.expect +--append_file $MYSQLTEST_VARDIR/tmp/mysqld.1.expect restart-binlog_mdev342.test EOF diff --git a/mysql-test/suite/binlog/t/binlog_xa_recover.test b/mysql-test/suite/binlog/t/binlog_xa_recover.test index d3914e60b10..903044ca5bd 100644 --- a/mysql-test/suite/binlog/t/binlog_xa_recover.test +++ b/mysql-test/suite/binlog/t/binlog_xa_recover.test @@ -117,8 +117,7 @@ connection con4; --error 2006,2013 reap; ---remove_file $MYSQLTEST_VARDIR/tmp/mysqld.1.expect ---write_file $MYSQLTEST_VARDIR/tmp/mysqld.1.expect +--append_file $MYSQLTEST_VARDIR/tmp/mysqld.1.expect restart-group_commit_binlog_pos.test EOF @@ -212,8 +211,7 @@ SET SESSION debug_dbug="+d,crash_commit_after_log"; --error 2006,2013 INSERT INTO t1 VALUES (14, NULL); ---remove_file $MYSQLTEST_VARDIR/tmp/mysqld.1.expect ---write_file $MYSQLTEST_VARDIR/tmp/mysqld.1.expect +--append_file $MYSQLTEST_VARDIR/tmp/mysqld.1.expect restart-group_commit_binlog_pos.test EOF @@ -257,8 +255,7 @@ SET SESSION debug_dbug="+d,crash_before_write_checkpoint_event"; --error 2006,2013 INSERT INTO t1 VALUES (24, REPEAT("x", 4100)); ---remove_file $MYSQLTEST_VARDIR/tmp/mysqld.1.expect ---write_file $MYSQLTEST_VARDIR/tmp/mysqld.1.expect +--append_file $MYSQLTEST_VARDIR/tmp/mysqld.1.expect restart-group_commit_binlog_pos.test EOF diff --git a/mysql-test/suite/rpl/t/rpl_gtid_crash.test b/mysql-test/suite/rpl/t/rpl_gtid_crash.test index 51a81506ba7..d78001aa69b 100644 --- a/mysql-test/suite/rpl/t/rpl_gtid_crash.test +++ b/mysql-test/suite/rpl/t/rpl_gtid_crash.test @@ -52,8 +52,7 @@ SET SESSION debug_dbug="+d,crash_dispatch_command_before"; SELECT 1; --source include/wait_until_disconnected.inc ---remove_file $MYSQLTEST_VARDIR/tmp/mysqld.1.expect ---write_file $MYSQLTEST_VARDIR/tmp/mysqld.1.expect +--append_file $MYSQLTEST_VARDIR/tmp/mysqld.1.expect restart-rpl_gtid_crash.test EOF @@ -112,8 +111,7 @@ SET SESSION debug_dbug="+d,crash_dispatch_command_before"; SELECT 1; --source include/wait_until_disconnected.inc ---remove_file $MYSQLTEST_VARDIR/tmp/mysqld.1.expect ---write_file $MYSQLTEST_VARDIR/tmp/mysqld.1.expect +--append_file $MYSQLTEST_VARDIR/tmp/mysqld.1.expect restart EOF @@ -147,8 +145,7 @@ INSERT INTO t1 VALUES (4); --connection server_2 --source include/wait_until_disconnected.inc ---remove_file $MYSQLTEST_VARDIR/tmp/mysqld.2.expect ---write_file $MYSQLTEST_VARDIR/tmp/mysqld.2.expect +--append_file $MYSQLTEST_VARDIR/tmp/mysqld.2.expect restart: --skip-slave-start=0 EOF @@ -172,8 +169,7 @@ INSERT INTO t1 VALUES (5); --connection server_2 --source include/wait_until_disconnected.inc ---remove_file $MYSQLTEST_VARDIR/tmp/mysqld.2.expect ---write_file $MYSQLTEST_VARDIR/tmp/mysqld.2.expect +--append_file $MYSQLTEST_VARDIR/tmp/mysqld.2.expect restart: --skip-slave-start=0 EOF @@ -197,8 +193,7 @@ INSERT INTO t1 VALUES (6); --connection server_2 --source include/wait_until_disconnected.inc ---remove_file $MYSQLTEST_VARDIR/tmp/mysqld.2.expect ---write_file $MYSQLTEST_VARDIR/tmp/mysqld.2.expect +--append_file $MYSQLTEST_VARDIR/tmp/mysqld.2.expect restart: --skip-slave-start=0 EOF @@ -222,8 +217,7 @@ INSERT INTO t1 VALUES (7); --connection server_2 --source include/wait_until_disconnected.inc ---remove_file $MYSQLTEST_VARDIR/tmp/mysqld.2.expect ---write_file $MYSQLTEST_VARDIR/tmp/mysqld.2.expect +--append_file $MYSQLTEST_VARDIR/tmp/mysqld.2.expect restart: --skip-slave-start=0 EOF @@ -247,8 +241,7 @@ INSERT INTO t1 VALUES (8); --connection server_2 --source include/wait_until_disconnected.inc ---remove_file $MYSQLTEST_VARDIR/tmp/mysqld.2.expect ---write_file $MYSQLTEST_VARDIR/tmp/mysqld.2.expect +--append_file $MYSQLTEST_VARDIR/tmp/mysqld.2.expect restart: --skip-slave-start=0 EOF diff --git a/mysql-test/suite/rpl/t/rpl_gtid_stop_start.test b/mysql-test/suite/rpl/t/rpl_gtid_stop_start.test index a0665110792..262d86a294e 100644 --- a/mysql-test/suite/rpl/t/rpl_gtid_stop_start.test +++ b/mysql-test/suite/rpl/t/rpl_gtid_stop_start.test @@ -41,8 +41,7 @@ INSERT INTO t1 VALUES (3); --source include/show_binary_logs.inc # Let the slave mysqld server start again. ---remove_file $MYSQLTEST_VARDIR/tmp/mysqld.2.expect ---write_file $MYSQLTEST_VARDIR/tmp/mysqld.2.expect +--append_file $MYSQLTEST_VARDIR/tmp/mysqld.2.expect restart: --skip-slave-start=0 EOF @@ -72,8 +71,7 @@ EOF --shutdown_server 30 --source include/wait_until_disconnected.inc ---remove_file $MYSQLTEST_VARDIR/tmp/mysqld.1.expect ---write_file $MYSQLTEST_VARDIR/tmp/mysqld.1.expect +--append_file $MYSQLTEST_VARDIR/tmp/mysqld.1.expect restart EOF diff --git a/mysql-test/suite/rpl/t/rpl_mdev382.test b/mysql-test/suite/rpl/t/rpl_mdev382.test index d88eeaa463e..d6e799d674c 100644 --- a/mysql-test/suite/rpl/t/rpl_mdev382.test +++ b/mysql-test/suite/rpl/t/rpl_mdev382.test @@ -210,8 +210,7 @@ EOF --shutdown_server 30 ---remove_file $MYSQLTEST_VARDIR/tmp/mysqld.1.expect ---write_file $MYSQLTEST_VARDIR/tmp/mysqld.1.expect +--append_file $MYSQLTEST_VARDIR/tmp/mysqld.1.expect restart-rpl_mdev382.test EOF diff --git a/mysql-test/suite/storage_engine/alter_tablespace.test b/mysql-test/suite/storage_engine/alter_tablespace.test index 508639c7dc5..ac206b8e328 100644 --- a/mysql-test/suite/storage_engine/alter_tablespace.test +++ b/mysql-test/suite/storage_engine/alter_tablespace.test @@ -53,8 +53,7 @@ EOF --replace_result $datadir --copy_file $datadir/test/t1.ibd $datadir/test/t1.ibd.save - --remove_file $MYSQLTEST_VARDIR/tmp/mysqld.1.expect - --write_file $MYSQLTEST_VARDIR/tmp/mysqld.1.expect + --append_file $MYSQLTEST_VARDIR/tmp/mysqld.1.expect restart EOF diff --git a/sql/mysqld.cc b/sql/mysqld.cc index 2d9923d3ef0..963f259f486 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -1494,8 +1494,21 @@ static void close_connections(void) Events::deinit(); end_slave(); - /* Give threads time to die. */ - for (int i= 0; *(volatile int32*) &thread_count && i < 100; i++) + /* + Give threads time to die. + + In 5.5, this was waiting 100 rounds @ 20 milliseconds/round, so as little + as 2 seconds, depending on thread scheduling. + + From 10.0, we increase this to 1000 rounds / 20 seconds. The rationale is + that on a server with heavy I/O load, it is quite possible for eg. an + fsync() of the binlog or whatever to cause something like LOCK_log to be + held for more than 2 seconds. We do not want to force kill threads in + such cases, if it can be avoided. Note that normally, the wait will be + much smaller than even 2 seconds, this is only a safety fallback against + stuck threads so server shutdown is not held up forever. + */ + for (int i= 0; *(volatile int32*) &thread_count && i < 1000; i++) my_sleep(20000); /* diff --git a/sql/sql_repl.cc b/sql/sql_repl.cc index d767fb50cae..550b78832ae 100644 --- a/sql/sql_repl.cc +++ b/sql/sql_repl.cc @@ -1727,13 +1727,15 @@ impossible position"; while (!net->error && net->vio != 0 && !thd->killed) { Log_event_type event_type= UNKNOWN_EVENT; + killed_state killed; /* reset the transmit packet for the event read from binary log file */ if (reset_transmit_packet(thd, flags, &ev_offset, &errmsg)) goto err; - while (!(error = Log_event::read_log_event(&log, packet, log_lock, + while (!(killed= thd->killed) && + !(error = Log_event::read_log_event(&log, packet, log_lock, current_checksum_alg))) { #ifndef DBUG_OFF @@ -1818,6 +1820,8 @@ impossible position"; if (reset_transmit_packet(thd, flags, &ev_offset, &errmsg)) goto err; } + if (killed) + goto end; /* TODO: now that we are logging the offset, check to make sure From ced65e21c60ca7342e8b11b888360b86bf83952d Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 25 Apr 2013 13:25:14 +0200 Subject: [PATCH 2/9] Fix more failures in buildbot. Server shutdown timeout of 10 seconds in test cases is too little for heavily loaded test servers. Fix innodb_bug12902967 to not fail with wrong error log output if we have warnings about too few AIO handles for InnoDB. Fix typo which could lead to unnecessarily replacing GTID event with dummy event. --- mysql-test/include/restart_mysqld.inc | 4 ++-- mysql-test/suite/innodb/t/innodb_bug12902967.test | 2 +- sql/log_event.cc | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/mysql-test/include/restart_mysqld.inc b/mysql-test/include/restart_mysqld.inc index 7cb9c7994d8..49f6dfd5364 100644 --- a/mysql-test/include/restart_mysqld.inc +++ b/mysql-test/include/restart_mysqld.inc @@ -14,8 +14,8 @@ if ($rpl_inited) --exec echo "wait" > $_expect_file_name # Send shutdown to the connected server and give -# it 10 seconds to die before zapping it -shutdown_server 10; +# it 60 seconds to die before zapping it +shutdown_server 60; # Write file to make mysql-test-run.pl start up the server again --exec echo "restart" > $_expect_file_name diff --git a/mysql-test/suite/innodb/t/innodb_bug12902967.test b/mysql-test/suite/innodb/t/innodb_bug12902967.test index 1183c4ceff6..8e1b8199524 100644 --- a/mysql-test/suite/innodb/t/innodb_bug12902967.test +++ b/mysql-test/suite/innodb/t/innodb_bug12902967.test @@ -24,7 +24,7 @@ alter table t1 add constraint c1 foreign key (f1) references t1(f1); perl; $file = $ENV{error_log}; open (FILE, '<', $file) or die "can't open(< $file): $!\n"; -print ((grep { /^InnoDB:/ and not /aio/i } )[-2..-1]); +print ((grep { /^InnoDB:/ and not /aio/i and not /io_setup\(\) attempt [0-9]+ failed/ } )[-2..-1]); EOF drop table t1; diff --git a/sql/log_event.cc b/sql/log_event.cc index f65d96eb9a8..f0b4ca5f8fc 100644 --- a/sql/log_event.cc +++ b/sql/log_event.cc @@ -6100,7 +6100,7 @@ Gtid_log_event::make_compatible_event(String *packet, bool *need_dummy_event, flags2= (*packet)[ev_offset + LOG_EVENT_HEADER_LEN + 12]; if (flags2 & FL_STANDALONE) { - if (need_dummy_event) + if (*need_dummy_event) return Query_log_event::dummy_event(packet, ev_offset, checksum_alg); else return 0; From 59830e1ab8d5e60442b5d15729c8ef06132fc827 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 29 Apr 2013 10:57:48 +0200 Subject: [PATCH 3/9] MDEV-4446: Incorrect handling of binlog checksum when searching for GTID start position in binlog When the slave connects, the master skips binlog event groups until it reaches the position requested by the slave. To identify event groups, it needs to detect COMMIT events. But this detection did not correctly handle binlog checksums, so could incorrectly skip extra groups due to not detecting the end of an event group. --- sql/log_event.cc | 26 +++++++++++++++++++++++++- sql/log_event.h | 3 ++- sql/sql_repl.cc | 7 +++++-- 3 files changed, 32 insertions(+), 4 deletions(-) diff --git a/sql/log_event.cc b/sql/log_event.cc index f0b4ca5f8fc..83789400924 100644 --- a/sql/log_event.cc +++ b/sql/log_event.cc @@ -4236,8 +4236,19 @@ Query_log_event::do_shall_skip(Relay_log_info *rli) bool Query_log_event::peek_is_commit_rollback(const char *event_start, - size_t event_len) + size_t event_len, uint8 checksum_alg) { + if (checksum_alg == BINLOG_CHECKSUM_ALG_CRC32) + { + if (event_len > BINLOG_CHECKSUM_LEN) + event_len-= BINLOG_CHECKSUM_LEN; + else + event_len= 0; + } + else + DBUG_ASSERT(checksum_alg == BINLOG_CHECKSUM_ALG_UNDEF || + checksum_alg == BINLOG_CHECKSUM_ALG_OFF); + if (event_len < LOG_EVENT_HEADER_LEN + QUERY_HEADER_LEN || event_len < 9) return false; return !memcmp(event_start + (event_len-7), "\0COMMIT", 7) || @@ -6050,10 +6061,23 @@ Gtid_log_event::Gtid_log_event(THD *thd_arg, uint64 seq_no_arg, */ bool Gtid_log_event::peek(const char *event_start, size_t event_len, + uint8 checksum_alg, uint32 *domain_id, uint32 *server_id, uint64 *seq_no, uchar *flags2) { const char *p; + + if (checksum_alg == BINLOG_CHECKSUM_ALG_CRC32) + { + if (event_len > BINLOG_CHECKSUM_LEN) + event_len-= BINLOG_CHECKSUM_LEN; + else + event_len= 0; + } + else + DBUG_ASSERT(checksum_alg == BINLOG_CHECKSUM_ALG_UNDEF || + checksum_alg == BINLOG_CHECKSUM_ALG_OFF); + if (event_len < LOG_EVENT_HEADER_LEN + GTID_HEADER_LEN) return true; *server_id= uint4korr(event_start + SERVER_ID_OFFSET); diff --git a/sql/log_event.h b/sql/log_event.h index 1c2b2769915..5026b280b27 100644 --- a/sql/log_event.h +++ b/sql/log_event.h @@ -1946,7 +1946,7 @@ public: /* !!! Public in this patch to allow old usage */ const char *query_arg, uint32 q_len_arg); static bool peek_is_commit_rollback(const char *event_start, - size_t event_len); + size_t event_len, uint8 checksum_alg); #endif /* HAVE_REPLICATION */ /* If true, the event always be applied by slave SQL thread or be printed by @@ -3084,6 +3084,7 @@ public: static int make_compatible_event(String *packet, bool *need_dummy_event, ulong ev_offset, uint8 checksum_alg); static bool peek(const char *event_start, size_t event_len, + uint8 checksum_alg, uint32 *domain_id, uint32 *server_id, uint64 *seq_no, uchar *flags2); #endif diff --git a/sql/sql_repl.cc b/sql/sql_repl.cc index 550b78832ae..f5f503b9fc8 100644 --- a/sql/sql_repl.cc +++ b/sql/sql_repl.cc @@ -1160,7 +1160,8 @@ gtid_state_from_pos(const char *name, uint32 offset, { rpl_gtid gtid; uchar flags2; - if (Gtid_log_event::peek(packet.ptr(), packet.length(), >id.domain_id, + if (Gtid_log_event::peek(packet.ptr(), packet.length(), + current_checksum_alg, >id.domain_id, >id.server_id, >id.seq_no, &flags2)) { errormsg= "Corrupt gtid_log_event found while scanning binlog to find " @@ -1253,6 +1254,7 @@ send_event_to_slave(THD *thd, NET *net, String* const packet, ushort flags, if (ev_offset > len || Gtid_log_event::peek(packet->ptr()+ev_offset, len - ev_offset, + current_checksum_alg, &domain_id, &server_id, &seq_no, &flags2)) return "Failed to read Gtid_log_event: corrupt binlog"; gtid= gtid_state->find(domain_id); @@ -1287,7 +1289,8 @@ send_event_to_slave(THD *thd, NET *net, String* const packet, ushort flags, if (event_type == XID_EVENT || (event_type == QUERY_EVENT && Query_log_event::peek_is_commit_rollback(packet->ptr() + ev_offset, - len - ev_offset))) + len - ev_offset, + current_checksum_alg))) *gtid_skip_group= GTID_SKIP_NOT; return NULL; case GTID_SKIP_NOT: From 8cdb118a0a4cbc193a233a6aea90feb159844eab Mon Sep 17 00:00:00 2001 From: Michael Widenius Date: Fri, 3 May 2013 01:50:42 +0300 Subject: [PATCH 4/9] Fixed: MDEV-4352; LOAD DATA was not multi-source safe - Calls to cleanup_load_tmpdir() could delete temporary files for another master connection - Concurrent LOAD DATA commands from two master connections could use the same file name Other bug fixes: - Enlarge buffer for connection names with 'special characters' one can't store in filenames Optimization: - Don't do 'lower case' of connection names. We can use cmp_connection_name, where we already have the connection name in lower case. mysql-test/suite/multi_source/load_data.result: Test case for MDEV-4352 mysql-test/suite/multi_source/load_data.test: Test case for MDEV-4352 sql/log_event.cc: Fixed: MDEV-4352 - Calls to cleanup_load_tmpdir() could delete temporary files for another master connection - Concurrent LOAD DATA commands from two master connections could use the same file name The fix was to add the connection name (if one exists) to all slave temporary files used by LOAD DATA sql/rpl_mi.cc: Enlarge buffer for connection names with 'special characters' one can't store in filenames Use mi->cmp_connection_name for connection file names. sql/rpl_rli.cc: Use mi->cmp_connection_name for connection file names. sql/slave.cc: Removed not needed empty line sql/sql_const.h: Added MAX_FILENAME_MBWIDTH to be able to calculate buffer length for connection_names stored in file names sql/sql_repl.cc: Use mi->cmp_connection_name for connection file names. --- .../suite/multi_source/load_data.result | 30 +++++ mysql-test/suite/multi_source/load_data.test | 70 ++++++++++++ sql/log_event.cc | 103 ++++++++++++++---- sql/rpl_mi.cc | 22 ++-- sql/rpl_rli.cc | 11 +- sql/slave.cc | 1 - sql/sql_const.h | 1 + sql/sql_repl.cc | 25 +++-- 8 files changed, 215 insertions(+), 48 deletions(-) create mode 100644 mysql-test/suite/multi_source/load_data.result create mode 100644 mysql-test/suite/multi_source/load_data.test diff --git a/mysql-test/suite/multi_source/load_data.result b/mysql-test/suite/multi_source/load_data.result new file mode 100644 index 00000000000..ef55abc5321 --- /dev/null +++ b/mysql-test/suite/multi_source/load_data.result @@ -0,0 +1,30 @@ +change master '' to master_port=MYPORT_1, master_host='127.0.0.1', master_user='root'; +change master 'master2' to master_port=MYPORT_2, master_host='127.0.0.1', master_user='root'; +start all slaves; +Warnings: +Note 1937 SLAVE 'master2' started +Note 1937 SLAVE '' started +set default_master_connection = ''; +include/wait_for_slave_to_start.inc +set default_master_connection = 'master2'; +include/wait_for_slave_to_start.inc +set default_master_connection = ''; +create table t1 (a varchar(10) character set utf8); +load data infile '../../std_data/loaddata6.dat' into table t1; +create table t2 (a varchar(10) character set utf8); +load data infile '../../std_data/loaddata6.dat' into table t2; +select count(*) from t1; +count(*) +1 +select count(*) from t2; +count(*) +1 +drop table t1; +drop table t2; +stop all slaves; +Warnings: +Note 1938 SLAVE 'master2' stopped +Note 1938 SLAVE '' stopped +include/reset_master_slave.inc +include/reset_master_slave.inc +include/reset_master_slave.inc diff --git a/mysql-test/suite/multi_source/load_data.test b/mysql-test/suite/multi_source/load_data.test new file mode 100644 index 00000000000..e6e1399cbf3 --- /dev/null +++ b/mysql-test/suite/multi_source/load_data.test @@ -0,0 +1,70 @@ +# +# Simple multi-master test +# + +--source include/not_embedded.inc +--let $rpl_server_count= 0 + +--connect (slave,127.0.0.1,root,,,$SERVER_MYPORT_3) +--connect (master1,127.0.0.1,root,,,$SERVER_MYPORT_1) +--connect (master2,127.0.0.1,root,,,$SERVER_MYPORT_2) +--connection slave + +--replace_result $SERVER_MYPORT_1 MYPORT_1 +eval change master '' to master_port=$SERVER_MYPORT_1, master_host='127.0.0.1', master_user='root'; +--replace_result $SERVER_MYPORT_2 MYPORT_2 +eval change master 'master2' to master_port=$SERVER_MYPORT_2, master_host='127.0.0.1', master_user='root'; +start all slaves; + +set default_master_connection = ''; +--source include/wait_for_slave_to_start.inc +set default_master_connection = 'master2'; +--source include/wait_for_slave_to_start.inc + +# +# Now test doing a load data infile from both connections +# +set default_master_connection = ''; +--connection master1 +create table t1 (a varchar(10) character set utf8); +load data infile '../../std_data/loaddata6.dat' into table t1; +--save_master_pos +--connection slave +--sync_with_master 0,'' +--connection master2 +create table t2 (a varchar(10) character set utf8); +load data infile '../../std_data/loaddata6.dat' into table t2; +--save_master_pos +--connection slave +--sync_with_master 0,'master2' +select count(*) from t1; +select count(*) from t2; +--connection master1 +drop table t1; +--connection master2 +drop table t2; + +# +# clean up +# + +--connection master1 +--save_master_pos +--connection slave +--sync_with_master 0,'' +--connection master2 +--save_master_pos +--connection slave +--sync_with_master 0,'master2' + +--connection slave +stop all slaves; + +--source reset_master_slave.inc +--disconnect slave +--connection master1 +--source reset_master_slave.inc +--disconnect master1 +--connection master2 +--source reset_master_slave.inc +--disconnect master2 diff --git a/sql/log_event.cc b/sql/log_event.cc index 83789400924..aa86fa6ff62 100644 --- a/sql/log_event.cc +++ b/sql/log_event.cc @@ -47,6 +47,7 @@ #include "transaction.h" #include #include "sql_show.h" // append_identifier +#include #endif /* MYSQL_CLIENT */ @@ -518,11 +519,59 @@ pretty_print_str(String *packet, const char *str, int len) #if defined(HAVE_REPLICATION) && !defined(MYSQL_CLIENT) /** - Creates a temporary name for load data infile:. + Create a prefix for the temporary files that is to be used for + load data file name for this master + + @param name Store prefix of name here + @param connection_name Connection name + + @return pointer to end of name + + @description + We assume that FN_REFLEN is big enough to hold + MAX_CONNECTION_NAME * MAX_FILENAME_MBWIDTH characters + 2 numbers + + a short extension. + + The resulting file name has the following parts, each separated with a '-' + - PREFIX_SQL_LOAD (SQL_LOAD-) + - If a connection name is given (multi-master setup): + - Add an extra '-' to mark that this is a multi-master file + - connection name in lower case, converted to safe file characters. + (see create_logfile_name_with_suffix()). + - server_id + - A last '-' (after server_id). +*/ + +static char *load_data_tmp_prefix(char *name, + LEX_STRING *connection_name) +{ + name= strmov(name, PREFIX_SQL_LOAD); + if (connection_name->length) + { + uint buf_length; + uint errors; + /* Add marker that this is a multi-master-file */ + *name++='-'; + /* Convert connection_name to a safe filename */ + buf_length= strconvert(system_charset_info, connection_name->str, + &my_charset_filename, name, FN_REFLEN, + &errors); + name+= buf_length; + *name++= '-'; + } + name= int10_to_str(global_system_variables.server_id, name, 10); + *name++ = '-'; + *name= '\0'; // For testing prefixes + return name; +} + + +/** + Creates a temporary name for LOAD DATA INFILE @param buf Store new filename here @param file_id File_id (part of file name) - @param event_server_id Event_id (part of file name) + @param event_server_id Event_id (part of file name) @param ext Extension for file name @return @@ -530,16 +579,14 @@ pretty_print_str(String *packet, const char *str, int len) */ static char *slave_load_file_stem(char *buf, uint file_id, - int event_server_id, const char *ext) + int event_server_id, const char *ext, + LEX_STRING *connection_name) { char *res; - fn_format(buf,PREFIX_SQL_LOAD,slave_load_tmpdir, "", MY_UNPACK_FILENAME); + res= buf+ unpack_dirname(buf, slave_load_tmpdir); to_unix_path(buf); - - buf = strend(buf); - buf = int10_to_str(global_system_variables.server_id, buf, 10); - *buf++ = '-'; - buf = int10_to_str(event_server_id, buf, 10); + buf= load_data_tmp_prefix(res, connection_name); + buf= int10_to_str(event_server_id, buf, 10); *buf++ = '-'; res= int10_to_str(file_id, buf, 10); strmov(res, ext); // Add extension last @@ -554,14 +601,17 @@ static char *slave_load_file_stem(char *buf, uint file_id, Delete all temporary files used for SQL_LOAD. */ -static void cleanup_load_tmpdir() +static void cleanup_load_tmpdir(LEX_STRING *connection_name) { MY_DIR *dirp; FILEINFO *file; uint i; - char fname[FN_REFLEN], prefbuf[31], *p; + char dir[FN_REFLEN], fname[FN_REFLEN]; + char prefbuf[31 + MAX_CONNECTION_NAME* MAX_FILENAME_MBWIDTH + 1]; + DBUG_ENTER("cleanup_load_tmpdir"); - if (!(dirp=my_dir(slave_load_tmpdir,MYF(0)))) + unpack_dirname(dir, slave_load_tmpdir); + if (!(dirp=my_dir(dir, MYF(MY_WME)))) return; /* @@ -572,10 +622,9 @@ static void cleanup_load_tmpdir() we cannot meet Start_log event in the middle of events from one LOAD DATA. */ - p= strmake(prefbuf, STRING_WITH_LEN(PREFIX_SQL_LOAD)); - p= int10_to_str(global_system_variables.server_id, p, 10); - *(p++)= '-'; - *p= 0; + + load_data_tmp_prefix(prefbuf, connection_name); + DBUG_PRINT("enter", ("dir: '%s' prefix: '%s'", dir, prefbuf)); for (i=0 ; i < (uint)dirp->number_of_files; i++) { @@ -588,6 +637,7 @@ static void cleanup_load_tmpdir() } my_dirend(dirp); + DBUG_VOID_RETURN; } #endif @@ -4417,7 +4467,11 @@ int Start_log_event_v3::do_apply_event(Relay_log_info const *rli) if (created) { error= close_temporary_tables(thd); - cleanup_load_tmpdir(); + /* + The following is only false if we get here with a BINLOG statement + */ + if (rli->mi) + cleanup_load_tmpdir(&rli->mi->cmp_connection_name); } else { @@ -7784,7 +7838,8 @@ int Create_file_log_event::do_apply_event(Relay_log_info const *rli) bzero((char*)&file, sizeof(file)); fname_buf= strmov(proc_info, "Making temp file "); - ext= slave_load_file_stem(fname_buf, file_id, server_id, ".info"); + ext= slave_load_file_stem(fname_buf, file_id, server_id, ".info", + &rli->mi->connection_name); thd_proc_info(thd, proc_info); /* old copy may exist already */ mysql_file_delete(key_file_log_event_info, fname_buf, MYF(0)); @@ -7962,7 +8017,8 @@ int Append_block_log_event::do_apply_event(Relay_log_info const *rli) DBUG_ENTER("Append_block_log_event::do_apply_event"); fname= strmov(proc_info, "Making temp file "); - slave_load_file_stem(fname, file_id, server_id, ".data"); + slave_load_file_stem(fname, file_id, server_id, ".data", + &rli->mi->cmp_connection_name); thd_proc_info(thd, proc_info); if (get_create_or_append()) { @@ -8106,7 +8162,8 @@ void Delete_file_log_event::pack_info(THD *thd, Protocol *protocol) int Delete_file_log_event::do_apply_event(Relay_log_info const *rli) { char fname[FN_REFLEN+10]; - char *ext= slave_load_file_stem(fname, file_id, server_id, ".data"); + char *ext= slave_load_file_stem(fname, file_id, server_id, ".data", + &rli->mi->cmp_connection_name); mysql_file_delete(key_file_log_event_data, fname, MYF(MY_WME)); strmov(ext, ".info"); mysql_file_delete(key_file_log_event_info, fname, MYF(MY_WME)); @@ -8210,7 +8267,8 @@ int Execute_load_log_event::do_apply_event(Relay_log_info const *rli) IO_CACHE file; Load_log_event *lev= 0; - ext= slave_load_file_stem(fname, file_id, server_id, ".info"); + ext= slave_load_file_stem(fname, file_id, server_id, ".info", + &rli->mi->cmp_connection_name); if ((fd= mysql_file_open(key_file_log_event_info, fname, O_RDONLY | O_BINARY | O_NOFOLLOW, MYF(MY_WME))) < 0 || @@ -8497,7 +8555,8 @@ Execute_load_query_log_event::do_apply_event(Relay_log_info const *rli) memcpy(p, query, fn_pos_start); p+= fn_pos_start; fname= (p= strmake(p, STRING_WITH_LEN(" INFILE \'"))); - p= slave_load_file_stem(p, file_id, server_id, ".data"); + p= slave_load_file_stem(p, file_id, server_id, ".data", + &rli->mi->cmp_connection_name); fname_end= p= strend(p); // Safer than p=p+5 *(p++)='\''; switch (dup_handling) { diff --git a/sql/rpl_mi.cc b/sql/rpl_mi.cc index 38fcc54e891..92dbf68d7a2 100644 --- a/sql/rpl_mi.cc +++ b/sql/rpl_mi.cc @@ -687,10 +687,11 @@ bool check_master_connection_name(LEX_STRING *name) */ void create_logfile_name_with_suffix(char *res_file_name, size_t length, - const char *info_file, bool append, - LEX_STRING *suffix) + const char *info_file, bool append, + LEX_STRING *suffix) { - char buff[MAX_CONNECTION_NAME+1], res[MAX_CONNECTION_NAME+1], *p; + char buff[MAX_CONNECTION_NAME+1], + res[MAX_CONNECTION_NAME * MAX_FILENAME_MBWIDTH+1], *p; p= strmake(res_file_name, info_file, length); /* If not empty suffix and there is place left for some part of the suffix */ @@ -703,8 +704,6 @@ void create_logfile_name_with_suffix(char *res_file_name, size_t length, /* Create null terminated string */ strmake(buff, suffix->str, suffix->length); - /* Convert to lower case */ - my_casedn_str(system_charset_info, buff); /* Convert to characters usable in a file name */ res_length= strconvert(system_charset_info, buff, &my_charset_filename, res, sizeof(res), &errors); @@ -820,7 +819,7 @@ bool Master_info_index::init_all_master_info() { int thread_mask; int err_num= 0, succ_num= 0; // The number of success read Master_info - char sign[MAX_CONNECTION_NAME]; + char sign[MAX_CONNECTION_NAME+1]; File index_file_nr; DBUG_ENTER("init_all_master_info"); @@ -872,11 +871,14 @@ bool Master_info_index::init_all_master_info() lock_slave_threads(mi); init_thread_mask(&thread_mask,mi,0 /*not inverse*/); - create_logfile_name_with_suffix(buf_master_info_file, sizeof(buf_master_info_file), - master_info_file, 0, &connection_name); + create_logfile_name_with_suffix(buf_master_info_file, + sizeof(buf_master_info_file), + master_info_file, 0, + &mi->cmp_connection_name); create_logfile_name_with_suffix(buf_relay_log_info_file, - sizeof(buf_relay_log_info_file), - relay_log_info_file, 0, &connection_name); + sizeof(buf_relay_log_info_file), + relay_log_info_file, 0, + &mi->cmp_connection_name); if (global_system_variables.log_warnings > 1) sql_print_information("Reading Master_info: '%s' Relay_info:'%s'", buf_master_info_file, buf_relay_log_info_file); diff --git a/sql/rpl_rli.cc b/sql/rpl_rli.cc index 7733354b106..ec2ca048976 100644 --- a/sql/rpl_rli.cc +++ b/sql/rpl_rli.cc @@ -213,17 +213,18 @@ a file name for --relay-log-index option", opt_relaylog_index_name); char buf_relay_logname[FN_REFLEN], buf_relaylog_index_name_buff[FN_REFLEN]; char *buf_relaylog_index_name= opt_relaylog_index_name; - create_logfile_name_with_suffix(buf_relay_logname, sizeof(buf_relay_logname), - ln, 1, &mi->connection_name); + create_logfile_name_with_suffix(buf_relay_logname, + sizeof(buf_relay_logname), + ln, 1, &mi->cmp_connection_name); ln= buf_relay_logname; if (opt_relaylog_index_name) { buf_relaylog_index_name= buf_relaylog_index_name_buff; create_logfile_name_with_suffix(buf_relaylog_index_name_buff, - sizeof(buf_relaylog_index_name_buff), - opt_relaylog_index_name, 0, - &mi->connection_name); + sizeof(buf_relaylog_index_name_buff), + opt_relaylog_index_name, 0, + &mi->cmp_connection_name); } /* diff --git a/sql/slave.cc b/sql/slave.cc index 36d26e76dce..f0a9b27707c 100644 --- a/sql/slave.cc +++ b/sql/slave.cc @@ -3712,7 +3712,6 @@ int check_temp_dir(char* tmp_file) MY_DIR *dirp; char tmp_dir[FN_REFLEN]; size_t tmp_dir_size; - DBUG_ENTER("check_temp_dir"); mysql_mutex_lock(&LOCK_thread_count); diff --git a/sql/sql_const.h b/sql/sql_const.h index 7dadbb7b8b4..d0a7a83f3a1 100644 --- a/sql/sql_const.h +++ b/sql/sql_const.h @@ -41,6 +41,7 @@ #define MAX_CONNECTION_NAME NAME_LEN #define MAX_MBWIDTH 3 /* Max multibyte sequence */ +#define MAX_FILENAME_MBWIDTH 5 #define MAX_FIELD_CHARLENGTH 255 #define MAX_FIELD_VARCHARLENGTH 65535 #define MAX_FIELD_BLOBLENGTH UINT_MAX32 /* cf field_blob::get_length() */ diff --git a/sql/sql_repl.cc b/sql/sql_repl.cc index f5f503b9fc8..1dac2aa2039 100644 --- a/sql/sql_repl.cc +++ b/sql/sql_repl.cc @@ -2128,11 +2128,12 @@ int start_slave(THD* thd , Master_info* mi, bool net_report) create_logfile_name_with_suffix(master_info_file_tmp, sizeof(master_info_file_tmp), - master_info_file, 0, &mi->connection_name); + master_info_file, 0, + &mi->cmp_connection_name); create_logfile_name_with_suffix(relay_log_info_file_tmp, sizeof(relay_log_info_file_tmp), relay_log_info_file, 0, - &mi->connection_name); + &mi->cmp_connection_name); lock_slave_threads(mi); // this allows us to cleanly read slave_running // Get a mask of _stopped_ threads @@ -2378,11 +2379,13 @@ int reset_slave(THD *thd, Master_info* mi) // and delete these two files create_logfile_name_with_suffix(master_info_file_tmp, - sizeof(master_info_file_tmp), - master_info_file, 0, &mi->connection_name); + sizeof(master_info_file_tmp), + master_info_file, 0, + &mi->cmp_connection_name); create_logfile_name_with_suffix(relay_log_info_file_tmp, - sizeof(relay_log_info_file_tmp), - relay_log_info_file, 0, &mi->connection_name); + sizeof(relay_log_info_file_tmp), + relay_log_info_file, 0, + &mi->cmp_connection_name); fn_format(fname, master_info_file_tmp, mysql_data_home, "", 4+32); if (mysql_file_stat(key_file_master_info, fname, &stat_area, MYF(0)) && @@ -2549,11 +2552,13 @@ bool change_master(THD* thd, Master_info* mi, bool *master_info_added) thd_proc_info(thd, "Changing master"); create_logfile_name_with_suffix(master_info_file_tmp, - sizeof(master_info_file_tmp), - master_info_file, 0, &mi->connection_name); + sizeof(master_info_file_tmp), + master_info_file, 0, + &mi->cmp_connection_name); create_logfile_name_with_suffix(relay_log_info_file_tmp, - sizeof(relay_log_info_file_tmp), - relay_log_info_file, 0, &mi->connection_name); + sizeof(relay_log_info_file_tmp), + relay_log_info_file, 0, + &mi->cmp_connection_name); /* if new Master_info doesn't exists, add it */ if (!master_info_index->get_master_info(&mi->connection_name, From eb75edfb2b3ac024f0d47860056b8d42f7dc3911 Mon Sep 17 00:00:00 2001 From: Michael Widenius Date: Fri, 3 May 2013 01:54:47 +0300 Subject: [PATCH 5/9] Instead of writing "Errcode" to the log for Slave errors, use "Internal MariaDB error code" This makes it clear that the error code has nothing to do with errno. mysql-test/include/mtr_warnings.sql: Fixed suppression for new slave error messages mysql-test/lib/My/Test.pm: Use 'send' instead of 'print' to avoid errors about "wrong class ... back attempt" mysql-test/lib/v1/mtr_report.pl: Fixed suppression for new slave error messages mysql-test/mysql-test-run.pl: Fixed suppression for new slave error messages Removed warning from perl 5.16.2 about arrays mysql-test/r/flush_read_lock.result: Fixed suppression for new slave error messages sql/rpl_reporting.cc: Instead of writing "Errcode" to the log for Slave errors, use "Internal MariaDB error code" --- mysql-test/extra/binlog_tests/binlog.test | 2 +- mysql-test/extra/rpl_tests/rpl_conflicts.test | 6 +++--- mysql-test/extra/rpl_tests/rpl_extra_col_master.test | 8 ++++---- mysql-test/extra/rpl_tests/rpl_extra_col_slave.test | 10 +++++----- mysql-test/extra/rpl_tests/rpl_loaddata.test | 4 ++-- mysql-test/extra/rpl_tests/rpl_row_basic.test | 6 +++--- mysql-test/extra/rpl_tests/rpl_row_tabledefs.test | 4 ++-- mysql-test/extra/rpl_tests/rpl_stm_EE_err2.test | 2 +- mysql-test/include/mtr_warnings.sql | 2 +- mysql-test/lib/My/Test.pm | 2 +- mysql-test/lib/v1/mtr_report.pl | 10 +++++----- mysql-test/mysql-test-run.pl | 6 +++--- mysql-test/r/flush_read_lock.result | 2 +- mysql-test/suite/binlog/r/binlog_base64_flag.result | 6 +++--- mysql-test/suite/binlog/r/binlog_row_binlog.result | 2 +- mysql-test/suite/binlog/r/binlog_stm_binlog.result | 2 +- mysql-test/suite/binlog/t/binlog_base64_flag.test | 6 +++--- mysql-test/suite/rpl/r/rpl_circular_for_4_hosts.result | 2 +- mysql-test/suite/rpl/r/rpl_corruption.result | 2 +- mysql-test/suite/rpl/r/rpl_do_grant.result | 2 +- .../suite/rpl/r/rpl_extra_col_slave_innodb.result | 10 +++++----- .../suite/rpl/r/rpl_extra_col_slave_myisam.result | 10 +++++----- .../suite/rpl/r/rpl_filter_tables_dynamic.result | 2 +- .../suite/rpl/r/rpl_filter_tables_not_exist.result | 2 +- mysql-test/suite/rpl/r/rpl_gtid_startpos.result | 2 +- mysql-test/suite/rpl/r/rpl_heartbeat_basic.result | 2 +- mysql-test/suite/rpl/r/rpl_idempotency.result | 8 ++++---- mysql-test/suite/rpl/r/rpl_ignore_table.result | 2 +- mysql-test/suite/rpl/r/rpl_loaddata.result | 4 ++-- mysql-test/suite/rpl/r/rpl_loaddata_fatal.result | 2 +- mysql-test/suite/rpl/r/rpl_packet.result | 2 +- mysql-test/suite/rpl/r/rpl_rotate_logs.result | 2 +- mysql-test/suite/rpl/r/rpl_row_basic_11bugs.result | 2 +- mysql-test/suite/rpl/r/rpl_row_basic_2myisam.result | 6 +++--- mysql-test/suite/rpl/r/rpl_row_basic_3innodb.result | 6 +++--- mysql-test/suite/rpl/r/rpl_row_colSize.result | 4 ++-- mysql-test/suite/rpl/r/rpl_row_conflicts.result | 6 +++--- mysql-test/suite/rpl/r/rpl_row_idempotency.result | 8 ++++---- mysql-test/suite/rpl/r/rpl_row_inexist_tbl.result | 2 +- .../suite/rpl/r/rpl_row_loaddata_concurrent.result | 4 ++-- .../suite/rpl/r/rpl_row_tabledefs_2myisam.result | 4 ++-- .../suite/rpl/r/rpl_row_tabledefs_3innodb.result | 4 ++-- mysql-test/suite/rpl/r/rpl_skip_error.result | 2 +- mysql-test/suite/rpl/r/rpl_slave_grp_exec.result | 2 +- .../suite/rpl/r/rpl_slave_load_remove_tmpfile.result | 4 ++-- .../suite/rpl/r/rpl_slave_load_tmpdir_not_exist.result | 2 +- mysql-test/suite/rpl/r/rpl_stm_EE_err2.result | 2 +- mysql-test/suite/rpl/r/rpl_stm_conflicts.result | 2 +- .../suite/rpl/r/rpl_stm_loaddata_concurrent.result | 4 ++-- mysql-test/suite/rpl/r/rpl_typeconv.result | 2 +- mysql-test/suite/rpl/t/rpl_circular_for_4_hosts.test | 2 +- mysql-test/suite/rpl/t/rpl_corruption.test | 2 +- mysql-test/suite/rpl/t/rpl_do_grant.test | 2 +- mysql-test/suite/rpl/t/rpl_filter_tables_dynamic.test | 2 +- .../suite/rpl/t/rpl_filter_tables_not_exist.test | 2 +- mysql-test/suite/rpl/t/rpl_gtid_startpos.test | 2 +- mysql-test/suite/rpl/t/rpl_heartbeat_basic.test | 2 +- mysql-test/suite/rpl/t/rpl_idempotency.test | 8 ++++---- mysql-test/suite/rpl/t/rpl_ignore_table.test | 2 +- mysql-test/suite/rpl/t/rpl_loaddata_fatal.test | 2 +- mysql-test/suite/rpl/t/rpl_packet.test | 2 +- mysql-test/suite/rpl/t/rpl_rotate_logs.test | 2 +- mysql-test/suite/rpl/t/rpl_row_basic_11bugs.test | 2 +- mysql-test/suite/rpl/t/rpl_row_colSize.test | 4 ++-- mysql-test/suite/rpl/t/rpl_row_conflicts.test | 2 +- mysql-test/suite/rpl/t/rpl_row_idempotency.test | 8 ++++---- mysql-test/suite/rpl/t/rpl_row_inexist_tbl.test | 2 +- mysql-test/suite/rpl/t/rpl_skip_error.test | 2 +- mysql-test/suite/rpl/t/rpl_slave_grp_exec.test | 2 +- .../suite/rpl/t/rpl_slave_load_remove_tmpfile.test | 4 ++-- .../suite/rpl/t/rpl_slave_load_tmpdir_not_exist.test | 4 ++-- mysql-test/suite/rpl/t/rpl_typeconv.test | 2 +- mysql-test/t/flush_read_lock.test | 2 +- sql/rpl_reporting.cc | 2 +- 74 files changed, 133 insertions(+), 133 deletions(-) diff --git a/mysql-test/extra/binlog_tests/binlog.test b/mysql-test/extra/binlog_tests/binlog.test index a74426bdd45..a87f1f351cc 100644 --- a/mysql-test/extra/binlog_tests/binlog.test +++ b/mysql-test/extra/binlog_tests/binlog.test @@ -392,7 +392,7 @@ SHOW SESSION VARIABLES LIKE "%_checks"; --echo # INSERT INTO t1 VALUES(2) --echo # foreign_key_checks=1 and unique_checks=1 --echo # It should not change current session's variables, even error happens -call mtr.add_suppression("Slave SQL.*Could not execute Write_rows event on table test.t1; Duplicate entry .2. for key .PRIMARY., Error_code: 1062"); +call mtr.add_suppression("Slave SQL.*Could not execute Write_rows event on table test.t1; Duplicate entry .2. for key .PRIMARY., error.* 1062"); --error 1062 BINLOG ' dfLtTBMBAAAAKQAAAKsBAAAAABcAAAAAAAEABHRlc3QAAnQxAAEDAAE= diff --git a/mysql-test/extra/rpl_tests/rpl_conflicts.test b/mysql-test/extra/rpl_tests/rpl_conflicts.test index 2fbf3dba5dc..b9bff3993e6 100644 --- a/mysql-test/extra/rpl_tests/rpl_conflicts.test +++ b/mysql-test/extra/rpl_tests/rpl_conflicts.test @@ -52,7 +52,7 @@ # - Replication has been initialized by include/master-slave.inc # # - The test adds a suppression for the following warning: -# Slave: Can't find record in 't1' Error_code: 1032 +# Slave: Can't find record in 't1' error.* 1032 --echo ==== Initialize ==== @@ -97,7 +97,7 @@ if (`SELECT @@global.binlog_format != 'ROW' OR @@global.slave_exec_mode = 'STRIC --disable_query_log --eval SELECT "$err" as 'Last_SQL_Error (expected "duplicate key" error)' --enable_query_log - call mtr.add_suppression("Slave SQL.*Duplicate entry .1. for key .PRIMARY.* Error_code: 1062"); + call mtr.add_suppression("Slave SQL.*Duplicate entry .1. for key .PRIMARY.* error.* 1062"); SELECT * FROM t1; @@ -143,7 +143,7 @@ connection slave; # replication continues. if (`SELECT @@global.binlog_format = 'ROW' AND @@global.slave_exec_mode = 'STRICT'`) { --echo ---- Wait until slave stops with an error ---- - call mtr.add_suppression("Slave SQL.*Can.t find record in .t1., Error_code: 1032"); + call mtr.add_suppression("Slave SQL.*Can.t find record in .t1., error.* 1032"); let $slave_sql_errno= 1032; # ER_KEY_NOT_FOUND source include/wait_for_slave_sql_error.inc; diff --git a/mysql-test/extra/rpl_tests/rpl_extra_col_master.test b/mysql-test/extra/rpl_tests/rpl_extra_col_master.test index 235eb858d34..18b6c0532f2 100644 --- a/mysql-test/extra/rpl_tests/rpl_extra_col_master.test +++ b/mysql-test/extra/rpl_tests/rpl_extra_col_master.test @@ -126,10 +126,10 @@ SELECT f1,f2,f3,f4,f5,f6,f7,f8,f9, --disable_query_log call mtr.add_suppression("Slave SQL.*Table definition on master and slave does not match: Column 2 type mismatch.* 1535"); -call mtr.add_suppression("Slave.*Can.t DROP .c7.; check that column.key exists.* Error_code: 1091"); -call mtr.add_suppression("Slave.*Unknown column .c7. in .t15.* Error_code: 1054"); -call mtr.add_suppression("Slave.*Key column .c6. doesn.t exist in table.* Error_code: 1072"); -call mtr.add_suppression("Slave SQL.*Column 2 of table .test.t1.. cannot be converted from type.* Error_code: 1677"); +call mtr.add_suppression("Slave.*Can.t DROP .c7.; check that column.key exists.* error.* 1091"); +call mtr.add_suppression("Slave.*Unknown column .c7. in .t15.* error.* 1054"); +call mtr.add_suppression("Slave.*Key column .c6. doesn.t exist in table.* error.* 1072"); +call mtr.add_suppression("Slave SQL.*Column 2 of table .test.t1.. cannot be converted from type.* error.* 1677"); --enable_query_log sync_slave_with_master; diff --git a/mysql-test/extra/rpl_tests/rpl_extra_col_slave.test b/mysql-test/extra/rpl_tests/rpl_extra_col_slave.test index 119e081878c..7dcb9e2725c 100644 --- a/mysql-test/extra/rpl_tests/rpl_extra_col_slave.test +++ b/mysql-test/extra/rpl_tests/rpl_extra_col_slave.test @@ -13,8 +13,8 @@ # should stop the slave. # ################################################# -call mtr.add_suppression("Slave: Unknown table 't6' Error_code: 1051"); -call mtr.add_suppression("Slave SQL.*Column [0-9] of table .test.t[0-9]*. cannot be converted from type.* Error_code: 1677"); +call mtr.add_suppression("Slave: Unknown table 't6' error.* 1051"); +call mtr.add_suppression("Slave SQL.*Column [0-9] of table .test.t[0-9]*. cannot be converted from type.* error.* 1677"); --echo **** Diff Table Def Start **** @@ -771,9 +771,9 @@ RESET MASTER; connection slave; START SLAVE; -call mtr.add_suppression("Error .Unknown table .t6.. on query.* Error_code: 1051"); -call mtr.add_suppression("Error .Duplicate column name .c6.. on query.* Error_code: 1060"); -call mtr.add_suppression("Table definition on master and slave does not match: Column . ...e mismatch.* Error_code: 1535"); +call mtr.add_suppression("Error .Unknown table .t6.. on query.* error.* 1051"); +call mtr.add_suppression("Error .Duplicate column name .c6.. on query.* error.* 1060"); +call mtr.add_suppression("Table definition on master and slave does not match: Column . ...e mismatch.* error.* 1535"); --echo *** Master Data Insert *** connection master; diff --git a/mysql-test/extra/rpl_tests/rpl_loaddata.test b/mysql-test/extra/rpl_tests/rpl_loaddata.test index b5d230d947e..3c7aa9e9474 100644 --- a/mysql-test/extra/rpl_tests/rpl_loaddata.test +++ b/mysql-test/extra/rpl_tests/rpl_loaddata.test @@ -68,8 +68,8 @@ eval $lower_stmt_head infile '../../std_data/rpl_loaddata.dat' into table t1; save_master_pos; connection slave; # 1062 = ER_DUP_ENTRY -call mtr.add_suppression("Slave SQL.*Error .Duplicate entry .10. for key .b.. on query.* Error_code: 1062"); -call mtr.add_suppression("Slave SQL.*Query caused different errors on master and slave.*Error on master:.*error code=1062.*Error on slave:.*Error_code: 0"); +call mtr.add_suppression("Slave SQL.*Error .Duplicate entry .10. for key .b.. on query.* error.* 1062"); +call mtr.add_suppression("Slave SQL.*Query caused different errors on master and slave.*Error on master:.*error code=1062.*Error on slave:.*error.* 0"); --let $slave_sql_errno= 1062 --source include/wait_for_slave_sql_error_and_skip.inc diff --git a/mysql-test/extra/rpl_tests/rpl_row_basic.test b/mysql-test/extra/rpl_tests/rpl_row_basic.test index c7570de3aba..f2ef0eda4f5 100644 --- a/mysql-test/extra/rpl_tests/rpl_row_basic.test +++ b/mysql-test/extra/rpl_tests/rpl_row_basic.test @@ -417,9 +417,9 @@ source include/diff_tables.inc; connection slave; SET GLOBAL SLAVE_TYPE_CONVERSIONS = @saved_slave_type_conversions; -call mtr.add_suppression("Slave SQL.*Table definition on master and slave does not match: Column 1 size mismatch.* Error_code: 1535"); -call mtr.add_suppression("Slave SQL.*Could not execute Delete_rows event on table test.t1.* Error_code: 1032"); -call mtr.add_suppression("Slave SQL.*Column 1 of table .test.t.. cannot be converted from type.*, Error_code: 1677"); +call mtr.add_suppression("Slave SQL.*Table definition on master and slave does not match: Column 1 size mismatch.* error.* 1535"); +call mtr.add_suppression("Slave SQL.*Could not execute Delete_rows event on table test.t1.* error.* 1032"); +call mtr.add_suppression("Slave SQL.*Column 1 of table .test.t.. cannot be converted from type.*, error.* 1677"); --let $rpl_only_running_threads= 1 --source include/rpl_reset.inc diff --git a/mysql-test/extra/rpl_tests/rpl_row_tabledefs.test b/mysql-test/extra/rpl_tests/rpl_row_tabledefs.test index 76432febd5e..8de2e6974b1 100644 --- a/mysql-test/extra/rpl_tests/rpl_row_tabledefs.test +++ b/mysql-test/extra/rpl_tests/rpl_row_tabledefs.test @@ -147,8 +147,8 @@ sync_slave_with_master; connection master; INSERT INTO t4 VALUES (4); connection slave; -call mtr.add_suppression("Slave SQL.*Table definition on master and slave does not match: Column [012] type mismatch.* Error_code: 1535"); -call mtr.add_suppression("Slave SQL.*Column [0-9] of table .test.t[0-9]. cannot be converted from type.* Error_code: 1677"); +call mtr.add_suppression("Slave SQL.*Table definition on master and slave does not match: Column [012] type mismatch.* error.* 1535"); +call mtr.add_suppression("Slave SQL.*Column [0-9] of table .test.t[0-9]. cannot be converted from type.* error.* 1677"); --let $slave_skip_counter= 2 --let $slave_sql_errno= 1677 --let $show_slave_sql_error= 1 diff --git a/mysql-test/extra/rpl_tests/rpl_stm_EE_err2.test b/mysql-test/extra/rpl_tests/rpl_stm_EE_err2.test index cc69c08fe7c..2f4435357ff 100644 --- a/mysql-test/extra/rpl_tests/rpl_stm_EE_err2.test +++ b/mysql-test/extra/rpl_tests/rpl_stm_EE_err2.test @@ -25,7 +25,7 @@ drop table t1; connection slave; --source include/wait_for_slave_sql_to_stop.inc -call mtr.add_suppression("Slave SQL.*Query caused different errors on master and slave.*Error on master:.* error code=1062.*Error on slave:.* Error_code: 0"); +call mtr.add_suppression("Slave SQL.*Query caused different errors on master and slave.*Error on master:.* error code=1062.*Error on slave:.* error.* 0"); let $error= query_get_value(SHOW SLAVE STATUS, Last_SQL_Error, 1); let $errno= query_get_value(SHOW SLAVE STATUS, Last_SQL_Errno, 1); --echo Error: "$error" (expected different error codes on master and slave) diff --git a/mysql-test/include/mtr_warnings.sql b/mysql-test/include/mtr_warnings.sql index d957e33d41c..0a6077c21d2 100644 --- a/mysql-test/include/mtr_warnings.sql +++ b/mysql-test/include/mtr_warnings.sql @@ -177,7 +177,7 @@ INSERT INTO global_suppressions VALUES ("The path specified for the variable .* is not a directory or cannot be written:"), ("Master server does not support or not configured semi-sync replication, fallback to asynchronous"), (": The MySQL server is running with the --secure-backup-file-priv option so it cannot execute this statement"), - ("Slave: Unknown table 't1' Error_code: 1051"), + ("Slave: Unknown table 't1' error.* 1051"), /* Maria storage engine dependent tests */ diff --git a/mysql-test/lib/My/Test.pm b/mysql-test/lib/My/Test.pm index 4d017b3b42c..806c90734fd 100644 --- a/mysql-test/lib/My/Test.pm +++ b/mysql-test/lib/My/Test.pm @@ -100,7 +100,7 @@ sub write_test { my $serialized= Storable::freeze($test); $serialized =~ s/([\x0d\x0a\\])/sprintf("\\%02x", ord($1))/eg; - print $sock $header, "\n", $serialized, "\n"; + send $sock,$header. "\n". $serialized. "\n", 0; } diff --git a/mysql-test/lib/v1/mtr_report.pl b/mysql-test/lib/v1/mtr_report.pl index 7166eb523f2..accf00dbb5d 100644 --- a/mysql-test/lib/v1/mtr_report.pl +++ b/mysql-test/lib/v1/mtr_report.pl @@ -312,7 +312,7 @@ sub mtr_report_stats ($) { /Slave: The incident LOST_EVENTS occured on the master/ or /Slave: Unknown error.* 1105/ or /Slave: Can't drop database.* database doesn't exist/ or - /Slave SQL:.*(?:Error_code: \d+|Query:.*)/ or + /Slave SQL:.*(?:error.* \d+|Query:.*)/ or /Sort aborted/ or /Time-out in NDB/ or /One can only use the --user.*root/ or @@ -361,7 +361,7 @@ sub mtr_report_stats ($) { # rpl_extrColmaster_*.test, the slave thread produces warnings # when it get updates to a table that has more columns on the # master - /Slave: Unknown column 'c7' in 't15' Error_code: 1054/ or + /Slave: Unknown column 'c7' in 't15' error.* 1054/ or /Slave: Can't DROP 'c7'.* 1091/ or /Slave: Key column 'c6'.* 1072/ or @@ -370,8 +370,8 @@ sub mtr_report_stats ($) { # rpl_idempotency.test produces warnings for the slave. ($testname eq 'rpl.rpl_idempotency' and - (/Slave: Can\'t find record in \'t1\' Error_code: 1032/ or - /Slave: Cannot add or update a child row: a foreign key constraint fails .* Error_code: 1452/ + (/Slave: Can\'t find record in \'t1\' error.* 1032/ or + /Slave: Cannot add or update a child row: a foreign key constraint fails .* error.* 1452/ )) or # These tests does "kill" on queries, causing sporadic errors when writing to logs @@ -389,7 +389,7 @@ sub mtr_report_stats ($) { # rpl_temporary has an error on slave that can be ignored ($testname eq 'rpl.rpl_temporary' and - (/Slave: Can\'t find record in \'user\' Error_code: 1032/ + (/Slave: Can\'t find record in \'user\' error.* 1032/ )) or # Test case for Bug#31590 produces the following error: /Out of sort memory; increase server sort buffer size/ or diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl index de42d1640d1..cb69a3c0124 100755 --- a/mysql-test/mysql-test-run.pl +++ b/mysql-test/mysql-test-run.pl @@ -537,7 +537,7 @@ sub main { } } - if ( not defined @$completed ) { + if ( not @$completed ) { mtr_error("Test suite aborted"); } @@ -4740,8 +4740,8 @@ sub extract_warning_lines ($$) { qr/InnoDB: Error: in ALTER TABLE `test`.`t[12]`/, qr/InnoDB: Error: table `test`.`t[12]` .*does not exist in the InnoDB internal/, qr/InnoDB: Warning: a long semaphore wait:/, - qr/Slave: Unknown table 't1' Error_code: 1051/, - qr/Slave SQL:.*(Error_code: [[:digit:]]+|Query:.*)/, + qr/Slave: Unknown table 't1' .* 1051/, + qr/Slave SQL:.*(Internal MariaDB error code: [[:digit:]]+|Query:.*)/, qr/slave SQL thread aborted/, qr/unknown option '--loose[-_]/, qr/unknown variable 'loose[-_]/, diff --git a/mysql-test/r/flush_read_lock.result b/mysql-test/r/flush_read_lock.result index cd7083405bf..05fab64330d 100644 --- a/mysql-test/r/flush_read_lock.result +++ b/mysql-test/r/flush_read_lock.result @@ -431,7 +431,7 @@ Success: Was able to run 'execute stmt1' under FTWRL. Success: Was able to run 'execute stmt1' with FTWRL active in another connection. Success: Was able to run FTWRL while 'execute stmt1' was active in another connection. deallocate prepare stmt1; -call mtr.add_suppression("Slave SQL.*Can.t execute the query because you have a conflicting read lock., Error_code: 1223"); +call mtr.add_suppression("Slave SQL.*Can.t execute the query because you have a conflicting read lock., error.* 1223"); # # 9.2.b) EXECUTE for statement which is incompatible with FTWRL # should be also incompatible. diff --git a/mysql-test/suite/binlog/r/binlog_base64_flag.result b/mysql-test/suite/binlog/r/binlog_base64_flag.result index 26eab9f141d..a218c6ab911 100644 --- a/mysql-test/suite/binlog/r/binlog_base64_flag.result +++ b/mysql-test/suite/binlog/r/binlog_base64_flag.result @@ -93,9 +93,9 @@ iONkSBcBAAAAKwAAAMQBAAAQABAAAAAAAAEAA//4AQAAAAMAMTIzAQAAAA== '; ERROR HY000: master may suffer from http://bugs.mysql.com/bug.php?id=37426 so slave stops; check error log on slave for more info drop table t1, char63_utf8, char128_utf8; -call mtr.add_suppression("Slave SQL.*master suffers from this bug: http:..bugs.mysql.com.bug.php.id=37426.* Error_code: 1105"); -call mtr.add_suppression("Slave SQL.*Table definition on master and slave does not match: Column 1 size mismatch.* Error_code: 1535"); -call mtr.add_suppression("Slave SQL.*Column 1 of table .test.char128_utf8. cannot be converted.* Error_code: 1677"); +call mtr.add_suppression("Slave SQL.*master suffers from this bug: http:..bugs.mysql.com.bug.php.id=37426.* error.* 1105"); +call mtr.add_suppression("Slave SQL.*Table definition on master and slave does not match: Column 1 size mismatch.* error.* 1535"); +call mtr.add_suppression("Slave SQL.*Column 1 of table .test.char128_utf8. cannot be converted.* error.* 1677"); # # Bug #54393: crash and/or valgrind errors in # mysql_client_binlog_statement diff --git a/mysql-test/suite/binlog/r/binlog_row_binlog.result b/mysql-test/suite/binlog/r/binlog_row_binlog.result index 5d6e8eacaf0..5433e98103e 100644 --- a/mysql-test/suite/binlog/r/binlog_row_binlog.result +++ b/mysql-test/suite/binlog/r/binlog_row_binlog.result @@ -831,7 +831,7 @@ unique_checks OFF # INSERT INTO t1 VALUES(2) # foreign_key_checks=1 and unique_checks=1 # It should not change current session's variables, even error happens -call mtr.add_suppression("Slave SQL.*Could not execute Write_rows event on table test.t1; Duplicate entry .2. for key .PRIMARY., Error_code: 1062"); +call mtr.add_suppression("Slave SQL.*Could not execute Write_rows event on table test.t1; Duplicate entry .2. for key .PRIMARY., error.* 1062"); BINLOG ' dfLtTBMBAAAAKQAAAKsBAAAAABcAAAAAAAEABHRlc3QAAnQxAAEDAAE= dfLtTBcBAAAAIgAAAM0BAAAAABcAAAAAAAEAAf/+AgAAAA== diff --git a/mysql-test/suite/binlog/r/binlog_stm_binlog.result b/mysql-test/suite/binlog/r/binlog_stm_binlog.result index 7c58708c841..33a13a7330d 100644 --- a/mysql-test/suite/binlog/r/binlog_stm_binlog.result +++ b/mysql-test/suite/binlog/r/binlog_stm_binlog.result @@ -643,7 +643,7 @@ unique_checks OFF # INSERT INTO t1 VALUES(2) # foreign_key_checks=1 and unique_checks=1 # It should not change current session's variables, even error happens -call mtr.add_suppression("Slave SQL.*Could not execute Write_rows event on table test.t1; Duplicate entry .2. for key .PRIMARY., Error_code: 1062"); +call mtr.add_suppression("Slave SQL.*Could not execute Write_rows event on table test.t1; Duplicate entry .2. for key .PRIMARY., error.* 1062"); BINLOG ' dfLtTBMBAAAAKQAAAKsBAAAAABcAAAAAAAEABHRlc3QAAnQxAAEDAAE= dfLtTBcBAAAAIgAAAM0BAAAAABcAAAAAAAEAAf/+AgAAAA== diff --git a/mysql-test/suite/binlog/t/binlog_base64_flag.test b/mysql-test/suite/binlog/t/binlog_base64_flag.test index 2ec979aade0..d200ff3bc8b 100644 --- a/mysql-test/suite/binlog/t/binlog_base64_flag.test +++ b/mysql-test/suite/binlog/t/binlog_base64_flag.test @@ -151,9 +151,9 @@ iONkSBcBAAAAKwAAAMQBAAAQABAAAAAAAAEAA//4AQAAAAMAMTIzAQAAAA== drop table t1, char63_utf8, char128_utf8; -call mtr.add_suppression("Slave SQL.*master suffers from this bug: http:..bugs.mysql.com.bug.php.id=37426.* Error_code: 1105"); -call mtr.add_suppression("Slave SQL.*Table definition on master and slave does not match: Column 1 size mismatch.* Error_code: 1535"); -call mtr.add_suppression("Slave SQL.*Column 1 of table .test.char128_utf8. cannot be converted.* Error_code: 1677"); +call mtr.add_suppression("Slave SQL.*master suffers from this bug: http:..bugs.mysql.com.bug.php.id=37426.* error.* 1105"); +call mtr.add_suppression("Slave SQL.*Table definition on master and slave does not match: Column 1 size mismatch.* error.* 1535"); +call mtr.add_suppression("Slave SQL.*Column 1 of table .test.char128_utf8. cannot be converted.* error.* 1677"); --echo # --echo # Bug #54393: crash and/or valgrind errors in diff --git a/mysql-test/suite/rpl/r/rpl_circular_for_4_hosts.result b/mysql-test/suite/rpl/r/rpl_circular_for_4_hosts.result index f9c5b48e227..c51279bf8df 100644 --- a/mysql-test/suite/rpl/r/rpl_circular_for_4_hosts.result +++ b/mysql-test/suite/rpl/r/rpl_circular_for_4_hosts.result @@ -47,7 +47,7 @@ SET GLOBAL SQL_SLAVE_SKIP_COUNTER = 1; include/start_slave.inc INSERT INTO t1 VALUES(6,'C',2); INSERT INTO t1(b,c) VALUES('B',2); -call mtr.add_suppression("Slave SQL.*Duplicate entry .6. for key .PRIMARY.* Error_code: 1062"); +call mtr.add_suppression("Slave SQL.*Duplicate entry .6. for key .PRIMARY.* error.* 1062"); include/wait_for_slave_sql_error.inc [errno=1062] INSERT INTO t1(b,c) VALUES('A',2); INSERT INTO t1(b,c) VALUES('D',2); diff --git a/mysql-test/suite/rpl/r/rpl_corruption.result b/mysql-test/suite/rpl/r/rpl_corruption.result index 84328170dd2..51c2c6261b8 100644 --- a/mysql-test/suite/rpl/r/rpl_corruption.result +++ b/mysql-test/suite/rpl/r/rpl_corruption.result @@ -5,7 +5,7 @@ call mtr.add_suppression('Slave I/O: Relay log write failure: could not queue ev call mtr.add_suppression('event read from binlog did not pass crc check'); call mtr.add_suppression('Replication event checksum verification failed'); call mtr.add_suppression('Event crc check failed! Most likely there is event corruption'); -call mtr.add_suppression('Slave SQL: Error initializing relay log position: I/O error reading event at position .*, Error_code: 1593'); +call mtr.add_suppression('Slave SQL: Error initializing relay log position: I/O error reading event at position .*, error.* 1593'); SET @old_master_verify_checksum = @@master_verify_checksum; # 1. Creating test table/data and set corruption position for testing * insert/update/delete rows in table t1 * diff --git a/mysql-test/suite/rpl/r/rpl_do_grant.result b/mysql-test/suite/rpl/r/rpl_do_grant.result index 989096e8ee7..1c477f011ac 100644 --- a/mysql-test/suite/rpl/r/rpl_do_grant.result +++ b/mysql-test/suite/rpl/r/rpl_do_grant.result @@ -85,7 +85,7 @@ show grants for rpl_do_grant2@localhost; ERROR 42000: There is no such grant defined for user 'rpl_do_grant2' on host 'localhost' show grants for rpl_do_grant2@localhost; ERROR 42000: There is no such grant defined for user 'rpl_do_grant2' on host 'localhost' -call mtr.add_suppression("Slave: Operation DROP USER failed for 'create_rout_db'@'localhost' Error_code: 1396"); +call mtr.add_suppression("Slave: Operation DROP USER failed for 'create_rout_db'@'localhost' error.* 1396"); DROP DATABASE IF EXISTS bug42217_db; CREATE DATABASE bug42217_db; GRANT CREATE ROUTINE ON bug42217_db.* TO 'create_rout_db'@'localhost' diff --git a/mysql-test/suite/rpl/r/rpl_extra_col_slave_innodb.result b/mysql-test/suite/rpl/r/rpl_extra_col_slave_innodb.result index c63ba401085..80d69eae6db 100644 --- a/mysql-test/suite/rpl/r/rpl_extra_col_slave_innodb.result +++ b/mysql-test/suite/rpl/r/rpl_extra_col_slave_innodb.result @@ -1,7 +1,7 @@ include/master-slave.inc [connection master] -call mtr.add_suppression("Slave: Unknown table 't6' Error_code: 1051"); -call mtr.add_suppression("Slave SQL.*Column [0-9] of table .test.t[0-9]*. cannot be converted from type.* Error_code: 1677"); +call mtr.add_suppression("Slave: Unknown table 't6' error.* 1051"); +call mtr.add_suppression("Slave SQL.*Column [0-9] of table .test.t[0-9]*. cannot be converted from type.* error.* 1677"); **** Diff Table Def Start **** *** On Slave *** STOP SLAVE; @@ -462,9 +462,9 @@ c4 BLOB, c5 CHAR(5)) ENGINE='InnoDB'; RESET MASTER; *** Start Slave *** START SLAVE; -call mtr.add_suppression("Error .Unknown table .t6.. on query.* Error_code: 1051"); -call mtr.add_suppression("Error .Duplicate column name .c6.. on query.* Error_code: 1060"); -call mtr.add_suppression("Table definition on master and slave does not match: Column . ...e mismatch.* Error_code: 1535"); +call mtr.add_suppression("Error .Unknown table .t6.. on query.* error.* 1051"); +call mtr.add_suppression("Error .Duplicate column name .c6.. on query.* error.* 1060"); +call mtr.add_suppression("Table definition on master and slave does not match: Column . ...e mismatch.* error.* 1535"); *** Master Data Insert *** set @b1 = 'b1b1b1b1'; set @b1 = concat(@b1,@b1); diff --git a/mysql-test/suite/rpl/r/rpl_extra_col_slave_myisam.result b/mysql-test/suite/rpl/r/rpl_extra_col_slave_myisam.result index 4e483da72e4..73c2a237f05 100644 --- a/mysql-test/suite/rpl/r/rpl_extra_col_slave_myisam.result +++ b/mysql-test/suite/rpl/r/rpl_extra_col_slave_myisam.result @@ -1,7 +1,7 @@ include/master-slave.inc [connection master] -call mtr.add_suppression("Slave: Unknown table 't6' Error_code: 1051"); -call mtr.add_suppression("Slave SQL.*Column [0-9] of table .test.t[0-9]*. cannot be converted from type.* Error_code: 1677"); +call mtr.add_suppression("Slave: Unknown table 't6' error.* 1051"); +call mtr.add_suppression("Slave SQL.*Column [0-9] of table .test.t[0-9]*. cannot be converted from type.* error.* 1677"); **** Diff Table Def Start **** *** On Slave *** STOP SLAVE; @@ -462,9 +462,9 @@ c4 BLOB, c5 CHAR(5)) ENGINE='MyISAM'; RESET MASTER; *** Start Slave *** START SLAVE; -call mtr.add_suppression("Error .Unknown table .t6.. on query.* Error_code: 1051"); -call mtr.add_suppression("Error .Duplicate column name .c6.. on query.* Error_code: 1060"); -call mtr.add_suppression("Table definition on master and slave does not match: Column . ...e mismatch.* Error_code: 1535"); +call mtr.add_suppression("Error .Unknown table .t6.. on query.* error.* 1051"); +call mtr.add_suppression("Error .Duplicate column name .c6.. on query.* error.* 1060"); +call mtr.add_suppression("Table definition on master and slave does not match: Column . ...e mismatch.* error.* 1535"); *** Master Data Insert *** set @b1 = 'b1b1b1b1'; set @b1 = concat(@b1,@b1); diff --git a/mysql-test/suite/rpl/r/rpl_filter_tables_dynamic.result b/mysql-test/suite/rpl/r/rpl_filter_tables_dynamic.result index 3d03d36828a..5a746c88458 100644 --- a/mysql-test/suite/rpl/r/rpl_filter_tables_dynamic.result +++ b/mysql-test/suite/rpl/r/rpl_filter_tables_dynamic.result @@ -50,7 +50,7 @@ UPDATE t4 LEFT JOIN (t1, t2, t5) ON (t1.id=t4.id and t2.id=t4.id and t5.id=t4.id UPDATE t4 LEFT JOIN (t1, t6, t7) ON (t4.id=t1.id and t4.id=t6.id and t4.id=t7.id) SET a=0, d=0, f=0, g=0 where t4.id=1; UPDATE t7 LEFT JOIN (t4, t1, t2) ON (t7.id=t4.id and t7.id=t1.id and t7.id=t2.id) SET a=0, b=0, d=0, g=0 where t7.id=1; UPDATE t7 LEFT JOIN (t8, t4, t1) ON (t7.id=t8.id and t7.id=t4.id and t7.id=t1.id) SET a=0, d=0, g=0, h=0 where t7.id=1; -call mtr.add_suppression("Slave SQL.*Error .Table .test.t[47]. doesn.t exist. on query.* Error_code: 1146"); +call mtr.add_suppression("Slave SQL.*Error .Table .test.t[47]. doesn.t exist. on query.* error.* 1146"); UPDATE t1 LEFT JOIN t4 ON (t1.id=t4.id) SET a=0 where t1.id=1; include/wait_for_slave_sql_error_and_skip.inc [errno=1146] Last_SQL_Error = 'Error 'Table 'test.t4' doesn't exist' on query. Default database: 'test'. Query: 'UPDATE t1 LEFT JOIN t4 ON (t1.id=t4.id) SET a=0 where t1.id=1'' diff --git a/mysql-test/suite/rpl/r/rpl_filter_tables_not_exist.result b/mysql-test/suite/rpl/r/rpl_filter_tables_not_exist.result index baf0cf81cec..932a44e7f04 100644 --- a/mysql-test/suite/rpl/r/rpl_filter_tables_not_exist.result +++ b/mysql-test/suite/rpl/r/rpl_filter_tables_not_exist.result @@ -42,7 +42,7 @@ UPDATE t4 LEFT JOIN (t1, t2, t5) ON (t1.id=t4.id and t2.id=t4.id and t5.id=t4.id UPDATE t4 LEFT JOIN (t1, t6, t7) ON (t4.id=t1.id and t4.id=t6.id and t4.id=t7.id) SET a=0, d=0, f=0, g=0 where t4.id=1; UPDATE t7 LEFT JOIN (t4, t1, t2) ON (t7.id=t4.id and t7.id=t1.id and t7.id=t2.id) SET a=0, b=0, d=0, g=0 where t7.id=1; UPDATE t7 LEFT JOIN (t8, t4, t1) ON (t7.id=t8.id and t7.id=t4.id and t7.id=t1.id) SET a=0, d=0, g=0, h=0 where t7.id=1; -call mtr.add_suppression("Slave SQL.*Error .Table .test.t[47]. doesn.t exist. on query.* Error_code: 1146"); +call mtr.add_suppression("Slave SQL.*Error .Table .test.t[47]. doesn.t exist. on query.* error.* 1146"); UPDATE t1 LEFT JOIN t4 ON (t1.id=t4.id) SET a=0 where t1.id=1; include/wait_for_slave_sql_error_and_skip.inc [errno=1146] Last_SQL_Error = 'Error 'Table 'test.t4' doesn't exist' on query. Default database: 'test'. Query: 'UPDATE t1 LEFT JOIN t4 ON (t1.id=t4.id) SET a=0 where t1.id=1'' diff --git a/mysql-test/suite/rpl/r/rpl_gtid_startpos.result b/mysql-test/suite/rpl/r/rpl_gtid_startpos.result index 1f95ee4a6e0..4530542f080 100644 --- a/mysql-test/suite/rpl/r/rpl_gtid_startpos.result +++ b/mysql-test/suite/rpl/r/rpl_gtid_startpos.result @@ -129,7 +129,7 @@ a 2 3 SET SQL_LOG_BIN=0; -call mtr.add_suppression("Slave: Table 't1' already exists Error_code: 1050"); +call mtr.add_suppression("Slave: Table 't1' already exists error.* 1050"); SET SQL_LOG_BIN=1; *** Test reconnecting slave with GTID after purge logs on master. *** FLUSH LOGS; diff --git a/mysql-test/suite/rpl/r/rpl_heartbeat_basic.result b/mysql-test/suite/rpl/r/rpl_heartbeat_basic.result index 0c274165e1e..91ed6d7a0cb 100644 --- a/mysql-test/suite/rpl/r/rpl_heartbeat_basic.result +++ b/mysql-test/suite/rpl/r/rpl_heartbeat_basic.result @@ -204,7 +204,7 @@ Heartbeat event received CREATE TABLE t1 (a INT PRIMARY KEY, b VARCHAR(10), c LONGTEXT); INSERT INTO t1 VALUES (1, 'on slave', NULL); INSERT INTO t1 VALUES (1, 'on master', NULL); -call mtr.add_suppression("Slave SQL.*Duplicate entry .1. for key .PRIMARY.. on query.* Error_code: 1062"); +call mtr.add_suppression("Slave SQL.*Duplicate entry .1. for key .PRIMARY.. on query.* error.* 1062"); call mtr.add_suppression("Slave SQL.*Request to stop slave SQL Thread received while applying a group that has non-transactional changes; waiting for completion of the group"); Heartbeat events are received while sql thread stopped (1 means 'yes'): 1 include/stop_slave.inc diff --git a/mysql-test/suite/rpl/r/rpl_idempotency.result b/mysql-test/suite/rpl/r/rpl_idempotency.result index 07c6db416b4..38b955d7697 100644 --- a/mysql-test/suite/rpl/r/rpl_idempotency.result +++ b/mysql-test/suite/rpl/r/rpl_idempotency.result @@ -1,9 +1,9 @@ include/master-slave.inc [connection master] -call mtr.add_suppression("Slave SQL.*Can.t find record in .t[12].* Error_code: 1032"); -call mtr.add_suppression("Slave SQL.*Cannot delete or update a parent row: a foreign key constraint fails .* Error_code: 1451"); -call mtr.add_suppression("Slave SQL.*Cannot add or update a child row: a foreign key constraint fails .* Error_code: 1452"); -call mtr.add_suppression("Slave SQL.*Could not execute Write_rows event on table test.* Duplicate entry .1. for key .PRIMARY.* Error_code: 1062"); +call mtr.add_suppression("Slave SQL.*Can.t find record in .t[12].* error.* 1032"); +call mtr.add_suppression("Slave SQL.*Cannot delete or update a parent row: a foreign key constraint fails .* error.* 1451"); +call mtr.add_suppression("Slave SQL.*Cannot add or update a child row: a foreign key constraint fails .* error.* 1452"); +call mtr.add_suppression("Slave SQL.*Could not execute Write_rows event on table test.* Duplicate entry .1. for key .PRIMARY.* error.* 1062"); CREATE TABLE t1 (a INT PRIMARY KEY); CREATE TABLE t2 (a INT); INSERT INTO t1 VALUES (-1),(-2),(-3); diff --git a/mysql-test/suite/rpl/r/rpl_ignore_table.result b/mysql-test/suite/rpl/r/rpl_ignore_table.result index 7bd30766d32..8e7166fa278 100644 --- a/mysql-test/suite/rpl/r/rpl_ignore_table.result +++ b/mysql-test/suite/rpl/r/rpl_ignore_table.result @@ -116,7 +116,7 @@ show grants for mysqltest4@localhost; Grants for mysqltest4@localhost GRANT USAGE ON *.* TO 'mysqltest4'@'localhost' IDENTIFIED BY PASSWORD '*196BDEDE2AE4F84CA44C47D54D78478C7E2BD7B7' set global slave_exec_mode='IDEMPOTENT'; -call mtr.add_suppression("Slave SQL.*Could not execute Delete_rows event on table mysql.* Error_code: 1032"); +call mtr.add_suppression("Slave SQL.*Could not execute Delete_rows event on table mysql.* error.* 1032"); drop table t1, mysqltest2.t2; drop table t4; drop database mysqltest2; diff --git a/mysql-test/suite/rpl/r/rpl_loaddata.result b/mysql-test/suite/rpl/r/rpl_loaddata.result index 621f3a1ddf5..310c88cc419 100644 --- a/mysql-test/suite/rpl/r/rpl_loaddata.result +++ b/mysql-test/suite/rpl/r/rpl_loaddata.result @@ -27,8 +27,8 @@ drop table t3; create table t1(a int, b int, unique(b)); insert into t1 values(1,10); load data infile '../../std_data/rpl_loaddata.dat' into table t1; -call mtr.add_suppression("Slave SQL.*Error .Duplicate entry .10. for key .b.. on query.* Error_code: 1062"); -call mtr.add_suppression("Slave SQL.*Query caused different errors on master and slave.*Error on master:.*error code=1062.*Error on slave:.*Error_code: 0"); +call mtr.add_suppression("Slave SQL.*Error .Duplicate entry .10. for key .b.. on query.* error.* 1062"); +call mtr.add_suppression("Slave SQL.*Query caused different errors on master and slave.*Error on master:.*error code=1062.*Error on slave:.*error.* 0"); include/wait_for_slave_sql_error_and_skip.inc [errno=1062] include/check_slave_no_error.inc set sql_log_bin=0; diff --git a/mysql-test/suite/rpl/r/rpl_loaddata_fatal.result b/mysql-test/suite/rpl/r/rpl_loaddata_fatal.result index b13e2ced183..8ce630f7bc2 100644 --- a/mysql-test/suite/rpl/r/rpl_loaddata_fatal.result +++ b/mysql-test/suite/rpl/r/rpl_loaddata_fatal.result @@ -3,7 +3,7 @@ include/master-slave.inc CREATE TABLE t1 (a INT, b INT); INSERT INTO t1 VALUES (1,10); LOAD DATA INFILE '../../std_data/rpl_loaddata.dat' INTO TABLE t1; -call mtr.add_suppression("Slave SQL.*Fatal error: Not enough memory, Error_code: 1593"); +call mtr.add_suppression("Slave SQL.*Fatal error: Not enough memory, error.* 1593"); include/wait_for_slave_sql_error_and_skip.inc [errno=1593] Last_SQL_Error = 'Fatal error: Not enough memory' DROP TABLE t1; diff --git a/mysql-test/suite/rpl/r/rpl_packet.result b/mysql-test/suite/rpl/r/rpl_packet.result index 65fd2800e7d..07558053287 100644 --- a/mysql-test/suite/rpl/r/rpl_packet.result +++ b/mysql-test/suite/rpl/r/rpl_packet.result @@ -1,6 +1,6 @@ include/master-slave.inc [connection master] -call mtr.add_suppression("Slave I/O: Got a packet bigger than 'slave_max_allowed_packet' bytes, Error_code: 1153"); +call mtr.add_suppression("Slave I/O: Got a packet bigger than 'slave_max_allowed_packet' bytes, .*error.* 1153"); call mtr.add_suppression("Log entry on master is longer than slave_max_allowed_packet"); drop database if exists DB_NAME_OF_MAX_LENGTH_AKA_NAME_LEN_64_BYTES_____________________; create database DB_NAME_OF_MAX_LENGTH_AKA_NAME_LEN_64_BYTES_____________________; diff --git a/mysql-test/suite/rpl/r/rpl_rotate_logs.result b/mysql-test/suite/rpl/r/rpl_rotate_logs.result index 83d97bad6b7..ecf6f5109f7 100644 --- a/mysql-test/suite/rpl/r/rpl_rotate_logs.result +++ b/mysql-test/suite/rpl/r/rpl_rotate_logs.result @@ -38,7 +38,7 @@ drop table temp_table, t3; insert into t2 values(1234); set insert_id=1234; insert into t2 values(NULL); -call mtr.add_suppression("Slave SQL.*Error .Duplicate entry .1234. for key .PRIMARY.. on query.* Error_code: 1062"); +call mtr.add_suppression("Slave SQL.*Error .Duplicate entry .1234. for key .PRIMARY.. on query.* error.* 1062"); include/wait_for_slave_sql_error_and_skip.inc [errno=1062] purge master logs to 'master-bin.000002'; show master logs; diff --git a/mysql-test/suite/rpl/r/rpl_row_basic_11bugs.result b/mysql-test/suite/rpl/r/rpl_row_basic_11bugs.result index 8bc031a1692..9bb5ef62c12 100644 --- a/mysql-test/suite/rpl/r/rpl_row_basic_11bugs.result +++ b/mysql-test/suite/rpl/r/rpl_row_basic_11bugs.result @@ -72,7 +72,7 @@ DROP TABLE t1; include/rpl_reset.inc **** On Slave **** SET GLOBAL QUERY_CACHE_SIZE=0; -call mtr.add_suppression("Slave SQL.*Could not execute Update_rows event on table test.t1.* Error_code: 1032"); +call mtr.add_suppression("Slave SQL.*Could not execute Update_rows event on table test.t1.* error.* 1032"); **** On Master **** CREATE TABLE t1 (a INT); INSERT INTO t1 VALUES (1),(2),(3); diff --git a/mysql-test/suite/rpl/r/rpl_row_basic_2myisam.result b/mysql-test/suite/rpl/r/rpl_row_basic_2myisam.result index 6e2415ebcd8..70148afcacb 100644 --- a/mysql-test/suite/rpl/r/rpl_row_basic_2myisam.result +++ b/mysql-test/suite/rpl/r/rpl_row_basic_2myisam.result @@ -482,9 +482,9 @@ INSERT INTO t2 VALUES (1, "", 1); INSERT INTO t2 VALUES (2, repeat(_utf8'a', 16), 2); include/diff_tables.inc [master:t2, slave:t2] SET GLOBAL SLAVE_TYPE_CONVERSIONS = @saved_slave_type_conversions; -call mtr.add_suppression("Slave SQL.*Table definition on master and slave does not match: Column 1 size mismatch.* Error_code: 1535"); -call mtr.add_suppression("Slave SQL.*Could not execute Delete_rows event on table test.t1.* Error_code: 1032"); -call mtr.add_suppression("Slave SQL.*Column 1 of table .test.t.. cannot be converted from type.*, Error_code: 1677"); +call mtr.add_suppression("Slave SQL.*Table definition on master and slave does not match: Column 1 size mismatch.* error.* 1535"); +call mtr.add_suppression("Slave SQL.*Could not execute Delete_rows event on table test.t1.* error.* 1032"); +call mtr.add_suppression("Slave SQL.*Column 1 of table .test.t.. cannot be converted from type.*, error.* 1677"); include/rpl_reset.inc [expecting slave to replicate correctly] INSERT INTO t4 VALUES (1, "", 1); diff --git a/mysql-test/suite/rpl/r/rpl_row_basic_3innodb.result b/mysql-test/suite/rpl/r/rpl_row_basic_3innodb.result index cba1b905d98..89557b554d0 100644 --- a/mysql-test/suite/rpl/r/rpl_row_basic_3innodb.result +++ b/mysql-test/suite/rpl/r/rpl_row_basic_3innodb.result @@ -485,9 +485,9 @@ INSERT INTO t2 VALUES (1, "", 1); INSERT INTO t2 VALUES (2, repeat(_utf8'a', 16), 2); include/diff_tables.inc [master:t2, slave:t2] SET GLOBAL SLAVE_TYPE_CONVERSIONS = @saved_slave_type_conversions; -call mtr.add_suppression("Slave SQL.*Table definition on master and slave does not match: Column 1 size mismatch.* Error_code: 1535"); -call mtr.add_suppression("Slave SQL.*Could not execute Delete_rows event on table test.t1.* Error_code: 1032"); -call mtr.add_suppression("Slave SQL.*Column 1 of table .test.t.. cannot be converted from type.*, Error_code: 1677"); +call mtr.add_suppression("Slave SQL.*Table definition on master and slave does not match: Column 1 size mismatch.* error.* 1535"); +call mtr.add_suppression("Slave SQL.*Could not execute Delete_rows event on table test.t1.* error.* 1032"); +call mtr.add_suppression("Slave SQL.*Column 1 of table .test.t.. cannot be converted from type.*, error.* 1677"); include/rpl_reset.inc [expecting slave to replicate correctly] INSERT INTO t4 VALUES (1, "", 1); diff --git a/mysql-test/suite/rpl/r/rpl_row_colSize.result b/mysql-test/suite/rpl/r/rpl_row_colSize.result index 487cddc2051..8db9aa6059f 100644 --- a/mysql-test/suite/rpl/r/rpl_row_colSize.result +++ b/mysql-test/suite/rpl/r/rpl_row_colSize.result @@ -265,8 +265,8 @@ STOP SLAVE; RESET SLAVE; RESET MASTER; START SLAVE; -call mtr.add_suppression("Slave SQL.*Table definition on master and slave does not match: Column 0 ...e mismatch.* Error_code: 1535"); -call mtr.add_suppression("Slave SQL.*Column 0 of table .test.t1. cannot be converted from type.* Error_code: 1677"); +call mtr.add_suppression("Slave SQL.*Table definition on master and slave does not match: Column 0 ...e mismatch.* error.* 1535"); +call mtr.add_suppression("Slave SQL.*Column 0 of table .test.t1. cannot be converted from type.* error.* 1677"); *** Cleanup *** DROP TABLE IF EXISTS t1; include/rpl_end.inc diff --git a/mysql-test/suite/rpl/r/rpl_row_conflicts.result b/mysql-test/suite/rpl/r/rpl_row_conflicts.result index b9a570fea33..0ed2cc9122b 100644 --- a/mysql-test/suite/rpl/r/rpl_row_conflicts.result +++ b/mysql-test/suite/rpl/r/rpl_row_conflicts.result @@ -1,6 +1,6 @@ include/master-slave.inc [connection master] -call mtr.add_suppression("Slave: Can\'t find record in \'t1\' Error_code: .*"); +call mtr.add_suppression("Slave: Can\'t find record in \'t1\' error.* .*"); call mtr.add_suppression("Can't find record in 't.'"); [on slave] SET @old_slave_exec_mode= @@global.slave_exec_mode; @@ -24,7 +24,7 @@ a include/wait_for_slave_sql_error.inc [errno=1062] Last_SQL_Error (expected "duplicate key" 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 END_LOG_POS -call mtr.add_suppression("Slave SQL.*Duplicate entry .1. for key .PRIMARY.* Error_code: 1062"); +call mtr.add_suppression("Slave SQL.*Duplicate entry .1. for key .PRIMARY.* error.* 1062"); SELECT * FROM t1; a 1 @@ -51,7 +51,7 @@ SELECT * FROM t1; a [on slave] ---- Wait until slave stops with an error ---- -call mtr.add_suppression("Slave SQL.*Can.t find record in .t1., Error_code: 1032"); +call mtr.add_suppression("Slave SQL.*Can.t find record in .t1., error.* 1032"); include/wait_for_slave_sql_error.inc [errno=1032] Last_SQL_Error (expected "duplicate key" 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 END_LOG_POS diff --git a/mysql-test/suite/rpl/r/rpl_row_idempotency.result b/mysql-test/suite/rpl/r/rpl_row_idempotency.result index 20afcd0a393..2e94d35644b 100644 --- a/mysql-test/suite/rpl/r/rpl_row_idempotency.result +++ b/mysql-test/suite/rpl/r/rpl_row_idempotency.result @@ -1,9 +1,9 @@ include/master-slave.inc [connection master] -call mtr.add_suppression("Can.t find record in .t[12].* Error_code: 1032"); -call mtr.add_suppression("Cannot delete or update a parent row: a foreign key constraint fails .* Error_code: 1451"); -call mtr.add_suppression("Cannot add or update a child row: a foreign key constraint fails .* Error_code: 1452"); -call mtr.add_suppression("Duplicate entry .1. for key .PRIMARY.* Error_code: 1062"); +call mtr.add_suppression("Can.t find record in .t[12].* error.* 1032"); +call mtr.add_suppression("Cannot delete or update a parent row: a foreign key constraint fails .* error.* 1451"); +call mtr.add_suppression("Cannot add or update a child row: a foreign key constraint fails .* error.* 1452"); +call mtr.add_suppression("Duplicate entry .1. for key .PRIMARY.* error.* 1062"); set @old_slave_exec_mode= @@global.slave_exec_mode; set @@global.slave_exec_mode= IDEMPOTENT; create table ti1 (b int primary key) engine = innodb; diff --git a/mysql-test/suite/rpl/r/rpl_row_inexist_tbl.result b/mysql-test/suite/rpl/r/rpl_row_inexist_tbl.result index fa565c4061c..354b7555034 100644 --- a/mysql-test/suite/rpl/r/rpl_row_inexist_tbl.result +++ b/mysql-test/suite/rpl/r/rpl_row_inexist_tbl.result @@ -10,7 +10,7 @@ DROP TABLE t1; INSERT INTO t1 VALUES (1); ==== Verify error on slave ==== [on slave] -call mtr.add_suppression("Slave SQL.*Error executing row event: .Table .test.t1. doesn.t exist., Error_code: 1146"); +call mtr.add_suppression("Slave SQL.*Error executing row event: .Table .test.t1. doesn.t exist., error.* 1146"); include/wait_for_slave_sql_error.inc [errno=1146] ==== Clean up ==== include/stop_slave_io.inc diff --git a/mysql-test/suite/rpl/r/rpl_row_loaddata_concurrent.result b/mysql-test/suite/rpl/r/rpl_row_loaddata_concurrent.result index 5a77b747476..76a24bab7cd 100644 --- a/mysql-test/suite/rpl/r/rpl_row_loaddata_concurrent.result +++ b/mysql-test/suite/rpl/r/rpl_row_loaddata_concurrent.result @@ -43,8 +43,8 @@ drop table t3; create table t1(a int, b int, unique(b)); insert into t1 values(1,10); load data CONCURRENT infile '../../std_data/rpl_loaddata.dat' into table t1; -call mtr.add_suppression("Slave SQL.*Error .Duplicate entry .10. for key .b.. on query.* Error_code: 1062"); -call mtr.add_suppression("Slave SQL.*Query caused different errors on master and slave.*Error on master:.*error code=1062.*Error on slave:.*Error_code: 0"); +call mtr.add_suppression("Slave SQL.*Error .Duplicate entry .10. for key .b.. on query.* error.* 1062"); +call mtr.add_suppression("Slave SQL.*Query caused different errors on master and slave.*Error on master:.*error code=1062.*Error on slave:.*error.* 0"); include/wait_for_slave_sql_error_and_skip.inc [errno=1062] include/check_slave_no_error.inc set sql_log_bin=0; diff --git a/mysql-test/suite/rpl/r/rpl_row_tabledefs_2myisam.result b/mysql-test/suite/rpl/r/rpl_row_tabledefs_2myisam.result index 49dccfc5d73..2aca0e8dc30 100644 --- a/mysql-test/suite/rpl/r/rpl_row_tabledefs_2myisam.result +++ b/mysql-test/suite/rpl/r/rpl_row_tabledefs_2myisam.result @@ -117,8 +117,8 @@ a include/check_slave_is_running.inc INSERT INTO t9 VALUES (4); INSERT INTO t4 VALUES (4); -call mtr.add_suppression("Slave SQL.*Table definition on master and slave does not match: Column [012] type mismatch.* Error_code: 1535"); -call mtr.add_suppression("Slave SQL.*Column [0-9] of table .test.t[0-9]. cannot be converted from type.* Error_code: 1677"); +call mtr.add_suppression("Slave SQL.*Table definition on master and slave does not match: Column [012] type mismatch.* error.* 1535"); +call mtr.add_suppression("Slave SQL.*Column [0-9] of table .test.t[0-9]. cannot be converted from type.* error.* 1677"); include/wait_for_slave_sql_error_and_skip.inc [errno=1677] Last_SQL_Error = 'Column 0 of table 'test.t4' cannot be converted from type 'int' to type 'float'' INSERT INTO t9 VALUES (5); diff --git a/mysql-test/suite/rpl/r/rpl_row_tabledefs_3innodb.result b/mysql-test/suite/rpl/r/rpl_row_tabledefs_3innodb.result index 9c1e2740c03..544bfa50034 100644 --- a/mysql-test/suite/rpl/r/rpl_row_tabledefs_3innodb.result +++ b/mysql-test/suite/rpl/r/rpl_row_tabledefs_3innodb.result @@ -117,8 +117,8 @@ a include/check_slave_is_running.inc INSERT INTO t9 VALUES (4); INSERT INTO t4 VALUES (4); -call mtr.add_suppression("Slave SQL.*Table definition on master and slave does not match: Column [012] type mismatch.* Error_code: 1535"); -call mtr.add_suppression("Slave SQL.*Column [0-9] of table .test.t[0-9]. cannot be converted from type.* Error_code: 1677"); +call mtr.add_suppression("Slave SQL.*Table definition on master and slave does not match: Column [012] type mismatch.* error.* 1535"); +call mtr.add_suppression("Slave SQL.*Column [0-9] of table .test.t[0-9]. cannot be converted from type.* error.* 1677"); include/wait_for_slave_sql_error_and_skip.inc [errno=1677] Last_SQL_Error = 'Column 0 of table 'test.t4' cannot be converted from type 'int' to type 'float'' INSERT INTO t9 VALUES (5); diff --git a/mysql-test/suite/rpl/r/rpl_skip_error.result b/mysql-test/suite/rpl/r/rpl_skip_error.result index f5675b5e25f..aff83e1b99e 100644 --- a/mysql-test/suite/rpl/r/rpl_skip_error.result +++ b/mysql-test/suite/rpl/r/rpl_skip_error.result @@ -56,7 +56,7 @@ t1 CREATE TABLE `t1` ( PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 SET SQL_LOG_BIN=1; -call mtr.add_suppression("Slave SQL.*Could not execute .*te_rows event on table test.t.; Duplicate entry.* Error_code: 1062"); +call mtr.add_suppression("Slave SQL.*Could not execute .*te_rows event on table test.t.; Duplicate entry.* error.* 1062"); CREATE TABLE t1(id INT NOT NULL PRIMARY KEY, data INT) Engine=InnoDB; SHOW CREATE TABLE t1; Table Create Table diff --git a/mysql-test/suite/rpl/r/rpl_slave_grp_exec.result b/mysql-test/suite/rpl/r/rpl_slave_grp_exec.result index 4c3b08589d9..d3cfbb6fa91 100644 --- a/mysql-test/suite/rpl/r/rpl_slave_grp_exec.result +++ b/mysql-test/suite/rpl/r/rpl_slave_grp_exec.result @@ -29,7 +29,7 @@ a b SELECT * FROM t3 ORDER BY a; a b 1 ZZ -call mtr.add_suppression("Slave SQL.*Table .test.t3. doesn.t exist.* Error_code: 1146"); +call mtr.add_suppression("Slave SQL.*Table .test.t3. doesn.t exist.* error.* 1146"); include/wait_for_slave_sql_error.inc [errno=1146] SHOW TABLES LIKE 't%'; Tables_in_test (t%) diff --git a/mysql-test/suite/rpl/r/rpl_slave_load_remove_tmpfile.result b/mysql-test/suite/rpl/r/rpl_slave_load_remove_tmpfile.result index 0abae0bff28..468de62731c 100644 --- a/mysql-test/suite/rpl/r/rpl_slave_load_remove_tmpfile.result +++ b/mysql-test/suite/rpl/r/rpl_slave_load_remove_tmpfile.result @@ -14,8 +14,8 @@ include/stop_slave_io.inc RESET SLAVE; drop table t1; call mtr.add_suppression("Slave: Can't get stat of .*"); -call mtr.add_suppression("Slave SQL: Error .Can.t get stat of.* Error_code: 13"); +call mtr.add_suppression("Slave SQL: Error .Can.t get stat of.* error.* 13"); call mtr.add_suppression("Slave: File.* not found.*"); -call mtr.add_suppression("Slave SQL: Error .File.* not found.* Error_code: 29"); +call mtr.add_suppression("Slave SQL: Error .File.* not found.* error.* 29"); SET @@global.debug_dbug= ''; include/rpl_end.inc diff --git a/mysql-test/suite/rpl/r/rpl_slave_load_tmpdir_not_exist.result b/mysql-test/suite/rpl/r/rpl_slave_load_tmpdir_not_exist.result index 262404ff6f9..60de4a9f812 100644 --- a/mysql-test/suite/rpl/r/rpl_slave_load_tmpdir_not_exist.result +++ b/mysql-test/suite/rpl/r/rpl_slave_load_tmpdir_not_exist.result @@ -1,7 +1,7 @@ include/master-slave.inc [connection master] START SLAVE; -call mtr.add_suppression("Slave SQL.*Unable to use slave.s temporary directory.* Error_code: 12"); +call mtr.add_suppression("Slave SQL.*Unable to use slave.s temporary directory"); include/wait_for_slave_sql_error.inc [errno=12] include/stop_slave_io.inc RESET SLAVE; diff --git a/mysql-test/suite/rpl/r/rpl_stm_EE_err2.result b/mysql-test/suite/rpl/r/rpl_stm_EE_err2.result index d4a14adc6b8..1c479713c89 100644 --- a/mysql-test/suite/rpl/r/rpl_stm_EE_err2.result +++ b/mysql-test/suite/rpl/r/rpl_stm_EE_err2.result @@ -8,7 +8,7 @@ insert into t1 values(1),(2); ERROR 23000: Duplicate entry '2' for key 'a' drop table t1; include/wait_for_slave_sql_to_stop.inc -call mtr.add_suppression("Slave SQL.*Query caused different errors on master and slave.*Error on master:.* error code=1062.*Error on slave:.* Error_code: 0"); +call mtr.add_suppression("Slave SQL.*Query caused different errors on master and slave.*Error on master:.* error code=1062.*Error on slave:.* error.* 0"); Error: "Query caused different errors on master and slave. Error on master: message (format)='Duplicate entry '%-.192s' for key %d' error code=1062 ; Error on slave: actual message='no error', error code=0. Default database: 'test'. Query: 'insert into t1 values(1),(2)'" (expected different error codes on master and slave) Errno: "0" (expected 0) drop table t1; diff --git a/mysql-test/suite/rpl/r/rpl_stm_conflicts.result b/mysql-test/suite/rpl/r/rpl_stm_conflicts.result index e30429540fb..07c5b0d445e 100644 --- a/mysql-test/suite/rpl/r/rpl_stm_conflicts.result +++ b/mysql-test/suite/rpl/r/rpl_stm_conflicts.result @@ -18,7 +18,7 @@ a include/wait_for_slave_sql_error.inc [errno=1062] Last_SQL_Error (expected "duplicate key" error) Error 'Duplicate entry '1' for key 'PRIMARY'' on query. Default database: 'test'. Query: 'INSERT INTO t1 VALUES (1)' -call mtr.add_suppression("Slave SQL.*Duplicate entry .1. for key .PRIMARY.* Error_code: 1062"); +call mtr.add_suppression("Slave SQL.*Duplicate entry .1. for key .PRIMARY.* error.* 1062"); SELECT * FROM t1; a 1 diff --git a/mysql-test/suite/rpl/r/rpl_stm_loaddata_concurrent.result b/mysql-test/suite/rpl/r/rpl_stm_loaddata_concurrent.result index ab91f73a5d6..c3ac581853e 100644 --- a/mysql-test/suite/rpl/r/rpl_stm_loaddata_concurrent.result +++ b/mysql-test/suite/rpl/r/rpl_stm_loaddata_concurrent.result @@ -44,8 +44,8 @@ drop table t3; create table t1(a int, b int, unique(b)); insert into t1 values(1,10); load data CONCURRENT infile '../../std_data/rpl_loaddata.dat' into table t1; -call mtr.add_suppression("Slave SQL.*Error .Duplicate entry .10. for key .b.. on query.* Error_code: 1062"); -call mtr.add_suppression("Slave SQL.*Query caused different errors on master and slave.*Error on master:.*error code=1062.*Error on slave:.*Error_code: 0"); +call mtr.add_suppression("Slave SQL.*Error .Duplicate entry .10. for key .b.. on query.* error.* 1062"); +call mtr.add_suppression("Slave SQL.*Query caused different errors on master and slave.*Error on master:.*error code=1062.*Error on slave:.*error.* 0"); include/wait_for_slave_sql_error_and_skip.inc [errno=1062] include/check_slave_no_error.inc set sql_log_bin=0; diff --git a/mysql-test/suite/rpl/r/rpl_typeconv.result b/mysql-test/suite/rpl/r/rpl_typeconv.result index f9d5b50b4e2..813c105c7dc 100644 --- a/mysql-test/suite/rpl/r/rpl_typeconv.result +++ b/mysql-test/suite/rpl/r/rpl_typeconv.result @@ -534,7 +534,7 @@ BIT(6) BIT(5) ALL_LOSSY,ALL_NON_LOSSY BIT(5) BIT(12) ALL_LOSSY,ALL_NON_LOSSY BIT(12) BIT(5) ALL_LOSSY,ALL_NON_LOSSY DROP TABLE type_conversions; -call mtr.add_suppression("Slave SQL.*Column 1 of table .test.t1. cannot be converted from type.* Error_code: 1677"); +call mtr.add_suppression("Slave SQL.*Column 1 of table .test.t1. cannot be converted from type.* error.* 1677"); DROP TABLE t1; set global slave_type_conversions = @saved_slave_type_conversions; include/rpl_end.inc diff --git a/mysql-test/suite/rpl/t/rpl_circular_for_4_hosts.test b/mysql-test/suite/rpl/t/rpl_circular_for_4_hosts.test index 7d4b538c8a6..5f492419ae7 100644 --- a/mysql-test/suite/rpl/t/rpl_circular_for_4_hosts.test +++ b/mysql-test/suite/rpl/t/rpl_circular_for_4_hosts.test @@ -86,7 +86,7 @@ INSERT INTO t1(b,c) VALUES('B',2); # Wait while C will stop. --connection server_3 # 1062 = ER_DUP_ENTRY -call mtr.add_suppression("Slave SQL.*Duplicate entry .6. for key .PRIMARY.* Error_code: 1062"); +call mtr.add_suppression("Slave SQL.*Duplicate entry .6. for key .PRIMARY.* error.* 1062"); --let $slave_sql_errno= 1062 --source include/wait_for_slave_sql_error.inc --connection server_1 diff --git a/mysql-test/suite/rpl/t/rpl_corruption.test b/mysql-test/suite/rpl/t/rpl_corruption.test index 45ca3805286..da87b133cb5 100644 --- a/mysql-test/suite/rpl/t/rpl_corruption.test +++ b/mysql-test/suite/rpl/t/rpl_corruption.test @@ -24,7 +24,7 @@ call mtr.add_suppression('Slave I/O: Relay log write failure: could not queue ev call mtr.add_suppression('event read from binlog did not pass crc check'); call mtr.add_suppression('Replication event checksum verification failed'); call mtr.add_suppression('Event crc check failed! Most likely there is event corruption'); -call mtr.add_suppression('Slave SQL: Error initializing relay log position: I/O error reading event at position .*, Error_code: 1593'); +call mtr.add_suppression('Slave SQL: Error initializing relay log position: I/O error reading event at position .*, error.* 1593'); SET @old_master_verify_checksum = @@master_verify_checksum; diff --git a/mysql-test/suite/rpl/t/rpl_do_grant.test b/mysql-test/suite/rpl/t/rpl_do_grant.test index a39c3fb6375..4d7d1bacc15 100644 --- a/mysql-test/suite/rpl/t/rpl_do_grant.test +++ b/mysql-test/suite/rpl/t/rpl_do_grant.test @@ -112,7 +112,7 @@ show grants for rpl_do_grant2@localhost; # BUG42217 mysql.procs_priv does not get replicated ##################################################### connection master; -call mtr.add_suppression("Slave: Operation DROP USER failed for 'create_rout_db'@'localhost' Error_code: 1396"); +call mtr.add_suppression("Slave: Operation DROP USER failed for 'create_rout_db'@'localhost' error.* 1396"); sync_slave_with_master; connection master; diff --git a/mysql-test/suite/rpl/t/rpl_filter_tables_dynamic.test b/mysql-test/suite/rpl/t/rpl_filter_tables_dynamic.test index 5cc9e8e0789..97ecc167356 100644 --- a/mysql-test/suite/rpl/t/rpl_filter_tables_dynamic.test +++ b/mysql-test/suite/rpl/t/rpl_filter_tables_dynamic.test @@ -128,7 +128,7 @@ UPDATE t7 LEFT JOIN (t8, t4, t1) ON (t7.id=t8.id and t7.id=t4.id and t7.id=t1.id # and stop slave sql thread. sync_slave_with_master; connection slave; -call mtr.add_suppression("Slave SQL.*Error .Table .test.t[47]. doesn.t exist. on query.* Error_code: 1146"); +call mtr.add_suppression("Slave SQL.*Error .Table .test.t[47]. doesn.t exist. on query.* error.* 1146"); connection master; # Parameters for include/wait_for_slave_sql_error_and_skip.inc: diff --git a/mysql-test/suite/rpl/t/rpl_filter_tables_not_exist.test b/mysql-test/suite/rpl/t/rpl_filter_tables_not_exist.test index 3572dd53ea7..4c54a05ff84 100644 --- a/mysql-test/suite/rpl/t/rpl_filter_tables_not_exist.test +++ b/mysql-test/suite/rpl/t/rpl_filter_tables_not_exist.test @@ -123,7 +123,7 @@ UPDATE t7 LEFT JOIN (t8, t4, t1) ON (t7.id=t8.id and t7.id=t4.id and t7.id=t1.id # and stop slave sql thread. sync_slave_with_master; connection slave; -call mtr.add_suppression("Slave SQL.*Error .Table .test.t[47]. doesn.t exist. on query.* Error_code: 1146"); +call mtr.add_suppression("Slave SQL.*Error .Table .test.t[47]. doesn.t exist. on query.* error.* 1146"); connection master; # Parameters for include/wait_for_slave_sql_error_and_skip.inc: diff --git a/mysql-test/suite/rpl/t/rpl_gtid_startpos.test b/mysql-test/suite/rpl/t/rpl_gtid_startpos.test index b7ec26f4728..c4390d3fccc 100644 --- a/mysql-test/suite/rpl/t/rpl_gtid_startpos.test +++ b/mysql-test/suite/rpl/t/rpl_gtid_startpos.test @@ -208,7 +208,7 @@ INSERT INTO t1 VALUES(3); --source include/wait_condition.inc SELECT * FROM t1 ORDER BY a; SET SQL_LOG_BIN=0; -call mtr.add_suppression("Slave: Table 't1' already exists Error_code: 1050"); +call mtr.add_suppression("Slave: Table 't1' already exists error.* 1050"); SET SQL_LOG_BIN=1; diff --git a/mysql-test/suite/rpl/t/rpl_heartbeat_basic.test b/mysql-test/suite/rpl/t/rpl_heartbeat_basic.test index e736eb1ba12..27dce9cd652 100644 --- a/mysql-test/suite/rpl/t/rpl_heartbeat_basic.test +++ b/mysql-test/suite/rpl/t/rpl_heartbeat_basic.test @@ -319,7 +319,7 @@ INSERT INTO t1 VALUES (1, 'on slave', NULL); --connection master INSERT INTO t1 VALUES (1, 'on master', NULL); --connection slave -call mtr.add_suppression("Slave SQL.*Duplicate entry .1. for key .PRIMARY.. on query.* Error_code: 1062"); +call mtr.add_suppression("Slave SQL.*Duplicate entry .1. for key .PRIMARY.. on query.* error.* 1062"); call mtr.add_suppression("Slave SQL.*Request to stop slave SQL Thread received while applying a group that has non-transactional changes; waiting for completion of the group"); let $slave_errno= ER_DUP_ENTRY --source include/wait_for_slave_sql_error.inc diff --git a/mysql-test/suite/rpl/t/rpl_idempotency.test b/mysql-test/suite/rpl/t/rpl_idempotency.test index c229711e005..186c6260154 100644 --- a/mysql-test/suite/rpl/t/rpl_idempotency.test +++ b/mysql-test/suite/rpl/t/rpl_idempotency.test @@ -4,10 +4,10 @@ source include/master-slave.inc; # Add suppression for expected warning(s) in slaves error log -call mtr.add_suppression("Slave SQL.*Can.t find record in .t[12].* Error_code: 1032"); -call mtr.add_suppression("Slave SQL.*Cannot delete or update a parent row: a foreign key constraint fails .* Error_code: 1451"); -call mtr.add_suppression("Slave SQL.*Cannot add or update a child row: a foreign key constraint fails .* Error_code: 1452"); -call mtr.add_suppression("Slave SQL.*Could not execute Write_rows event on table test.* Duplicate entry .1. for key .PRIMARY.* Error_code: 1062"); +call mtr.add_suppression("Slave SQL.*Can.t find record in .t[12].* error.* 1032"); +call mtr.add_suppression("Slave SQL.*Cannot delete or update a parent row: a foreign key constraint fails .* error.* 1451"); +call mtr.add_suppression("Slave SQL.*Cannot add or update a child row: a foreign key constraint fails .* error.* 1452"); +call mtr.add_suppression("Slave SQL.*Could not execute Write_rows event on table test.* Duplicate entry .1. for key .PRIMARY.* error.* 1062"); connection master; CREATE TABLE t1 (a INT PRIMARY KEY); diff --git a/mysql-test/suite/rpl/t/rpl_ignore_table.test b/mysql-test/suite/rpl/t/rpl_ignore_table.test index 5a714498e27..b0019b70dc8 100644 --- a/mysql-test/suite/rpl/t/rpl_ignore_table.test +++ b/mysql-test/suite/rpl/t/rpl_ignore_table.test @@ -131,7 +131,7 @@ show grants for mysqltest4@localhost; # where mysqltest1 does not exist on slave, # to succeed on slave the mode is temporarily changed set global slave_exec_mode='IDEMPOTENT'; -call mtr.add_suppression("Slave SQL.*Could not execute Delete_rows event on table mysql.* Error_code: 1032"); +call mtr.add_suppression("Slave SQL.*Could not execute Delete_rows event on table mysql.* error.* 1032"); connection master; drop table t1, mysqltest2.t2; diff --git a/mysql-test/suite/rpl/t/rpl_loaddata_fatal.test b/mysql-test/suite/rpl/t/rpl_loaddata_fatal.test index be099c1b6c4..4e87d6de59c 100644 --- a/mysql-test/suite/rpl/t/rpl_loaddata_fatal.test +++ b/mysql-test/suite/rpl/t/rpl_loaddata_fatal.test @@ -15,7 +15,7 @@ connection master; LOAD DATA INFILE '../../std_data/rpl_loaddata.dat' INTO TABLE t1; connection slave; -call mtr.add_suppression("Slave SQL.*Fatal error: Not enough memory, Error_code: 1593"); +call mtr.add_suppression("Slave SQL.*Fatal error: Not enough memory, error.* 1593"); let $slave_sql_errno= 1593; let $show_slave_sql_error= 1; source include/wait_for_slave_sql_error_and_skip.inc; diff --git a/mysql-test/suite/rpl/t/rpl_packet.test b/mysql-test/suite/rpl/t/rpl_packet.test index c49d9490bd9..0e74481bb61 100644 --- a/mysql-test/suite/rpl/t/rpl_packet.test +++ b/mysql-test/suite/rpl/t/rpl_packet.test @@ -11,7 +11,7 @@ # max-out size db name source include/master-slave.inc; source include/have_binlog_format_row.inc; -call mtr.add_suppression("Slave I/O: Got a packet bigger than 'slave_max_allowed_packet' bytes, Error_code: 1153"); +call mtr.add_suppression("Slave I/O: Got a packet bigger than 'slave_max_allowed_packet' bytes, .*error.* 1153"); call mtr.add_suppression("Log entry on master is longer than slave_max_allowed_packet"); let $db= DB_NAME_OF_MAX_LENGTH_AKA_NAME_LEN_64_BYTES_____________________; disable_warnings; diff --git a/mysql-test/suite/rpl/t/rpl_rotate_logs.test b/mysql-test/suite/rpl/t/rpl_rotate_logs.test index 788941b8b39..4dd4fccc363 100644 --- a/mysql-test/suite/rpl/t/rpl_rotate_logs.test +++ b/mysql-test/suite/rpl/t/rpl_rotate_logs.test @@ -95,7 +95,7 @@ set insert_id=1234; insert into t2 values(NULL); connection slave; # 1062 = ER_DUP_ENTRY -call mtr.add_suppression("Slave SQL.*Error .Duplicate entry .1234. for key .PRIMARY.. on query.* Error_code: 1062"); +call mtr.add_suppression("Slave SQL.*Error .Duplicate entry .1234. for key .PRIMARY.. on query.* error.* 1062"); --let $slave_sql_errno= 1062 --source include/wait_for_slave_sql_error_and_skip.inc diff --git a/mysql-test/suite/rpl/t/rpl_row_basic_11bugs.test b/mysql-test/suite/rpl/t/rpl_row_basic_11bugs.test index 23832cd6298..b88001e6a9f 100644 --- a/mysql-test/suite/rpl/t/rpl_row_basic_11bugs.test +++ b/mysql-test/suite/rpl/t/rpl_row_basic_11bugs.test @@ -68,7 +68,7 @@ DROP TABLE t1; --echo **** On Slave **** connection slave; SET GLOBAL QUERY_CACHE_SIZE=0; -call mtr.add_suppression("Slave SQL.*Could not execute Update_rows event on table test.t1.* Error_code: 1032"); +call mtr.add_suppression("Slave SQL.*Could not execute Update_rows event on table test.t1.* error.* 1032"); --echo **** On Master **** connection master; diff --git a/mysql-test/suite/rpl/t/rpl_row_colSize.test b/mysql-test/suite/rpl/t/rpl_row_colSize.test index 0701c44edd3..cdffe2e333b 100644 --- a/mysql-test/suite/rpl/t/rpl_row_colSize.test +++ b/mysql-test/suite/rpl/t/rpl_row_colSize.test @@ -161,8 +161,8 @@ let $test_insert = INSERT INTO t1 VALUES ('This is a test.'); source include/test_fieldsize.inc; connection slave; -call mtr.add_suppression("Slave SQL.*Table definition on master and slave does not match: Column 0 ...e mismatch.* Error_code: 1535"); -call mtr.add_suppression("Slave SQL.*Column 0 of table .test.t1. cannot be converted from type.* Error_code: 1677"); +call mtr.add_suppression("Slave SQL.*Table definition on master and slave does not match: Column 0 ...e mismatch.* error.* 1535"); +call mtr.add_suppression("Slave SQL.*Column 0 of table .test.t1. cannot be converted from type.* error.* 1677"); --echo *** Cleanup *** connection master; diff --git a/mysql-test/suite/rpl/t/rpl_row_conflicts.test b/mysql-test/suite/rpl/t/rpl_row_conflicts.test index 0f525e0f58d..24d14f90bad 100644 --- a/mysql-test/suite/rpl/t/rpl_row_conflicts.test +++ b/mysql-test/suite/rpl/t/rpl_row_conflicts.test @@ -8,7 +8,7 @@ source include/have_binlog_format_row.inc; source include/master-slave.inc; connection slave; -call mtr.add_suppression("Slave: Can\'t find record in \'t1\' Error_code: .*"); +call mtr.add_suppression("Slave: Can\'t find record in \'t1\' error.* .*"); call mtr.add_suppression("Can't find record in 't.'"); --echo [on slave] diff --git a/mysql-test/suite/rpl/t/rpl_row_idempotency.test b/mysql-test/suite/rpl/t/rpl_row_idempotency.test index 7f48d6503c1..cbc04a918dc 100644 --- a/mysql-test/suite/rpl/t/rpl_row_idempotency.test +++ b/mysql-test/suite/rpl/t/rpl_row_idempotency.test @@ -9,10 +9,10 @@ connection slave; source include/have_innodb.inc; # Add suppression for expected warning(s) in slaves error log -call mtr.add_suppression("Can.t find record in .t[12].* Error_code: 1032"); -call mtr.add_suppression("Cannot delete or update a parent row: a foreign key constraint fails .* Error_code: 1451"); -call mtr.add_suppression("Cannot add or update a child row: a foreign key constraint fails .* Error_code: 1452"); -call mtr.add_suppression("Duplicate entry .1. for key .PRIMARY.* Error_code: 1062"); +call mtr.add_suppression("Can.t find record in .t[12].* error.* 1032"); +call mtr.add_suppression("Cannot delete or update a parent row: a foreign key constraint fails .* error.* 1451"); +call mtr.add_suppression("Cannot add or update a child row: a foreign key constraint fails .* error.* 1452"); +call mtr.add_suppression("Duplicate entry .1. for key .PRIMARY.* error.* 1062"); # bug#31609 Not all RBR slave errors reported as errors # bug#31552 Replication breaks when deleting rows from out-of-sync table diff --git a/mysql-test/suite/rpl/t/rpl_row_inexist_tbl.test b/mysql-test/suite/rpl/t/rpl_row_inexist_tbl.test index 22fd65ecaf3..86cf7a245b2 100644 --- a/mysql-test/suite/rpl/t/rpl_row_inexist_tbl.test +++ b/mysql-test/suite/rpl/t/rpl_row_inexist_tbl.test @@ -30,7 +30,7 @@ INSERT INTO t1 VALUES (1); connection slave; # slave should have stopped because can't find table t1 # 1146 = ER_NO_SUCH_TABLE -call mtr.add_suppression("Slave SQL.*Error executing row event: .Table .test.t1. doesn.t exist., Error_code: 1146"); +call mtr.add_suppression("Slave SQL.*Error executing row event: .Table .test.t1. doesn.t exist., error.* 1146"); --let $slave_sql_errno= 1146 --source include/wait_for_slave_sql_error.inc diff --git a/mysql-test/suite/rpl/t/rpl_skip_error.test b/mysql-test/suite/rpl/t/rpl_skip_error.test index 82d6e61a2cd..142cd53b9dd 100644 --- a/mysql-test/suite/rpl/t/rpl_skip_error.test +++ b/mysql-test/suite/rpl/t/rpl_skip_error.test @@ -102,7 +102,7 @@ SET SQL_LOG_BIN=1; connection slave; -call mtr.add_suppression("Slave SQL.*Could not execute .*te_rows event on table test.t.; Duplicate entry.* Error_code: 1062"); +call mtr.add_suppression("Slave SQL.*Could not execute .*te_rows event on table test.t.; Duplicate entry.* error.* 1062"); CREATE TABLE t1(id INT NOT NULL PRIMARY KEY, data INT) Engine=InnoDB; SHOW CREATE TABLE t1; diff --git a/mysql-test/suite/rpl/t/rpl_slave_grp_exec.test b/mysql-test/suite/rpl/t/rpl_slave_grp_exec.test index 4fdc1268b80..426c3c831b0 100644 --- a/mysql-test/suite/rpl/t/rpl_slave_grp_exec.test +++ b/mysql-test/suite/rpl/t/rpl_slave_grp_exec.test @@ -63,7 +63,7 @@ SELECT * FROM t3 ORDER BY a; --connection slave # 1146 = ER_NO_SUCH_TABLE -call mtr.add_suppression("Slave SQL.*Table .test.t3. doesn.t exist.* Error_code: 1146"); +call mtr.add_suppression("Slave SQL.*Table .test.t3. doesn.t exist.* error.* 1146"); --let $slave_sql_errno= 1146 --source include/wait_for_slave_sql_error.inc SHOW TABLES LIKE 't%'; diff --git a/mysql-test/suite/rpl/t/rpl_slave_load_remove_tmpfile.test b/mysql-test/suite/rpl/t/rpl_slave_load_remove_tmpfile.test index 14cf3fc00e9..b1af6e92c29 100644 --- a/mysql-test/suite/rpl/t/rpl_slave_load_remove_tmpfile.test +++ b/mysql-test/suite/rpl/t/rpl_slave_load_remove_tmpfile.test @@ -69,9 +69,9 @@ RESET SLAVE; drop table t1; call mtr.add_suppression("Slave: Can't get stat of .*"); -call mtr.add_suppression("Slave SQL: Error .Can.t get stat of.* Error_code: 13"); +call mtr.add_suppression("Slave SQL: Error .Can.t get stat of.* error.* 13"); call mtr.add_suppression("Slave: File.* not found.*"); -call mtr.add_suppression("Slave SQL: Error .File.* not found.* Error_code: 29"); +call mtr.add_suppression("Slave SQL: Error .File.* not found.* error.* 29"); --let $rpl_only_running_threads= 1 eval SET @@global.debug_dbug= '$old_debug'; diff --git a/mysql-test/suite/rpl/t/rpl_slave_load_tmpdir_not_exist.test b/mysql-test/suite/rpl/t/rpl_slave_load_tmpdir_not_exist.test index b99c71b1ca0..16dcd8ecbd3 100644 --- a/mysql-test/suite/rpl/t/rpl_slave_load_tmpdir_not_exist.test +++ b/mysql-test/suite/rpl/t/rpl_slave_load_tmpdir_not_exist.test @@ -10,8 +10,8 @@ --connection slave START SLAVE; -# Why 12??? -call mtr.add_suppression("Slave SQL.*Unable to use slave.s temporary directory.* Error_code: 12"); +call mtr.add_suppression("Slave SQL.*Unable to use slave.s temporary directory"); +# 12 = EE_CANT_MKDIR --let $slave_sql_errno= 12 source include/wait_for_slave_sql_error.inc; diff --git a/mysql-test/suite/rpl/t/rpl_typeconv.test b/mysql-test/suite/rpl/t/rpl_typeconv.test index efcbe97049f..59d75dd47f5 100644 --- a/mysql-test/suite/rpl/t/rpl_typeconv.test +++ b/mysql-test/suite/rpl/t/rpl_typeconv.test @@ -61,7 +61,7 @@ SELECT RPAD(Source, 15, ' ') AS Source_Type, enable_query_log; DROP TABLE type_conversions; -call mtr.add_suppression("Slave SQL.*Column 1 of table .test.t1. cannot be converted from type.* Error_code: 1677"); +call mtr.add_suppression("Slave SQL.*Column 1 of table .test.t1. cannot be converted from type.* error.* 1677"); connection master; DROP TABLE t1; diff --git a/mysql-test/t/flush_read_lock.test b/mysql-test/t/flush_read_lock.test index 9da93dd40a1..f024bff0af7 100644 --- a/mysql-test/t/flush_read_lock.test +++ b/mysql-test/t/flush_read_lock.test @@ -557,7 +557,7 @@ let $cleanup_stmt= ; --source include/check_ftwrl_compatible.inc deallocate prepare stmt1; -call mtr.add_suppression("Slave SQL.*Can.t execute the query because you have a conflicting read lock., Error_code: 1223"); +call mtr.add_suppression("Slave SQL.*Can.t execute the query because you have a conflicting read lock., error.* 1223"); --echo # --echo # 9.2.b) EXECUTE for statement which is incompatible with FTWRL diff --git a/sql/rpl_reporting.cc b/sql/rpl_reporting.cc index f442f3a37c0..96fe6242ac3 100644 --- a/sql/rpl_reporting.cc +++ b/sql/rpl_reporting.cc @@ -67,7 +67,7 @@ Slave_reporting_capability::report(loglevel level, int err_code, va_end(args); /* If the msg string ends with '.', do not add a ',' it would be ugly */ - report_function("Slave %s: %s%s Error_code: %d", + report_function("Slave %s: %s%s Internal MariaDB error code: %d", m_thread_name, pbuff, (pbuff[0] && *(strend(pbuff)-1) == '.') ? "" : ",", err_code); From 5aa0d185ca18cf538eea5c9c501e1e342b41b274 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 3 May 2013 11:27:29 +0200 Subject: [PATCH 6/9] MDEV-4473: mysql_binlog_send() starts sending events from wrong GTID position in some master failover scenarios Suppose binlog file X has in its Gtid_list_event: 0-1-3,0-2-5, and suppose the slave requests to start replicating after 0-1-3. In this case the bug was that master would start sending events from the start of X. This is wrong, because 0-2-4 and 0-2-5 are contained in X-1, and are needed by the slave. So these events were lost. On the other hand, if the slave requested 0-2-5, then it _is_ correct to start sending from the beginning of binlog file X, because 0-2-5 is the last GTID logged in earlier binlogs. The difference is that 0-2-5 is the last of the GTIDs in the Gtid_list_event. The problem was that the code did not check that the matched GTID was the last one in the list. Fixed by checking if the gtid requested by slave that matches a gtid in the Gtid_list_event is the last event for that domain in the list. If not, go back to a prior binlog to ensure all needed events are sent to slave. mysql-test/include/show_events.inc: Backport --let $binlog_file=LAST, used by MDEV-4473 test case. --- mysql-test/include/show_events.inc | 14 +++- .../suite/rpl/r/rpl_gtid_mdev4473.result | 57 +++++++++++++++ mysql-test/suite/rpl/t/rpl_gtid_mdev4473.cnf | 18 +++++ mysql-test/suite/rpl/t/rpl_gtid_mdev4473.test | 71 +++++++++++++++++++ sql/sql_repl.cc | 43 +++++++++-- 5 files changed, 195 insertions(+), 8 deletions(-) create mode 100644 mysql-test/suite/rpl/r/rpl_gtid_mdev4473.result create mode 100644 mysql-test/suite/rpl/t/rpl_gtid_mdev4473.cnf create mode 100644 mysql-test/suite/rpl/t/rpl_gtid_mdev4473.test diff --git a/mysql-test/include/show_events.inc b/mysql-test/include/show_events.inc index 68baa4050bc..eeae503ce5e 100644 --- a/mysql-test/include/show_events.inc +++ b/mysql-test/include/show_events.inc @@ -18,7 +18,19 @@ if ($is_relay_log) if ($binlog_file) { - --let $_statement= $_statement in '$binlog_file' + --let $_binlog_file= $binlog_file + if ($_binlog_file == 'LAST') + { + if ($is_relay_log) + { + --let $_binlog_file= query_get_value(SHOW SLAVE STATUS, Relay_Log_File, 1) + } + if (!$is_relay_log) + { + --let $_binlog_file= query_get_value(SHOW MASTER STATUS, File, 1) + } + } + --let $_statement= $_statement in '$_binlog_file' } if (!$binlog_start) diff --git a/mysql-test/suite/rpl/r/rpl_gtid_mdev4473.result b/mysql-test/suite/rpl/r/rpl_gtid_mdev4473.result new file mode 100644 index 00000000000..1289bbb7e20 --- /dev/null +++ b/mysql-test/suite/rpl/r/rpl_gtid_mdev4473.result @@ -0,0 +1,57 @@ +include/rpl_init.inc [topology=1->2,1->3] +create table t1 (n int); +insert into t1 values (1); +insert into t1 values (2); +include/stop_slave.inc +include/wait_for_slave_to_stop.inc +include/stop_slave.inc +include/wait_for_slave_to_stop.inc +reset slave all; +CHANGE MASTER TO master_host = '127.0.0.1', master_port = SERVER_MYPORT_2, +master_user='root', MASTER_USE_GTID=1; +include/start_slave.inc +include/wait_for_slave_to_start.inc +flush logs; +insert into t1 values (3); +insert into t1 values (4); +flush logs; +CHANGE MASTER TO master_host = '127.0.0.1', master_port = SERVER_MYPORT_2, +MASTER_USE_GTID=1; +include/start_slave.inc +select * from t1 order by n; +n +1 +2 +3 +4 +show binary logs; +Log_name File_size +master-bin.000001 # +show binlog events in 'master-bin.000001' from ; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Gtid # # GTID #-#-# +master-bin.000001 # Query # # use `test`; create table t1 (n int) +master-bin.000001 # Gtid # # BEGIN GTID #-#-# +master-bin.000001 # Query # # use `test`; insert into t1 values (1) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Gtid # # BEGIN GTID #-#-# +master-bin.000001 # Query # # use `test`; insert into t1 values (2) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Gtid # # BEGIN GTID #-#-# +master-bin.000001 # Query # # use `test`; insert into t1 values (3) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Gtid # # BEGIN GTID #-#-# +master-bin.000001 # Query # # use `test`; insert into t1 values (4) +master-bin.000001 # Query # # COMMIT +include/stop_slave.inc +include/wait_for_slave_to_stop.inc +reset slave all; +CHANGE MASTER TO master_host = '127.0.0.1', master_port = SERVER_MYPORT_1, +master_user = 'root', MASTER_USE_GTID=1; +include/start_slave.inc +include/stop_slave.inc +CHANGE MASTER TO master_host = '127.0.0.1', master_port = SERVER_MYPORT_1, +MASTER_USE_GTID=1; +include/start_slave.inc +drop table t1; +include/rpl_end.inc diff --git a/mysql-test/suite/rpl/t/rpl_gtid_mdev4473.cnf b/mysql-test/suite/rpl/t/rpl_gtid_mdev4473.cnf new file mode 100644 index 00000000000..4fe90e6a281 --- /dev/null +++ b/mysql-test/suite/rpl/t/rpl_gtid_mdev4473.cnf @@ -0,0 +1,18 @@ +!include ../my.cnf + +[mysqld.1] +log-slave-updates +loose-innodb + +[mysqld.2] +log-slave-updates +loose-innodb + +[mysqld.3] +log-slave-updates +loose-innodb + +[ENV] +SERVER_MYPORT_3= @mysqld.3.port +SERVER_MYSOCK_3= @mysqld.3.socket + diff --git a/mysql-test/suite/rpl/t/rpl_gtid_mdev4473.test b/mysql-test/suite/rpl/t/rpl_gtid_mdev4473.test new file mode 100644 index 00000000000..549d11e9d1c --- /dev/null +++ b/mysql-test/suite/rpl/t/rpl_gtid_mdev4473.test @@ -0,0 +1,71 @@ +--source include/have_innodb.inc +--source include/have_binlog_format_mixed.inc + +--let $rpl_topology=1->2,1->3 +--source include/rpl_init.inc + +connection server_1; +create table t1 (n int); +insert into t1 values (1); +insert into t1 values (2); +save_master_pos; + +connection server_3; +sync_with_master; +source include/stop_slave.inc; +source include/wait_for_slave_to_stop.inc; + +connection server_2; +sync_with_master; +source include/stop_slave.inc; +source include/wait_for_slave_to_stop.inc; +reset slave all; + +connection server_1; +--replace_result $SERVER_MYPORT_2 SERVER_MYPORT_2 +eval CHANGE MASTER TO master_host = '127.0.0.1', master_port = $SERVER_MYPORT_2, + master_user='root', MASTER_USE_GTID=1; +source include/start_slave.inc; +source include/wait_for_slave_to_start.inc; + +connection server_2; +flush logs; +insert into t1 values (3); +insert into t1 values (4); +flush logs; +save_master_pos; + +connection server_3; +--replace_result $SERVER_MYPORT_2 SERVER_MYPORT_2 +eval CHANGE MASTER TO master_host = '127.0.0.1', master_port = $SERVER_MYPORT_2, + MASTER_USE_GTID=1; +source include/start_slave.inc; +sync_with_master; + +select * from t1 order by n; +source include/show_binary_logs.inc; +let $binlog_file=LAST; +source include/show_binlog_events.inc; + +connection server_1; +source include/stop_slave.inc; +source include/wait_for_slave_to_stop.inc; +reset slave all; + +connection server_2; +--replace_result $SERVER_MYPORT_1 SERVER_MYPORT_1 +eval CHANGE MASTER TO master_host = '127.0.0.1', master_port = $SERVER_MYPORT_1, + master_user = 'root', MASTER_USE_GTID=1; +source include/start_slave.inc; + +connection server_3; +source include/stop_slave.inc; +--replace_result $SERVER_MYPORT_1 SERVER_MYPORT_1 +eval CHANGE MASTER TO master_host = '127.0.0.1', master_port = $SERVER_MYPORT_1, + MASTER_USE_GTID=1; +source include/start_slave.inc; + +connection server_1; +drop table t1; + +--source include/rpl_end.inc diff --git a/sql/sql_repl.cc b/sql/sql_repl.cc index 1dac2aa2039..32e653cebff 100644 --- a/sql/sql_repl.cc +++ b/sql/sql_repl.cc @@ -703,7 +703,12 @@ get_gtid_list_event(IO_CACHE *cache, Gtid_list_log_event **out_gtid_list) to build an in-memory hash or stuff like that. We need to check that slave did not request GTID D-S-N1, when the - Gtid_list_log_event for this binlog file has D-S-N2 with N2 > N1. + Gtid_list_log_event for this binlog file has D-S-N2 with N2 >= N1. + (Because this means that requested GTID is in an earlier binlog). + However, if the Gtid_list_log_event indicates that D-S-N1 is the very last + GTID for domain D in prior binlog files, then it is ok to start from the + very start of this binlog file. This special case is important, as it + allows to purge old logs even if some domain is unused for long. In addition, we need to check that we do not have a GTID D-S-N3 in the Gtid_list_log_event where D is not present in the requested slave state at @@ -717,7 +722,8 @@ contains_all_slave_gtid(slave_connection_state *st, Gtid_list_log_event *glev) for (i= 0; i < glev->count; ++i) { - const rpl_gtid *gtid= st->find(glev->list[i].domain_id); + uint32 gl_domain_id= glev->list[i].domain_id; + const rpl_gtid *gtid= st->find(gl_domain_id); if (!gtid) { /* @@ -727,13 +733,28 @@ contains_all_slave_gtid(slave_connection_state *st, Gtid_list_log_event *glev) return false; } if (gtid->server_id == glev->list[i].server_id && - gtid->seq_no < glev->list[i].seq_no) + gtid->seq_no <= glev->list[i].seq_no) { /* - The slave needs to receive gtid, but it is contained in an earlier - binlog file. So we need to search back further. + The slave needs to start after gtid, but it is contained in an earlier + binlog file. So we need to search back further, unless it was the very + last gtid logged for the domain in earlier binlog files. */ - return false; + if (gtid->seq_no < glev->list[i].seq_no) + return false; + + /* + The slave requested D-S-N1, which happens to be the last GTID logged + in prior binlog files with same domain id D and server id S. + + The Gtid_list is kept sorted on domain_id, with the last GTID in each + domain_id group being the last one logged. So if this is the last GTID + within the domain_id group, then it is ok to start from the very + beginning of this group, per the special case explained in comment at + the start of this function. If not, then we need to search back further. + */ + if (i+1 < glev->count && gl_domain_id == glev->list[i+1].domain_id) + return false; } } @@ -997,7 +1018,15 @@ gtid_find_binlog_file(slave_connection_state *state, char *out_name) const rpl_gtid *gtid= state->find(glev->list[i].domain_id); if (!gtid) { - /* contains_all_slave_gtid() would have returned false if so. */ + /* + contains_all_slave_gtid() returns false if there is any domain in + Gtid_list_event which is not in the requested slave position. + + We may delete a domain from the slave state inside this loop, but + we only do this when it is the very last GTID logged for that + domain in earlier binlogs, and then we can not encounter it in any + further GTIDs in the Gtid_list. + */ DBUG_ASSERT(0); continue; } From 70e909cb165ff47fcffcb9c485a8f0522f597a3c Mon Sep 17 00:00:00 2001 From: Sergey Petrunya Date: Mon, 20 May 2013 08:06:34 +0400 Subject: [PATCH 7/9] Update test results. --- mysql-test/suite/plugins/r/cassandra.result | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/mysql-test/suite/plugins/r/cassandra.result b/mysql-test/suite/plugins/r/cassandra.result index e26df069f93..65a81c429b0 100644 --- a/mysql-test/suite/plugins/r/cassandra.result +++ b/mysql-test/suite/plugins/r/cassandra.result @@ -74,8 +74,8 @@ Variable_name Value cassandra_insert_batch_size 100 show status like 'cassandra_row_insert%'; Variable_name Value -Cassandra_row_insert_batches 7 Cassandra_row_inserts 8 +Cassandra_row_insert_batches 7 CREATE TABLE t1 (rowkey BIGINT PRIMARY KEY, a BIGINT) ENGINE=CASSANDRA thrift_host='localhost' keyspace='mariadbtest2' column_family = 'cf2'; delete from t1; @@ -84,14 +84,14 @@ DELETE FROM t1 ORDER BY a LIMIT 1; DROP TABLE t1; show status like 'cassandra_row_insert%'; Variable_name Value -Cassandra_row_insert_batches 8 Cassandra_row_inserts 10 +Cassandra_row_insert_batches 8 # FLUSH STATUS doesn't work for our variables, just like with InnoDB. flush status; show status like 'cassandra_row_insert%'; Variable_name Value -Cassandra_row_insert_batches 0 -Cassandra_row_inserts 0 +Cassandra_row_inserts 10 +Cassandra_row_insert_batches 8 # # Batched Key Access # From 52045d40d4fe0df0e60fa37eb35609fcb0fd857a Mon Sep 17 00:00:00 2001 From: Sergey Petrunya Date: Mon, 20 May 2013 08:37:03 +0400 Subject: [PATCH 8/9] MDEV-4000: Mapping between Cassandra blob (BytesType) and MySQL BLOB does not work - Allow SQL blobs in the data mapping. --- mysql-test/suite/plugins/r/cassandra.result | 11 +++++++++++ mysql-test/suite/plugins/t/cassandra.test | 17 +++++++++++++++++ storage/cassandra/ha_cassandra.cc | 1 + 3 files changed, 29 insertions(+) diff --git a/mysql-test/suite/plugins/r/cassandra.result b/mysql-test/suite/plugins/r/cassandra.result index 65a81c429b0..5bd58710dd6 100644 --- a/mysql-test/suite/plugins/r/cassandra.result +++ b/mysql-test/suite/plugins/r/cassandra.result @@ -591,3 +591,14 @@ col_int int, dyncol blob DYNAMIC_COLUMN_STORAGE=yes ) ENGINE=cassandra keyspace='bug' thrift_host = '127.0.0.1' column_family='cf1'; drop table t1; +# +# MDEV-4000: Mapping between Cassandra blob (BytesType) and MySQL BLOB does not work +# +create table t1 (rowkey int primary key, b blob ) ENGINE=CASSANDRA thrift_host = '127.0.0.1' `keyspace`='mariadbtest2' `column_family`='cf13'; +insert into t1 values (1, 'fooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo-bar'); +insert into t1 values (2, 'qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq-baz'); +select * from t1; +rowkey b +1 fooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo-bar +2 qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq-baz +drop table t1; diff --git a/mysql-test/suite/plugins/t/cassandra.test b/mysql-test/suite/plugins/t/cassandra.test index 1543993843a..c7060d673e4 100644 --- a/mysql-test/suite/plugins/t/cassandra.test +++ b/mysql-test/suite/plugins/t/cassandra.test @@ -83,6 +83,8 @@ insert into cf11 (rowkey, decimal_col) values ('val_1234', 1234); create columnfamily cf12 (rowkey varchar primary key, decimal_col decimal); +create columnfamily cf13 (rowkey int primary key, b blob); + EOF --error 0,1,2 --system cqlsh -3 -f $MYSQLTEST_VARDIR/cassandra_test_init.cql @@ -704,6 +706,19 @@ CREATE TABLE t1 ( drop table t1; + +--echo # +--echo # MDEV-4000: Mapping between Cassandra blob (BytesType) and MySQL BLOB does not work +--echo # + +create table t1 (rowkey int primary key, b blob ) ENGINE=CASSANDRA thrift_host = '127.0.0.1' `keyspace`='mariadbtest2' `column_family`='cf13'; + +insert into t1 values (1, 'fooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo-bar'); +insert into t1 values (2, 'qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq-baz'); + +select * from t1; +drop table t1; + ############################################################################ ## Cassandra cleanup ############################################################################ @@ -715,6 +730,8 @@ drop columnfamily cf4; drop columnfamily cf5; drop columnfamily cf6; drop columnfamily cf7; + +drop columnfamily cf13; --enable_parsing ############################################################################ ## Cassandra cleanup ends diff --git a/storage/cassandra/ha_cassandra.cc b/storage/cassandra/ha_cassandra.cc index a9a97806a7e..481b520e79a 100644 --- a/storage/cassandra/ha_cassandra.cc +++ b/storage/cassandra/ha_cassandra.cc @@ -1373,6 +1373,7 @@ ColumnDataConverter *map_field_to_validator(Field *field, const char *validator_ /* fall through: */ case MYSQL_TYPE_VAR_STRING: case MYSQL_TYPE_VARCHAR: + case MYSQL_TYPE_BLOB: { /* Cassandra's "varint" type is a binary-encoded arbitary-length From 08ce9bfe057b6cd31e7fbca4e4e9e48edde242fb Mon Sep 17 00:00:00 2001 From: Vladislav Vaintroub Date: Thu, 23 May 2013 14:52:48 +0200 Subject: [PATCH 9/9] MDEV-4566 : Failing DBUG_ASSERT() in SELECT SLEEP(), with threadpool. This bug only happens with long sleep()s ( > 5 sec), and in debug version. Analysis: The assertion is caused by nested thd_wait_begin() calls, which is not an expected condition. - "outer" thd_wait_begin()) , in Item_func_sleep::val_int() - "inner" thd_wait_begin() in Interruptible_wait::wait(). This function periodically checks whether connection is still valid, via THD::is_connection(), which ends up calling vio_io_wait() with timeout parameter set to 0. Fix is not to call thd wait callback in vio_io_wait(), if timeout parameter is 0. There is no "waiting" in this case. --- mysql-test/r/pool_of_threads.result | 4 ++-- mysql-test/t/pool_of_threads.test | 5 ++++- vio/viosocket.c | 24 ++++++++++++------------ 3 files changed, 18 insertions(+), 15 deletions(-) diff --git a/mysql-test/r/pool_of_threads.result b/mysql-test/r/pool_of_threads.result index 7acb45121d6..c151805e151 100644 --- a/mysql-test/r/pool_of_threads.result +++ b/mysql-test/r/pool_of_threads.result @@ -2157,10 +2157,10 @@ Warnings: Warning 1052 Column 'kundentyp' in group statement is ambiguous drop table t1; SET optimizer_switch=@save_optimizer_switch; -SELECT sleep(5); +SELECT sleep(5.5); SELECT sleep(5); # -- Success: more than --thread_pool_max_threads normal connections not possible -sleep(5) +sleep(5.5) 0 sleep(5) 0 diff --git a/mysql-test/t/pool_of_threads.test b/mysql-test/t/pool_of_threads.test index 4600128ff43..24e0218db62 100644 --- a/mysql-test/t/pool_of_threads.test +++ b/mysql-test/t/pool_of_threads.test @@ -17,7 +17,10 @@ SET optimizer_switch=@save_optimizer_switch; # First set two connections running, and check that extra connection # on normal port fails due to--thread-pool-max_threads=2 connection default; -send SELECT sleep(5); + +# Sleep for slightly longer than 5 sec to trigger MDEV-4566 +# (abort in interruptible wait connection check) +send SELECT sleep(5.5); --sleep 1 connect(con2,localhost,root,,); diff --git a/vio/viosocket.c b/vio/viosocket.c index f84d7e802be..da5f640fc62 100644 --- a/vio/viosocket.c +++ b/vio/viosocket.c @@ -42,21 +42,21 @@ static void (*before_io_wait)(void)= 0; static void (*after_io_wait)(void)= 0; /* Wait callback macros (both performance schema and threadpool */ -#define START_SOCKET_WAIT(locker, state_ptr, sock, which) \ +#define START_SOCKET_WAIT(locker, state_ptr, sock, which, timeout) \ do \ { \ MYSQL_START_SOCKET_WAIT(locker, state_ptr, sock, \ which, 0); \ - if (before_io_wait) \ + if (timeout && before_io_wait) \ before_io_wait(); \ } while(0) -#define END_SOCKET_WAIT(locker) \ +#define END_SOCKET_WAIT(locker,timeout) \ do \ { \ MYSQL_END_SOCKET_WAIT(locker, 0); \ - if (after_io_wait) \ + if (timeout && after_io_wait) \ after_io_wait(); \ } while(0) @@ -930,11 +930,11 @@ int vio_io_wait(Vio *vio, enum enum_vio_io_event event, int timeout) if (timeout != 0 && vio->async_context && vio->async_context->active) { START_SOCKET_WAIT(locker, &state, vio->mysql_socket, - PSI_SOCKET_SELECT); + PSI_SOCKET_SELECT, timeout); ret= my_io_wait_async(vio->async_context, event, timeout); if (ret == 0) errno= SOCKET_ETIMEDOUT; - END_SOCKET_WAIT(locker); + END_SOCKET_WAIT(locker,timeout); DBUG_RETURN(ret); } @@ -959,7 +959,7 @@ int vio_io_wait(Vio *vio, enum enum_vio_io_event event, int timeout) break; } - START_SOCKET_WAIT(locker, &state, vio->mysql_socket, PSI_SOCKET_SELECT); + START_SOCKET_WAIT(locker, &state, vio->mysql_socket, PSI_SOCKET_SELECT, timeout); /* Wait for the I/O event and return early in case of error or timeout. @@ -982,7 +982,7 @@ int vio_io_wait(Vio *vio, enum enum_vio_io_event event, int timeout) break; } - END_SOCKET_WAIT(locker); + END_SOCKET_WAIT(locker, timeout); DBUG_RETURN(ret); } @@ -1004,11 +1004,11 @@ int vio_io_wait(Vio *vio, enum enum_vio_io_event event, int timeout) if (timeout != 0 && vio->async_context && vio->async_context->active) { START_SOCKET_WAIT(locker, &state, vio->mysql_socket, - PSI_SOCKET_SELECT); + PSI_SOCKET_SELECT, timeout); ret= my_io_wait_async(vio->async_context, event, timeout); if (ret == 0) WSASetLastError(SOCKET_ETIMEDOUT); - END_SOCKET_WAIT(locker); + END_SOCKET_WAIT(locker, timeout); DBUG_RETURN(ret); } @@ -1039,12 +1039,12 @@ int vio_io_wait(Vio *vio, enum enum_vio_io_event event, int timeout) break; } - START_SOCKET_WAIT(locker, &state, vio->mysql_socket, PSI_SOCKET_SELECT); + START_SOCKET_WAIT(locker, &state, vio->mysql_socket, PSI_SOCKET_SELECT, timeout); /* The first argument is ignored on Windows. */ ret= select(0, &readfds, &writefds, &exceptfds, (timeout >= 0) ? &tm : NULL); - END_SOCKET_WAIT(locker); + END_SOCKET_WAIT(locker, timeout); /* Set error code to indicate a timeout error. */ if (ret == 0)