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

Merge branch '10.5' into 10.6

This commit is contained in:
Oleksandr Byelkin
2023-08-01 15:08:52 +02:00
827 changed files with 11530 additions and 5879 deletions

View File

@@ -51,19 +51,22 @@ sys_trx_start SYS_DATATYPE as row start invisible,
sys_trx_end SYS_DATATYPE as row end invisible,
period for system_time (sys_trx_start, sys_trx_end))
with system versioning;
set timestamp= unix_timestamp('2000-01-01 00:00:00');
insert into t1 values(1, 1, 1);
set @ins_t= now(6);
select sys_trx_start into @tmp1 from t1;
set timestamp= unix_timestamp('2000-01-01 01:00:00');
update t1 set x= 11, y= 11 where id = 1;
select @tmp1 < sys_trx_start as A1, x, y from t1;
A1 x y
1 11 11
select sys_trx_start into @tmp1 from t1;
set timestamp= unix_timestamp('2000-01-01 02:00:00');
update t1 set y= 1 where id = 1;
select @tmp1 = sys_trx_start as A2, x from t1;
A2 x
1 11
drop table t1;
set timestamp= default;
create table t1 (
x int,
y int,
@@ -437,4 +440,46 @@ update t1 set a = 3 where b <= 9;
update t2 set a = 3 where b <= 9;
update t1, t2 set t1.a = 3, t2.a = 3 where t1.b <= 10 and t2.b <= 10 and t1.b = t2.b;
drop tables t1, t2;
#
# MDEV-23100 ODKU of non-versioning column inserts history row
#
create table t1 (
x int unique,
y int without system versioning
) with system versioning;
insert into t1 (x, y) values ('1', '1');
insert into t1 (x, y) values ('1', '2')
on duplicate key update y = 3;
select x, y, check_row_ts(row_start, row_end) from t1 for system_time all order by row_end;
x y check_row_ts(row_start, row_end)
1 3 CURRENT ROW
drop table t1;
#
# MDEV-25644 UPDATE not working properly on transaction precise system versioned table
#
create or replace table t1 (nid int primary key, nstate int, ntype int) engine innodb;
alter table t1 add
row_start SYS_DATATYPE generated always as row start invisible,
add row_end SYS_DATATYPE generated always as row end invisible,
add period for system_time(row_start, row_end),
add system versioning;
insert into t1 values (1, 1, 1);
select nid, nstate, check_row(row_start, row_end) from t1 for system_time all order by row_start, row_end;
nid nstate check_row(row_start, row_end)
1 1 CURRENT ROW
start transaction;
update t1 set nstate= nstate where nid = 1;
select nid, nstate, check_row(row_start, row_end) from t1 for system_time all order by row_start, row_end;
nid nstate check_row(row_start, row_end)
1 1 HISTORICAL ROW
1 1 CURRENT ROW
# Bug: ERROR 1761 (23000): Foreign key constraint for table 'xxx', record '1-18446744073709551615' would lead to a duplicate entry in table 'xxx', key 'PRIMARY'
update t1 set nstate= 3 where nid= 1;
select nid, nstate, check_row(row_start, row_end) from t1 for system_time all order by row_start, row_end;
nid nstate check_row(row_start, row_end)
1 1 HISTORICAL ROW
1 1 HISTORICAL ROW
1 3 CURRENT ROW
commit;
drop tables t1;
# End of 10.4 tests