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