| 1 |
create table t (a int NOT NULL) engine=innodb row_format= compressed; |
| 2 |
alter table t modify a int NULL, algorithm=instant; |
| 3 |
ERROR 0A000: ALGORITHM=INSTANT is not supported for this operation. Try ALGORITHM=INPLACE |
| 4 |
drop table t; |
| 5 |
create table t (a int NOT NULL) engine=innodb row_format= dynamic; |
| 6 |
alter table t modify a int NULL, algorithm=instant; |
| 7 |
ERROR 0A000: ALGORITHM=INSTANT is not supported for this operation. Try ALGORITHM=INPLACE |
| 8 |
drop table t; |
| 9 |
create table t (a int NOT NULL) engine=innodb row_format= compact; |
| 10 |
alter table t modify a int NULL, algorithm=instant; |
| 11 |
ERROR 0A000: ALGORITHM=INSTANT is not supported for this operation. Try ALGORITHM=INPLACE |
| 12 |
drop table t; |
| 13 |
create table t ( |
| 14 |
id int primary key, |
| 15 |
a int NOT NULL default 0, |
| 16 |
b int NOT NULL default 0, |
| 17 |
c int NOT NULL default 0, |
| 18 |
index idx (a,b,c) |
| 19 |
) engine=innodb row_format=redundant; |
| 20 |
insert into t (id, a) values (0, NULL); |
| 21 |
ERROR 23000: Column 'a' cannot be null |
| 22 |
insert into t (id, b) values (0, NULL); |
| 23 |
ERROR 23000: Column 'b' cannot be null |
| 24 |
insert into t (id, c) values (0, NULL); |
| 25 |
ERROR 23000: Column 'c' cannot be null |
| 26 |
insert into t values (1,1,1,1); |
| 27 |
set @id = (select table_id from information_schema.innodb_sys_tables |
| 28 |
where name = 'test/t'); |
| 29 |
select * from information_schema.innodb_sys_columns where table_id=@id; |
| 30 |
TABLE_ID NAME POS MTYPE PRTYPE LEN |
| 31 |
TABLE_ID id 0 6 1283 4 |
| 32 |
TABLE_ID a 1 6 1283 4 |
| 33 |
TABLE_ID b 2 6 1283 4 |
| 34 |
TABLE_ID c 3 6 1283 4 |
| 35 |
alter table t modify a int NULL, algorithm=instant; |
| 36 |
insert into t values (2, NULL, 2, 2); |
| 37 |
alter table t modify b int NULL, algorithm=nocopy; |
| 38 |
insert into t values (3, NULL, NULL, 3); |
| 39 |
alter table t modify c int NULL, algorithm=inplace; |
| 40 |
insert into t values (4, NULL, NULL, NULL); |
| 41 |
select * from information_schema.innodb_sys_columns where table_id=@id; |
| 42 |
TABLE_ID NAME POS MTYPE PRTYPE LEN |
| 43 |
TABLE_ID id 0 6 1283 4 |
| 44 |
TABLE_ID a 1 6 1027 4 |
| 45 |
TABLE_ID b 2 6 1027 4 |
| 46 |
TABLE_ID c 3 6 1027 4 |
| 47 |
select * from t; |
| 48 |
id a b c |
| 49 |
4 NULL NULL NULL |
| 50 |
3 NULL NULL 3 |
| 51 |
2 NULL 2 2 |
| 52 |
1 1 1 1 |
| 53 |
check table t; |
| 54 |
Table Op Msg_type Msg_text |
| 55 |
test.t check status OK |
| 56 |
drop table t; |