summaryrefslogtreecommitdiff
path: root/mysql-test/suite/versioning/r
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2020-05-30 11:04:27 +0300
committerMarko Mäkelä <marko.makela@mariadb.com>2020-05-30 11:04:27 +0300
commit6da14d7b4a935466de55a6aa87db14bc359dbd30 (patch)
treea2d1a73a6bf6bbe0dab2857fd87fa782969412f4 /mysql-test/suite/versioning/r
parent4783494a5e21939424ecca92bf23d2df65528266 (diff)
parent2e1d10ecacc8ccfc0bda8a199c741ee36df981be (diff)
downloadmariadb-git-6da14d7b4a935466de55a6aa87db14bc359dbd30.tar.gz
Merge 10.3 into 10.4
Diffstat (limited to 'mysql-test/suite/versioning/r')
-rw-r--r--mysql-test/suite/versioning/r/partition.result25
-rw-r--r--mysql-test/suite/versioning/r/partition_innodb.result13
-rw-r--r--mysql-test/suite/versioning/r/select.result3
-rw-r--r--mysql-test/suite/versioning/r/select2.result3
4 files changed, 40 insertions, 4 deletions
diff --git a/mysql-test/suite/versioning/r/partition.result b/mysql-test/suite/versioning/r/partition.result
index cba47537e7a..2e66fb2ba9b 100644
--- a/mysql-test/suite/versioning/r/partition.result
+++ b/mysql-test/suite/versioning/r/partition.result
@@ -659,6 +659,30 @@ update t1 set f=pk;
delete from t1;
drop table t1;
#
+# MDEV-22413 Server hangs upon UPDATE/DELETE on a view reading from versioned partitioned table
+#
+create or replace table t1 (f char(6)) engine innodb with system versioning;
+insert into t1 values (null);
+update t1 set f= 'foo';
+update t1 set f= 'bar';
+create or replace view v1 as select * from t1 for system_time all;
+update v1 set f = '';
+ERROR HY000: Table 't1' was locked with a READ lock and can't be updated
+create or replace table t1 (f char(6)) engine innodb with system versioning
+partition by system_time limit 1
+(partition p1 history, partition p2 history, partition pn current);
+insert into t1 values (null);
+update t1 set f= 'foo';
+update t1 set f= 'bar';
+create or replace view v1 as select * from t1 for system_time all;
+update v1 set f= '';
+ERROR HY000: Table 't1' was locked with a READ lock and can't be updated
+delete from v1;
+ERROR HY000: Table 't1' was locked with a READ lock and can't be updated
+drop view v1;
+drop table t1;
+# End of 10.3 tests
+#
# MDEV-22283 Server crashes in key_copy or unexpected error 156: The table already existed in the storage engine
#
create table t1 (a int primary key) engine=aria page_checksum=0
@@ -678,3 +702,4 @@ partition by system_time (partition p1 history, partition pn current);
insert into t1 values (1);
replace into t1 values (1);
drop table t1;
+# End of 10.4 tests
diff --git a/mysql-test/suite/versioning/r/partition_innodb.result b/mysql-test/suite/versioning/r/partition_innodb.result
index afed90ffe05..1bc0549a735 100644
--- a/mysql-test/suite/versioning/r/partition_innodb.result
+++ b/mysql-test/suite/versioning/r/partition_innodb.result
@@ -65,3 +65,16 @@ partition by range columns (a, row_start) (
partition p1 values less than (100, 100)
);
ERROR HY000: Transaction-precise system-versioned tables do not support partitioning by ROW START or ROW END
+#
+# MDEV-18794 Assertion `!m_innodb' failed in ha_partition::cmp_ref upon SELECT from partitioned table
+#
+create or replace table t1 (pk int auto_increment, i int, c char(1), primary key (pk), key(i))
+engine=innodb with system versioning partition by key() partitions 2;
+insert into t1 (i, c) values (1, 'a'), (2, 'b'), (null, 'c'), (null, 'b');
+alter table t1 drop system versioning;
+replace into t1 select * from t1;
+select * from t1 where i > 0 or pk = 1000 limit 1;
+pk i c
+1 1 a
+drop table t1;
+# End of 10.3 tests
diff --git a/mysql-test/suite/versioning/r/select.result b/mysql-test/suite/versioning/r/select.result
index a969c16bad4..3cecc6dc893 100644
--- a/mysql-test/suite/versioning/r/select.result
+++ b/mysql-test/suite/versioning/r/select.result
@@ -242,8 +242,7 @@ ERROR HY000: Table `t1` is not system-versioned
create or replace table t1 (x int) with system versioning;
insert into t1 values (1);
select * from t1 for system_time all for update;
-x
-1
+ERROR HY000: Table 't1' was locked with a READ lock and can't be updated
create or replace table t1 (a int not null auto_increment primary key) with system versioning;
select * from (t1 as t2 left join t1 as t3 using (a)) natural left join t1;
a
diff --git a/mysql-test/suite/versioning/r/select2.result b/mysql-test/suite/versioning/r/select2.result
index a2642b319ee..8c9c519c349 100644
--- a/mysql-test/suite/versioning/r/select2.result
+++ b/mysql-test/suite/versioning/r/select2.result
@@ -233,8 +233,7 @@ ERROR HY000: Table `t1` is not system-versioned
create or replace table t1 (x int) with system versioning;
insert into t1 values (1);
select * from t1 for system_time as of now() for update;
-x
-1
+ERROR HY000: Table 't1' was locked with a READ lock and can't be updated
create or replace table t1 (a int not null auto_increment primary key) with system versioning;
select * from (t1 as t2 left join t1 as t3 using (a)) natural left join t1;
a