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

Merge 10.4 into 10.5

This commit is contained in:
Aleksey Midenkov
2019-12-02 13:35:54 +03:00
47 changed files with 1241 additions and 109 deletions

View File

@@ -411,6 +411,14 @@ delete from t1 where a is not null;
create or replace table t1 (i int) with system versioning partition by system_time limit 10;
--error ER_VERS_QUERY_IN_PARTITION
select * from t1 partition (p0) for system_time all;
--echo # MDEV-18929 2nd execution of SP does not detect ER_VERS_NOT_VERSIONED
create or replace procedure sp()
select * from t1 partition (p0) for system_time all;
--error ER_VERS_QUERY_IN_PARTITION
call sp;
--error ER_VERS_QUERY_IN_PARTITION
call sp;
drop procedure sp;
--echo # MDEV-15380 Index for versioned table gets corrupt after partitioning and DELETE
create or replace table t1 (pk int primary key)
@@ -501,4 +509,19 @@ update t1 set a= 'bar' limit 4;
select * from t1;
drop table t1;
--echo #
--echo # MDEV-21011 Table corruption reported for versioned partitioned table after DELETE: "Found a misplaced row"
--echo #
create table t1 (a int) with system versioning
partition by system_time limit 3
(partition p1 history, partition p2 history, partition pn current);
insert into t1 values (1),(2),(3),(4);
delete from t1;
delete from t1;
check table t1;
# cleanup
drop table t1;
--source suite/versioning/common_finish.inc

View File

@@ -228,6 +228,21 @@ for system_time all as t;
create or replace table t1 (x int) with system versioning engine myisam;
--error ER_VERS_ENGINE_UNSUPPORTED
select * from t1 for system_time as of transaction 1;
--echo # MDEV-18929 2nd execution of SP does not detect ER_VERS_NOT_VERSIONED
create or replace procedure sp()
select * from t1 for system_time as of transaction 1;
--error ER_VERS_ENGINE_UNSUPPORTED
call sp;
--error ER_VERS_ENGINE_UNSUPPORTED
call sp;
create or replace table t1 (a int);
create or replace procedure sp()
select * from t1 for system_time all;
--error ER_VERS_NOT_VERSIONED
call sp;
--error ER_VERS_NOT_VERSIONED
call sp;
drop procedure sp;
create or replace table t1 (
x int,

View File

@@ -157,7 +157,6 @@ replace t1 values (1,2),(1,3),(2,4);
--echo #
--echo # MDEV-14829 Assertion `0' failed in Protocol::end_statement upon concurrent UPDATE
--echo #
create or replace table t1 (pk int, a char(3), b char(3), primary key(pk))
engine=innodb with system versioning;
@@ -192,4 +191,31 @@ drop view v;
drop table t1, t2;
--enable_warnings
--echo #
--echo # MDEV-20441 ER_CRASHED_ON_USAGE upon update on versioned Aria table
--echo #
create or replace table t1 (a varchar(8))
engine=aria row_format=fixed
with system versioning;
insert into t1 (a) values ('foo');
update t1 set a = 'bar';
drop table t1;
--echo #
--echo # MDEV-21147 Assertion `marked_for_read()' upon UPDATE on versioned table via view
--echo #
create or replace table t1 (
pk int, a char(8), b char(8),
primary key (pk)
) with system versioning;
create or replace view v1 as select * from t1;
insert into t1 values (1, null, 'd') , (2, null, 'i') ;
update v1 set a= null where b = '';
# cleanup
drop view v1;
drop table t1;
source suite/versioning/common_finish.inc;

View File

@@ -136,6 +136,7 @@ eval create or replace table t1 (
) with system versioning;
insert into t1 values (1), (2);
create or replace view v1 as select * from t1 where x > 1;
--echo # update, delete
update v1 set x= x + 1;
select *, check_row(row_start, row_end) from t1 for system_time all order by x;
insert v1 values (4);
@@ -153,8 +154,63 @@ select *, check_row(row_start, row_end) from t2 for system_time all order by x;
delete v1, v2 from v1 join v2 where v1.x = v2.x + 2;
select *, check_row(row_start, row_end) from t1 for system_time all order by x;
select *, check_row(row_start, row_end) from t2 for system_time all order by x;
--echo # replace
--replace_result $sys_datatype_expl SYS_DATATYPE
eval create or replace table t1 (
x int primary key, y 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 t1 values (1, 0), (2, 0);
create or replace view v1 as select * from t1 where x > 1;
replace v1 values (1, 1);
replace v1 values (2, 1);
replace v1 values (3, 1);
--echo # REPLACE ignores VIEW condition because itself doesn't use WHERE
select *, check_row(row_start, row_end) from t1 for system_time all order by x, row_end;
--echo # insert-select, on duplicate key
insert v1 select * from t1 where x = 1 on duplicate key update x = v1.x - 1;
select *, check_row(row_start, row_end) from t1 for system_time all order by x, row_end;
drop view v1, v2;
drop tables t1, t2;
--echo #
--echo # MDEV-21146 Assertion `m_lock_type == 2' in handler::ha_drop_table upon LOAD DATA
--echo #
create table t1 (a int);
create view v1 as select * from t1;
create or replace table t1 (b int) with system versioning;
--error ER_VIEW_INVALID
load data infile 'xx' into table v1;
# cleanup
drop view v1;
drop table t1;
--echo #
--echo # MDEV-21155 Assertion with versioned table upon DELETE from view of view after replacing first view
--echo #
create table t1 (a int);
insert into t1 values (1);
--replace_result $sys_datatype_expl SYS_DATATYPE
eval create table t2 (
b 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 t2 values (2);
create view v1 as select * from t1;
create view v2 as select * from v1;
create or replace view v1 as select * from t2;
delete from v2;
select * from t1;
select *, check_row(row_start, row_end) from t2 for system_time all;
# cleanup
drop view v2;
drop view v1;
drop table t1, t2;
--source suite/versioning/common_finish.inc