summaryrefslogtreecommitdiff
path: root/sql/rpl_rli.cc
diff options
context:
space:
mode:
authorMonty <monty@mariadb.org>2015-11-29 17:51:23 +0200
committerMonty <monty@mariadb.org>2015-11-29 17:51:23 +0200
commitc3018b0ff4fb02c029787d03867adf0530607bab (patch)
treec3497838c222af9445a16312ecbd0e78ebc62f66 /sql/rpl_rli.cc
parent654547b5b4b21aec719a84149595464364c96eea (diff)
downloadmariadb-git-c3018b0ff4fb02c029787d03867adf0530607bab.tar.gz
Fixes to get all test to run on MacosX Lion 10.7
This includes fixing all utilities to not have any memory leaks, as safemalloc warnings stopped tests from passing on MacOSX. - Ensure that all clients takes character-set-dir, as the libmysqlclient library will use it. - mysql-test-run now passes character-set-dir to all external clients. - Changed dynstr_free() so that it can be called twice (made freeing code easier) - Changed rpl_global_gtid_slave_state to be allocated dynamicly as it includes a mutex that needs to be initizlied/destroyed before my_end() is called. - Removed rpl_slave_state::init() and rpl_slave_stage::deinit() as their job are better handling by constructor and delete. - Print alias instead of table_name in check_duplicate_key as table_name may have been converted to lower case. Other things: - Fixed a case in time_to_datetime_with_warn() where we where using && instead of & in tests
Diffstat (limited to 'sql/rpl_rli.cc')
-rw-r--r--sql/rpl_rli.cc30
1 files changed, 15 insertions, 15 deletions
diff --git a/sql/rpl_rli.cc b/sql/rpl_rli.cc
index 3b2fea93c3b..8c7724d88a3 100644
--- a/sql/rpl_rli.cc
+++ b/sql/rpl_rli.cc
@@ -37,7 +37,7 @@ static int count_relay_log_space(Relay_log_info* rli);
Current replication state (hash of last GTID executed, per replication
domain).
*/
-rpl_slave_state rpl_global_gtid_slave_state;
+rpl_slave_state *rpl_global_gtid_slave_state;
/* Object used for MASTER_GTID_WAIT(). */
gtid_waiting rpl_global_gtid_waiting;
@@ -1340,7 +1340,7 @@ void Relay_log_info::stmt_done(my_off_t event_master_log_pos, THD *thd,
else
{
inc_group_relay_log_pos(event_master_log_pos, rgi);
- if (rpl_global_gtid_slave_state.record_and_update_gtid(thd, rgi))
+ if (rpl_global_gtid_slave_state->record_and_update_gtid(thd, rgi))
{
report(WARNING_LEVEL, ER_CANNOT_UPDATE_GTID_STATE, rgi->gtid_info(),
"Failed to update GTID state in %s.%s, slave state may become "
@@ -1466,9 +1466,9 @@ rpl_load_gtid_slave_state(THD *thd)
uint32 i;
DBUG_ENTER("rpl_load_gtid_slave_state");
- mysql_mutex_lock(&rpl_global_gtid_slave_state.LOCK_slave_state);
- bool loaded= rpl_global_gtid_slave_state.loaded;
- mysql_mutex_unlock(&rpl_global_gtid_slave_state.LOCK_slave_state);
+ mysql_mutex_lock(&rpl_global_gtid_slave_state->LOCK_slave_state);
+ bool loaded= rpl_global_gtid_slave_state->loaded;
+ mysql_mutex_unlock(&rpl_global_gtid_slave_state->LOCK_slave_state);
if (loaded)
DBUG_RETURN(0);
@@ -1568,23 +1568,23 @@ rpl_load_gtid_slave_state(THD *thd)
}
}
- mysql_mutex_lock(&rpl_global_gtid_slave_state.LOCK_slave_state);
- if (rpl_global_gtid_slave_state.loaded)
+ mysql_mutex_lock(&rpl_global_gtid_slave_state->LOCK_slave_state);
+ if (rpl_global_gtid_slave_state->loaded)
{
- mysql_mutex_unlock(&rpl_global_gtid_slave_state.LOCK_slave_state);
+ mysql_mutex_unlock(&rpl_global_gtid_slave_state->LOCK_slave_state);
goto end;
}
for (i= 0; i < array.elements; ++i)
{
get_dynamic(&array, (uchar *)&tmp_entry, i);
- if ((err= rpl_global_gtid_slave_state.update(tmp_entry.gtid.domain_id,
+ if ((err= rpl_global_gtid_slave_state->update(tmp_entry.gtid.domain_id,
tmp_entry.gtid.server_id,
tmp_entry.sub_id,
tmp_entry.gtid.seq_no,
NULL)))
{
- mysql_mutex_unlock(&rpl_global_gtid_slave_state.LOCK_slave_state);
+ mysql_mutex_unlock(&rpl_global_gtid_slave_state->LOCK_slave_state);
my_error(ER_OUT_OF_RESOURCES, MYF(0));
goto end;
}
@@ -1597,14 +1597,14 @@ rpl_load_gtid_slave_state(THD *thd)
mysql_bin_log.bump_seq_no_counter_if_needed(entry->gtid.domain_id,
entry->gtid.seq_no))
{
- mysql_mutex_unlock(&rpl_global_gtid_slave_state.LOCK_slave_state);
+ mysql_mutex_unlock(&rpl_global_gtid_slave_state->LOCK_slave_state);
my_error(ER_OUT_OF_RESOURCES, MYF(0));
goto end;
}
}
- rpl_global_gtid_slave_state.loaded= true;
- mysql_mutex_unlock(&rpl_global_gtid_slave_state.LOCK_slave_state);
+ rpl_global_gtid_slave_state->loaded= true;
+ mysql_mutex_unlock(&rpl_global_gtid_slave_state->LOCK_slave_state);
err= 0; /* Clear HA_ERR_END_OF_FILE */
@@ -1672,7 +1672,7 @@ rpl_group_info::~rpl_group_info()
int
event_group_new_gtid(rpl_group_info *rgi, Gtid_log_event *gev)
{
- uint64 sub_id= rpl_global_gtid_slave_state.next_sub_id(gev->domain_id);
+ uint64 sub_id= rpl_global_gtid_slave_state->next_sub_id(gev->domain_id);
if (!sub_id)
{
/* Out of memory caused hash insertion to fail. */
@@ -1787,7 +1787,7 @@ void rpl_group_info::cleanup_context(THD *thd, bool error)
--gtid-ignore-duplicates.
*/
if (gtid_ignore_duplicate_state != GTID_DUPLICATE_NULL)
- rpl_global_gtid_slave_state.release_domain_owner(this);
+ rpl_global_gtid_slave_state->release_domain_owner(this);
}
/*