From 241ed6b81caf0248200aacbd7e945a24ce835baa Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 28 Aug 2003 18:09:00 +0500 Subject: 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 --- sql/handler.cc | 3 +++ 1 file changed, 3 insertions(+) (limited to 'sql/handler.cc') 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; -- cgit v1.2.1