summaryrefslogtreecommitdiff
path: root/sql/log_event.cc
diff options
context:
space:
mode:
authorunknown <knielsen@knielsen-hq.org>2013-01-22 15:18:36 +0100
committerunknown <knielsen@knielsen-hq.org>2013-01-22 15:18:36 +0100
commit0b36233acd53299f8721d9229698e97b72c90d93 (patch)
tree643a5e4b7f5269c012dea853c54d732af18ba3fa /sql/log_event.cc
parentbdbce30dee9bf550cf09e5d9098bc2a7e0ad940e (diff)
downloadmariadb-git-0b36233acd53299f8721d9229698e97b72c90d93.tar.gz
MDEV-26. Intermediate commit.
Implement CHANGE MASTER TO MASTER_GTID_POS=xxx.
Diffstat (limited to 'sql/log_event.cc')
-rw-r--r--sql/log_event.cc29
1 files changed, 23 insertions, 6 deletions
diff --git a/sql/log_event.cc b/sql/log_event.cc
index 7a32a812214..3f008b30aa7 100644
--- a/sql/log_event.cc
+++ b/sql/log_event.cc
@@ -6292,7 +6292,6 @@ rpl_slave_state::tostring(String *dest)
{
bool first= true;
uint32 i;
- int err= 1;
lock();
@@ -6303,9 +6302,8 @@ rpl_slave_state::tostring(String *dest)
element *e= (element *)my_hash_element(&hash, i);
list_element *l= e->list;
- DBUG_ASSERT(l /* We should never have empty list in element. */);
if (!l)
- goto err;
+ continue; /* Nothing here */
best_gtid.domain_id= e->domain_id;
best_gtid.server_id= l->server_id;
@@ -6332,11 +6330,30 @@ rpl_slave_state::tostring(String *dest)
dest->append_ulonglong(best_gtid.seq_no);
}
- err= 0;
+ unlock();
+ return 0;
+}
+
-err:
+bool
+rpl_slave_state::is_empty()
+{
+ uint32 i;
+ bool result= true;
+
+ lock();
+ for (i= 0; i < hash.records; ++i)
+ {
+ element *e= (element *)my_hash_element(&hash, i);
+ if (e->list)
+ {
+ result= false;
+ break;
+ }
+ }
unlock();
- return err;
+
+ return result;
}