summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOleksandr Byelkin <sanja@mariadb.com>2021-07-29 17:16:52 +0200
committerOleksandr Byelkin <sanja@mariadb.com>2021-07-29 17:16:52 +0200
commit1423cf5e3dcb3c50047f086a5933fe77006cf242 (patch)
tree7995a21aec2d74e38d9a98f85a8e1cb30493f20b
parent83d7e4faf6967ddd16b7dde6a89d65729c41b98d (diff)
downloadmariadb-git-1423cf5e3dcb3c50047f086a5933fe77006cf242.tar.gz
fix MDEV-16026 MDEV-16481 embedded server results and rests
-rw-r--r--mysql-test/suite/sys_vars/r/sysvars_server_embedded.result2
-rw-r--r--mysql-test/suite/versioning/r/sysvars-notembedded.result30
-rw-r--r--mysql-test/suite/versioning/r/sysvars.result21
-rw-r--r--mysql-test/suite/versioning/t/sysvars-notembedded.test31
-rw-r--r--mysql-test/suite/versioning/t/sysvars.test18
5 files changed, 62 insertions, 40 deletions
diff --git a/mysql-test/suite/sys_vars/r/sysvars_server_embedded.result b/mysql-test/suite/sys_vars/r/sysvars_server_embedded.result
index 3a561d93335..43f3d4313db 100644
--- a/mysql-test/suite/sys_vars/r/sysvars_server_embedded.result
+++ b/mysql-test/suite/sys_vars/r/sysvars_server_embedded.result
@@ -3279,7 +3279,7 @@ VARIABLE_COMMENT Default value for the FOR SYSTEM_TIME AS OF clause
NUMERIC_MIN_VALUE NULL
NUMERIC_MAX_VALUE NULL
NUMERIC_BLOCK_SIZE NULL
-ENUM_VALUE_LIST DEFAULT
+ENUM_VALUE_LIST NULL
READ_ONLY NO
COMMAND_LINE_ARGUMENT NULL
VARIABLE_NAME TABLE_DEFINITION_CACHE
diff --git a/mysql-test/suite/versioning/r/sysvars-notembedded.result b/mysql-test/suite/versioning/r/sysvars-notembedded.result
new file mode 100644
index 00000000000..8b1ad6cfc58
--- /dev/null
+++ b/mysql-test/suite/versioning/r/sysvars-notembedded.result
@@ -0,0 +1,30 @@
+create table t (a int) with system versioning;
+set @before= UNIX_TIMESTAMP(now(6));
+insert into t values (1);
+set @after= UNIX_TIMESTAMP(now(6));
+update t set a= 2;
+set global system_versioning_asof= FROM_UNIXTIME(@after);
+set system_versioning_asof= FROM_UNIXTIME(@after);
+select * from t as nonempty;
+a
+1
+connect subcon,127.0.0.1,root,,,$SERVER_MYPORT_1;
+connection subcon;
+select * from t as nonempty;
+a
+1
+disconnect subcon;
+connection default;
+set global system_versioning_asof= FROM_UNIXTIME(@before);
+select * from t as nonempty;
+a
+1
+connect subcon,127.0.0.1,root,,,$SERVER_MYPORT_1;
+connection subcon;
+select * from t as empty;
+a
+disconnect subcon;
+connection default;
+drop table t;
+set global system_versioning_asof= DEFAULT;
+set system_versioning_asof= DEFAULT;
diff --git a/mysql-test/suite/versioning/r/sysvars.result b/mysql-test/suite/versioning/r/sysvars.result
index e3af236a7fa..ee9509a0039 100644
--- a/mysql-test/suite/versioning/r/sysvars.result
+++ b/mysql-test/suite/versioning/r/sysvars.result
@@ -190,27 +190,6 @@ set system_versioning_asof= FROM_UNIXTIME(@after);
select * from t as nonempty;
a
1
-set global system_versioning_asof= FROM_UNIXTIME(@after);
-select * from t as nonempty;
-a
-1
-connect subcon,127.0.0.1,root,,,$SERVER_MYPORT_1;
-connection subcon;
-select * from t as nonempty;
-a
-1
-disconnect subcon;
-connection default;
-set global system_versioning_asof= FROM_UNIXTIME(@before);
-select * from t as nonempty;
-a
-1
-connect subcon,127.0.0.1,root,,,$SERVER_MYPORT_1;
-connection subcon;
-select * from t as empty;
-a
-disconnect subcon;
-connection default;
# MDEV-16481: set global system_versioning_asof=sf() crashes in specific case
# Using global variable inside a stored function should not crash
create or replace function now_global() returns timestamp
diff --git a/mysql-test/suite/versioning/t/sysvars-notembedded.test b/mysql-test/suite/versioning/t/sysvars-notembedded.test
new file mode 100644
index 00000000000..314972bc375
--- /dev/null
+++ b/mysql-test/suite/versioning/t/sysvars-notembedded.test
@@ -0,0 +1,31 @@
+source include/not_embedded.inc;
+
+create table t (a int) with system versioning;
+set @before= UNIX_TIMESTAMP(now(6));
+insert into t values (1);
+set @after= UNIX_TIMESTAMP(now(6));
+update t set a= 2;
+
+set global system_versioning_asof= FROM_UNIXTIME(@after);
+set system_versioning_asof= FROM_UNIXTIME(@after);
+select * from t as nonempty;
+
+--connect (subcon,127.0.0.1,root,,,$SERVER_MYPORT_1)
+--connection subcon
+select * from t as nonempty;
+--disconnect subcon
+--connection default
+
+set global system_versioning_asof= FROM_UNIXTIME(@before);
+select * from t as nonempty;
+
+--connect (subcon,127.0.0.1,root,,,$SERVER_MYPORT_1)
+--connection subcon
+select * from t as empty;
+--disconnect subcon
+--connection default
+
+drop table t;
+
+set global system_versioning_asof= DEFAULT;
+set system_versioning_asof= DEFAULT;
diff --git a/mysql-test/suite/versioning/t/sysvars.test b/mysql-test/suite/versioning/t/sysvars.test
index 248020010b6..eb76581121d 100644
--- a/mysql-test/suite/versioning/t/sysvars.test
+++ b/mysql-test/suite/versioning/t/sysvars.test
@@ -137,24 +137,6 @@ select * from t as empty;
set system_versioning_asof= FROM_UNIXTIME(@after);
select * from t as nonempty;
-set global system_versioning_asof= FROM_UNIXTIME(@after);
-select * from t as nonempty;
-
---connect (subcon,127.0.0.1,root,,,$SERVER_MYPORT_1)
---connection subcon
-select * from t as nonempty;
---disconnect subcon
---connection default
-
-set global system_versioning_asof= FROM_UNIXTIME(@before);
-select * from t as nonempty;
-
---connect (subcon,127.0.0.1,root,,,$SERVER_MYPORT_1)
---connection subcon
-select * from t as empty;
---disconnect subcon
---connection default
-
--echo # MDEV-16481: set global system_versioning_asof=sf() crashes in specific case
--echo # Using global variable inside a stored function should not crash
create or replace function now_global() returns timestamp