~ubuntu-branches/ubuntu/trusty/drizzle/trusty

« back to all changes in this revision

Viewing changes to plugin/memcached_query_cache/tests/t/query_cache_invalidation.test

  • Committer: Bazaar Package Importer
  • Author(s): Monty Taylor
  • Date: 2010-10-02 14:17:48 UTC
  • mfrom: (1.1.1 upstream)
  • mto: (2.1.17 sid)
  • mto: This revision was merged to the branch mainline in revision 3.
  • Revision ID: james.westby@ubuntu.com-20101002141748-m6vbfbfjhrw1153e
Tags: 2010.09.1802-1
* New upstream release.
* Removed pid-file argument hack.
* Updated GPL-2 address to be new address.
* Directly copy in drizzledump.1 since debian doesn't have sphinx 1.0 yet.
* Link to jquery from libjs-jquery. Add it as a depend.
* Add drizzled.8 symlink to the install files.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# we are assuming the memcached binary is contained in PATH or
 
2
# common directories we might expect it to be in
 
3
--exec sh $TOP_BUILDDIR/plugin/memcached_query_cache/start_mc.sh stop
 
4
--exec sh $TOP_BUILDDIR/plugin/memcached_query_cache/start_mc.sh start
 
5
 
 
6
--disable_warnings
 
7
DROP TABLE IF EXISTS `t1`;
 
8
DROP TABLE IF EXISTS `t2`;
 
9
--enable_warnings
 
10
 
 
11
--replace_result $MC_PORT MC_A_PORT
 
12
set global query_cache_servers= "127.0.0.1:$MC_PORT";
 
13
set query_cache_enable= on;
 
14
CREATE TABLE `t1` (id integer NOT NULL auto_increment primary key, name varchar(20), age int);
 
15
 
 
16
INSERT INTO `t1` (name, age) values ("leila", 20);
 
17
INSERT INTO `t1` (name, age) values ("lockman", 2);
 
18
INSERT INTO `t1` (name, age) values ("ali", 22);
 
19
INSERT INTO `t1` (name, age) values ("Meriem", NULL);
 
20
 
 
21
CREATE TABLE `t2` (id int auto_increment primary key) select * from `t1` where age > 20;
 
22
select * from t1;
 
23
select * from t2;
 
24
select * from t1, t2 where t1.name = t2.name;
 
25
select t.table from data_dictionary.query_cached_tables t;
 
26
select d.schema, d.sql from data_dictionary.query_cache_entries d;
 
27
 
 
28
#Test the invalidation BY
 
29
 
 
30
#1: INSERT
 
31
INSERT INTO `t1` (name, age) values ("Foued", 35);
 
32
select t.table from data_dictionary.query_cached_tables t;
 
33
select d.schema, d.sql from data_dictionary.query_cache_entries d;
 
34
 
 
35
#2: UPDATE
 
36
UPDATE `t2` set age= age + 4;
 
37
select t.table from data_dictionary.query_cached_tables t;
 
38
select d.schema, d.sql from data_dictionary.query_cache_entries d;
 
39
 
 
40
 
 
41
#3: DELETE
 
42
select query_cache_flush();
 
43
select * from t1;
 
44
select * from t2;
 
45
select * from t1, t2 where t1.name = t2.name;
 
46
select t.table from data_dictionary.query_cached_tables t;
 
47
select d.schema, d.sql from data_dictionary.query_cache_entries d;
 
48
delete from t1 where name= "ali";
 
49
select t.table from data_dictionary.query_cached_tables t;
 
50
select d.schema, d.sql from data_dictionary.query_cache_entries d;
 
51
 
 
52
#4: ALTER (replication of this statement is not working)
 
53
##select query_cache_flush();
 
54
##select * from t1;
 
55
##select * from t2;
 
56
##select * from t1, t2 where t1.name = t2.name;
 
57
##select t.table from data_dictionary.query_cached_tables t;
 
58
##select d.schema, d.sql from data_dictionary.query_cache_entries d;
 
59
##ALTER TABLE `t2` add column (education varchar(20) default "Phd");
 
60
##select t.table from data_dictionary.query_cached_tables t;
 
61
##select d.schema, d.sql from data_dictionary.query_cache_entries d;
 
62
 
 
63
#5: DROP
 
64
select query_cache_flush();
 
65
select * from t1;
 
66
select * from t2;
 
67
select * from t1, t2 where t1.name = t2.name;
 
68
select t.table from data_dictionary.query_cached_tables t;
 
69
select d.schema, d.sql from data_dictionary.query_cache_entries d;
 
70
DROP TABLE `t2`;
 
71
select t.table from data_dictionary.query_cached_tables t;
 
72
select d.schema, d.sql from data_dictionary.query_cache_entries d;
 
73
 
 
74
 
 
75
--exec sh $TOP_BUILDDIR/plugin/memcached_query_cache/start_mc.sh stop
 
76