summaryrefslogtreecommitdiff
path: root/sql/item_func.cc
diff options
context:
space:
mode:
authorunknown <guilhem@mysql.com>2004-03-11 16:23:35 +0100
committerunknown <guilhem@mysql.com>2004-03-11 16:23:35 +0100
commitf808030209e7bd102b6100df04aa7094bc767af2 (patch)
tree90f46c5c76afb57731f6600678fb72189c05d38a /sql/item_func.cc
parentc6d91e00bbd103e46d806b1b9aad1963f4cfe18c (diff)
downloadmariadb-git-f808030209e7bd102b6100df04aa7094bc767af2.tar.gz
Fix for BUG#2921 "Replication problem on mutex lock in mySQL-4.0.18":
re-using unused LOCK_active_mi to serialize all administrative commands related to replication: START SLAVE, STOP SLAVE, RESET SLAVE, CHANGE MASTER, init_slave() (replication autostart at server startup), end_slave() (replication autostop at server shutdown), LOAD DATA FROM MASTER. This protects us against a handful of deadlocks (like BUG#2921 when two START SLAVE, but when two STOP SLAVE too). Removing unused variables. sql/item_func.cc: We don't need LOCK_active_mi just to MASTER_POS_WAIT(). sql/repl_failsafe.cc: no need for macro sql/set_var.cc: no need for macro sql/slave.cc: Re-using unused LOCK_active_mi to serialize all administrative commands related to replication: START SLAVE, STOP SLAVE, RESET SLAVE, CHANGE MASTER, init_slave() (replication autostart at server startup), end_slave() (replication autostop at server shutdown), LOAD DATA FROM MASTER. This protects us against a handful of deadlocks. Removing unused variables. sql/slave.h: Re-using LOCK_active_mi to serialize administrative replication commands. Macros unneeded. Removing unneeded variables. sql/sql_parse.cc: found unused variable. Replacing macros. sql/sql_show.cc: replacing macros
Diffstat (limited to 'sql/item_func.cc')
-rw-r--r--sql/item_func.cc2
1 files changed, 0 insertions, 2 deletions
diff --git a/sql/item_func.cc b/sql/item_func.cc
index 656dff63609..ab96915e746 100644
--- a/sql/item_func.cc
+++ b/sql/item_func.cc
@@ -1543,13 +1543,11 @@ longlong Item_master_pos_wait::val_int()
}
longlong pos = args[1]->val_int();
longlong timeout = (arg_count==3) ? args[2]->val_int() : 0 ;
- LOCK_ACTIVE_MI;
if ((event_count = active_mi->rli.wait_for_pos(thd, log_name, pos, timeout)) == -2)
{
null_value = 1;
event_count=0;
}
- UNLOCK_ACTIVE_MI;
return event_count;
}