Skip to content

Commit 681fbca

Browse files
author
Sergei Golubchik
committed
fix func_time.test to be independent from the system time zone
1 parent 5b452ae commit 681fbca

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

mysql-test/r/func_time.result

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2004,15 +2004,16 @@ a
20042004
2000-02-23
20052005
2005-05-04
20062006
DROP TABLE t1;
2007+
SET TIME_ZONE='+02:00';
20072008
#
20082009
# MDEV-6302 Wrong result set when using GROUP BY FROM_UNIXTIME(...)+0
20092010
#
20102011
CREATE TABLE t1 (a DATE);
20112012
INSERT INTO t1 VALUES ('2005-05-04'),('2000-02-23');
20122013
SELECT a, FROM_UNIXTIME(CONCAT(a,'10')) AS f1, FROM_UNIXTIME(CONCAT(a,'10'))+0 AS f2 FROM t1;
20132014
a f1 f2
2014-
2005-05-04 1970-01-01 03:33:25 19700101033325.000000
2015-
2000-02-23 1970-01-01 03:33:20 19700101033320.000000
2015+
2005-05-04 1970-01-01 02:33:25 19700101023325.000000
2016+
2000-02-23 1970-01-01 02:33:20 19700101023320.000000
20162017
SELECT * FROM t1 GROUP BY FROM_UNIXTIME(CONCAT(a,'10'))+0;
20172018
a
20182019
2000-02-23
@@ -2046,7 +2047,6 @@ DROP TABLE t1,t2;
20462047
#
20472048
# MDEV-4635 Crash in UNIX_TIMESTAMP(STR_TO_DATE('2020','%Y'))
20482049
#
2049-
SET TIME_ZONE='+02:00';
20502050
SELECT UNIX_TIMESTAMP(STR_TO_DATE('2020','%Y'));
20512051
UNIX_TIMESTAMP(STR_TO_DATE('2020','%Y'))
20522052
NULL

mysql-test/t/func_time.test

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1212,6 +1212,7 @@ SELECT * FROM t1 GROUP BY @a:=(FROM_UNIXTIME(concat(a,'10'))*1);
12121212

12131213
DROP TABLE t1;
12141214

1215+
SET TIME_ZONE='+02:00';
12151216

12161217
--echo #
12171218
--echo # MDEV-6302 Wrong result set when using GROUP BY FROM_UNIXTIME(...)+0
@@ -1239,10 +1240,9 @@ DROP TABLE t1,t2;
12391240
--echo #
12401241
--echo # MDEV-4635 Crash in UNIX_TIMESTAMP(STR_TO_DATE('2020','%Y'))
12411242
--echo #
1242-
SET TIME_ZONE='+02:00';
12431243
SELECT UNIX_TIMESTAMP(STR_TO_DATE('2020','%Y'));
1244-
SET TIME_ZONE=DEFAULT;
12451244

1245+
SET TIME_ZONE=DEFAULT;
12461246

12471247
--echo #
12481248
--echo # MDEV-4863 COALESCE(time_or_datetime) returns wrong results in numeric context

0 commit comments

Comments
 (0)