Debian Codegraph @

mysql-test/suite/memcached/t/memc212_2_cols.test

raw
1 source include/not_valgrind.inc;
2 source include/have_memcached_plugin.inc;
3 source include/not_windows.inc;
4
5 --disable_query_log
6 CALL mtr.add_suppression("daemon-memcached-w-batch-size': unsigned");
7 CALL mtr.add_suppression("Could not obtain server's UPN to be used as target service name");
8 CALL mtr.add_suppression("Warning: MySQL is trying to drop");
9 --enable_query_log
10
11 --enable_connect_log
12 SET @transaction_isolation= @@global.transaction_isolation;
13 SET GLOBAL TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
14
15 # Create the memcached tables
16 --disable_query_log
17 source include/memcache_config.inc;
18 --enable_query_log
19
20 INSERT INTO cache_policies VALUES("cache_policy", "innodb_only",
21 "innodb_only", "innodb_only", "innodb_only");
22
23 INSERT INTO config_options VALUES("separator", "|");
24
25 # describe table for memcache
26 INSERT INTO containers VALUES ("desc_t1", "test", "t1",
27 "c1", "c2,c21", "c3", "c4", "c5", "PRIMARY");
28
29 USE test;
30
31 --disable_warnings
32 DROP TABLE IF EXISTS t1;
33 --enable_warnings
34 CREATE TABLE t1 (c1 VARCHAR(32),
35 c2 VARCHAR(1024),
36 c21 VARCHAR(1024),
37 c3 INT, c4 BIGINT UNSIGNED, c5 INT, primary key(c1))
38 ENGINE = INNODB;
39
40 INSERT INTO t1 VALUES ('D', 'Darmstadt', 'City', 0, 0, 0);
41 INSERT INTO t1 VALUES ('B', 'Berlin', 'Mitte', 0, 0, 0);
42 INSERT INTO t1 VALUES ('C', 'Cottbus', 'West', 0, 0 ,0);
43 INSERT INTO t1 VALUES ('H', 'Hamburg', 'Norderstedt', 0, 0, 0);
44
45 # Tables must exist before plugin can be started!
46 --let $memcached_address=127.0.0.1:11212
47 --source ../include/load_daemon_memcached_expecting_success.inc
48
49 show variables like 'daemon_memcached_option';
50
51 --sorted_result
52 SELECT c1,c2,c21 FROM t1;
53
54 perl;
55 use DBI;
56 use Cache::Memcached;
57 my $memd = new Cache::Memcached {
58 'servers' => [ "127.0.0.1:11212" ],
59 'connect_timeout' => 20,
60 'select_timeout' => 20
61 };
62 print "Here are the memcached results with D,B,H,C:\n";
63 $val = $memd->get("D");
64 if ($val) { print "$val\n"; }
65 $val = $memd->get("B");
66 if ($val) { print "$val\n"; }
67 $val = $memd->get("H");
68 if ($val) { print "$val\n"; }
69 $val = $memd->get("C");
70 if ($val) { print "$val\n"; }
71 $memd->disconnect_all;
72 EOF
73
74 --sorted_result
75 SELECT c1,c2,c21 FROM t1;
76
77 perl;
78 use DBI;
79 use Cache::Memcached;
80 my $memd = new Cache::Memcached {
81 'servers' => [ "127.0.0.1:11212" ],
82 'connect_timeout' => 20,
83 'select_timeout' => 20
84 };
85 print "Here are the memcached results after set:\n";
86 $val = $memd->set("E","Essen|Ost");
87 $val = $memd->get("E");
88 if ($val) { print "$val\n"; }
89 $memd->disconnect_all;
90 EOF
91
92 --sorted_result
93 SELECT c1,c2,c21 FROM t1;
94
95 perl;
96 use DBI;
97 use Cache::Memcached;
98 my $memd = new Cache::Memcached {
99 'servers' => [ "127.0.0.1:11212" ],
100 'connect_timeout' => 20,
101 'select_timeout' => 20
102 };
103 print "Here are the memcached results after add:\n";
104 $val = $memd->add("F","Frankfurt|Sachsenhause");
105 $val = $memd->get("F");
106 if ($val) { print "$val\n"; }
107 $memd->disconnect_all;
108 EOF
109
110 --sorted_result
111 SELECT c1,c2,c21 FROM t1;
112
113 perl;
114 use DBI;
115 use Cache::Memcached;
116 my $memd = new Cache::Memcached {
117 'servers' => [ "127.0.0.1:11212" ],
118 'connect_timeout' => 20,
119 'select_timeout' => 20
120 };
121 print "Here are the memcached results after replace:\n";
122 $val = $memd->replace("F","Frankfurt a. M.|Sachsenhausen");
123 $val = $memd->get("F");
124 if ($val) { print "$val\n"; }
125 $memd->disconnect_all;
126 EOF
127
128 --sorted_result
129 SELECT c1,c2,c21 FROM t1;
130
131 perl;
132 use DBI;
133 use Cache::Memcached;
134 my $memd = new Cache::Memcached {
135 'servers' => [ "127.0.0.1:11212" ],
136 'connect_timeout' => 20,
137 'select_timeout' => 20
138 };
139 print "Here are the memcached results after delete:\n";
140 $val = $memd->delete("F");
141 $val = $memd->get("F");
142 if ($val) { print "$val\n"; }
143 $memd->disconnect_all;
144 EOF
145
146 --sorted_result
147 SELECT c1,c2,c21 FROM t1;
148
149 perl;
150 use DBI;
151 use Cache::Memcached;
152 my $memd = new Cache::Memcached {
153 'servers' => [ "127.0.0.1:11212" ],
154 'connect_timeout' => 20,
155 'select_timeout' => 20
156 };
157 print "Here are the memcached results after add Frankfurt|:\n";
158 $val = $memd->add("F","Frankfurt|");
159 $val = $memd->get("F");
160 if ($val) { print "$val\n"; }
161 print "Here are the memcached results after add |Airport:\n";
162 $val = $memd->add("F","|");
163 $val = $memd->get("F");
164 if ($val) { print "$val\n"; }
165 $memd->disconnect_all;
166 EOF
167
168 --sorted_result
169 SELECT c1,c2,c21 FROM t1;
170
171 perl;
172 use DBI;
173 use Cache::Memcached;
174 my $memd = new Cache::Memcached {
175 'servers' => [ "127.0.0.1:11212" ],
176 'connect_timeout' => 20,
177 'select_timeout' => 20
178 };
179 print "Here are the memcached results after replace Frankfurt a.M.:\n";
180 $val = $memd->replace("F","Frankfurt a. M.|");
181 $val = $memd->get("F");
182 if ($val) { print "$val\n"; }
183 print "Here are the memcached results after replace Sachsenhausen:\n";
184 $val = $memd->replace("F","|Sachsenhausen");
185 $val = $memd->get("F");
186 if ($val) { print "$val\n"; }
187 $memd->disconnect_all;
188 EOF
189
190 --sorted_result
191 SELECT c1,c2,c21 FROM t1;
192 SET sql_mode='NO_ENGINE_SUBSTITUTION';
193 ALTER TABLE t1 MODIFY c2 int;
194 SET sql_mode=default;
195 --sorted_result
196 SELECT c1,c2,c21 FROM t1;
197
198 perl;
199 use DBI;
200 use Cache::Memcached;
201 my $memd = new Cache::Memcached {
202 'servers' => [ "127.0.0.1:11212" ],
203 'connect_timeout' => 20,
204 'select_timeout' => 20
205 };
206 print "Here are the memcached results after add Frankfurt|:\n";
207 $val = $memd->add("F","Frankfurt|");
208 $val = $memd->get("F");
209 if ($val) { print "$val\n"; }
210 print "Here are the memcached results after add |Airport:\n";
211 $val = $memd->add("F","|");
212 $val = $memd->get("F");
213 if ($val) { print "$val\n"; }
214 $memd->disconnect_all;
215 EOF
216
217 --sorted_result
218 SELECT c1,c2,c21 FROM t1;
219
220 perl;
221 use DBI;
222 use Cache::Memcached;
223 my $memd = new Cache::Memcached {
224 'servers' => [ "127.0.0.1:11212" ],
225 'connect_timeout' => 20,
226 'select_timeout' => 20
227 };
228 print "Here are the memcached results after flush_all:\n";
229 $memd->flush_all;
230 $val = $memd->get("F");
231 if ($val) { print "$val\n"; }
232 $memd->disconnect_all;
233 EOF
234
235 --sorted_result
236 SELECT c1,c2,c21 FROM t1;
237
238 DROP TABLE t1;
239
240 UNINSTALL PLUGIN daemon_memcached;
241 DROP DATABASE innodb_memcache;
242
243 SET @@global.transaction_isolation= @transaction_isolation;