[MDEV-33179] Duplicate values upon InnoDB bulk insert cause complete silent rollback Created: 2024-01-04  Updated: 2024-02-01

Status: Open
Project: MariaDB Server
Component/s: Storage Engine - InnoDB
Affects Version/s: 10.7, 10.11, 11.0, 11.1, 11.2, 11.3
Fix Version/s: 10.11, 11.0, 11.1, 11.2, 11.3

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

Issue Links:
Relates
relates to MDEV-33350 Bulk InnoDB LOAD DATA breaks replicat... Confirmed

 Description   

--source include/have_innodb.inc
 
create table t (a int) engine=InnoDB;
insert into t values (1),(2),(1);
 
create table t1 (a int unique) engine=InnoDB;
SET unique_checks=0, foreign_key_checks=0;
insert into t1 select * from t;
SET unique_checks=1, foreign_key_checks=1;
select * from t1;
 
# Cleanup
drop table t, t1;

10.7.8

create table t (a int) engine=InnoDB;
insert into t values (1),(2),(1);
create table t1 (a int unique) engine=InnoDB;
SET unique_checks=0, foreign_key_checks=0;
insert into t1 select * from t;
SET unique_checks=1, foreign_key_checks=1;
select * from t1;
a
drop table t, t1;

So, the table ends up empty, but there are no hints for the user that the operation didn't succeed.
Reproducible on 10.7+. 10.6 returns a duplicate key error.
According to marko, it was likely induced by MDEV-24621.

It is somewhat similar to MDEV-31985 in the sense that the table ends up empty, however in MDEV-31985 INSERT IGNORE is used, and it at least produces a warning.


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