| 1 |
# Prepare for creating Encrypted Table |
| 2 |
# create bootstrap file |
| 3 |
# Create and start mysqld with keyring plugin. |
| 4 |
# restart: --datadir=ENCRYPT_DATADIR --early-plugin-load=keyring_file=KEYRING_PLUGIN --keyring_file_data=MYSQL_TMP_DIR/mysecret_keyring |
| 5 |
INSTALL PLUGIN clone SONAME 'CLONE_PLUGIN'; |
| 6 |
CREATE TABLE t1(col1 INT PRIMARY KEY, col2 int, col3 varchar(64), col4 BLOB); |
| 7 |
CREATE TABLE t2(col1 INT PRIMARY KEY, col2 int, col3 varchar(64), col4 BLOB) |
| 8 |
PARTITION BY KEY(col1) PARTITIONS 5; |
| 9 |
CREATE PROCEDURE execute_dml( |
| 10 |
p_dml_type INT, |
| 11 |
p_key_min INT, |
| 12 |
p_key_range INT, |
| 13 |
p_loop_count INT, |
| 14 |
p_frequency INT, |
| 15 |
p_is_rand INT) |
| 16 |
BEGIN |
| 17 |
DECLARE v_idx INT DEFAULT 0; |
| 18 |
DECLARE v_commit INT DEFAULT 0; |
| 19 |
DECLARE v_key INT DEFAULT 0; |
| 20 |
/* Loop and INSERT data at random position */ |
| 21 |
WHILE(v_idx < p_loop_count) DO |
| 22 |
/* Generate key between 1 to p_loop_count */ |
| 23 |
IF p_is_rand = 1 THEN |
| 24 |
SET v_key = p_key_min + FLOOR(RAND() * p_key_range); |
| 25 |
ELSE |
| 26 |
SET v_key = p_key_min + (v_idx % p_key_range); |
| 27 |
END IF; |
| 28 |
CASE p_dml_type |
| 29 |
WHEN 0 THEN |
| 30 |
SET @clol3_text = CONCAT('Clone Test Row - ', v_key); |
| 31 |
INSERT INTO t1 (col1, col2, col3, col4) VALUES ( |
| 32 |
v_key, v_key * 10, |
| 33 |
@clol3_text, REPEAT('Large Column Data ', 2048)) |
| 34 |
ON DUPLICATE KEY UPDATE col2 = col2 + 1; |
| 35 |
INSERT INTO t2 (col1, col2, col3, col4) VALUES ( |
| 36 |
v_key, v_key * 10, |
| 37 |
@clol3_text, REPEAT('Large Column Data ', 2048)) |
| 38 |
ON DUPLICATE KEY UPDATE col2 = col2 + 1; |
| 39 |
WHEN 1 THEN |
| 40 |
UPDATE t1 SET col2 = v_idx + 1 WHERE col1 = v_key; |
| 41 |
UPDATE t2 SET col2 = v_idx + 1 WHERE col1 = v_key; |
| 42 |
WHEN 2 THEN |
| 43 |
DELETE FROM t1 WHERE col1 = v_key; |
| 44 |
DELETE FROM t2 WHERE col1 = v_key; |
| 45 |
ELSE |
| 46 |
DELETE FROM t1; |
| 47 |
DELETE FROM t2; |
| 48 |
END CASE; |
| 49 |
SET v_idx = v_idx + 1; |
| 50 |
/* Commit or rollback work at specified frequency. */ |
| 51 |
IF v_idx % p_frequency = 0 THEN |
| 52 |
SET v_commit = FLOOR(RAND() * 2); |
| 53 |
IF v_commit = 0 AND p_is_rand = 1 THEN |
| 54 |
ROLLBACK; |
| 55 |
START TRANSACTION; |
| 56 |
ELSE |
| 57 |
COMMIT; |
| 58 |
START TRANSACTION; |
| 59 |
END IF; |
| 60 |
END IF; |
| 61 |
END WHILE; |
| 62 |
COMMIT; |
| 63 |
END| |
| 64 |
call execute_dml(0, 0, 100, 100, 10, 0); |
| 65 |
CREATE TABLE t SELECT * FROM t1; |
| 66 |
CREATE TABLE t0 (col1 INT PRIMARY KEY, col2 int, col3 varchar(64), col4 BLOB); |
| 67 |
CREATE TABLE t01 (col1 INT PRIMARY KEY, col2 int, col3 varchar(64), col4 BLOB); |
| 68 |
CREATE TABLE t3 (col1 INT PRIMARY KEY, col2 int, col3 varchar(64), col4 BLOB); |
| 69 |
CREATE TABLE t11 (col1 INT PRIMARY KEY, col2 int, col3 varchar(64), col4 BLOB); |
| 70 |
CREATE TABLE t21 (col1 INT PRIMARY KEY, col2 int, col3 varchar(64), col4 BLOB); |
| 71 |
INSERT INTO t11 SELECT * FROM t; |
| 72 |
INSERT INTO t21 SELECT * FROM t; |
| 73 |
SHOW VARIABLES LIKE 'clone_ddl_timeout'; |
| 74 |
Variable_name Value |
| 75 |
clone_ddl_timeout 300 |
| 76 |
SHOW VARIABLES LIKE 'clone_block_ddl'; |
| 77 |
Variable_name Value |
| 78 |
clone_block_ddl OFF |
| 79 |
CREATE TABLESPACE tbs; |
| 80 |
DROP TABLE t1; |
| 81 |
CREATE TABLE t1(col1 INT PRIMARY KEY, col2 int, col3 varchar(64), col4 BLOB) |
| 82 |
TABLESPACE = tbs; |
| 83 |
DROP TABLE t2; |
| 84 |
CREATE TABLE t2(col1 INT PRIMARY KEY, col2 int, col3 varchar(64), col4 BLOB) |
| 85 |
TABLESPACE = tbs; |
| 86 |
# 1. Enable REDO and UNDO encryption while clone in progress |
| 87 |
RESET MASTER; |
| 88 |
SET GLOBAL DEBUG = '+d,local_release_clone_file_pin'; |
| 89 |
SET GLOBAL DEBUG = '+d,log_redo_with_invalid_master_key'; |
| 90 |
SET DEBUG_SYNC = 'clone_before_init_meta SIGNAL start_ddl_file_init WAIT_FOR resume_file_init'; |
| 91 |
SET DEBUG_SYNC = 'clone_file_copy SIGNAL start_ddl_file WAIT_FOR resume_file'; |
| 92 |
SET DEBUG_SYNC = 'clone_file_copy_end_before_ack SIGNAL start_ddl_file_ack WAIT_FOR resume_file_ack'; |
| 93 |
SET DEBUG_SYNC = 'clone_before_file_ddl_meta SIGNAL start_ddl_file_meta WAIT_FOR resume_file_meta'; |
| 94 |
SET DEBUG_SYNC = 'clone_page_copy SIGNAL start_ddl_page WAIT_FOR resume_page'; |
| 95 |
SET DEBUG_SYNC = 'clone_before_page_ddl_meta SIGNAL start_ddl_page_meta WAIT_FOR resume_page_meta'; |
| 96 |
SET DEBUG_SYNC = 'clone_redo_copy SIGNAL start_ddl_redo WAIT_FOR resume_redo'; |
| 97 |
SET GLOBAL clone_autotune_concurrency = OFF; |
| 98 |
SET GLOBAL clone_max_concurrency = 8; |
| 99 |
CLONE LOCAL DATA DIRECTORY = 'CLONE_DATADIR'; |
| 100 |
# In connection CON1 |
| 101 |
# Waiting for clone to reach 'Initial metadata transfer' |
| 102 |
SET DEBUG_SYNC = 'now WAIT_FOR start_ddl_file_init'; |
| 103 |
# Wait finished |
| 104 |
SET GLOBAL innodb_redo_log_encrypt = ON; |
| 105 |
SET GLOBAL innodb_undo_log_encrypt = ON; |
| 106 |
ALTER TABLESPACE tbs ENCRYPTION = 'Y'; |
| 107 |
SET DEBUG_SYNC = 'now SIGNAL resume_file_init'; |
| 108 |
# Waiting for clone to reach 'file copy' |
| 109 |
SET DEBUG_SYNC = 'now WAIT_FOR start_ddl_file'; |
| 110 |
# Wait finished |
| 111 |
SET GLOBAL innodb_redo_log_encrypt = ON; |
| 112 |
SET GLOBAL innodb_undo_log_encrypt = ON; |
| 113 |
ALTER TABLESPACE tbs ENCRYPTION = 'Y'; |
| 114 |
CALL execute_dml(0, 0, 100, 100, 10, 0); |
| 115 |
# Flush all dirty pages to track |
| 116 |
SET GLOBAL innodb_buf_flush_list_now = 1; |
| 117 |
SET DEBUG_SYNC = 'now SIGNAL resume_file'; |
| 118 |
SET DEBUG_SYNC = 'now WAIT_FOR start_ddl_file_ack'; |
| 119 |
SET DEBUG_SYNC = 'now SIGNAL resume_file_ack'; |
| 120 |
# Waiting for clone to reach DDL metadata for 'file copy' |
| 121 |
SET DEBUG_SYNC = 'now WAIT_FOR start_ddl_file_meta'; |
| 122 |
# Wait finished |
| 123 |
SET GLOBAL innodb_redo_log_encrypt = ON; |
| 124 |
SET GLOBAL innodb_undo_log_encrypt = ON; |
| 125 |
ALTER TABLESPACE tbs ENCRYPTION = 'Y'; |
| 126 |
CALL execute_dml(0, 0, 100, 100, 10, 0); |
| 127 |
SET DEBUG_SYNC = 'now SIGNAL resume_file_meta'; |
| 128 |
# Waiting for clone to reach 'page copy' |
| 129 |
SET DEBUG_SYNC = 'now WAIT_FOR start_ddl_page'; |
| 130 |
# Wait finished |
| 131 |
SET GLOBAL innodb_redo_log_encrypt = ON; |
| 132 |
SET GLOBAL innodb_undo_log_encrypt = ON; |
| 133 |
ALTER TABLESPACE tbs ENCRYPTION = 'Y'; |
| 134 |
CALL execute_dml(0, 0, 100, 100, 10, 0); |
| 135 |
SET DEBUG_SYNC = 'now SIGNAL resume_page'; |
| 136 |
# Waiting for clone to reach DDL metadata for 'page copy' |
| 137 |
SET DEBUG_SYNC = 'now WAIT_FOR start_ddl_page_meta'; |
| 138 |
# Wait finished |
| 139 |
SET GLOBAL innodb_redo_log_encrypt = ON; |
| 140 |
SET GLOBAL innodb_undo_log_encrypt = ON; |
| 141 |
ALTER TABLESPACE tbs ENCRYPTION = 'Y'; |
| 142 |
CALL execute_dml(0, 0, 100, 100, 10, 0); |
| 143 |
SET DEBUG_SYNC = 'now SIGNAL resume_page_meta'; |
| 144 |
# Waiting for clone to reach 'redo copy' |
| 145 |
SET DEBUG_SYNC = 'now WAIT_FOR start_ddl_redo'; |
| 146 |
# Wait finished |
| 147 |
SET GLOBAL innodb_redo_log_encrypt = ON; |
| 148 |
SET GLOBAL innodb_undo_log_encrypt = ON; |
| 149 |
ALTER TABLESPACE tbs ENCRYPTION = 'Y'; |
| 150 |
SET DEBUG_SYNC = 'now SIGNAL resume_redo'; |
| 151 |
# In connection DEFAULT |
| 152 |
# Waiting for clone to complete |
| 153 |
# Wait finished |
| 154 |
SET GLOBAL DEBUG = '-d,local_release_clone_file_pin'; |
| 155 |
# Restart server on cloned data directory |
| 156 |
# restart: --datadir=CLONE_DATADIR --early-plugin-load=keyring_file=KEYRING_PLUGIN --keyring_file_data=MYSQL_TMP_DIR/mysecret_keyring |
| 157 |
# Check cloned data |
| 158 |
SHOW TABLES; |
| 159 |
Tables_in_test |
| 160 |
t |
| 161 |
t0 |
| 162 |
t01 |
| 163 |
t1 |
| 164 |
t11 |
| 165 |
t2 |
| 166 |
t21 |
| 167 |
t3 |
| 168 |
SHOW CREATE TABLE t1; |
| 169 |
Table Create Table |
| 170 |
t1 CREATE TABLE `t1` ( |
| 171 |
`col1` int NOT NULL, |
| 172 |
`col2` int DEFAULT NULL, |
| 173 |
`col3` varchar(64) DEFAULT NULL, |
| 174 |
`col4` blob, |
| 175 |
PRIMARY KEY (`col1`) |
| 176 |
) /*!50100 TABLESPACE `tbs` */ ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!80016 ENCRYPTION='Y' */ |
| 177 |
CHECK TABLE t1 EXTENDED; |
| 178 |
Table Op Msg_type Msg_text |
| 179 |
test.t1 check status OK |
| 180 |
SELECT count(*) from t1; |
| 181 |
count(*) |
| 182 |
100 |
| 183 |
SELECT col1, col2, col3 FROM t1 ORDER BY col1 LIMIT 10;; |
| 184 |
col1 col2 col3 |
| 185 |
0 2 Clone Test Row - 0 |
| 186 |
1 12 Clone Test Row - 1 |
| 187 |
2 22 Clone Test Row - 2 |
| 188 |
3 32 Clone Test Row - 3 |
| 189 |
4 42 Clone Test Row - 4 |
| 190 |
5 52 Clone Test Row - 5 |
| 191 |
6 62 Clone Test Row - 6 |
| 192 |
7 72 Clone Test Row - 7 |
| 193 |
8 82 Clone Test Row - 8 |
| 194 |
9 92 Clone Test Row - 9 |
| 195 |
SELECT col1, col2, col3 FROM t1 ORDER BY col1 DESC LIMIT 10;; |
| 196 |
col1 col2 col3 |
| 197 |
99 992 Clone Test Row - 99 |
| 198 |
98 982 Clone Test Row - 98 |
| 199 |
97 972 Clone Test Row - 97 |
| 200 |
96 962 Clone Test Row - 96 |
| 201 |
95 952 Clone Test Row - 95 |
| 202 |
94 942 Clone Test Row - 94 |
| 203 |
93 932 Clone Test Row - 93 |
| 204 |
92 922 Clone Test Row - 92 |
| 205 |
91 912 Clone Test Row - 91 |
| 206 |
90 902 Clone Test Row - 90 |
| 207 |
SHOW CREATE TABLE t11; |
| 208 |
Table Create Table |
| 209 |
t11 CREATE TABLE `t11` ( |
| 210 |
`col1` int NOT NULL, |
| 211 |
`col2` int DEFAULT NULL, |
| 212 |
`col3` varchar(64) DEFAULT NULL, |
| 213 |
`col4` blob, |
| 214 |
PRIMARY KEY (`col1`) |
| 215 |
) ENGINE=InnoDB DEFAULT CHARSET=latin1 |
| 216 |
CHECK TABLE t11 EXTENDED; |
| 217 |
Table Op Msg_type Msg_text |
| 218 |
test.t11 check status OK |
| 219 |
SELECT count(*) from t11; |
| 220 |
count(*) |
| 221 |
100 |
| 222 |
SELECT col1, col2, col3 FROM t11 ORDER BY col1 LIMIT 10;; |
| 223 |
col1 col2 col3 |
| 224 |
0 0 Clone Test Row - 0 |
| 225 |
1 10 Clone Test Row - 1 |
| 226 |
2 20 Clone Test Row - 2 |
| 227 |
3 30 Clone Test Row - 3 |
| 228 |
4 40 Clone Test Row - 4 |
| 229 |
5 50 Clone Test Row - 5 |
| 230 |
6 60 Clone Test Row - 6 |
| 231 |
7 70 Clone Test Row - 7 |
| 232 |
8 80 Clone Test Row - 8 |
| 233 |
9 90 Clone Test Row - 9 |
| 234 |
SELECT col1, col2, col3 FROM t11 ORDER BY col1 DESC LIMIT 10;; |
| 235 |
col1 col2 col3 |
| 236 |
99 990 Clone Test Row - 99 |
| 237 |
98 980 Clone Test Row - 98 |
| 238 |
97 970 Clone Test Row - 97 |
| 239 |
96 960 Clone Test Row - 96 |
| 240 |
95 950 Clone Test Row - 95 |
| 241 |
94 940 Clone Test Row - 94 |
| 242 |
93 930 Clone Test Row - 93 |
| 243 |
92 920 Clone Test Row - 92 |
| 244 |
91 910 Clone Test Row - 91 |
| 245 |
90 900 Clone Test Row - 90 |
| 246 |
SHOW CREATE TABLE t2; |
| 247 |
Table Create Table |
| 248 |
t2 CREATE TABLE `t2` ( |
| 249 |
`col1` int NOT NULL, |
| 250 |
`col2` int DEFAULT NULL, |
| 251 |
`col3` varchar(64) DEFAULT NULL, |
| 252 |
`col4` blob, |
| 253 |
PRIMARY KEY (`col1`) |
| 254 |
) /*!50100 TABLESPACE `tbs` */ ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!80016 ENCRYPTION='Y' */ |
| 255 |
CHECK TABLE t2 EXTENDED; |
| 256 |
Table Op Msg_type Msg_text |
| 257 |
test.t2 check status OK |
| 258 |
SELECT count(*) from t2; |
| 259 |
count(*) |
| 260 |
100 |
| 261 |
SELECT col1, col2, col3 FROM t2 ORDER BY col1 LIMIT 10;; |
| 262 |
col1 col2 col3 |
| 263 |
0 2 Clone Test Row - 0 |
| 264 |
1 12 Clone Test Row - 1 |
| 265 |
2 22 Clone Test Row - 2 |
| 266 |
3 32 Clone Test Row - 3 |
| 267 |
4 42 Clone Test Row - 4 |
| 268 |
5 52 Clone Test Row - 5 |
| 269 |
6 62 Clone Test Row - 6 |
| 270 |
7 72 Clone Test Row - 7 |
| 271 |
8 82 Clone Test Row - 8 |
| 272 |
9 92 Clone Test Row - 9 |
| 273 |
SELECT col1, col2, col3 FROM t2 ORDER BY col1 DESC LIMIT 10;; |
| 274 |
col1 col2 col3 |
| 275 |
99 992 Clone Test Row - 99 |
| 276 |
98 982 Clone Test Row - 98 |
| 277 |
97 972 Clone Test Row - 97 |
| 278 |
96 962 Clone Test Row - 96 |
| 279 |
95 952 Clone Test Row - 95 |
| 280 |
94 942 Clone Test Row - 94 |
| 281 |
93 932 Clone Test Row - 93 |
| 282 |
92 922 Clone Test Row - 92 |
| 283 |
91 912 Clone Test Row - 91 |
| 284 |
90 902 Clone Test Row - 90 |
| 285 |
call execute_dml(1, 0, 100, 100, 10, 0); |
| 286 |
# Restart server back on base data directory |
| 287 |
# restart: --datadir=ENCRYPT_DATADIR --early-plugin-load=keyring_file=KEYRING_PLUGIN --keyring_file_data=MYSQL_TMP_DIR/mysecret_keyring |
| 288 |
SET DEBUG_SYNC = 'RESET'; |
| 289 |
# 2. Disable REDO and UNDO encryption while clone in progress |
| 290 |
RESET MASTER; |
| 291 |
SET GLOBAL DEBUG = '+d,local_release_clone_file_pin'; |
| 292 |
SET GLOBAL DEBUG = '+d,log_redo_with_invalid_master_key'; |
| 293 |
SET DEBUG_SYNC = 'clone_before_init_meta SIGNAL start_ddl_file_init WAIT_FOR resume_file_init'; |
| 294 |
SET DEBUG_SYNC = 'clone_file_copy SIGNAL start_ddl_file WAIT_FOR resume_file'; |
| 295 |
SET DEBUG_SYNC = 'clone_file_copy_end_before_ack SIGNAL start_ddl_file_ack WAIT_FOR resume_file_ack'; |
| 296 |
SET DEBUG_SYNC = 'clone_before_file_ddl_meta SIGNAL start_ddl_file_meta WAIT_FOR resume_file_meta'; |
| 297 |
SET DEBUG_SYNC = 'clone_page_copy SIGNAL start_ddl_page WAIT_FOR resume_page'; |
| 298 |
SET DEBUG_SYNC = 'clone_before_page_ddl_meta SIGNAL start_ddl_page_meta WAIT_FOR resume_page_meta'; |
| 299 |
SET DEBUG_SYNC = 'clone_redo_copy SIGNAL start_ddl_redo WAIT_FOR resume_redo'; |
| 300 |
SET GLOBAL clone_autotune_concurrency = OFF; |
| 301 |
SET GLOBAL clone_max_concurrency = 8; |
| 302 |
CLONE LOCAL DATA DIRECTORY = 'CLONE_DATADIR'; |
| 303 |
# In connection CON1 |
| 304 |
# Waiting for clone to reach 'Initial metadata transfer' |
| 305 |
SET DEBUG_SYNC = 'now WAIT_FOR start_ddl_file_init'; |
| 306 |
# Wait finished |
| 307 |
SET GLOBAL innodb_redo_log_encrypt = OFF; |
| 308 |
SET GLOBAL innodb_undo_log_encrypt = OFF; |
| 309 |
ALTER TABLESPACE tbs ENCRYPTION = 'N'; |
| 310 |
SET DEBUG_SYNC = 'now SIGNAL resume_file_init'; |
| 311 |
# Waiting for clone to reach 'file copy' |
| 312 |
SET DEBUG_SYNC = 'now WAIT_FOR start_ddl_file'; |
| 313 |
# Wait finished |
| 314 |
SET GLOBAL innodb_redo_log_encrypt = OFF; |
| 315 |
SET GLOBAL innodb_undo_log_encrypt = OFF; |
| 316 |
ALTER TABLESPACE tbs ENCRYPTION = 'N'; |
| 317 |
call execute_dml(1, 0, 100, 100, 10, 0); |
| 318 |
# Flush all dirty pages to track |
| 319 |
SET GLOBAL innodb_buf_flush_list_now = 1; |
| 320 |
SET DEBUG_SYNC = 'now SIGNAL resume_file'; |
| 321 |
SET DEBUG_SYNC = 'now WAIT_FOR start_ddl_file_ack'; |
| 322 |
SET DEBUG_SYNC = 'now SIGNAL resume_file_ack'; |
| 323 |
# Waiting for clone to reach DDL metadata for 'file copy' |
| 324 |
SET DEBUG_SYNC = 'now WAIT_FOR start_ddl_file_meta'; |
| 325 |
# Wait finished |
| 326 |
SET GLOBAL innodb_redo_log_encrypt = OFF; |
| 327 |
SET GLOBAL innodb_undo_log_encrypt = OFF; |
| 328 |
ALTER TABLESPACE tbs ENCRYPTION = 'N'; |
| 329 |
INSERT INTO t11 SELECT * FROM t ON DUPLICATE KEY UPDATE col2 = t11.col2 + 1;; |
| 330 |
SET DEBUG_SYNC = 'now SIGNAL resume_file_meta'; |
| 331 |
# Waiting for clone to reach 'page copy' |
| 332 |
SET DEBUG_SYNC = 'now WAIT_FOR start_ddl_page'; |
| 333 |
# Wait finished |
| 334 |
SET GLOBAL innodb_redo_log_encrypt = OFF; |
| 335 |
SET GLOBAL innodb_undo_log_encrypt = OFF; |
| 336 |
ALTER TABLESPACE tbs ENCRYPTION = 'N'; |
| 337 |
call execute_dml(1, 0, 100, 100, 10, 0); |
| 338 |
SET DEBUG_SYNC = 'now SIGNAL resume_page'; |
| 339 |
# Waiting for clone to reach DDL metadata for 'page copy' |
| 340 |
SET DEBUG_SYNC = 'now WAIT_FOR start_ddl_page_meta'; |
| 341 |
# Wait finished |
| 342 |
SET GLOBAL innodb_redo_log_encrypt = OFF; |
| 343 |
SET GLOBAL innodb_undo_log_encrypt = OFF; |
| 344 |
ALTER TABLESPACE tbs ENCRYPTION = 'N'; |
| 345 |
INSERT INTO t21 SELECT * FROM t ON DUPLICATE KEY UPDATE col2 = t21.col2 + 1;; |
| 346 |
SET DEBUG_SYNC = 'now SIGNAL resume_page_meta'; |
| 347 |
# Waiting for clone to reach 'redo copy' |
| 348 |
SET DEBUG_SYNC = 'now WAIT_FOR start_ddl_redo'; |
| 349 |
# Wait finished |
| 350 |
SET GLOBAL innodb_redo_log_encrypt = OFF; |
| 351 |
SET GLOBAL innodb_undo_log_encrypt = OFF; |
| 352 |
ALTER TABLESPACE tbs ENCRYPTION = 'N'; |
| 353 |
SET DEBUG_SYNC = 'now SIGNAL resume_redo'; |
| 354 |
# In connection DEFAULT |
| 355 |
# Waiting for clone to complete |
| 356 |
# Wait finished |
| 357 |
SET GLOBAL DEBUG = '-d,local_release_clone_file_pin'; |
| 358 |
# Restart server on cloned data directory |
| 359 |
# restart: --datadir=CLONE_DATADIR --early-plugin-load=keyring_file=KEYRING_PLUGIN --keyring_file_data=MYSQL_TMP_DIR/mysecret_keyring |
| 360 |
# Check cloned data |
| 361 |
SHOW TABLES; |
| 362 |
Tables_in_test |
| 363 |
t |
| 364 |
t0 |
| 365 |
t01 |
| 366 |
t1 |
| 367 |
t11 |
| 368 |
t2 |
| 369 |
t21 |
| 370 |
t3 |
| 371 |
SHOW CREATE TABLE t1; |
| 372 |
Table Create Table |
| 373 |
t1 CREATE TABLE `t1` ( |
| 374 |
`col1` int NOT NULL, |
| 375 |
`col2` int DEFAULT NULL, |
| 376 |
`col3` varchar(64) DEFAULT NULL, |
| 377 |
`col4` blob, |
| 378 |
PRIMARY KEY (`col1`) |
| 379 |
) /*!50100 TABLESPACE `tbs` */ ENGINE=InnoDB DEFAULT CHARSET=latin1 |
| 380 |
CHECK TABLE t1 EXTENDED; |
| 381 |
Table Op Msg_type Msg_text |
| 382 |
test.t1 check status OK |
| 383 |
SELECT count(*) from t1; |
| 384 |
count(*) |
| 385 |
100 |
| 386 |
SELECT col1, col2, col3 FROM t1 ORDER BY col1 LIMIT 10;; |
| 387 |
col1 col2 col3 |
| 388 |
0 1 Clone Test Row - 0 |
| 389 |
1 2 Clone Test Row - 1 |
| 390 |
2 3 Clone Test Row - 2 |
| 391 |
3 4 Clone Test Row - 3 |
| 392 |
4 5 Clone Test Row - 4 |
| 393 |
5 6 Clone Test Row - 5 |
| 394 |
6 7 Clone Test Row - 6 |
| 395 |
7 8 Clone Test Row - 7 |
| 396 |
8 9 Clone Test Row - 8 |
| 397 |
9 10 Clone Test Row - 9 |
| 398 |
SELECT col1, col2, col3 FROM t1 ORDER BY col1 DESC LIMIT 10;; |
| 399 |
col1 col2 col3 |
| 400 |
99 100 Clone Test Row - 99 |
| 401 |
98 99 Clone Test Row - 98 |
| 402 |
97 98 Clone Test Row - 97 |
| 403 |
96 97 Clone Test Row - 96 |
| 404 |
95 96 Clone Test Row - 95 |
| 405 |
94 95 Clone Test Row - 94 |
| 406 |
93 94 Clone Test Row - 93 |
| 407 |
92 93 Clone Test Row - 92 |
| 408 |
91 92 Clone Test Row - 91 |
| 409 |
90 91 Clone Test Row - 90 |
| 410 |
SHOW CREATE TABLE t11; |
| 411 |
Table Create Table |
| 412 |
t11 CREATE TABLE `t11` ( |
| 413 |
`col1` int NOT NULL, |
| 414 |
`col2` int DEFAULT NULL, |
| 415 |
`col3` varchar(64) DEFAULT NULL, |
| 416 |
`col4` blob, |
| 417 |
PRIMARY KEY (`col1`) |
| 418 |
) ENGINE=InnoDB DEFAULT CHARSET=latin1 |
| 419 |
CHECK TABLE t11 EXTENDED; |
| 420 |
Table Op Msg_type Msg_text |
| 421 |
test.t11 check status OK |
| 422 |
SELECT count(*) from t11; |
| 423 |
count(*) |
| 424 |
100 |
| 425 |
SELECT col1, col2, col3 FROM t11 ORDER BY col1 LIMIT 10;; |
| 426 |
col1 col2 col3 |
| 427 |
0 1 Clone Test Row - 0 |
| 428 |
1 11 Clone Test Row - 1 |
| 429 |
2 21 Clone Test Row - 2 |
| 430 |
3 31 Clone Test Row - 3 |
| 431 |
4 41 Clone Test Row - 4 |
| 432 |
5 51 Clone Test Row - 5 |
| 433 |
6 61 Clone Test Row - 6 |
| 434 |
7 71 Clone Test Row - 7 |
| 435 |
8 81 Clone Test Row - 8 |
| 436 |
9 91 Clone Test Row - 9 |
| 437 |
SELECT col1, col2, col3 FROM t11 ORDER BY col1 DESC LIMIT 10;; |
| 438 |
col1 col2 col3 |
| 439 |
99 991 Clone Test Row - 99 |
| 440 |
98 981 Clone Test Row - 98 |
| 441 |
97 971 Clone Test Row - 97 |
| 442 |
96 961 Clone Test Row - 96 |
| 443 |
95 951 Clone Test Row - 95 |
| 444 |
94 941 Clone Test Row - 94 |
| 445 |
93 931 Clone Test Row - 93 |
| 446 |
92 921 Clone Test Row - 92 |
| 447 |
91 911 Clone Test Row - 91 |
| 448 |
90 901 Clone Test Row - 90 |
| 449 |
SHOW CREATE TABLE t2; |
| 450 |
Table Create Table |
| 451 |
t2 CREATE TABLE `t2` ( |
| 452 |
`col1` int NOT NULL, |
| 453 |
`col2` int DEFAULT NULL, |
| 454 |
`col3` varchar(64) DEFAULT NULL, |
| 455 |
`col4` blob, |
| 456 |
PRIMARY KEY (`col1`) |
| 457 |
) /*!50100 TABLESPACE `tbs` */ ENGINE=InnoDB DEFAULT CHARSET=latin1 |
| 458 |
CHECK TABLE t2 EXTENDED; |
| 459 |
Table Op Msg_type Msg_text |
| 460 |
test.t2 check status OK |
| 461 |
SELECT count(*) from t2; |
| 462 |
count(*) |
| 463 |
100 |
| 464 |
SELECT col1, col2, col3 FROM t2 ORDER BY col1 LIMIT 10;; |
| 465 |
col1 col2 col3 |
| 466 |
0 1 Clone Test Row - 0 |
| 467 |
1 2 Clone Test Row - 1 |
| 468 |
2 3 Clone Test Row - 2 |
| 469 |
3 4 Clone Test Row - 3 |
| 470 |
4 5 Clone Test Row - 4 |
| 471 |
5 6 Clone Test Row - 5 |
| 472 |
6 7 Clone Test Row - 6 |
| 473 |
7 8 Clone Test Row - 7 |
| 474 |
8 9 Clone Test Row - 8 |
| 475 |
9 10 Clone Test Row - 9 |
| 476 |
SELECT col1, col2, col3 FROM t2 ORDER BY col1 DESC LIMIT 10;; |
| 477 |
col1 col2 col3 |
| 478 |
99 100 Clone Test Row - 99 |
| 479 |
98 99 Clone Test Row - 98 |
| 480 |
97 98 Clone Test Row - 97 |
| 481 |
96 97 Clone Test Row - 96 |
| 482 |
95 96 Clone Test Row - 95 |
| 483 |
94 95 Clone Test Row - 94 |
| 484 |
93 94 Clone Test Row - 93 |
| 485 |
92 93 Clone Test Row - 92 |
| 486 |
91 92 Clone Test Row - 91 |
| 487 |
90 91 Clone Test Row - 90 |
| 488 |
call execute_dml(1, 0, 100, 100, 10, 0); |
| 489 |
# Restart server back on base data directory |
| 490 |
# restart: --datadir=ENCRYPT_DATADIR --early-plugin-load=keyring_file=KEYRING_PLUGIN --keyring_file_data=MYSQL_TMP_DIR/mysecret_keyring |
| 491 |
SET DEBUG_SYNC = 'RESET'; |
| 492 |
# Cleanup |
| 493 |
DROP TABLE t; |
| 494 |
DROP TABLE t1; |
| 495 |
DROP TABLE t2; |
| 496 |
DROP PROCEDURE execute_dml; |
| 497 |
DROP TABLE t0; |
| 498 |
DROP TABLE t01; |
| 499 |
DROP TABLE t3; |
| 500 |
DROP TABLE t11; |
| 501 |
DROP TABLE t21; |
| 502 |
DROP TABLESPACE tbs; |
| 503 |
# Uninstall clone |
| 504 |
UNINSTALL PLUGIN clone; |
| 505 |
# Restart server and remove encrypted data directory |
| 506 |
# restart: |