| 1 |
# |
| 2 |
# MDEV-9045 Inconsistent handling of "ALGORITHM=INPLACE" with PERSISTENT generated columns |
| 3 |
# |
| 4 |
--source include/have_innodb.inc |
| 5 |
|
| 6 |
create table t1(id int auto_increment primary key, handle int, data bigint not null default 0) engine = innodb; |
| 7 |
insert into t1(handle) values(12),(54),(NULL); |
| 8 |
select *, md5(handle) from t1; |
| 9 |
alter table t1 add index handle(handle), algorithm=inplace; |
| 10 |
--error ER_ALTER_OPERATION_NOT_SUPPORTED |
| 11 |
alter table t1 add column hash varchar(32) as (md5(handle)) persistent, algorithm=inplace; |
| 12 |
--error ER_ALTER_OPERATION_NOT_SUPPORTED |
| 13 |
alter table t1 add column hash varchar(32) as (md5(handle)) persistent, add unique index hash(hash), algorithm=inplace; |
| 14 |
alter table t1 add column hash varchar(32) as (md5(handle)) persistent, add unique index hash(hash), algorithm=copy; |
| 15 |
select * from t1; |
| 16 |
--error ER_ALTER_OPERATION_NOT_SUPPORTED |
| 17 |
alter table t1 modify column hash varchar(32) as (md5(handle+1)) persistent, algorithm=inplace; |
| 18 |
alter table t1 modify column hash varchar(32) as (md5(handle+1)) persistent, algorithm=copy; |
| 19 |
select * from t1; |
| 20 |
--error ER_ALTER_OPERATION_NOT_SUPPORTED |
| 21 |
alter table t1 modify column handle int not null, algorithm=inplace; |
| 22 |
SET STATEMENT sql_mode = 'NO_ENGINE_SUBSTITUTION' FOR |
| 23 |
alter table t1 modify column handle int not null, algorithm=copy; |
| 24 |
select * from t1; |
| 25 |
alter table t1 drop index handle, algorithm=inplace; |
| 26 |
create index data on t1(data) algorithm=inplace; |
| 27 |
alter table t1 drop column data, algorithm=inplace; |
| 28 |
--error ER_ALTER_OPERATION_NOT_SUPPORTED |
| 29 |
alter table t1 add column sha varchar(32) as (sha1(handle)) persistent, algorithm=inplace; |
| 30 |
alter table t1 add column sha varchar(32), algorithm=inplace; |
| 31 |
alter table t1 drop column hash, algorithm=inplace; |
| 32 |
drop table t1; |