Skip to content

Commit b0852d8

Browse files
author
Shivji Kumar Jha
committed
BUG#15833516 - SQL_SLAVE_SKIP_COUNTER DOES NOT SKIP ERRORS WITH GTID_MODE ON
merge from mysql-5.6 into mysql-trunk
2 parents 9c6a0e7 + 30860ee commit b0852d8

9 files changed

+26
-16
lines changed

mysql-test/extra/rpl_tests/rpl_loaddata.test

+4-4
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ save_master_pos;
7070
connection slave;
7171
# 1062 = ER_DUP_ENTRY
7272
call mtr.add_suppression("Slave SQL.*Error .Duplicate entry .10. for key .b.. on query.* Error_code: 1062");
73-
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: 1860");
73+
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: 1861");
7474
call mtr.add_suppression("The slave coordinator and worker threads are stopped, possibly leaving data in inconsistent state");
7575
--let $slave_sql_errno= 1062
7676
--source include/wait_for_slave_sql_error_and_skip.inc
@@ -161,10 +161,10 @@ if (`SELECT @@global.binlog_format != 'ROW'`)
161161
# Query causes error on master but not on slave. This causes the slave to
162162
# stop with error code 0 (which is wrong: see BUG#57287)
163163
# A new error code ER_INCONSISTENT_ERROR has been introduced instead of 0.
164-
# The error code is 1860
164+
# The error code is 1861
165165
# 1756 = ER_MTS_INCONSISTENT_DATA
166-
# 1860 = ER_INCONSISTENT_ERROR
167-
--let $slave_sql_errno= 1860,1756
166+
# 1861 = ER_INCONSISTENT_ERROR
167+
--let $slave_sql_errno= 1861,1756
168168
--source include/wait_for_slave_sql_error.inc
169169
drop table t1, t2;
170170
}

mysql-test/extra/rpl_tests/rpl_stm_EE_err2.test

+3-3
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,13 @@ insert into t1 values(1),(2);
2424
drop table t1;
2525

2626
connection slave;
27-
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: 1860");
27+
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: 1861");
2828
call mtr.add_suppression("The slave coordinator and worker threads are stopped, possibly leaving data in inconsistent state");
2929

3030
--echo (expect different error codes on master and slave)
3131
# 1756 = ER_MTS_INCONSISTENT_DATA
32-
# 1860 = ER_INCONSISTENT_ERROR
33-
--let $slave_sql_errno= 1860,1756
32+
# 1861 = ER_INCONSISTENT_ERROR
33+
--let $slave_sql_errno= 1861,1756
3434
# can't print error text. MTS reports a separate error in this case.
3535
# Todo: to fix single-threaded-slave BUG#57287.
3636
--let $show_slave_sql_error= 0

mysql-test/r/insert.result

+2-2
Original file line numberDiff line numberDiff line change
@@ -577,10 +577,10 @@ DROP TABLE t1;
577577
CREATE TABLE t1( a INT );
578578
INSERT DELAYED INTO t1 VALUES ( 1 );
579579
Warnings:
580-
Warning 1863 INSERT DELAYED is no longer supported. The statement was converted to INSERT.
580+
Warning 1864 INSERT DELAYED is no longer supported. The statement was converted to INSERT.
581581
REPLACE DELAYED INTO t1 VALUES ( 1 );
582582
Warnings:
583-
Warning 1863 REPLACE DELAYED is no longer supported. The statement was converted to REPLACE.
583+
Warning 1864 REPLACE DELAYED is no longer supported. The statement was converted to REPLACE.
584584
DROP TABLE t1;
585585
SET GLOBAL delayed_insert_limit = DEFAULT;
586586
Warnings:

mysql-test/suite/rpl/r/rpl_loaddata.result

+2-2
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ create table t1(a int, b int, unique(b));
3131
insert into t1 values(1,10);
3232
load data infile '../../std_data/rpl_loaddata.dat' into table t1;
3333
call mtr.add_suppression("Slave SQL.*Error .Duplicate entry .10. for key .b.. on query.* Error_code: 1062");
34-
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: 1860");
34+
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: 1861");
3535
call mtr.add_suppression("The slave coordinator and worker threads are stopped, possibly leaving data in inconsistent state");
3636
include/wait_for_slave_sql_error_and_skip.inc [errno=1062]
3737
include/check_slave_no_error.inc
@@ -82,7 +82,7 @@ load data infile '../../std_data/rpl_loaddata2.dat' into table t2 fields
8282
terminated by ',' optionally enclosed by '%' escaped by '@' lines terminated by
8383
'\n##\n' starting by '>' ignore 1 lines;
8484
ERROR 23000: Duplicate entry '2003-03-22' for key 'day'
85-
include/wait_for_slave_sql_error.inc [errno=1860,1756]
85+
include/wait_for_slave_sql_error.inc [errno=1861,1756]
8686
drop table t1, t2;
8787
drop table t1, t2;
8888
CREATE TABLE t1 (word CHAR(20) NOT NULL PRIMARY KEY) ENGINE=INNODB;

mysql-test/suite/rpl/r/rpl_stm_000001.result

+1-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ select (@id := id) - id from t2;
5454
kill @id;
5555
drop table t2;
5656
Got one of the listed errors
57-
include/wait_for_slave_sql_error.inc [errno=1859]
57+
include/wait_for_slave_sql_error.inc [errno=1860]
5858
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=1;
5959
include/start_slave.inc
6060
select count(*) from t1;

mysql-test/suite/rpl/r/rpl_stm_EE_err2.result

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ set sql_log_bin=1;
1010
insert into t1 values(1),(2);
1111
ERROR 23000: Duplicate entry '2' for key 'a'
1212
drop table t1;
13-
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: 1860");
13+
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: 1861");
1414
call mtr.add_suppression("The slave coordinator and worker threads are stopped, possibly leaving data in inconsistent state");
1515
(expect different error codes on master and slave)
16-
include/wait_for_slave_sql_error.inc [errno=1860,1756]
16+
include/wait_for_slave_sql_error.inc [errno=1861,1756]
1717
drop table t1;
1818
include/stop_slave.inc
1919
RESET SLAVE;

mysql-test/suite/rpl/r/rpl_stm_loaddata_concurrent.result

+2-2
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ create table t1(a int, b int, unique(b));
4747
insert into t1 values(1,10);
4848
load data CONCURRENT infile '../../std_data/rpl_loaddata.dat' into table t1;
4949
call mtr.add_suppression("Slave SQL.*Error .Duplicate entry .10. for key .b.. on query.* Error_code: 1062");
50-
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: 1860");
50+
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: 1861");
5151
call mtr.add_suppression("The slave coordinator and worker threads are stopped, possibly leaving data in inconsistent state");
5252
include/wait_for_slave_sql_error_and_skip.inc [errno=1062]
5353
include/check_slave_no_error.inc
@@ -98,7 +98,7 @@ load data CONCURRENT infile '../../std_data/rpl_loaddata2.dat' into table t2 fie
9898
terminated by ',' optionally enclosed by '%' escaped by '@' lines terminated by
9999
'\n##\n' starting by '>' ignore 1 lines;
100100
ERROR 23000: Duplicate entry '2003-03-22' for key 'day'
101-
include/wait_for_slave_sql_error.inc [errno=1860,1756]
101+
include/wait_for_slave_sql_error.inc [errno=1861,1756]
102102
drop table t1, t2;
103103
drop table t1, t2;
104104
CREATE TABLE t1 (word CHAR(20) NOT NULL PRIMARY KEY) ENGINE=INNODB;

sql/share/errmsg-utf8.txt

+3
Original file line numberDiff line numberDiff line change
@@ -6944,6 +6944,9 @@ ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_CHANGE_FTS
69446944
ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_FTS
69456945
eng "Fulltext index creation requires a lock"
69466946

6947+
ER_SQL_SLAVE_SKIP_COUNTER_NOT_SETTABLE_IN_GTID_MODE
6948+
eng "sql_slave_skip_counter can not be set when the server is running with GTID_MODE = ON. Instead, for each transaction that you want to skip, generate an empty transaction with the same GTID as the transaction"
6949+
69476950
#
69486951
# End of 5.6 error messages.
69496952
#

sql/sys_vars.cc

+7
Original file line numberDiff line numberDiff line change
@@ -3948,6 +3948,13 @@ static bool check_slave_skip_counter(sys_var *self, THD *thd, set_var *var)
39483948
my_message(ER_SLAVE_MUST_STOP, ER(ER_SLAVE_MUST_STOP), MYF(0));
39493949
result= true;
39503950
}
3951+
if (gtid_mode == 3)
3952+
{
3953+
my_message(ER_SQL_SLAVE_SKIP_COUNTER_NOT_SETTABLE_IN_GTID_MODE,
3954+
ER(ER_SQL_SLAVE_SKIP_COUNTER_NOT_SETTABLE_IN_GTID_MODE),
3955+
MYF(0));
3956+
result= true;
3957+
}
39513958
mysql_mutex_unlock(&active_mi->rli->run_lock);
39523959
}
39533960
mysql_mutex_unlock(&LOCK_active_mi);

0 commit comments

Comments
 (0)