summaryrefslogtreecommitdiff
path: root/mysql-test/suite/versioning
diff options
context:
space:
mode:
Diffstat (limited to 'mysql-test/suite/versioning')
-rw-r--r--mysql-test/suite/versioning/r/alter.result4
-rw-r--r--mysql-test/suite/versioning/r/delete.result14
-rw-r--r--mysql-test/suite/versioning/r/partition.result9
-rw-r--r--mysql-test/suite/versioning/r/select.result24
-rw-r--r--mysql-test/suite/versioning/r/update.result12
-rw-r--r--mysql-test/suite/versioning/t/delete.test15
-rw-r--r--mysql-test/suite/versioning/t/partition.test13
-rw-r--r--mysql-test/suite/versioning/t/select.test29
-rw-r--r--mysql-test/suite/versioning/t/update.test14
9 files changed, 132 insertions, 2 deletions
diff --git a/mysql-test/suite/versioning/r/alter.result b/mysql-test/suite/versioning/r/alter.result
index ed8a86c0053..6563638c195 100644
--- a/mysql-test/suite/versioning/r/alter.result
+++ b/mysql-test/suite/versioning/r/alter.result
@@ -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;
diff --git a/mysql-test/suite/versioning/r/delete.result b/mysql-test/suite/versioning/r/delete.result
index 26ade83acd7..5aa239b9cb8 100644
--- a/mysql-test/suite/versioning/r/delete.result
+++ b/mysql-test/suite/versioning/r/delete.result
@@ -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;
diff --git a/mysql-test/suite/versioning/r/partition.result b/mysql-test/suite/versioning/r/partition.result
index 583b42bf1ec..038051055e7 100644
--- a/mysql-test/suite/versioning/r/partition.result
+++ b/mysql-test/suite/versioning/r/partition.result
@@ -1000,3 +1000,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;
diff --git a/mysql-test/suite/versioning/r/select.result b/mysql-test/suite/versioning/r/select.result
index 87b09d8dff7..d33edb50968 100644
--- a/mysql-test/suite/versioning/r/select.result
+++ b/mysql-test/suite/versioning/r/select.result
@@ -625,6 +625,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
diff --git a/mysql-test/suite/versioning/r/update.result b/mysql-test/suite/versioning/r/update.result
index 64aa7c7068c..e7c617f9196 100644
--- a/mysql-test/suite/versioning/r/update.result
+++ b/mysql-test/suite/versioning/r/update.result
@@ -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;
diff --git a/mysql-test/suite/versioning/t/delete.test b/mysql-test/suite/versioning/t/delete.test
index 4f1ba4b1d8e..492463f9395 100644
--- a/mysql-test/suite/versioning/t/delete.test
+++ b/mysql-test/suite/versioning/t/delete.test
@@ -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
diff --git a/mysql-test/suite/versioning/t/partition.test b/mysql-test/suite/versioning/t/partition.test
index 49a209f920e..f55b43f56da 100644
--- a/mysql-test/suite/versioning/t/partition.test
+++ b/mysql-test/suite/versioning/t/partition.test
@@ -823,5 +823,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
diff --git a/mysql-test/suite/versioning/t/select.test b/mysql-test/suite/versioning/t/select.test
index 1767457401e..c8932ddf272 100644
--- a/mysql-test/suite/versioning/t/select.test
+++ b/mysql-test/suite/versioning/t/select.test
@@ -423,6 +423,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
diff --git a/mysql-test/suite/versioning/t/update.test b/mysql-test/suite/versioning/t/update.test
index baf3c1ec876..548505bd39a 100644
--- a/mysql-test/suite/versioning/t/update.test
+++ b/mysql-test/suite/versioning/t/update.test
@@ -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;