summaryrefslogtreecommitdiff
path: root/sql/handler.cc
diff options
context:
space:
mode:
authorunknown <gluh@gluh.mysql.r18.ru>2003-08-28 18:09:00 +0500
committerunknown <gluh@gluh.mysql.r18.ru>2003-08-28 18:09:00 +0500
commit241ed6b81caf0248200aacbd7e945a24ce835baa (patch)
treed0c13f66f3fb6662f823e9eff89889816d5b1925 /sql/handler.cc
parent5f8cc0998f6366c46cc20e42e4989f8f3f468f03 (diff)
downloadmariadb-git-241ed6b81caf0248200aacbd7e945a24ce835baa.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. mysql-test/r/drop.result: Fix for bug #799 FLUSH TABLES WITH READ LOCK does not block CREATE TABLE mysql-test/r/innodb.result: Fix for bug #799 FLUSH TABLES WITH READ LOCK does not block CREATE TABLE mysql-test/t/drop.test: Fix for bug #799 FLUSH TABLES WITH READ LOCK does not block CREATE TABLE mysql-test/t/innodb.test: Fix for bug #799 FLUSH TABLES WITH READ LOCK does not block CREATE TABLE sql/handler.cc: Fix for bug #799 FLUSH TABLES WITH READ LOCK does not block CREATE TABLE sql/sql_table.cc: Fix for bug #799 FLUSH TABLES WITH READ LOCK does not block CREATE TABLE
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;