summaryrefslogtreecommitdiff
path: root/sql
diff options
context:
space:
mode:
authorsasha@mysql.sashanet.com <>2001-08-31 15:55:58 -0600
committersasha@mysql.sashanet.com <>2001-08-31 15:55:58 -0600
commit65a484a10b3f8d15ff5c4ae51e0ae44d177c502c (patch)
tree24905e953ced32379d08a24a3520366534675f68 /sql
parentb78f8380d570e677ec602217ed575e7ecac9bb36 (diff)
downloadmariadb-git-65a484a10b3f8d15ff5c4ae51e0ae44d177c502c.tar.gz
replicated get_lock() properly
Diffstat (limited to 'sql')
-rw-r--r--sql/item_func.cc17
1 files changed, 17 insertions, 0 deletions
diff --git a/sql/item_func.cc b/sql/item_func.cc
index 989d7709513..47adb902107 100644
--- a/sql/item_func.cc
+++ b/sql/item_func.cc
@@ -1399,6 +1399,23 @@ void item_user_lock_free(void)
void item_user_lock_release(ULL *ull)
{
ull->locked=0;
+ if (mysql_bin_log.is_open())
+ {
+ THD *thd = current_thd;
+ int save_errno;
+ char buf[256];
+ String tmp(buf,sizeof(buf));
+ tmp.length(0);
+ tmp.append("SELECT release_lock(\"");
+ tmp.append(ull->key,ull->key_length);
+ tmp.append("\")");
+ save_errno=thd->net.last_errno;
+ thd->net.last_errno=0;
+ thd->query_length=tmp.length();
+ Query_log_event qev(thd,tmp.ptr());
+ mysql_bin_log.write(&qev);
+ thd->net.last_errno=save_errno;
+ }
if (--ull->count)
pthread_cond_signal(&ull->cond);
else