summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrei Elkin <andrei.elkin@mariadb.com>2020-03-01 21:59:29 +0200
committerAndrei Elkin <andrei.elkin@mariadb.com>2020-06-12 11:25:27 +0300
commite156a8da08955445727385aee34ac9e2c735e4bd (patch)
tree138be428036d81cb0b3ceb2dd030757927e88a60
parent762bf7a03b6214f091a66ca8683df341112d7d4a (diff)
downloadmariadb-git-e156a8da08955445727385aee34ac9e2c735e4bd.tar.gz
MDEV-21851: Error in BINLOG_BASE64_EVENT i s always error-logged as if it is done by Slave
The prefix of error log message out of a failed BINLOG applying is corrected to be the sql command name.
-rw-r--r--mysql-test/suite/binlog/include/binlog.test2
-rw-r--r--mysql-test/suite/binlog/r/binlog_base64_flag.result2
-rw-r--r--mysql-test/suite/binlog/r/binlog_row_binlog.result2
-rw-r--r--mysql-test/suite/binlog/r/binlog_stm_binlog.result2
-rw-r--r--mysql-test/suite/binlog/t/binlog_base64_flag.test4
-rw-r--r--sql/rpl_reporting.cc4
-rw-r--r--sql/rpl_rli.cc4
-rw-r--r--sql/rpl_rli.h4
-rw-r--r--sql/sql_binlog.cc2
9 files changed, 16 insertions, 10 deletions
diff --git a/mysql-test/suite/binlog/include/binlog.test b/mysql-test/suite/binlog/include/binlog.test
index e5d4efb183b..368dcebc5f1 100644
--- a/mysql-test/suite/binlog/include/binlog.test
+++ b/mysql-test/suite/binlog/include/binlog.test
@@ -391,7 +391,7 @@ SHOW SESSION VARIABLES LIKE "unique_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_v1 event on table test.t1; Duplicate entry .2. for key .PRIMARY., Error_code: 1062");
+call mtr.add_suppression("BINLOG_BASE64_EVENT.*Could not execute Write_rows_v1 event on table test.t1; Duplicate entry .2. for key .PRIMARY., Error_code: 1062");
--error 1062
BINLOG '
dfLtTBMBAAAAKQAAAKsBAAAAABcAAAAAAAEABHRlc3QAAnQxAAEDAAE=
diff --git a/mysql-test/suite/binlog/r/binlog_base64_flag.result b/mysql-test/suite/binlog/r/binlog_base64_flag.result
index a12e0d8eb31..a75164992d5 100644
--- a/mysql-test/suite/binlog/r/binlog_base64_flag.result
+++ b/mysql-test/suite/binlog/r/binlog_base64_flag.result
@@ -1,3 +1,5 @@
+call mtr.add_suppression("BINLOG_BASE64_EVENT: According to the master's version");
+call mtr.add_suppression("BINLOG_BASE64_EVENT: Column 1 of table 'test.char128_utf8' cannot be converted");
DROP TABLE IF EXISTS t1;
==== Test BUG#32407 ====
select * from t1;
diff --git a/mysql-test/suite/binlog/r/binlog_row_binlog.result b/mysql-test/suite/binlog/r/binlog_row_binlog.result
index 2d79de6960a..7715d0e0325 100644
--- a/mysql-test/suite/binlog/r/binlog_row_binlog.result
+++ b/mysql-test/suite/binlog/r/binlog_row_binlog.result
@@ -1054,7 +1054,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_v1 event on table test.t1; Duplicate entry .2. for key .PRIMARY., Error_code: 1062");
+call mtr.add_suppression("BINLOG_BASE64_EVENT.*Could not execute Write_rows_v1 event on table test.t1; Duplicate entry .2. for key .PRIMARY., Error_code: 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 ccc3db2ba7e..ad14a31381d 100644
--- a/mysql-test/suite/binlog/r/binlog_stm_binlog.result
+++ b/mysql-test/suite/binlog/r/binlog_stm_binlog.result
@@ -650,7 +650,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_v1 event on table test.t1; Duplicate entry .2. for key .PRIMARY., Error_code: 1062");
+call mtr.add_suppression("BINLOG_BASE64_EVENT.*Could not execute Write_rows_v1 event on table test.t1; Duplicate entry .2. for key .PRIMARY., Error_code: 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 e1187cd895c..5311da54f5f 100644
--- a/mysql-test/suite/binlog/t/binlog_base64_flag.test
+++ b/mysql-test/suite/binlog/t/binlog_base64_flag.test
@@ -9,10 +9,12 @@
# BINLOG statement does not work in embedded mode.
source include/not_embedded.inc;
+call mtr.add_suppression("BINLOG_BASE64_EVENT: According to the master's version");
+call mtr.add_suppression("BINLOG_BASE64_EVENT: Column 1 of table 'test.char128_utf8' cannot be converted");
+
disable_warnings;
DROP TABLE IF EXISTS t1;
enable_warnings;
-
# Test to show BUG#32407. This reads a binlog created with the
# mysql-5.1-telco-6.1 tree, specifically at the tag
# mysql-5.1.15-ndb-6.1.23, and applies it to the database. The test
diff --git a/sql/rpl_reporting.cc b/sql/rpl_reporting.cc
index 738ae52782d..aa69168d44c 100644
--- a/sql/rpl_reporting.cc
+++ b/sql/rpl_reporting.cc
@@ -19,6 +19,7 @@
#include "rpl_reporting.h"
#include "log.h" // sql_print_error, sql_print_warning,
// sql_print_information
+#include "sql_class.h"
Slave_reporting_capability::Slave_reporting_capability(char const *thread_name)
: m_thread_name(thread_name)
@@ -70,7 +71,8 @@ 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 %s%sInternal MariaDB error code: %d",
+ report_function("%s %s: %s%s %s%sInternal MariaDB error code: %d",
+ (current_thd && current_thd->rgi_fake) ? "" : "Slave",
m_thread_name, pbuff,
(pbuff[0] && *(strend(pbuff)-1) == '.') ? "" : ",",
(extra_info ? extra_info : ""), (extra_info ? ", " : ""),
diff --git a/sql/rpl_rli.cc b/sql/rpl_rli.cc
index c11889a08cd..d8ef17e3494 100644
--- a/sql/rpl_rli.cc
+++ b/sql/rpl_rli.cc
@@ -46,8 +46,8 @@ gtid_waiting rpl_global_gtid_waiting;
const char *const Relay_log_info::state_delaying_string = "Waiting until MASTER_DELAY seconds after master executed event";
-Relay_log_info::Relay_log_info(bool is_slave_recovery)
- :Slave_reporting_capability("SQL"),
+Relay_log_info::Relay_log_info(bool is_slave_recovery, const char* thread_name)
+ :Slave_reporting_capability(thread_name),
replicate_same_server_id(::replicate_same_server_id),
info_fd(-1), cur_log_fd(-1), relay_log(&sync_relaylog_period),
sync_counter(0), is_relay_log_recovery(is_slave_recovery),
diff --git a/sql/rpl_rli.h b/sql/rpl_rli.h
index f89b40b1efc..4223e015ecd 100644
--- a/sql/rpl_rli.h
+++ b/sql/rpl_rli.h
@@ -387,11 +387,11 @@ public:
*/
slave_connection_state restart_gtid_pos;
- Relay_log_info(bool is_slave_recovery);
+ Relay_log_info(bool is_slave_recovery, const char* thread_name= "SQL");
~Relay_log_info();
/*
- Invalidate cached until_log_name and group_relay_log_name comparison
+ Invalidate cached until_log_name and group_relay_log_name comparison
result. Should be called after any update of group_realy_log_name if
there chances that sql_thread is running.
*/
diff --git a/sql/sql_binlog.cc b/sql/sql_binlog.cc
index 4895eebdeb2..0011487f1dc 100644
--- a/sql/sql_binlog.cc
+++ b/sql/sql_binlog.cc
@@ -211,7 +211,7 @@ void mysql_client_binlog_statement(THD* thd)
size_t coded_len= 0, decoded_len= 0;
rli= thd->rli_fake;
- if (!rli && (rli= thd->rli_fake= new Relay_log_info(FALSE)))
+ if (!rli && (rli= thd->rli_fake= new Relay_log_info(FALSE, "BINLOG_BASE64_EVENT")))
rli->sql_driver_thd= thd;
if (!(rgi= thd->rgi_fake))
rgi= thd->rgi_fake= new rpl_group_info(rli);