25 lines
549 B
Plaintext
25 lines
549 B
Plaintext
--source include/have_ndb.inc
|
|
|
|
#
|
|
# Test inplace alter table
|
|
#
|
|
CREATE TABLE t1 (
|
|
a int PRIMARY KEY,
|
|
b varchar(255)
|
|
) ENGINE = NDB;
|
|
INSERT INTO t1 VALUES (1, "MySQL Server with NDB");
|
|
INSERT INTO t1 (a, b) VALUES (11, "Barrier effect");
|
|
INSERT INTO t1 (a, b) VALUES
|
|
(12, "The third row"),
|
|
(37, "And of course number 37");
|
|
|
|
# Show table contents
|
|
SELECT * FROM t1 ORDER BY a;
|
|
|
|
ALTER TABLE t1 ALGORITHM=INPLACE, ADD COLUMN c INT DEFAULT NULL;
|
|
|
|
# Show tables contents unchanged and new column added
|
|
SELECT * FROM t1 ORDER BY a;
|
|
|
|
DROP TABLE t1;
|