From e1ec4de43f3fd812acee1f7c197cd73c929f7675 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 3 Aug 2006 17:23:37 +0400 Subject: Fix Bug #20139 Infinite loop after "FLUSH" and "LOCK tabX, general_log" Due to incorrect handling of FLUSH TABLES, log tables were marked for flush, but not reopened. Later we started to wait for the log table to be closed (disabled) after the flush. And as nobody disabled logs in concurrent treads, the command lasted forever. After internal consultations it was decided to skip logs during FLUSH TABLES. The reasoning is that logging is done in the "log device", whatever it is which is always active and controlled by FLUSH LOGS. So, to flush logs one should use FLUSH LOGS, and not FLUSH TABLES. mysql-test/r/log_tables.result: update result file mysql-test/t/log_tables.test: add a test for the bug sql/sql_base.cc: Skip log tables during FLUSH TABLES --- mysql-test/t/log_tables.test | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'mysql-test/t/log_tables.test') diff --git a/mysql-test/t/log_tables.test b/mysql-test/t/log_tables.test index 5b79e5e4625..236ef87e948 100644 --- a/mysql-test/t/log_tables.test +++ b/mysql-test/t/log_tables.test @@ -171,6 +171,16 @@ select sleep(2); --replace_column 1 TIMESTAMP 2 USER_HOST 3 QUERY_TIME select * from mysql.slow_log; +# +# Bug #20139 Infinite loop after "FLUSH" and "LOCK tabX, general_log" +# + +flush tables with read lock; +unlock tables; +use mysql; +lock tables general_log read local, help_category read local; +unlock tables; + # kill all connections disconnect con1; disconnect con2; -- cgit v1.2.1