| 1 |
--source include/have_ndb.inc |
| 2 |
|
| 3 |
# |
| 4 |
# Test copying alter table |
| 5 |
# |
| 6 |
CREATE TABLE t1 ( |
| 7 |
a int PRIMARY KEY, |
| 8 |
b varchar(255) |
| 9 |
) ENGINE = NDB; |
| 10 |
INSERT INTO t1 VALUES (1, "MySQL Server with NDB"); |
| 11 |
INSERT INTO t1 (a, b) VALUES (11, "Barrier effect"); |
| 12 |
INSERT INTO t1 (a, b) VALUES |
| 13 |
(12, "The third row"), |
| 14 |
(37, "And of course number 37"); |
| 15 |
|
| 16 |
# Show table contents |
| 17 |
SELECT * FROM t1 ORDER BY a; |
| 18 |
|
| 19 |
ALTER TABLE t1 ALGORITHM=COPY, ADD COLUMN c INT NOT NULL DEFAULT 14; |
| 20 |
|
| 21 |
# Show tables contents unchanged and new column added |
| 22 |
SELECT * FROM t1 ORDER BY a; |
| 23 |
|
| 24 |
DROP TABLE t1; |