Debian Codegraph @

mysql-test/suite/memcached/t/memc284_misc.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
41 # Tables must exist before plugin can be started!
42 --let $memcached_address=127.0.0.1:11284
43 --source ../include/load_daemon_memcached_expecting_success.inc
44
45 --sorted_result
46 SELECT c1,c2 FROM t1;
47
48 perl;
49 use DBI;
50 use Cache::Memcached;
51 my $memd = new Cache::Memcached {
52 'servers' => [ "127.0.0.1:11284" ],
53 'connect_timeout' => 20,
54 'select_timeout' => 20
55 };
56
57 print "Set E|Essen with negative expire time should fail:\n";
58 $memd->set("E","Essen","-60");
59
60 $val = $memd->get("E");
61 if ($val) { print "$val\n"; }
62
63 print "Set B|Berlin with expire time as INT_MAX32 should succeed:\n";
64 $memd->set("B","Berlin","2147483647");
65
66 $val = $memd->get("B");
67 if ($val) { print "$val\n"; }
68
69 print "Set P|paris with expire time greater than INT_MAX32 should fail:\n";
70 $memd->set("P","Paris","2147483648");
71
72 $val = $memd->get("P");
73 if ($val) { print "$val\n"; }
74
75 $memd->disconnect_all;
76 EOF
77
78 --sorted_result
79 SELECT c1,c2 FROM t1;
80
81 DROP TABLE t1;
82
83 # Stop plugin before innodb_memcached configuration
84 UNINSTALL PLUGIN daemon_memcached;
85 DROP DATABASE innodb_memcache;
86
87 SET @@global.transaction_isolation= @transaction_isolation;