summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorunknown <jimw@mysql.com>2005-03-11 11:07:32 -0800
committerunknown <jimw@mysql.com>2005-03-11 11:07:32 -0800
commitbefe4fa99f377292ed7dcc1e47e4052d7204e488 (patch)
tree4f7243853e672ad30afb3da59732b0090b4c9784
parentd4e7d91f3e41c6e81820c78b504a2b9bf0988bc6 (diff)
parent8e24e6079f0a0e60dee696a9164bf4d8356c9630 (diff)
downloadmariadb-git-befe4fa99f377292ed7dcc1e47e4052d7204e488.tar.gz
Merge test and results
sql/sql_table.cc: Auto merged mysql-test/r/query_cache.result: Update results mysql-test/t/query_cache.test: Merge tests
-rw-r--r--mysql-test/r/query_cache.result22
-rw-r--r--mysql-test/t/query_cache.test14
-rw-r--r--sql/sql_table.cc4
3 files changed, 37 insertions, 3 deletions
diff --git a/mysql-test/r/query_cache.result b/mysql-test/r/query_cache.result
index 9f61b029391..5fe00e70d3d 100644
--- a/mysql-test/r/query_cache.result
+++ b/mysql-test/r/query_cache.result
@@ -922,4 +922,24 @@ group_concat(a)
12345678901234567890
set group_concat_max_len=default;
drop table t1;
-SET GLOBAL query_cache_size=0;
+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;
diff --git a/mysql-test/t/query_cache.test b/mysql-test/t/query_cache.test
index d570073b1d2..b0148a689af 100644
--- a/mysql-test/t/query_cache.test
+++ b/mysql-test/t/query_cache.test
@@ -672,4 +672,16 @@ select group_concat(a) FROM t1 group by b;
set group_concat_max_len=default;
drop table t1;
-SET GLOBAL query_cache_size=0;
+# 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;
diff --git a/sql/sql_table.cc b/sql/sql_table.cc
index 5f3875ba934..fffef49effc 100644
--- a/sql/sql_table.cc
+++ b/sql/sql_table.cc
@@ -1971,7 +1971,9 @@ static int mysql_admin_table(THD* thd, TABLE_LIST* tables,
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);