summaryrefslogtreecommitdiff
path: root/sql/handler.cc
diff options
context:
space:
mode:
authorgluh@gluh.mysql.r18.ru <>2003-08-28 18:09:00 +0500
committergluh@gluh.mysql.r18.ru <>2003-08-28 18:09:00 +0500
commite4951147cf6fbea62612fe2fee90c1dcc1d14ec6 (patch)
treed0c13f66f3fb6662f823e9eff89889816d5b1925 /sql/handler.cc
parent4c076ea6d7c1c1d0f05b016bf3e010657a65ebba (diff)
downloadmariadb-git-e4951147cf6fbea62612fe2fee90c1dcc1d14ec6.tar.gz
Fix for bug #799 FLUSH TABLES WITH READ LOCK does not block CREATE TABLE
This commit is related to my previos one(ChangeSet 1.1583 03/08/27 18:03:39). Note about COMMIT&ROLLBACK: Only 'COMMIT' statement updates the binary log. 'ROLLBACK' statement doesn't update the binlog.
Diffstat (limited to 'sql/handler.cc')
-rw-r--r--sql/handler.cc3
1 files changed, 3 insertions, 0 deletions
diff --git a/sql/handler.cc b/sql/handler.cc
index b4d370491bb..851e73f15d2 100644
--- a/sql/handler.cc
+++ b/sql/handler.cc
@@ -359,7 +359,10 @@ int ha_commit_trans(THD *thd, THD_TRANS* trans)
if (trans == &thd->transaction.all && mysql_bin_log.is_open() &&
my_b_tell(&thd->transaction.trans_log))
{
+ if (wait_if_global_read_lock(thd, 0))
+ DBUG_RETURN(1);
mysql_bin_log.write(thd, &thd->transaction.trans_log);
+ start_waiting_global_read_lock(thd);
reinit_io_cache(&thd->transaction.trans_log,
WRITE_CACHE, (my_off_t) 0, 0, 1);
thd->transaction.trans_log.end_of_file= max_binlog_cache_size;