fixed invalidation of query cache on LOAD DATA

mysql-test/r/query_cache.result:
  test of LOAD DATA
mysql-test/t/query_cache.test:
  test of LOAD DATA
This commit is contained in:
unknown 2003-02-14 22:20:38 +02:00
parent fb2c8c7cb8
commit d13d8aa00e
3 changed files with 23 additions and 1 deletions

View file

@ -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;

View file

@ -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;

View file

@ -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)