summaryrefslogtreecommitdiff
path: root/mysql-test/r
diff options
context:
space:
mode:
authorSergei Golubchik <serg@mariadb.org>2020-01-21 15:17:43 +0100
committerSergei Golubchik <serg@mariadb.org>2020-01-21 21:15:10 +0100
commit8eec2d61fcb1d4ce4fcd56989c6fe13cd012ecad (patch)
tree40ff28a21b62c5f7e2acadb971e2788f9b5a7b79 /mysql-test/r
parent4e7f3fb8332c42c3beb2376ee0d90f559f1e7470 (diff)
downloadmariadb-git-8eec2d61fcb1d4ce4fcd56989c6fe13cd012ecad.tar.gz
MDEV-21249 MariaDB 10.3.10 When referring to bigint to generate timestamp data in the virtual generated column, the value of the generated column does not change when the time zone changes
FROM_UNIXTIME() depends on @@time_zone, so it's VCOL_SESSION_FUNC
Diffstat (limited to 'mysql-test/r')
-rw-r--r--mysql-test/r/default_session.result28
1 files changed, 28 insertions, 0 deletions
diff --git a/mysql-test/r/default_session.result b/mysql-test/r/default_session.result
index 6c0bcad0cb3..1b0c5f3f67a 100644
--- a/mysql-test/r/default_session.result
+++ b/mysql-test/r/default_session.result
@@ -92,3 +92,31 @@ a
STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION
REAL_AS_FLOAT,PIPES_AS_CONCAT,ANSI_QUOTES,IGNORE_SPACE,ANSI
drop table t1;
+set time_zone='+00:00';
+create table t1 (a int, b datetime default from_unixtime(a), c datetime);
+insert t1 (a, c) values (1569495327, from_unixtime(1569495327));
+set time_zone='+01:00';
+insert t1 (a, c) values (1569495327, from_unixtime(1569495327));
+flush tables;
+insert t1 (a, c) values (1569495327, from_unixtime(1569495327));
+select * from t1;
+a b c
+1569495327 2019-09-26 10:55:27 2019-09-26 10:55:27
+1569495327 2019-09-26 11:55:27 2019-09-26 11:55:27
+1569495327 2019-09-26 11:55:27 2019-09-26 11:55:27
+drop table t1;
+set time_zone = "+00:00";
+create table t1 (a int, b timestamp as (from_unixtime(a)) virtual);
+insert into t1 (a) value (1569495327);
+select a, b, from_unixtime(a) from t1;
+a b from_unixtime(a)
+1569495327 2019-09-26 10:55:27 2019-09-26 10:55:27
+set time_zone = "+01:00";
+select a, b, from_unixtime(a) from t1;
+a b from_unixtime(a)
+1569495327 2019-09-26 11:55:27 2019-09-26 11:55:27
+flush tables;
+select a, b, from_unixtime(a) from t1;
+a b from_unixtime(a)
+1569495327 2019-09-26 11:55:27 2019-09-26 11:55:27
+drop table t1;