8
8
col5 enum('PENDING', 'ACTIVE', 'DISABLED') not null,
9
9
col6 int not null, to_be_deleted int);
10
10
insert into t1 values (2,4,3,5,"PENDING",1,7);
12
col1 col2 col3 col4 col5 col6 to_be_deleted
12
15
add column col4_5 varchar(20) not null after col4,
13
16
add column col7 varchar(30) not null after col5,
14
17
add column col8 datetime not null default '1000-01-01 00:00:00', drop column to_be_deleted,
15
18
change column col2 fourth varchar(30) not null after col3,
16
19
modify column col6 int not null first;
20
ERROR HY000: Either a DEFAULt value or NULL NULL description is required for a new column if table is not empty
22
add column col4_5 varchar(20) DEFAULT "added" not null after col4,
23
add column col7 varchar(30) DEFAULT "added" not null after col5,
24
add column col8 datetime not null default '1000-01-01 00:00:00',
25
drop column to_be_deleted,
26
change column col2 fourth varchar(30) not null after col3,
27
modify column col6 int not null first;
18
29
col6 col1 col3 fourth col4 col4_5 col5 col7 col8
19
1 2 3 4 5 PENDING 1000-01-01 00:00:00
30
1 2 3 4 5 added PENDING added 1000-01-01 00:00:00
21
32
create table t1 (bandID INT NOT NULL PRIMARY KEY, payoutID int NOT NULL);
22
33
insert into t1 (bandID,payoutID) VALUES (1,6),(2,6),(3,4),(4,9),(5,10),(6,1),(7,12),(8,12);
850
861
"Non-copy data change - new frm, but old data and index files"
851
862
ALTER TABLE t1 CHANGE int_field unsigned_int_field INTEGER NOT NULL, RENAME t2;
852
863
SELECT * FROM t1 ORDER BY int_field;
853
ERROR 42S02: Table 'test.t1' doesn't exist
864
ERROR 42S02: Unknown table 'test.t1'
854
865
SELECT * FROM t2 ORDER BY unsigned_int_field;
855
866
unsigned_int_field char_field