| 1 |
connection node_2; |
| 2 |
connection node_1; |
| 3 |
CREATE TABLE t1 (id INT PRIMARY KEY) ENGINE=InnoDB; |
| 4 |
INSERT INTO t1 VALUES (1); |
| 5 |
connection node_2; |
| 6 |
FLUSH TABLE WITH READ LOCK; |
| 7 |
### This shouldn't block. |
| 8 |
FLUSH TABLES t1 FOR EXPORT; |
| 9 |
connection node_1; |
| 10 |
ALTER TABLE t1 ADD COLUMN f2 INTEGER; |
| 11 |
connection node_2; |
| 12 |
UNLOCK TABLES; |
| 13 |
### t1 should have column f2 |
| 14 |
SHOW CREATE TABLE t1; |
| 15 |
Table Create Table |
| 16 |
t1 CREATE TABLE `t1` ( |
| 17 |
`id` int(11) NOT NULL, |
| 18 |
`f2` int(11) DEFAULT NULL, |
| 19 |
PRIMARY KEY (`id`) |
| 20 |
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_uca1400_ai_ci |
| 21 |
connection node_1; |
| 22 |
INSERT INTO t1 VALUES (2,3); |
| 23 |
connection node_2; |
| 24 |
SELECT * from t1; |
| 25 |
id f2 |
| 26 |
1 NULL |
| 27 |
2 3 |
| 28 |
connection node_1; |
| 29 |
DROP TABLE t1; |