Commit 486682b1 authored by Sergei Golubchik's avatar Sergei Golubchik

cleanup: vers tests, remove create_table procedure

parent 898a8c3c
--disable_query_log
if ($MTR_COMBINATION_UNIQUE)
{
set @KEY_TYPE= 'unique';
}
if ($MTR_COMBINATION_PK)
{
set @KEY_TYPE= 'primary key';
}
delimiter ~~;
create procedure create_table(name varchar(255), cols varchar(255))
begin
if (cols is null or cols = '') then
set cols= '';
else
set cols= concat(', ', cols);
end if;
set @str= concat('create or replace table ', name, '(id int ', @KEY_TYPE, cols, ') with system versioning');
prepare stmt from @str; execute stmt; drop prepare stmt;
end~~
delimiter ;~~
--enable_query_log
call create_table('t', 'x int');
create table t (
id int primary key,
x int,
row_start SYS_DATATYPE as row start invisible,
row_end SYS_DATATYPE as row end invisible,
period for system_time (row_start, row_end)
) with system versioning;
insert t values (1, 2);
replace t values (1, 3);
select *, row_end>TIMESTAMP'2038-01-01 00:00:00' as current from t for system_time all
......@@ -6,5 +12,19 @@ order by x;
id x current
1 2 0
1 3 1
drop database test;
create database test;
drop table t;
create table t (
id int unique,
x int,
row_start SYS_DATATYPE as row start invisible,
row_end SYS_DATATYPE as row end invisible,
period for system_time (row_start, row_end)
) with system versioning;
insert t values (1, 2);
replace t values (1, 3);
select *, row_end>TIMESTAMP'2038-01-01 00:00:00' as current from t for system_time all
order by x;
id x current
1 2 0
1 3 1
drop table t;
--source suite/versioning/common.inc
--source suite/versioning/key_type.inc
--source suite/versioning/engines.inc
call create_table('t', 'x int');
--replace_result $sys_datatype_expl SYS_DATATYPE
eval create table t (
id int primary key,
x 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 t values (1, 2);
replace t values (1, 3);
select *, row_end>TIMESTAMP'2038-01-01 00:00:00' as current from t for system_time all
order by x;
drop table t;
drop database test;
create database test;
--replace_result $sys_datatype_expl SYS_DATATYPE
eval create table t (
id int unique,
x 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 t values (1, 2);
replace t values (1, 3);
select *, row_end>TIMESTAMP'2038-01-01 00:00:00' as current from t for system_time all
order by x;
drop table t;
--source suite/versioning/common_finish.inc
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment