summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergei Golubchik <sergii@pisem.net>2014-08-01 12:04:55 +0200
committerSergei Golubchik <sergii@pisem.net>2014-08-01 12:04:55 +0200
commit681fbcaf9255e1aa9f4ef458f8ef69f1a31eade2 (patch)
treeee6322fccbd92711834d5dbdcc9b77a7ca9a02ff
parent5b452ae0279935164b6a2bee8861bf2e830508b5 (diff)
downloadmariadb-git-681fbcaf9255e1aa9f4ef458f8ef69f1a31eade2.tar.gz
fix func_time.test to be independent from the system time zone
-rw-r--r--mysql-test/r/func_time.result6
-rw-r--r--mysql-test/t/func_time.test4
2 files changed, 5 insertions, 5 deletions
diff --git a/mysql-test/r/func_time.result b/mysql-test/r/func_time.result
index 74df2b100fe..7351256296a 100644
--- a/mysql-test/r/func_time.result
+++ b/mysql-test/r/func_time.result
@@ -2004,6 +2004,7 @@ a
2000-02-23
2005-05-04
DROP TABLE t1;
+SET TIME_ZONE='+02:00';
#
# MDEV-6302 Wrong result set when using GROUP BY FROM_UNIXTIME(...)+0
#
@@ -2011,8 +2012,8 @@ CREATE TABLE t1 (a DATE);
INSERT INTO t1 VALUES ('2005-05-04'),('2000-02-23');
SELECT a, FROM_UNIXTIME(CONCAT(a,'10')) AS f1, FROM_UNIXTIME(CONCAT(a,'10'))+0 AS f2 FROM t1;
a f1 f2
-2005-05-04 1970-01-01 03:33:25 19700101033325.000000
-2000-02-23 1970-01-01 03:33:20 19700101033320.000000
+2005-05-04 1970-01-01 02:33:25 19700101023325.000000
+2000-02-23 1970-01-01 02:33:20 19700101023320.000000
SELECT * FROM t1 GROUP BY FROM_UNIXTIME(CONCAT(a,'10'))+0;
a
2000-02-23
@@ -2046,7 +2047,6 @@ DROP TABLE t1,t2;
#
# MDEV-4635 Crash in UNIX_TIMESTAMP(STR_TO_DATE('2020','%Y'))
#
-SET TIME_ZONE='+02:00';
SELECT UNIX_TIMESTAMP(STR_TO_DATE('2020','%Y'));
UNIX_TIMESTAMP(STR_TO_DATE('2020','%Y'))
NULL
diff --git a/mysql-test/t/func_time.test b/mysql-test/t/func_time.test
index 4d479aa8f0e..25c4612632f 100644
--- a/mysql-test/t/func_time.test
+++ b/mysql-test/t/func_time.test
@@ -1212,6 +1212,7 @@ SELECT * FROM t1 GROUP BY @a:=(FROM_UNIXTIME(concat(a,'10'))*1);
DROP TABLE t1;
+SET TIME_ZONE='+02:00';
--echo #
--echo # MDEV-6302 Wrong result set when using GROUP BY FROM_UNIXTIME(...)+0
@@ -1239,10 +1240,9 @@ DROP TABLE t1,t2;
--echo #
--echo # MDEV-4635 Crash in UNIX_TIMESTAMP(STR_TO_DATE('2020','%Y'))
--echo #
-SET TIME_ZONE='+02:00';
SELECT UNIX_TIMESTAMP(STR_TO_DATE('2020','%Y'));
-SET TIME_ZONE=DEFAULT;
+SET TIME_ZONE=DEFAULT;
--echo #
--echo # MDEV-4863 COALESCE(time_or_datetime) returns wrong results in numeric context