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
15
12
add column col4_5 varchar(20) not null after col4,
16
13
add column col7 varchar(30) not null after col5,
17
14
add column col8 datetime not null default '1000-01-01 00:00:00', drop column to_be_deleted,
18
15
change column col2 fourth varchar(30) not null after col3,
19
16
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;
29
18
col6 col1 col3 fourth col4 col4_5 col5 col7 col8
30
1 2 3 4 5 added PENDING added 1000-01-01 00:00:00
19
1 2 3 4 5 PENDING 1000-01-01 00:00:00
32
21
create table t1 (bandID INT NOT NULL PRIMARY KEY, payoutID int NOT NULL);
33
22
insert into t1 (bandID,payoutID) VALUES (1,6),(2,6),(3,4),(4,9),(5,10),(6,1),(7,12),(8,12);
861
850
"Non-copy data change - new frm, but old data and index files"
862
851
ALTER TABLE t1 CHANGE int_field unsigned_int_field INTEGER NOT NULL, RENAME t2;
863
852
SELECT * FROM t1 ORDER BY int_field;
864
ERROR 42S02: Unknown table 'test.t1'
853
ERROR 42S02: Table 'test.t1' doesn't exist
865
854
SELECT * FROM t2 ORDER BY unsigned_int_field;
866
855
unsigned_int_field char_field