1
# query cache is local to each mysqld, so counting hits
2
# will not be the same when using one and several mysqld's
3
# hence disable test for embedded
4
-- source include/not_embedded.inc
5
-- source include/have_query_cache.inc
6
-- source include/have_multi_ndb.inc
9
drop table if exists t1, t2;
13
# Turn on and reset query cache on server1
15
set GLOBAL query_cache_type=on;
16
set GLOBAL query_cache_size=1355776;
20
# Turn on and reset query cache on server2
22
set GLOBAL query_cache_type=on;
23
set GLOBAL query_cache_size=1355776;
29
# Create test tables in NDB and load them into cache
32
create table t1 (a int) engine=ndbcluster;
33
create table t2 (a int) engine=ndbcluster;
34
insert into t1 value (2);
35
insert into t2 value (3);
38
show status like "Qcache_queries_in_cache";
39
show status like "Qcache_inserts";
40
show status like "Qcache_hits";
43
# Connect server2, load table in to cache, then update the table
45
show status like "Qcache_queries_in_cache";
46
show status like "Qcache_inserts";
47
show status like "Qcache_hits";
49
show status like "Qcache_queries_in_cache";
50
show status like "Qcache_inserts";
51
show status like "Qcache_hits";
52
update t1 set a=3 where a=2;
54
# Connect to server1 and check that cache is invalidated
55
# and correct data is returned
57
show status like "Qcache_queries_in_cache";
58
show status like "Qcache_inserts";
59
show status like "Qcache_hits";
61
show status like "Qcache_queries_in_cache";
62
show status like "Qcache_inserts";
63
show status like "Qcache_hits";
68
# Turn off query cache on server1
70
set GLOBAL query_cache_size=0;
72
# Turn off query cache on server2
74
set GLOBAL query_cache_size=0;