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

MDEV-16010 Too many rows with AS OF point_in_the_past_or_NULL

This commit is contained in:
Aleksey Midenkov
2018-04-28 17:02:00 +03:00
committed by Sergei Golubchik
parent fddaaf7295
commit fd4153f083
4 changed files with 32 additions and 1 deletions

View File

@@ -62,7 +62,7 @@ A B C D E F
1 1 1 1 1 1 1 1 1 1 1 1
select trt_trx_sees(0, @tx2); select trt_trx_sees(0, @tx2);
trt_trx_sees(0, @tx2) trt_trx_sees(0, @tx2)
NULL 0
set transaction isolation level read uncommitted; set transaction isolation level read uncommitted;
insert into t1 values (); insert into t1 values ();
select sys_trx_start from t1 where id = last_insert_id() into @tx3; select sys_trx_start from t1 where id = last_insert_id() into @tx3;

View File

@@ -153,5 +153,18 @@ select x, row_start < row_end from t1 for system_time all;
x row_start < row_end x row_start < row_end
4 1 4 1
2 1 2 1
# MDEV-16010 Too many rows with AS OF point_in_the_past_or_NULL
create or replace table t1 (
x int,
row_start bigint unsigned as row start invisible,
row_end bigint unsigned as row end invisible,
period for system_time (row_start, row_end)
) with system versioning engine innodb;
insert into t1 (x) values (1);
delete from t1;
select * from t1 for system_time as of timestamp'1990-1-1 00:00';
x
select * from t1 for system_time as of NULL;
x
drop database test; drop database test;
create database test; create database test;

View File

@@ -141,5 +141,17 @@ update t1 set x= 4;
commit; commit;
select x, row_start < row_end from t1 for system_time all; select x, row_start < row_end from t1 for system_time all;
--echo # MDEV-16010 Too many rows with AS OF point_in_the_past_or_NULL
create or replace table t1 (
x int,
row_start bigint unsigned as row start invisible,
row_end bigint unsigned as row end invisible,
period for system_time (row_start, row_end)
) with system versioning engine innodb;
insert into t1 (x) values (1);
delete from t1;
select * from t1 for system_time as of timestamp'1990-1-1 00:00';
select * from t1 for system_time as of NULL;
drop database test; drop database test;
create database test; create database test;

View File

@@ -8739,6 +8739,12 @@ bool TR_table::query_sees(bool &result, ulonglong trx_id1, ulonglong trx_id0,
return false; return false;
} }
if (trx_id0 == ULONGLONG_MAX || trx_id1 == 0)
{
result= false;
return false;
}
if (!commit_id1) if (!commit_id1)
{ {
if (!query(trx_id1)) if (!query(trx_id1))