diff options
author | Nirbhay Choubey <nirbhay@mariadb.com> | 2015-02-27 23:33:22 -0500 |
---|---|---|
committer | Nirbhay Choubey <nirbhay@mariadb.com> | 2015-02-27 23:33:22 -0500 |
commit | 75a27eeaf7a0bcdd3888e1bbaf5d55c573d7696b (patch) | |
tree | 1d1a725000bcb2822b3252b421ed84ccc6d102dd /sql/rpl_gtid.h | |
parent | 34d86ac9ff664972d2031e3fabf6c4a407e32c8a (diff) | |
download | mariadb-git-75a27eeaf7a0bcdd3888e1bbaf5d55c573d7696b.tar.gz |
MDEV-4987: Sort by domain_id when list of GTIDs are output
Added logic to sort gtid list based on domain_id before
populating them in string. Added a test case.
Diffstat (limited to 'sql/rpl_gtid.h')
-rw-r--r-- | sql/rpl_gtid.h | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/sql/rpl_gtid.h b/sql/rpl_gtid.h index b203f34df5a..bd58d091a02 100644 --- a/sql/rpl_gtid.h +++ b/sql/rpl_gtid.h @@ -159,6 +159,8 @@ struct rpl_slave_state HASH hash; /* Mutex protecting access to the state. */ mysql_mutex_t LOCK_slave_state; + /* Auxiliary buffer to sort gtid list. */ + DYNAMIC_ARRAY gtid_sort_array; uint64 last_sub_id; bool inited; @@ -178,7 +180,8 @@ struct rpl_slave_state bool in_transaction, bool in_statement); uint64 next_sub_id(uint32 domain_id); int iterate(int (*cb)(rpl_gtid *, void *), void *data, - rpl_gtid *extra_gtids, uint32 num_extra); + rpl_gtid *extra_gtids, uint32 num_extra, + bool sort); int tostring(String *dest, rpl_gtid *extra_gtids, uint32 num_extra); bool domain_to_gtid(uint32 domain_id, rpl_gtid *out_gtid); int load(THD *thd, char *state_from_master, size_t len, bool reset, @@ -228,6 +231,9 @@ struct rpl_binlog_state mysql_mutex_t LOCK_binlog_state; my_bool initialized; + /* Auxiliary buffer to sort gtid list. */ + DYNAMIC_ARRAY gtid_sort_array; + rpl_binlog_state(); ~rpl_binlog_state(); @@ -271,6 +277,9 @@ struct slave_connection_state /* Mapping from domain_id to the entry with GTID requested for that domain. */ HASH hash; + /* Auxiliary buffer to sort gtid list. */ + DYNAMIC_ARRAY gtid_sort_array; + slave_connection_state(); ~slave_connection_state(); |