Commit 34bd0d02 authored by unknown's avatar unknown

Merge 10.0-base -> 10.0

parents 2e42130b cc792576
...@@ -61,7 +61,13 @@ include/stop_slave.inc ...@@ -61,7 +61,13 @@ include/stop_slave.inc
INSERT INTO t1 VALUES (5, "m1a"); INSERT INTO t1 VALUES (5, "m1a");
INSERT INTO t2 VALUES (5, "i1a"); INSERT INTO t2 VALUES (5, "i1a");
CHANGE MASTER TO master_host = '127.0.0.1', master_port = MASTER_PORT, CHANGE MASTER TO master_host = '127.0.0.1', master_port = MASTER_PORT,
MASTER_USE_GTID=SLAVE_POS;
SET GLOBAL sql_slave_skip_counter=1;
ERROR HY000: When using GTID, @@sql_slave_skip_counter can not be used. Instead, setting @@gtid_slave_pos explicitly can be used to skip to after a given GTID position.
CHANGE MASTER TO master_host = '127.0.0.1', master_port = MASTER_PORT,
MASTER_USE_GTID=CURRENT_POS; MASTER_USE_GTID=CURRENT_POS;
SET GLOBAL sql_slave_skip_counter=10;
ERROR HY000: When using GTID, @@sql_slave_skip_counter can not be used. Instead, setting @@gtid_slave_pos explicitly can be used to skip to after a given GTID position.
include/start_slave.inc include/start_slave.inc
SELECT * FROM t1 ORDER BY a; SELECT * FROM t1 ORDER BY a;
a b a b
......
...@@ -68,8 +68,16 @@ save_master_pos; ...@@ -68,8 +68,16 @@ save_master_pos;
connection server_4; connection server_4;
--replace_result $MASTER_MYPORT MASTER_PORT --replace_result $MASTER_MYPORT MASTER_PORT
eval CHANGE MASTER TO master_host = '127.0.0.1', master_port = $MASTER_MYPORT,
MASTER_USE_GTID=SLAVE_POS;
# Test that sql_slave_skip_counter is prevented in GTID mode.
--error ER_SLAVE_SKIP_NOT_IN_GTID
SET GLOBAL sql_slave_skip_counter=1;
--replace_result $MASTER_MYPORT MASTER_PORT
eval CHANGE MASTER TO master_host = '127.0.0.1', master_port = $MASTER_MYPORT, eval CHANGE MASTER TO master_host = '127.0.0.1', master_port = $MASTER_MYPORT,
MASTER_USE_GTID=CURRENT_POS; MASTER_USE_GTID=CURRENT_POS;
--error ER_SLAVE_SKIP_NOT_IN_GTID
SET GLOBAL sql_slave_skip_counter=10;
--source include/start_slave.inc --source include/start_slave.inc
sync_with_master; sync_with_master;
SELECT * FROM t1 ORDER BY a; SELECT * FROM t1 ORDER BY a;
......
...@@ -28,6 +28,7 @@ drop table t1; ...@@ -28,6 +28,7 @@ drop table t1;
--connection server_2 --connection server_2
drop table t2; drop table t2;
--save_master_pos
--connection server_3 --connection server_3
--sync_with_master 0,'m2' --sync_with_master 0,'m2'
......
...@@ -6217,6 +6217,16 @@ void Binlog_checkpoint_log_event::pack_info(THD *thd, Protocol *protocol) ...@@ -6217,6 +6217,16 @@ void Binlog_checkpoint_log_event::pack_info(THD *thd, Protocol *protocol)
{ {
protocol->store(binlog_file_name, binlog_file_len, &my_charset_bin); protocol->store(binlog_file_name, binlog_file_len, &my_charset_bin);
} }
Log_event::enum_skip_reason
Binlog_checkpoint_log_event::do_shall_skip(rpl_group_info *rgi)
{
enum_skip_reason reason= Log_event::do_shall_skip(rgi);
if (reason == EVENT_SKIP_COUNT)
reason= EVENT_SKIP_NOT;
return reason;
}
#endif #endif
...@@ -6778,6 +6788,16 @@ Gtid_list_log_event::do_apply_event(rpl_group_info *rgi) ...@@ -6778,6 +6788,16 @@ Gtid_list_log_event::do_apply_event(rpl_group_info *rgi)
} }
Log_event::enum_skip_reason
Gtid_list_log_event::do_shall_skip(rpl_group_info *rgi)
{
enum_skip_reason reason= Log_event::do_shall_skip(rgi);
if (reason == EVENT_SKIP_COUNT)
reason= EVENT_SKIP_NOT;
return reason;
}
void void
Gtid_list_log_event::pack_info(THD *thd, Protocol *protocol) Gtid_list_log_event::pack_info(THD *thd, Protocol *protocol)
{ {
......
...@@ -3075,6 +3075,7 @@ class Binlog_checkpoint_log_event: public Log_event ...@@ -3075,6 +3075,7 @@ class Binlog_checkpoint_log_event: public Log_event
bool is_valid() const { return binlog_file_name != 0; } bool is_valid() const { return binlog_file_name != 0; }
#ifdef MYSQL_SERVER #ifdef MYSQL_SERVER
bool write(IO_CACHE* file); bool write(IO_CACHE* file);
enum_skip_reason do_shall_skip(rpl_group_info *rgi);
#endif #endif
}; };
...@@ -3292,6 +3293,7 @@ class Gtid_list_log_event: public Log_event ...@@ -3292,6 +3293,7 @@ class Gtid_list_log_event: public Log_event
bool to_packet(String *packet); bool to_packet(String *packet);
bool write(IO_CACHE *file); bool write(IO_CACHE *file);
virtual int do_apply_event(rpl_group_info *rgi); virtual int do_apply_event(rpl_group_info *rgi);
enum_skip_reason do_shall_skip(rpl_group_info *rgi);
#endif #endif
static bool peek(const char *event_start, uint32 event_len, static bool peek(const char *event_start, uint32 event_len,
uint8 checksum_alg, uint8 checksum_alg,
......
...@@ -7065,3 +7065,5 @@ ER_PRIOR_COMMIT_FAILED ...@@ -7065,3 +7065,5 @@ ER_PRIOR_COMMIT_FAILED
eng "Commit failed due to failure of an earlier commit on which this one depends" eng "Commit failed due to failure of an earlier commit on which this one depends"
ER_IT_IS_A_VIEW 42S02 ER_IT_IS_A_VIEW 42S02
eng "'%-.192s' is a view" eng "'%-.192s' is a view"
ER_SLAVE_SKIP_NOT_IN_GTID
eng "When using GTID, @@sql_slave_skip_counter can not be used. Instead, setting @@gtid_slave_pos explicitly can be used to skip to after a given GTID position."
...@@ -4179,13 +4179,18 @@ bool update_multi_source_variable(sys_var *self_var, THD *thd, ...@@ -4179,13 +4179,18 @@ bool update_multi_source_variable(sys_var *self_var, THD *thd,
static bool update_slave_skip_counter(sys_var *self, THD *thd, Master_info *mi) static bool update_slave_skip_counter(sys_var *self, THD *thd, Master_info *mi)
{ {
if (mi->using_gtid != Master_info::USE_GTID_NO)
{
my_error(ER_SLAVE_SKIP_NOT_IN_GTID, MYF(0));
return true;
}
if (mi->rli.slave_running) if (mi->rli.slave_running)
{ {
my_error(ER_SLAVE_MUST_STOP, MYF(0), mi->connection_name.length, my_error(ER_SLAVE_MUST_STOP, MYF(0), mi->connection_name.length,
mi->connection_name.str); mi->connection_name.str);
return true; return true;
} }
/* The value was stored temporarly in thd */ /* The value was stored temporarily in thd */
mi->rli.slave_skip_counter= thd->variables.slave_skip_counter; mi->rli.slave_skip_counter= thd->variables.slave_skip_counter;
return false; return false;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment