[MDEV-15476] Inplace algorithm doesn't support changing virtual column datatype Created: 2018-03-06  Updated: 2020-05-19

Status: Stalled
Project: MariaDB Server
Component/s: Storage Engine - InnoDB
Affects Version/s: 10.1
Fix Version/s: 10.1

Type: Bug Priority: Major
Reporter: Thirunarayanan Balathandayuthapani Assignee: Thirunarayanan Balathandayuthapani
Resolution: Unresolved Votes: 0
Labels: None

Issue Links:
Relates
relates to MDEV-14046 Allow ALGORITHM=INPLACE for 10.1 tabl... Closed
relates to MDEV-14341 Allow LOCK=NONE in table-rebuilding A... Open
relates to MDEV-16332 Allow ALGORITHM=NOCOPY or INSTANT for... Confirmed
relates to MDEV-17468 Avoid table rebuild on operations on ... Stalled
relates to MDEV-19214 Virtual column type cannot be convert... Open

 Description   

Inplace algorithm doesn't support change of virtual column data type.

--source include/have_innodb.inc
create table t1(f1 int not null, f2 char(100) as ("test") virtual)engine=innodb;
alter table t1 modify column f2 varchar(200) as ("db") virtual, algorithm=inplace;
drop table t1;

Above alter fails with the following error:

failed: 1845: ALGORITHM=INPLACE is not supported for this operation. Try ALGORITHM=COPY 

There is no reason mentioned why inplace fails. Above alter doesn't affect the data or rebuild
the table. It should be part of INNOBASE_INPLACE_IGNORE flag. I think inplace should support this operation.



 Comments   
Comment by Thirunarayanan Balathandayuthapani [ 2018-03-06 ]

create table t1(f1 int not null, f2 int as (f1 * f1) virtual)engine=innodb;
alter table t1 change f2 f2 int as (f1) virtual, algorithm=inplace;
drop table t1;

Above alter passes in inplace algorithm. Only difference here is datatype change flag enabled in the bug page testcase.
I think it should be fixable in innodb itself.

I have to change reported version to 10.1

Comment by Thirunarayanan Balathandayuthapani [ 2018-03-06 ]

--source include/have_innodb.inc
create table t1(f1 int not null, f2 int as (f1) virtual, f3 int not null)engine=innodb;
insert into t1(f1, f3) values(1, 1);
 
alter table t1 modify column f2 int as (f1) virtual after f3, algorithm=inplace;
 
drop table t1;

The above alter fails in inplace. It doesn't make sense for these virtual column restriction.

Generated at Thu Feb 08 08:21:36 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.