1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-08 11:22:35 +03:00

MDEV-29813 REPLACE/IGNORE does not work with historical records in InnoDB

note that replace no longer supports system_versioning_insert_history,
the test case is only for ignore
This commit is contained in:
Sergei Golubchik
2022-10-18 20:18:07 +02:00
parent 3b6742a106
commit ab50321508
4 changed files with 50 additions and 3 deletions

View File

@@ -295,3 +295,27 @@ ERROR 42000: Access denied; you need (at least one of) the SUPER, BINLOG REPLAY
use test;
# restart: --secure-timestamp=NO
drop tables t1, t2, t3;
#
# MDEV-29813 REPLACE/IGNORE does not work with historical records in InnoDB
#
set sql_mode='STRICT_ALL_TABLES';
create or replace table t1 (a int) with system versioning;
set system_versioning_insert_history= on;
insert into t1 (a,row_start,row_end) values (1,'2022-01-01','2023-01-01'),(1,'2022-01-01','2023-01-01');
select a,row_start,row_end into outfile 'mdev29813.txt' from t1 for system_time all;
create or replace table t1 (a int primary key) with system versioning;
load data infile 'mdev29813.txt' ignore into table t1 (a,row_start,row_end);
Warnings:
Warning 1062 Duplicate entry '1' for key 'PRIMARY'
select a,row_start,row_end from t1 for system_time all;
a row_start row_end
1 2022-01-01 00:00:00.000000 2023-01-01 00:00:00.000000
create or replace table t1 (a int primary key) with system versioning;
insert ignore into t1 (a,row_start,row_end) values (1,'2022-01-01','2023-01-01'),(1,'2022-01-01','2023-01-01');
Warnings:
Warning 1062 Duplicate entry '1' for key 'PRIMARY'
select a,row_start,row_end from t1 for system_time all;
a row_start row_end
1 2022-01-01 00:00:00.000000 2023-01-01 00:00:00.000000
drop table t1;
set sql_mode=default;