List:Internals« Previous MessageNext Message »
From:Jim Winstead Date:March 8 2005 3:15am
Subject:bk commit into 4.0 tree (jimw:1.2076) BUG#8480
View as plain text  
Below is the list of changes that have just been committed into a local
4.0 repository of jimw. When jimw 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
  1.2076 05/03/07 18:15:19 jimw@stripped +3 -0
  Flush entries from the query cache for tables used in
  administrative statements that may alter the table, such
  as REPAIR TABLE. (Bug #8480)

  sql/sql_table.cc
    1.193 05/03/07 18:15:17 jimw@stripped +3 -1
    Make sure entries are flushed from the query cache for
    any administrative command run on a table that acquires
    a write lock on it (and thus might change it), like 
    REPAIR TABLE.

  mysql-test/t/query_cache.test
    1.31 05/03/07 18:15:17 jimw@stripped +12 -0
    Add regression test

  mysql-test/r/query_cache.result
    1.30 05/03/07 18:15:17 jimw@stripped +20 -0
    Add new results

# 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:	jimw
# Host:	rama.(none)
# Root:	/home/jimw/my/mysql-4.0-8480

--- 1.192/sql/sql_table.cc	2004-12-02 13:52:23 -08:00
+++ 1.193/sql/sql_table.cc	2005-03-07 18:15:17 -08:00
@@ -1318,7 +1318,9 @@
       thd->exit_cond(old_message);
       if (thd->killed)
 	goto err;
-      open_for_modify=0;
+      /* Flush entries in the query cache involving this table. */
+      query_cache_invalidate3(thd, table->table, 0);
+      open_for_modify= 0;
     }
 
     int result_code = (table->table->file->*operator_func)(thd, check_opt);

--- 1.29/mysql-test/r/query_cache.result	2004-10-21 13:56:02 -07:00
+++ 1.30/mysql-test/r/query_cache.result	2005-03-07 18:15:17 -08:00
@@ -717,4 +717,24 @@
 a
 drop table t1;
 drop table t1;
+set global query_cache_size=1024*1024;
+flush query cache;
+create table t1 ( a int );
+insert into t1 values (1);
+select a from t1;
+a
+1
+select a from t1;
+a
+1
+show status like 'qcache_queries_in_cache';
+Variable_name	Value
+Qcache_queries_in_cache	1
+repair table t1;
+Table	Op	Msg_type	Msg_text
+test.t1	repair	status	OK
+show status like 'qcache_queries_in_cache';
+Variable_name	Value
+Qcache_queries_in_cache	0
+drop table t1;
 set GLOBAL query_cache_size=0;

--- 1.30/mysql-test/t/query_cache.test	2004-10-21 13:56:02 -07:00
+++ 1.31/mysql-test/t/query_cache.test	2005-03-07 18:15:17 -08:00
@@ -533,4 +533,16 @@
 drop table t1;
 drop table t1;
 
+# Bug #8480: REPAIR TABLE needs to flush the table from the query cache
+set global query_cache_size=1024*1024;
+flush query cache;
+create table t1 ( a int );
+insert into t1 values (1);
+select a from t1;
+select a from t1;
+show status like 'qcache_queries_in_cache';
+repair table t1;
+show status like 'qcache_queries_in_cache';
+drop table t1;
+
 set GLOBAL query_cache_size=0;
Thread
bk commit into 4.0 tree (jimw:1.2076) BUG#8480Jim Winstead8 Mar