summaryrefslogtreecommitdiff
path: root/mysql-test/suite/versioning
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2020-04-25 21:57:52 +0300
committerMarko Mäkelä <marko.makela@mariadb.com>2020-04-25 21:57:52 +0300
commitfbe2712705d464bf8488df249c36115e2c1f63f7 (patch)
tree274e728c719611769288afcb10f79549f6e11f8c /mysql-test/suite/versioning
parent62903434eb009cb0bcd5003b0a45914bd4c09886 (diff)
parenta19782522b1eac52d72f5e787b5d96f1fd1a2cb7 (diff)
downloadmariadb-git-fbe2712705d464bf8488df249c36115e2c1f63f7.tar.gz
Merge 10.4 into 10.5
The functional changes of commit 5836191c8f0658d5d75484766fdcc3d838b0a5c1 (MDEV-21168) are omitted due to MDEV-742 having addressed the issue.
Diffstat (limited to 'mysql-test/suite/versioning')
-rw-r--r--mysql-test/suite/versioning/r/alter.result12
-rw-r--r--mysql-test/suite/versioning/r/partition.result40
-rw-r--r--mysql-test/suite/versioning/r/update.result7
-rw-r--r--mysql-test/suite/versioning/t/alter.test14
-rw-r--r--mysql-test/suite/versioning/t/partition.test42
-rw-r--r--mysql-test/suite/versioning/t/update.test10
6 files changed, 124 insertions, 1 deletions
diff --git a/mysql-test/suite/versioning/r/alter.result b/mysql-test/suite/versioning/r/alter.result
index c8114822897..3cdba78b973 100644
--- a/mysql-test/suite/versioning/r/alter.result
+++ b/mysql-test/suite/versioning/r/alter.result
@@ -54,7 +54,7 @@ add column trx_end timestamp(6) not null as row end invisible,
add period for system_time(trx_start, trx_end),
add system versioning;
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'as row start invisible,
-add column trx_end timestamp(6) not null as row end invi' at line 2
+add column trx_end timestamp(6) not null as row end i...' at line 2
alter table t
add column trx_start timestamp(6) as row start invisible,
add column trx_end timestamp(6) as row end invisible,
@@ -688,6 +688,15 @@ change column c c int,
change column b b int without system versioning;
drop table t;
#
+# MDEV-21688 Assertion or ER_WARN_DATA_OUT_OF_RANGE upon ALTER on previously versioned table
+#
+create or replace table t1 (a int) with system versioning;
+insert into t1 values (128);
+delete from t1;
+set statement system_versioning_alter_history=keep for
+alter table t1 drop system versioning, modify column a tinyint;
+drop table t1;
+#
# MDEV-21941 RENAME doesn't work for system time or period fields
#
create or replace table t1 (a int) with system versioning;
@@ -710,3 +719,4 @@ t1 CREATE TABLE `t1` (
PERIOD FOR SYSTEM_TIME (`x`, `y`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 WITH SYSTEM VERSIONING
drop table t1;
+# End of 10.5 tests
diff --git a/mysql-test/suite/versioning/r/partition.result b/mysql-test/suite/versioning/r/partition.result
index a7047cbd11b..bb0284a8f06 100644
--- a/mysql-test/suite/versioning/r/partition.result
+++ b/mysql-test/suite/versioning/r/partition.result
@@ -1010,6 +1010,17 @@ insert into t2 values (1),(2);
update t1, t2 set a = 1;
drop table t1, t2;
#
+# MDEV-20515 multi-update tries to position updated table by null reference
+#
+create or replace table t1 (a int);
+insert into t1 values (0), (1);
+create or replace table t2 (b int) with system versioning
+partition by system_time
+(partition p1 history, partition pn current);
+insert into t2 values (0), (2);
+update t1 left join t2 on a > b set b= 2 order by b;
+drop table t1, t2;
+#
# MDEV-22153 ALTER add default history partitions breaks table
#
create or replace table t1 (x int) with system versioning partition by system_time;
@@ -1044,3 +1055,32 @@ t1 CREATE TABLE `t1` (
PARTITION BY SYSTEM_TIME
PARTITIONS 8
drop tables t1;
+#
+# MDEV-17091 Assertion `old_part_id == m_last_part' failed in
+# ha_partition::update_row or `part_id == m_last_part' in
+# ha_partition::delete_row upon UPDATE/DELETE after dropping versioning
+#
+create or replace table t1 (pk int primary key, f int) engine=innodb
+with system versioning
+partition by key() partitions 2;
+insert into t1 values (1,10),(2,20);
+# expected to hit same partition
+select * from t1 partition (p0);
+pk f
+1 10
+2 20
+alter table t1 drop system versioning;
+# 1 and 2 are expected to be in different partitions
+select * from t1 partition(p0);
+pk f
+1 10
+select * from t1 partition(p1);
+pk f
+2 20
+update t1 set f=pk;
+delete from t1;
+drop table t1;
+# End of 10.5 tests
+# Test cleanup
+drop database test;
+create database test;
diff --git a/mysql-test/suite/versioning/r/update.result b/mysql-test/suite/versioning/r/update.result
index a2ec02a7ec1..f7901d11d2a 100644
--- a/mysql-test/suite/versioning/r/update.result
+++ b/mysql-test/suite/versioning/r/update.result
@@ -312,3 +312,10 @@ ERROR 42S22: Unknown column 'xx' in 'field list'
drop procedure sp;
drop view v1;
drop table t1;
+#
+# MDEV-21342 Assertion in set_ok_status() upon spatial field error on system-versioned table
+#
+create or replace table t1 (f point, key(f)) with system versioning engine=myisam;
+update t1 set f = null where f = 'foo';
+ERROR 22003: Cannot get geometry object from data you send to the GEOMETRY field
+drop table t1;
diff --git a/mysql-test/suite/versioning/t/alter.test b/mysql-test/suite/versioning/t/alter.test
index 05e7fbd962f..9e0ed7cabb9 100644
--- a/mysql-test/suite/versioning/t/alter.test
+++ b/mysql-test/suite/versioning/t/alter.test
@@ -583,6 +583,18 @@ alter table t
drop table t;
--echo #
+--echo # MDEV-21688 Assertion or ER_WARN_DATA_OUT_OF_RANGE upon ALTER on previously versioned table
+--echo #
+create or replace table t1 (a int) with system versioning;
+insert into t1 values (128);
+delete from t1;
+set statement system_versioning_alter_history=keep for
+alter table t1 drop system versioning, modify column a tinyint;
+
+# cleanup
+drop table t1;
+
+--echo #
--echo # MDEV-21941 RENAME doesn't work for system time or period fields
--echo #
create or replace table t1 (a int) with system versioning;
@@ -602,3 +614,5 @@ alter table t1 rename column row_end to y;
show create table t1;
# cleanup
drop table t1;
+
+--echo # End of 10.5 tests
diff --git a/mysql-test/suite/versioning/t/partition.test b/mysql-test/suite/versioning/t/partition.test
index d49fdf530dd..417052c2bb1 100644
--- a/mysql-test/suite/versioning/t/partition.test
+++ b/mysql-test/suite/versioning/t/partition.test
@@ -838,6 +838,22 @@ update t1, t2 set a = 1;
drop table t1, t2;
--echo #
+--echo # MDEV-20515 multi-update tries to position updated table by null reference
+--echo #
+create or replace table t1 (a int);
+insert into t1 values (0), (1);
+
+create or replace table t2 (b int) with system versioning
+partition by system_time
+(partition p1 history, partition pn current);
+
+insert into t2 values (0), (2);
+update t1 left join t2 on a > b set b= 2 order by b;
+
+# cleanup
+drop table t1, t2;
+
+--echo #
--echo # MDEV-22153 ALTER add default history partitions breaks table
--echo #
create or replace table t1 (x int) with system versioning partition by system_time;
@@ -853,3 +869,29 @@ show create table t1;
drop tables t1;
--source suite/versioning/common_finish.inc
+--echo #
+--echo # MDEV-17091 Assertion `old_part_id == m_last_part' failed in
+--echo # ha_partition::update_row or `part_id == m_last_part' in
+--echo # ha_partition::delete_row upon UPDATE/DELETE after dropping versioning
+--echo #
+create or replace table t1 (pk int primary key, f int) engine=innodb
+ with system versioning
+ partition by key() partitions 2;
+insert into t1 values (1,10),(2,20);
+--echo # expected to hit same partition
+select * from t1 partition (p0);
+alter table t1 drop system versioning;
+
+--echo # 1 and 2 are expected to be in different partitions
+select * from t1 partition(p0);
+select * from t1 partition(p1);
+
+update t1 set f=pk;
+delete from t1;
+drop table t1;
+
+--echo # End of 10.5 tests
+
+--echo # Test cleanup
+drop database test;
+create database test;
diff --git a/mysql-test/suite/versioning/t/update.test b/mysql-test/suite/versioning/t/update.test
index 71e946e6c2b..5b0a9eb5c42 100644
--- a/mysql-test/suite/versioning/t/update.test
+++ b/mysql-test/suite/versioning/t/update.test
@@ -235,4 +235,14 @@ drop procedure sp;
drop view v1;
drop table t1;
+--echo #
+--echo # MDEV-21342 Assertion in set_ok_status() upon spatial field error on system-versioned table
+--echo #
+create or replace table t1 (f point, key(f)) with system versioning engine=myisam;
+--error ER_CANT_CREATE_GEOMETRY_OBJECT
+update t1 set f = null where f = 'foo';
+
+# cleanup
+drop table t1;
+
source suite/versioning/common_finish.inc;