1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-02 14:47:37 +03:00

Merge branch '10.3' into 10.4

This commit is contained in:
Oleksandr Byelkin
2019-12-09 15:09:41 +01:00
251 changed files with 2265 additions and 949 deletions

View File

@ -530,9 +530,9 @@ ERROR HY000: Table `t` is already system-versioned
#
use mysql;
create or replace table t (x int) with system versioning;
ERROR HY000: System-versioned tables in the `mysql` database are not suported
ERROR HY000: System-versioned tables in the `mysql` database are not supported
alter table db add system versioning;
ERROR HY000: System-versioned tables in the `mysql` database are not suported
ERROR HY000: System-versioned tables in the `mysql` database are not supported
use test;
# MDEV-15956 Strange ER_UNSUPPORTED_ACTION_ON_GENERATED_COLUMN upon ALTER on versioning column
create or replace table t1 (i int, j int as (i), s timestamp(6) as row start, e timestamp(6) as row end, period for system_time(s,e)) with system versioning;

View File

@ -116,3 +116,17 @@ x
2
1
drop table t1;
#
# MDEV-18929 2nd execution of SP does not detect ER_VERS_NOT_VERSIONED
#
create or replace table t1 (a int) with system versioning;
replace into t1 values (1), (2);
create or replace trigger tr before delete on t1 for each row delete from xx;
create or replace procedure pr() delete from t1;
call pr;
ERROR 42S02: Table 'test.xx' doesn't exist
call pr;
ERROR 42S02: Table 'test.xx' doesn't exist
drop procedure pr;
drop trigger tr;
drop table t1;

View File

@ -613,3 +613,12 @@ Table Op Msg_type Msg_text
test.t1 check note Not supported for non-INTERVAL history partitions
test.t1 check note The storage engine for the table doesn't support check
drop table t1;
#
# MDEV-21233 Assertion `m_extra_cache' failed in ha_partition::late_extra_cache
#
create table t1 (id int, a varchar(8)) with system versioning partition by key (id) partitions 2;
insert into t1 values (1,'foo'),(2,'bar');
create table t2 (b int);
insert into t2 values (1),(2);
update t1, t2 set a = 1;
drop table t1, t2;

View File

@ -628,6 +628,30 @@ call p;
i
drop procedure p;
drop table t1;
#
# MDEV-21234 Server crashes in in setup_on_expr upon 3rd execution of SP
#
create table t1 (a varchar(8));
insert into t1 values ('foo'),('bar');
create table t2 (b date);
create procedure pr() insert into t2 select * from t1;
call pr;
ERROR 22007: Incorrect date value: 'foo' for column `test`.`t2`.`b` at row 1
prepare stmt from 'insert into t2 select * from t1';
execute stmt;
ERROR 22007: Incorrect date value: 'foo' for column `test`.`t2`.`b` at row 1
alter table t1 add system versioning;
call pr;
ERROR 22007: Incorrect date value: 'foo' for column `test`.`t2`.`b` at row 1
call pr;
ERROR 22007: Incorrect date value: 'foo' for column `test`.`t2`.`b` at row 1
execute stmt;
ERROR 22007: Incorrect date value: 'foo' for column `test`.`t2`.`b` at row 1
execute stmt;
ERROR 22007: Incorrect date value: 'foo' for column `test`.`t2`.`b` at row 1
drop prepare stmt;
drop procedure pr;
drop table t1, t2;
call verify_trt_dummy(34);
No A B C D
1 1 1 1 1

View File

@ -295,5 +295,17 @@ primary key (pk)
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 = '';
create or replace table t1 (id int, k int, primary key (id)) engine=innodb with system versioning;
insert into t1 values (1,1),(2,2);
create or replace view v1 as select * from t1;
update v1 set id= 2 where k = 0;
create or replace table t1 (a int) with system versioning;
create or replace view v1 as select * from t1;
create or replace procedure sp() update v1 set xx = 1;
call sp;
ERROR 42S22: Unknown column 'xx' in 'field list'
call sp;
ERROR 42S22: Unknown column 'xx' in 'field list'
drop procedure sp;
drop view v1;
drop table t1;

View File

@ -79,4 +79,19 @@ delete from t1;
select x from t1 for system_time all;
drop table t1;
--echo #
--echo # MDEV-18929 2nd execution of SP does not detect ER_VERS_NOT_VERSIONED
--echo #
create or replace table t1 (a int) with system versioning;
replace into t1 values (1), (2);
create or replace trigger tr before delete on t1 for each row delete from xx;
create or replace procedure pr() delete from t1;
--error ER_NO_SUCH_TABLE
call pr;
--error ER_NO_SUCH_TABLE
call pr;
drop procedure pr;
drop trigger tr;
drop table t1;
--source suite/versioning/common_finish.inc

View File

@ -544,5 +544,18 @@ check table t1;
# cleanup
drop table t1;
--echo #
--echo # MDEV-21233 Assertion `m_extra_cache' failed in ha_partition::late_extra_cache
--echo #
create table t1 (id int, a varchar(8)) with system versioning partition by key (id) partitions 2;
insert into t1 values (1,'foo'),(2,'bar');
create table t2 (b int);
insert into t2 values (1),(2);
update t1, t2 set a = 1;
# cleanup
drop table t1, t2;
--source suite/versioning/common_finish.inc

View File

@ -418,6 +418,35 @@ call p;
drop procedure p;
drop table t1;
--echo #
--echo # MDEV-21234 Server crashes in in setup_on_expr upon 3rd execution of SP
--echo #
create table t1 (a varchar(8));
insert into t1 values ('foo'),('bar');
create table t2 (b date);
create procedure pr() insert into t2 select * from t1;
--error ER_TRUNCATED_WRONG_VALUE
call pr;
prepare stmt from 'insert into t2 select * from t1';
--error ER_TRUNCATED_WRONG_VALUE
execute stmt;
alter table t1 add system versioning;
--error ER_TRUNCATED_WRONG_VALUE
call pr;
--error ER_TRUNCATED_WRONG_VALUE
call pr;
--error ER_TRUNCATED_WRONG_VALUE
execute stmt;
--error ER_TRUNCATED_WRONG_VALUE
execute stmt;
drop prepare stmt;
# cleanup
drop procedure pr;
drop table t1, t2;
call verify_trt_dummy(34);
-- source suite/versioning/common_finish.inc

View File

@ -214,7 +214,21 @@ 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 = '';
create or replace table t1 (id int, k int, primary key (id)) engine=innodb with system versioning;
insert into t1 values (1,1),(2,2);
create or replace view v1 as select * from t1;
update v1 set id= 2 where k = 0;
create or replace table t1 (a int) with system versioning;
create or replace view v1 as select * from t1;
create or replace procedure sp() update v1 set xx = 1;
--error ER_BAD_FIELD_ERROR
call sp;
--error ER_BAD_FIELD_ERROR
call sp;
# cleanup
drop procedure sp;
drop view v1;
drop table t1;