summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--mysql-test/r/query_cache.result11
-rw-r--r--mysql-test/t/query_cache.test12
-rw-r--r--sql/sql_load.cc1
3 files changed, 23 insertions, 1 deletions
diff --git a/mysql-test/r/query_cache.result b/mysql-test/r/query_cache.result
index 9d63050fc4e..41fccc2743c 100644
--- a/mysql-test/r/query_cache.result
+++ b/mysql-test/r/query_cache.result
@@ -553,3 +553,14 @@ Table 'test.t1' doesn't exist
drop table t2;
select * from t1 where id=2;
Table 'test.t1' doesn't exist
+create table t1 (word char(20) not null);
+select * from t1;
+word
+show status like "Qcache_queries_in_cache";
+Variable_name Value
+Qcache_queries_in_cache 1
+load data infile '../../std_data/words.dat' into table t1;
+show status like "Qcache_queries_in_cache";
+Variable_name Value
+Qcache_queries_in_cache 0
+drop table t1;
diff --git a/mysql-test/t/query_cache.test b/mysql-test/t/query_cache.test
index f77ea3c3b2a..dd092866e44 100644
--- a/mysql-test/t/query_cache.test
+++ b/mysql-test/t/query_cache.test
@@ -384,7 +384,6 @@ select * from mysql.db;
enable_result_log;
show status like "Qcache_queries_in_cache";
-
#
# simple rename test
#
@@ -397,3 +396,14 @@ select * from t1 where id=2;
drop table t2;
-- error 1146
select * from t1 where id=2;
+
+#
+# Load data invalidation test
+#
+
+create table t1 (word char(20) not null);
+select * from t1;
+show status like "Qcache_queries_in_cache";
+load data infile '../../std_data/words.dat' into table t1;
+show status like "Qcache_queries_in_cache";
+drop table t1; \ No newline at end of file
diff --git a/sql/sql_load.cc b/sql/sql_load.cc
index c1c6267879e..ba62b1d5c20 100644
--- a/sql/sql_load.cc
+++ b/sql/sql_load.cc
@@ -336,6 +336,7 @@ int mysql_load(THD *thd,sql_exchange *ex,TABLE_LIST *table_list,
}
if (transactional_table)
error=ha_autocommit_or_rollback(thd,error);
+ query_cache_invalidate3(thd, table_list, 0);
err:
if (thd->lock)