~ubuntu-branches/ubuntu/trusty/mysql-5.6/trusty

« back to all changes in this revision

Viewing changes to mysql-test/suite/ndb/t/ndb_cache_multi.test

  • Committer: Package Import Robot
  • Author(s): James Page
  • Date: 2014-02-12 11:54:27 UTC
  • Revision ID: package-import@ubuntu.com-20140212115427-oq6tfsqxl1wuwehi
Tags: upstream-5.6.15
ImportĀ upstreamĀ versionĀ 5.6.15

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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
 
7
 
 
8
--disable_warnings
 
9
drop table if exists t1, t2;
 
10
--enable_warnings
 
11
 
 
12
 
 
13
# Turn on and reset query cache on server1
 
14
connection server1;
 
15
set GLOBAL query_cache_type=on;
 
16
set GLOBAL query_cache_size=1355776;
 
17
reset query cache;
 
18
flush status;
 
19
 
 
20
# Turn on and reset query cache on server2
 
21
connection server2;
 
22
set GLOBAL query_cache_type=on;
 
23
set GLOBAL query_cache_size=1355776;
 
24
reset query cache;
 
25
flush status;
 
26
 
 
27
 
 
28
 
 
29
# Create test tables in NDB and load them into cache
 
30
# on server1
 
31
connection server1;
 
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);
 
36
select * from t1;
 
37
select * from t2;
 
38
show status like "Qcache_queries_in_cache";
 
39
show status like "Qcache_inserts";
 
40
show status like "Qcache_hits";
 
41
 
 
42
 
 
43
# Connect server2, load table in to cache, then update the table
 
44
connection server2;
 
45
show status like "Qcache_queries_in_cache";
 
46
show status like "Qcache_inserts";
 
47
show status like "Qcache_hits";
 
48
select * from t1;
 
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;
 
53
 
 
54
# Connect to server1 and check that cache is invalidated 
 
55
# and correct data is returned
 
56
connection server1;
 
57
show status like "Qcache_queries_in_cache";
 
58
show status like "Qcache_inserts";
 
59
show status like "Qcache_hits";
 
60
select * from t1;
 
61
show status like "Qcache_queries_in_cache";
 
62
show status like "Qcache_inserts";
 
63
show status like "Qcache_hits";
 
64
 
 
65
drop table t1, t2;
 
66
 
 
67
 
 
68
# Turn off query cache on server1
 
69
connection server1;
 
70
set GLOBAL query_cache_size=0;
 
71
 
 
72
# Turn off query cache on server2
 
73
connection server2;
 
74
set GLOBAL query_cache_size=0;