[MDEV-28057] Online log for virtual index doesn't compute virtual column value Created: 2022-03-14  Updated: 2023-04-27

Status: Open
Project: MariaDB Server
Component/s: Storage Engine - InnoDB, Virtual Columns
Affects Version/s: 10.2, 10.3, 10.4, 10.5, 10.6, 10.7
Fix Version/s: 10.4, 10.5, 10.6

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


 Description   

InnoDB concurrent DML doesn't compute virtual column value during index build DDL. It leads to insertion of NULL value.

--source include/have_innodb.inc
--source include/have_debug.inc
 
create table t1(f1 int not null, f2 int not null,
                f3 int as (f2) virtual, index(f1),
                index(f2))engine=innodb;
insert into t1(f1, f2) values(1, 2);
set DEBUG_SYNC="innodb_inplace_alter_table_enter SIGNAL dml_start WAIT_FOR dml_finish";
send alter table t1 add index(f3), algorithm=inplace;
connect(con1,localhost,root,,,);
set DEBUG_SYNC="now WAIT_FOR dml_start";
BEGIN;
INSERT INTO t1(f1, f2) VALUES(3, 4);
UPDATE t1 SET f2= 5 WHERE f2= 4;
COMMIT;
set DEBUG_SYNC="now SIGNAL dml_finish";
disconnect con1;
connection default;
reap;
 
check table t1;
drop table t1;
 
select f3 from t1 use index(f3);
drop table t1;
set debug_sync=reset;

10.7 e67d46e4a16a6550734dbff8d1a28c578ab3b23d

check table t1;
Table	Op	Msg_type	Msg_text
test.t1	check	Warning	InnoDB: Index 'f3' contains 3 entries, should be 2.
test.t1	check	error	Corrupt
drop table t1;
set debug_sync=reset;

Server fails to send the value of virtual column for the secondary index tuple when index is being created.


Generated at Thu Feb 08 09:57:43 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.