summaryrefslogtreecommitdiff
path: root/mysql-test/suite/versioning
diff options
context:
space:
mode:
authorNikita Malyavin <nikitamalyavin@gmail.com>2021-05-05 23:03:01 +0300
committerNikita Malyavin <nikitamalyavin@gmail.com>2021-05-05 23:03:01 +0300
commit509e4990af4d99e9d3c790eabe1c1705ae910b55 (patch)
tree02d4ca9409711baef3ec163adc402f2c380df7c8 /mysql-test/suite/versioning
parent0cc811c633d1fe5290b10fa49fad0a4b889383fa (diff)
parent4f143a88bcb36e94e9edba8a3c5b4a350dcd9bf9 (diff)
downloadmariadb-git-509e4990af4d99e9d3c790eabe1c1705ae910b55.tar.gz
Merge branch bb-10.3-release into bb-10.4-release
Diffstat (limited to 'mysql-test/suite/versioning')
-rw-r--r--mysql-test/suite/versioning/r/delete_history.result33
-rw-r--r--mysql-test/suite/versioning/r/trx_id.result8
-rw-r--r--mysql-test/suite/versioning/t/delete_history.test22
-rw-r--r--mysql-test/suite/versioning/t/trx_id.opt1
-rw-r--r--mysql-test/suite/versioning/t/trx_id.test13
5 files changed, 73 insertions, 4 deletions
diff --git a/mysql-test/suite/versioning/r/delete_history.result b/mysql-test/suite/versioning/r/delete_history.result
index 46ef271db3d..4fc4618d110 100644
--- a/mysql-test/suite/versioning/r/delete_history.result
+++ b/mysql-test/suite/versioning/r/delete_history.result
@@ -154,3 +154,36 @@ select * from t1;
a
1
drop table t1;
+#
+# MDEV-25468 DELETE HISTORY may delete current data on system-versioned table
+#
+create or replace table t1 (x int) with system versioning;
+insert into t1 values (1);
+delete history from t1 before system_time '2039-01-01 23:00';
+select * from t1;
+x
+1
+explain extended delete history from t1 before system_time '2039-01-01 23:00';
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 1 100.00 Using where
+create or replace procedure p() delete history from t1 before system_time '2039-01-01 23:00';
+call p;
+select * from t1;
+x
+1
+call p;
+select * from t1;
+x
+1
+drop procedure p;
+prepare stmt from "delete history from t1 before system_time '2039-01-01 23:00'";
+execute stmt;
+select * from t1;
+x
+1
+execute stmt;
+select * from t1;
+x
+1
+drop prepare stmt;
+drop table t1;
diff --git a/mysql-test/suite/versioning/r/trx_id.result b/mysql-test/suite/versioning/r/trx_id.result
index 03ef20a6a9e..1210262fcd0 100644
--- a/mysql-test/suite/versioning/r/trx_id.result
+++ b/mysql-test/suite/versioning/r/trx_id.result
@@ -521,4 +521,10 @@ add `row_end` bigint unsigned as row end,
add period for system_time(`row_start`,`row_end`),
modify x int after row_start,
with system versioning;
-create or replace database test;
+drop table t;
+#
+# MDEV-20842 Crash using versioning plugin functions after plugin was removed from server
+#
+uninstall plugin test_versioning;
+select trt_begin_ts(0);
+ERROR 42000: FUNCTION test.trt_begin_ts does not exist
diff --git a/mysql-test/suite/versioning/t/delete_history.test b/mysql-test/suite/versioning/t/delete_history.test
index 07fb4eb187a..94e58590dd9 100644
--- a/mysql-test/suite/versioning/t/delete_history.test
+++ b/mysql-test/suite/versioning/t/delete_history.test
@@ -170,4 +170,26 @@ insert into t1 values (1);
select * from t1;
drop table t1;
+--echo #
+--echo # MDEV-25468 DELETE HISTORY may delete current data on system-versioned table
+--echo #
+create or replace table t1 (x int) with system versioning;
+insert into t1 values (1);
+delete history from t1 before system_time '2039-01-01 23:00';
+select * from t1;
+explain extended delete history from t1 before system_time '2039-01-01 23:00';
+create or replace procedure p() delete history from t1 before system_time '2039-01-01 23:00';
+call p;
+select * from t1;
+call p;
+select * from t1;
+drop procedure p;
+prepare stmt from "delete history from t1 before system_time '2039-01-01 23:00'";
+execute stmt;
+select * from t1;
+execute stmt;
+select * from t1;
+drop prepare stmt;
+drop table t1;
+
--source suite/versioning/common_finish.inc
diff --git a/mysql-test/suite/versioning/t/trx_id.opt b/mysql-test/suite/versioning/t/trx_id.opt
deleted file mode 100644
index b55a187cb13..00000000000
--- a/mysql-test/suite/versioning/t/trx_id.opt
+++ /dev/null
@@ -1 +0,0 @@
---plugin-load-add=$TEST_VERSIONING_SO
diff --git a/mysql-test/suite/versioning/t/trx_id.test b/mysql-test/suite/versioning/t/trx_id.test
index 7dfc8acb080..08f183536f6 100644
--- a/mysql-test/suite/versioning/t/trx_id.test
+++ b/mysql-test/suite/versioning/t/trx_id.test
@@ -5,6 +5,10 @@ if (!$TEST_VERSIONING_SO)
--source include/have_innodb.inc
--source include/default_charset.inc
+--disable_query_log
+--eval install plugin test_versioning soname '$TEST_VERSIONING_SO'
+--enable_query_log
+
set default_storage_engine= innodb;
create or replace table t1 (
@@ -528,6 +532,11 @@ alter table t add `row_start` bigint unsigned as row start,
add period for system_time(`row_start`,`row_end`),
modify x int after row_start,
with system versioning;
+drop table t;
-
-create or replace database test;
+--echo #
+--echo # MDEV-20842 Crash using versioning plugin functions after plugin was removed from server
+--echo #
+uninstall plugin test_versioning;
+--error ER_SP_DOES_NOT_EXIST
+select trt_begin_ts(0);