1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240
|
SET @transaction_isolation= @@global.transaction_isolation;
SET GLOBAL TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
INSERT INTO cache_policies VALUES("cache_policy", "innodb_only",
"innodb_only", "innodb_only", "innodb_only");
INSERT INTO config_options VALUES("separator", "|");
INSERT INTO containers VALUES ("desc_t1", "test", "t1",
"c1", "c2", "c3", "c4", "c5", "PRIMARY");
USE test;
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (c1 VARCHAR(32),
c2 VARCHAR(1024),
c3 INT, c4 BIGINT UNSIGNED, c5 INT, primary key(c1))
ENGINE = INNODB;
INSERT INTO t1 VALUES ('D', 'Darmstadt', 0, 0, 0);
INSERT INTO t1 VALUES ('B', 'Berlin', 0, 0, 0);
INSERT INTO t1 VALUES ('C', 'Cottbus', 0, 0 ,0);
INSERT INTO t1 VALUES ('H', 'Hamburg', 0, 0, 0);
INSTALL PLUGIN daemon_memcached SONAME 'libmemcached.so';
Warnings:
Warning 1681 'InnoDB Memcached Plugin' is deprecated and will be removed in a future release.
SELECT c1,c2 FROM t1;
c1 c2
B Berlin
C Cottbus
D Darmstadt
H Hamburg
# Add E|Essen:
Ok.
# Add E|Essen:
Error: E|Essen is still existing.
SELECT c1,c2 FROM t1;
c1 c2
B Berlin
C Cottbus
D Darmstadt
E Essen
H Hamburg
# Here are the memcached results with E:
Essen
SELECT c1,c2 FROM t1;
c1 c2
B Berlin
C Cottbus
D Darmstadt
E Essen
H Hamburg
# Here are the memcached results with E,H:
Essen
Hamburg
UNINSTALL PLUGIN daemon_memcached;
use innodb_memcache;
DELETE FROM containers;
INSERT INTO containers VALUES ("desc_t2", "test", "t2",
"c1", "c2", "c3", "c4", "c5", "PRIMARY");
USE test;
DROP TABLE IF EXISTS t1;
CREATE TABLE t2 (c1 VARCHAR(32),
c2 VARCHAR(1024),
c3 INT, c4 BIGINT UNSIGNED, c5 INT, primary key(c1))
ENGINE = INNODB;
INSERT INTO t2 VALUES ('D', 't2_Darmstadt', 0, 0, 0);
INSERT INTO t2 VALUES ('B', 't2_Berlin', 0, 0, 0);
INSERT INTO t2 VALUES ('C', 't2_Cottbus', 0, 0 ,0);
INSERT INTO t2 VALUES ('H', 't2_Hamburg', 0, 0, 0);
INSTALL PLUGIN daemon_memcached SONAME 'libmemcached.so';
Warnings:
Warning 1681 'InnoDB Memcached Plugin' is deprecated and will be removed in a future release.
SELECT c1,c2 FROM t2;
c1 c2
B t2_Berlin
C t2_Cottbus
D t2_Darmstadt
H t2_Hamburg
# Add E|Essen:
Ok.
# Add E|Essen:
Error: E|Essen is still existing.
SELECT c1,c2 FROM t2;
c1 c2
B t2_Berlin
C t2_Cottbus
D t2_Darmstadt
E Essen
H t2_Hamburg
# Here are the memcached results with E:
Essen
SELECT c1,c2 FROM t2;
c1 c2
B t2_Berlin
C t2_Cottbus
D t2_Darmstadt
E Essen
H t2_Hamburg
# Here are the memcached results with E,H:
Essen
t2_Hamburg
UNINSTALL PLUGIN daemon_memcached;
use innodb_memcache;
DELETE FROM containers;
INSERT INTO containers VALUES ("desc_t2", NULL, "t2",
"c1", "c2", "c3", "c4", "c5", "PRIMARY");
ERROR 23000: Column 'db_schema' cannot be null
INSERT INTO containers VALUES ("desc_t2", "test", "t2",
NULL, "c2", "c3", "c4", "c5", "PRIMARY");
ERROR 23000: Column 'key_columns' cannot be null
DELETE FROM containers;
INSERT INTO containers VALUES ("desc_t2", "junk", "t2",
"c1", "c2", "c3", "c4", "c5", "PRIMARY");
INSTALL PLUGIN daemon_memcached SONAME 'libmemcached.so';
Warnings:
Warning 1681 'InnoDB Memcached Plugin' is deprecated and will be removed in a future release.
# This will fail, since memcached not initialized
UNINSTALL PLUGIN daemon_memcached;
DELETE FROM containers;
INSERT INTO containers VALUES ("desc_t2", "test", "t2",
"c1", "c2", "c3", "c4", "c5", "PRIMARY");
USE test;
DROP TABLE IF EXISTS t2;
CREATE TABLE t2 (c1 int,
c2 VARCHAR(1024),
c3 INT, c4 BIGINT UNSIGNED, c5 INT, primary key(c1))
ENGINE = INNODB;
INSERT INTO t2 VALUES (3, 't2_Hamburg', 0, 0, 0);
INSTALL PLUGIN daemon_memcached SONAME 'libmemcached.so';
Warnings:
Warning 1681 'InnoDB Memcached Plugin' is deprecated and will be removed in a future release.
# This will succeed, since memcached supports int as key
t2_Hamburg
use test;
DROP TABLE IF EXISTS t2;
CREATE TABLE t2 (c1 CHAR(10),
c2 VARCHAR(1024),
c3 INT, c4 INT, c5 INT, primary key(c1));
INSERT INTO t2 VALUES ('H', 't2_Hamburg', 0, 0, 0);
UNINSTALL PLUGIN daemon_memcached;
INSTALL PLUGIN daemon_memcached SONAME 'libmemcached.so';
Warnings:
Warning 1681 'InnoDB Memcached Plugin' is deprecated and will be removed in a future release.
# This will fail, since memcached not initialized
t2_Hamburg
UNINSTALL PLUGIN daemon_memcached;
use innodb_memcache;
DELETE FROM containers;
INSERT INTO containers VALUES ("desc_t2", "test", "t2",
"c1", "c2", "c3", "c4", "c5", "PRIMARY");
USE test;
DROP TABLE IF EXISTS t2;
CREATE TABLE t2 (c1 VARCHAR(32),
c2 VARCHAR(1024),
c3 INT, c4 BIGINT UNSIGNED, c5 INT, primary key(c1))
ENGINE = INNODB;
INSTALL PLUGIN daemon_memcached SONAME 'libmemcached.so';
Warnings:
Warning 1681 'InnoDB Memcached Plugin' is deprecated and will be removed in a future release.
SELECT c1,c2 FROM t2;
c1 c2
# Add E|Essen:
Ok.
SELECT MAX(c4) INTO @baseline_cas_value FROM t2;
SELECT c1, c2, c4-@baseline_cas_value as relative_cas FROM t2;
c1 c2 relative_cas
E Essen 0
# Add G|Gossen:
Ok.
Ok.
SELECT c1, c2, c4-@baseline_cas_value as relative_cas FROM t2;
c1 c2 relative_cas
E Essen 0
G Gossen 1
H Hamburg 2
SELECT c1,c2,c3,c4-@baseline_cas_value as relative_cas,c5 FROM test.t2;
c1 c2 c3 relative_cas c5
E Essen 0 0 0
G Gossen 0 1 0
H Hamburg 0 2 0
# Add B|Berlin expires in 1 seconds:
Ok.
select sleep(3);
sleep(3)
0
# Should not find B|Berlin, since it is expired
# Add C|Cottbus, expires 100 seconds:
Ok.
# Should be able to find C|Cottbus, assume it does not take 100s to get here
Cottbus
# Add J|Jilin
Ok.
# Should not find J|Jilin, it should be expired
UNINSTALL PLUGIN daemon_memcached;
use innodb_memcache;
DELETE FROM containers;
INSERT INTO containers VALUES ("desc_t2", "test", "t2",
"c1", "c2", "c3", "c4", "c5", "PRIMARY");
USE test;
DROP TABLE IF EXISTS t2;
CREATE TABLE t2 (c1 VARCHAR(32),
c2 VARCHAR(1024),
c3 INT, c4 BIGINT UNSIGNED, c5 INT, primary key(c1))
ENGINE = INNODB;
INSERT INTO t2 VALUES ('D', 't2_Darmstadt', 0, 0, 0);
INSERT INTO t2 VALUES ('B', 't2_Berlin', 0, 0, 0);
INSERT INTO t2 VALUES ('C', 't2_Cottbus', 0, 0 ,0);
INSERT INTO t2 VALUES ('H', 't2_Hamburg', 0, 0, 0);
INSTALL PLUGIN daemon_memcached SONAME 'libmemcached.so';
Warnings:
Warning 1681 'InnoDB Memcached Plugin' is deprecated and will be removed in a future release.
SELECT c1,c2 FROM t2;
c1 c2
B t2_Berlin
C t2_Cottbus
D t2_Darmstadt
H t2_Hamburg
# Add E|Essen:
Ok.
connection default;
c1 c2
# Add E|Essen:
Error: E|Essen is still existing.
c1 c2
# Here are the memcached results with E:
c1 c2
# Here are the memcached results with E,H:
alter table test.t2 change c2 c_new int;
show create table test.t2;
Table Create Table
t2 CREATE TABLE `t2` (
`c1` varchar(32) NOT NULL,
`c_new` int DEFAULT NULL,
`c3` int DEFAULT NULL,
`c4` bigint unsigned DEFAULT NULL,
`c5` int DEFAULT NULL,
PRIMARY KEY (`c1`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci
INSTALL PLUGIN daemon_memcached SONAME 'libmemcached.so';
Warnings:
Warning 1681 'InnoDB Memcached Plugin' is deprecated and will be removed in a future release.
DROP TABLE t2;
UNINSTALL PLUGIN daemon_memcached;
DROP DATABASE innodb_memcache;
SET @@global.transaction_isolation= @transaction_isolation;
|