mirror of
https://github.com/MariaDB/server.git
synced 2025-07-27 18:02:13 +03:00
MDEV-15979 DELETE HISTORY from a table with transaction-precise versioning causes Assertion `table_list->vers_conditions.type == SYSTEM_TIME_BEFORE' failure
* Fix versioning.truncate,trx_id to create transaction-based tables * Fix SYSTEM_TIME_BEFORE condition for VERS_TRX_ID
This commit is contained in:
committed by
Sergei Golubchik
parent
60319afff7
commit
21eccff625
@ -1,7 +1,12 @@
|
||||
create table t (a int);
|
||||
delete history from t before system_time now();
|
||||
ERROR HY000: Table `t` is not system-versioned
|
||||
create or replace table t (a int) with system versioning;
|
||||
create or replace table t (
|
||||
a int,
|
||||
row_start SYS_TYPE as row start invisible,
|
||||
row_end SYS_TYPE as row end invisible,
|
||||
period for system_time (row_start, row_end))
|
||||
with system versioning;
|
||||
insert into t values (1);
|
||||
update t set a=2;
|
||||
set @test = 'correct';
|
||||
@ -12,7 +17,12 @@ select @test from t;
|
||||
@test
|
||||
correct
|
||||
drop table t;
|
||||
create table t (a int) with system versioning;
|
||||
create or replace table t (
|
||||
a int,
|
||||
row_start SYS_TYPE as row start invisible,
|
||||
row_end SYS_TYPE as row end invisible,
|
||||
period for system_time (row_start, row_end))
|
||||
with system versioning;
|
||||
insert into t values (1), (2);
|
||||
update t set a=11 where a=1;
|
||||
set @ts1=now(6);
|
||||
@ -48,7 +58,6 @@ drop procedure truncate_sp;
|
||||
# Truncate partitioned
|
||||
create or replace table t (a int)
|
||||
with system versioning
|
||||
engine myisam
|
||||
partition by system_time limit 1 (
|
||||
partition p0 history,
|
||||
partition p1 history,
|
||||
@ -61,7 +70,12 @@ select * from t for system_time all;
|
||||
a
|
||||
3
|
||||
# VIEW
|
||||
create or replace table t (i int) with system versioning;
|
||||
create or replace table t (
|
||||
i int,
|
||||
row_start SYS_TYPE as row start invisible,
|
||||
row_end SYS_TYPE as row end invisible,
|
||||
period for system_time (row_start, row_end))
|
||||
with system versioning;
|
||||
delete history from t;
|
||||
create or replace view v as select * from t;
|
||||
delete history from v;
|
||||
@ -86,3 +100,5 @@ ERROR 42S02: 'v' is a view
|
||||
unlock tables;
|
||||
drop view v;
|
||||
drop table t;
|
||||
drop database test;
|
||||
create database test;
|
||||
|
Reference in New Issue
Block a user