mirror of
https://github.com/MariaDB/server.git
synced 2025-01-19 05:22:25 +01:00
42 lines
962 B
Text
42 lines
962 B
Text
|
-- source include/have_ndb.inc
|
||
|
|
||
|
--disable_warnings
|
||
|
DROP TABLE IF EXISTS t1;
|
||
|
--enable_warnings
|
||
|
|
||
|
#
|
||
|
# Basic test to show that the ALTER TABLE
|
||
|
# is working
|
||
|
#
|
||
|
CREATE TABLE t1 (
|
||
|
a INT NOT NULL,
|
||
|
b INT NOT NULL
|
||
|
) ENGINE=ndbcluster;
|
||
|
|
||
|
INSERT INTO t1 VALUES (9410,9412);
|
||
|
|
||
|
ALTER TABLE t1 ADD COLUMN c int not null;
|
||
|
SELECT * FROM t1;
|
||
|
|
||
|
DROP TABLE t1;
|
||
|
|
||
|
#
|
||
|
# More advanced test
|
||
|
#
|
||
|
create table t1 (
|
||
|
col1 int not null auto_increment primary key,
|
||
|
col2 varchar(30) not null,
|
||
|
col3 varchar (20) not null,
|
||
|
col4 varchar(4) not null,
|
||
|
col5 enum('PENDING', 'ACTIVE', 'DISABLED') not null,
|
||
|
col6 int not null, to_be_deleted int);
|
||
|
insert into t1 values (2,4,3,5,"PENDING",1,7);
|
||
|
alter table t1
|
||
|
add column col4_5 varchar(20) not null after col4,
|
||
|
add column col7 varchar(30) not null after col5,
|
||
|
add column col8 datetime not null, drop column to_be_deleted,
|
||
|
change column col2 fourth varchar(30) not null after col3,
|
||
|
modify column col6 int not null first;
|
||
|
select * from t1;
|
||
|
drop table t1;
|