diff options
author | unknown <knielsen@knielsen-hq.org> | 2013-06-20 09:04:44 +0200 |
---|---|---|
committer | unknown <knielsen@knielsen-hq.org> | 2013-06-20 09:04:44 +0200 |
commit | 03fb90f3a770bceca743c26533af4d99c8fa9549 (patch) | |
tree | edc36b9bc70dc7b17569cd379bd17963d339d80e /sql | |
parent | 35360ec452bbd5b7f4068859f524e98641bbbf50 (diff) | |
download | mariadb-git-03fb90f3a770bceca743c26533af4d99c8fa9549.tar.gz |
MDEV-4686: Temporary variable for sub_id is 32-bit, should be 64-bit
Fix wrong type for sub_id, which would cause overflow grief on
long-running server. Also some related renames for consistency.
Diffstat (limited to 'sql')
-rw-r--r-- | sql/rpl_gtid.cc | 6 | ||||
-rw-r--r-- | sql/rpl_gtid.h | 2 | ||||
-rw-r--r-- | sql/slave.cc | 2 |
3 files changed, 5 insertions, 5 deletions
diff --git a/sql/rpl_gtid.cc b/sql/rpl_gtid.cc index 71b18e64842..d8e79c1e002 100644 --- a/sql/rpl_gtid.cc +++ b/sql/rpl_gtid.cc @@ -462,9 +462,9 @@ end: uint64 -rpl_slave_state::next_subid(uint32 domain_id) +rpl_slave_state::next_sub_id(uint32 domain_id) { - uint32 sub_id= 0; + uint64 sub_id= 0; element *elem; lock(); @@ -722,7 +722,7 @@ rpl_slave_state::load(THD *thd, char *state_from_master, size_t len, uint64 sub_id; if (gtid_parser_helper(&state_from_master, end, >id) || - !(sub_id= next_subid(gtid.domain_id)) || + !(sub_id= next_sub_id(gtid.domain_id)) || record_gtid(thd, >id, sub_id, false, in_statement) || update(gtid.domain_id, gtid.server_id, sub_id, gtid.seq_no)) return 1; diff --git a/sql/rpl_gtid.h b/sql/rpl_gtid.h index 4d5302020bf..1a94ee76eca 100644 --- a/sql/rpl_gtid.h +++ b/sql/rpl_gtid.h @@ -92,7 +92,7 @@ struct rpl_slave_state int truncate_state_table(THD *thd); int record_gtid(THD *thd, const rpl_gtid *gtid, uint64 sub_id, bool in_transaction, bool in_statement); - uint64 next_subid(uint32 domain_id); + uint64 next_sub_id(uint32 domain_id); int iterate(int (*cb)(rpl_gtid *, void *), void *data, rpl_gtid *extra_gtids, uint32 num_extra); int tostring(String *dest, rpl_gtid *extra_gtids, uint32 num_extra); diff --git a/sql/slave.cc b/sql/slave.cc index 1734b2c4f76..83260e9aac7 100644 --- a/sql/slave.cc +++ b/sql/slave.cc @@ -5823,7 +5823,7 @@ static Log_event* next_event(Relay_log_info* rli) if (ev->get_type_code() == GTID_EVENT) { Gtid_log_event *gev= static_cast<Gtid_log_event *>(ev); - uint64 sub_id= rpl_global_gtid_slave_state.next_subid(gev->domain_id); + uint64 sub_id= rpl_global_gtid_slave_state.next_sub_id(gev->domain_id); if (!sub_id) { errmsg = "slave SQL thread aborted because of out-of-memory error"; |