summaryrefslogtreecommitdiff
path: root/sql
diff options
context:
space:
mode:
authorunknown <knielsen@knielsen-hq.org>2013-03-27 09:37:54 +0100
committerunknown <knielsen@knielsen-hq.org>2013-03-27 09:37:54 +0100
commit20e021115fac345c8c6a9b6c4d6512e0f93f816a (patch)
treeda82944a3611691bbf5bd64750529b71825b8864 /sql
parent466ceba6f09e83d7d176c750377da0d1c6cd93dd (diff)
downloadmariadb-git-20e021115fac345c8c6a9b6c4d6512e0f93f816a.tar.gz
MDEV-26: Global transaction ID.
Fix MDEV-4329. When user does CHANGE MASTER TO MASTER_GTID_POS='<explicit GTID state>', we check that this state does not conflict with the binlog. But the code forgot to give an error in the case where a domain was completely missing from the requested position (eg. MASTER_GTID_POS='').
Diffstat (limited to 'sql')
-rw-r--r--sql/share/errmsg-utf8.txt2
-rw-r--r--sql/sql_repl.cc7
2 files changed, 8 insertions, 1 deletions
diff --git a/sql/share/errmsg-utf8.txt b/sql/share/errmsg-utf8.txt
index aa19d2c9c05..3ee66ae2a7a 100644
--- a/sql/share/errmsg-utf8.txt
+++ b/sql/share/errmsg-utf8.txt
@@ -6617,3 +6617,5 @@ ER_CANNOT_LOAD_SLAVE_GTID_STATE
eng "Failed to load replication slave GTID state from table %s.%s"
ER_MASTER_GTID_POS_CONFLICTS_WITH_BINLOG
eng "Requested MASTER_GTID_POS %u-%u-%llu conflicts with the binary log which contains a more recent GTID %u-%u-%llu. To use the requested MASTER_GTID_POS, the old binlog must be removed with RESET MASTER to avoid out-of-order binlog"
+ER_MASTER_GTID_POS_MISSING_DOMAIN
+ eng "Requested MASTER_GTID_POS contains no value for replication domain %u. This conflicts with the binary log which contains GTID %u-%u-%llu. To use the requested MASTER_GTID_POS, the old binlog must be removed with RESET MASTER to avoid out-of-order binlog"
diff --git a/sql/sql_repl.cc b/sql/sql_repl.cc
index 3c6a4588c36..57e85810808 100644
--- a/sql/sql_repl.cc
+++ b/sql/sql_repl.cc
@@ -2533,7 +2533,12 @@ bool change_master(THD* thd, Master_info* mi, bool *master_info_added)
if (binlog_gtid->server_id != global_system_variables.server_id)
continue;
if (!(slave_gtid= tmp_slave_state.find(binlog_gtid->domain_id)))
- continue;
+ {
+ my_error(ER_MASTER_GTID_POS_MISSING_DOMAIN, MYF(0),
+ binlog_gtid->domain_id, binlog_gtid->domain_id,
+ binlog_gtid->server_id, binlog_gtid->seq_no);
+ break;
+ }
if (slave_gtid->seq_no < binlog_gtid->seq_no)
{
my_error(ER_MASTER_GTID_POS_CONFLICTS_WITH_BINLOG, MYF(0),