Debian Codegraph @

mysql-test/suite/memcached/t/memc221_get.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", "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 c3 INT, c4 BIGINT UNSIGNED, c5 INT, primary key(c1))
37 ENGINE = INNODB;
38
39 INSERT INTO t1 VALUES ('D', 'Darmstadt', 0, 0, 0);
40 INSERT INTO t1 VALUES ('B', 'Berlin', 0, 0, 0);
41 INSERT INTO t1 VALUES ('C', 'Cottbus', 0, 0 ,0);
42 INSERT INTO t1 VALUES ('H', 'Hamburg', 0, 0, 0);
43
44 # Tables must exist before plugin can be started!
45 --let $memcached_address=127.0.0.1:11221
46 --source ../include/load_daemon_memcached_expecting_success.inc
47
48 --sorted_result
49 SELECT c1,c2 FROM t1;
50
51 perl;
52 use DBI;
53 use Cache::Memcached;
54 my $memd = new Cache::Memcached {
55 'servers' => [ "127.0.0.1:11221" ],
56 'connect_timeout' => 20,
57 'select_timeout' => 20
58 };
59 print "Here are the memcached results with D,B,H,C:\n";
60 $val = $memd->get("D");
61 if ($val) { print "$val\n"; }
62 $val = $memd->get("B");
63 if ($val) { print "$val\n"; }
64 $val = $memd->get("H");
65 if ($val) { print "$val\n"; }
66 $val = $memd->get("C");
67 if ($val) { print "$val\n"; }
68 $memd->disconnect_all;
69 EOF
70
71 --sorted_result
72 SELECT c1,c2 FROM t1;
73
74 perl;
75 use DBI;
76 use Cache::Memcached;
77 my $memd = new Cache::Memcached {
78 'servers' => [ "127.0.0.1:11221" ],
79 'connect_timeout' => 20,
80 'select_timeout' => 20
81 };
82 print "Here are the memcached results with B:\n";
83 $val = $memd->get("B");
84 if ($val) { print "$val\n"; }
85 $memd->disconnect_all;
86 EOF
87
88 --sorted_result
89 SELECT c1,c2 FROM t1;
90
91 perl;
92 use DBI;
93 use Cache::Memcached;
94 my $memd = new Cache::Memcached {
95 'servers' => [ "127.0.0.1:11221" ],
96 'connect_timeout' => 20,
97 'select_timeout' => 20
98 };
99 print "Here are the memcached results with D,H:\n";
100 $val = $memd->get("D");
101 if ($val) { print "$val\n"; }
102 $val = $memd->get("H");
103 if ($val) { print "$val\n"; }
104 $memd->disconnect_all;
105 EOF
106
107 DROP TABLE t1;
108
109 UNINSTALL PLUGIN daemon_memcached;
110 DROP DATABASE innodb_memcache;
111
112 SET @@global.transaction_isolation= @transaction_isolation;