Skip to content

Commit 08e5b00

Browse files
author
tnurnberg@mysql.com
committed
#19409: Test 'func_timestamp' fails on Windows x64
- The setting of "ENV{'TZ'}" doesn't affect the timezone used by MySQL Server on Windows. - Explicitly set timezone in test cases before doing UTC/localtime conversions so tests produce deterministic results
1 parent 0f4e09a commit 08e5b00

File tree

4 files changed

+16
-0
lines changed

4 files changed

+16
-0
lines changed

mysql-test/r/func_timestamp.result

+2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
drop table if exists t1;
2+
set time_zone="+03:00";
23
create table t1 (Zeit time, Tag tinyint not null, Monat tinyint not null,
34
Jahr smallint not null, index(Tag), index(Monat), index(Jahr) );
45
insert into t1 values ("09:26:00",16,9,1998),("09:26:00",16,9,1998);
@@ -9,3 +10,4 @@ Date Unix
910
1998-9-16 09:26:00 905927160
1011
1998-9-16 09:26:00 905927160
1112
drop table t1;
13+
set time_zone= @@global.time_zone;

mysql-test/r/type_timestamp.result

+2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
drop table if exists t1,t2;
2+
set time_zone="+03:00";
23
CREATE TABLE t1 (a int, t timestamp);
34
CREATE TABLE t2 (a int, t datetime);
45
SET TIMESTAMP=1234;
@@ -491,3 +492,4 @@ a b c
491492
5 NULL 2001-09-09 04:46:59
492493
6 NULL 2006-06-06 06:06:06
493494
drop table t1;
495+
set time_zone= @@global.time_zone;

mysql-test/t/func_timestamp.test

+6
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@
66
drop table if exists t1;
77
--enable_warnings
88

9+
# Set timezone to GMT-3, to make it possible to use "interval 3 hour"
10+
set time_zone="+03:00";
11+
912
create table t1 (Zeit time, Tag tinyint not null, Monat tinyint not null,
1013
Jahr smallint not null, index(Tag), index(Monat), index(Jahr) );
1114
insert into t1 values ("09:26:00",16,9,1998),("09:26:00",16,9,1998);
@@ -15,3 +18,6 @@ FROM t1;
1518
drop table t1;
1619

1720
# End of 4.1 tests
21+
22+
# Restore timezone to default
23+
set time_zone= @@global.time_zone;

mysql-test/t/type_timestamp.test

+6
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@
66
drop table if exists t1,t2;
77
--enable_warnings
88

9+
# Set timezone to GMT-3, to make it possible to use "interval 3 hour"
10+
set time_zone="+03:00";
11+
912
CREATE TABLE t1 (a int, t timestamp);
1013
CREATE TABLE t2 (a int, t datetime);
1114
SET TIMESTAMP=1234;
@@ -322,3 +325,6 @@ select * from t1;
322325
drop table t1;
323326

324327
# End of 4.1 tests
328+
329+
# Restore timezone to default
330+
set time_zone= @@global.time_zone;

0 commit comments

Comments
 (0)