List:Commits« Previous MessageNext Message »
From:Petr Chardin Date:July 19 2006 6:58am
Subject:bk commit into 5.1 tree (petr:1.2245) BUG#20139
View as plain text  
Below is the list of changes that have just been committed into a local
5.1 repository of cps. When cps does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html

ChangeSet@stripped, 2006-07-19 10:58:25+04:00, petr@stripped +3 -0
  Fix Bug#20139 Infinite loop after "FLUSH" and "LOCK tabX, general_log"

  mysql-test/r/log_tables.result@stripped, 2006-07-19 10:58:03+04:00, petr@stripped +5 -0
    update result file

  mysql-test/t/log_tables.test@stripped, 2006-07-19 10:58:03+04:00, petr@stripped +10 -0
    add a test case for the bug

  sql/sql_base.cc@stripped, 2006-07-19 10:58:03+04:00, petr@stripped +8 -7
    skip log tables during flush of old tables

# This is a BitKeeper patch.  What follows are the unified diffs for the
# set of deltas contained in the patch.  The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User:	petr
# Host:	owlet.
# Root:	/home/cps/mysql/trees/5.1-team

--- 1.333/sql/sql_base.cc	2006-07-19 10:58:34 +04:00
+++ 1.334/sql/sql_base.cc	2006-07-19 10:58:34 +04:00
@@ -1996,17 +1996,17 @@
        table= (TABLE*) hash_next(&open_cache, (byte*) key, key_length,
                                  &state))
   {
-    if (table->s->version != refresh_version)
+    /*
+      Here we flush tables marked for flush. However we never flush log
+      tables here. They are flushed only on FLUSH LOGS.
+    */
+    if (table->s->version != refresh_version && !table->s->log_table)
     {
       DBUG_PRINT("note",
                  ("Found table '%s.%s' with different refresh version",
                   table_list->db, table_list->table_name));
 
-      /*
-        Don't close tables if we are working with a log table or were
-        asked not to close the table explicitly
-      */
-      if (flags & MYSQL_LOCK_IGNORE_FLUSH || table->s->log_table)
+      if (flags & MYSQL_LOCK_IGNORE_FLUSH)
       {
         /* Force close at once after usage */
         thd->version= table->s->version;
@@ -2345,7 +2345,8 @@
 
   for (; table ; table=table->next)
   {
-    if (table->s->version != refresh_version)
+    /* don't close log table */
+    if (table->s->version != refresh_version && !table->s->log_table)
     {
       found=1;
       if (table->db_stat)

--- 1.5/mysql-test/r/log_tables.result	2006-07-19 10:58:34 +04:00
+++ 1.6/mysql-test/r/log_tables.result	2006-07-19 10:58:34 +04:00
@@ -72,3 +72,8 @@
 select * from mysql.slow_log;
 start_time	user_host	query_time	lock_time	rows_sent	rows_examined	db	last_insert_id	insert_id	server_id	sql_text
 TIMESTAMP	USER_HOST	QUERY_TIME	00:00:00	1	0	test	0	0	1	select sleep(2)
+flush tables with read lock;
+unlock tables;
+use mysql;
+lock tables general_log read local, help_category read local;
+unlock tables;

--- 1.10/mysql-test/t/log_tables.test	2006-07-19 10:58:34 +04:00
+++ 1.11/mysql-test/t/log_tables.test	2006-07-19 10:58:34 +04:00
@@ -171,6 +171,16 @@
 --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;
Thread
bk commit into 5.1 tree (petr:1.2245) BUG#20139Petr Chardin19 Jul