mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +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,3 +1,4 @@
|
||||
--source suite/versioning/common.inc
|
||||
--source include/have_partition.inc
|
||||
--source suite/versioning/engines.inc
|
||||
|
||||
@ -6,7 +7,13 @@ create table t (a int);
|
||||
delete history from t before system_time now();
|
||||
|
||||
# TRUNCATE is not DELETE and trigger must not be called.
|
||||
create or replace table t (a int) with system versioning;
|
||||
--replace_result $sys_datatype_expl SYS_TYPE
|
||||
eval create or replace table t (
|
||||
a int,
|
||||
row_start $sys_datatype_expl as row start invisible,
|
||||
row_end $sys_datatype_expl 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';
|
||||
@ -16,7 +23,13 @@ delete history from t;
|
||||
select @test from t;
|
||||
drop table t;
|
||||
|
||||
create table t (a int) with system versioning;
|
||||
--replace_result $sys_datatype_expl SYS_TYPE
|
||||
eval create or replace table t (
|
||||
a int,
|
||||
row_start $sys_datatype_expl as row start invisible,
|
||||
row_end $sys_datatype_expl 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;
|
||||
--real_sleep 0.01
|
||||
@ -45,7 +58,6 @@ drop procedure truncate_sp;
|
||||
--echo # 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,
|
||||
@ -57,7 +69,13 @@ delete history from t;
|
||||
select * from t for system_time all;
|
||||
|
||||
--echo # VIEW
|
||||
create or replace table t (i int) with system versioning;
|
||||
--replace_result $sys_datatype_expl SYS_TYPE
|
||||
eval create or replace table t (
|
||||
i int,
|
||||
row_start $sys_datatype_expl as row start invisible,
|
||||
row_end $sys_datatype_expl 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;
|
||||
--error ER_IT_IS_A_VIEW
|
||||
@ -88,3 +106,6 @@ delete history from v before system_time now(6);
|
||||
unlock tables;
|
||||
drop view v;
|
||||
drop table t;
|
||||
|
||||
drop database test;
|
||||
create database test;
|
||||
|
Reference in New Issue
Block a user