mirror of
https://github.com/MariaDB/server.git
synced 2025-08-01 03:47:19 +03:00
Bug#19408 Test 'func_time' fails on Windows x64
- The setting of "ENV{'TZ'}" doesn't affect the timezone used by MySQL Server on Windows. - Explicitly set timezone to "+03:00" in test case before doing the calculatiosn to check that there is three hours difference between utc and local time. (Magnus' fix) mysql-test/r/func_time.result: Update test results mysql-test/t/func_time.test: Set timezone to GMT-3, to make it possible to use "interval 3 hour"
This commit is contained in:
@ -1,4 +1,5 @@
|
||||
drop table if exists t1,t2,t3;
|
||||
set time_zone="+03:00";
|
||||
select from_days(to_days("960101")),to_days(960201)-to_days("19960101"),to_days(date_add(curdate(), interval 1 day))-to_days(curdate()),weekday("1997-11-29");
|
||||
from_days(to_days("960101")) to_days(960201)-to_days("19960101") to_days(date_add(curdate(), interval 1 day))-to_days(curdate()) weekday("1997-11-29")
|
||||
1996-01-01 31 1 5
|
||||
@ -945,3 +946,4 @@ id day id day
|
||||
1 2005-06-01 3 2005-07-15
|
||||
3 2005-07-01 3 2005-07-15
|
||||
DROP TABLE t1,t2;
|
||||
set time_zone= @@global.time_zone;
|
||||
|
@ -5,6 +5,9 @@
|
||||
drop table if exists t1,t2,t3;
|
||||
--enable_warnings
|
||||
|
||||
# Set timezone to GMT-3, to make it possible to use "interval 3 hour"
|
||||
set time_zone="+03:00";
|
||||
|
||||
select from_days(to_days("960101")),to_days(960201)-to_days("19960101"),to_days(date_add(curdate(), interval 1 day))-to_days(curdate()),weekday("1997-11-29");
|
||||
select period_add("9602",-12),period_diff(199505,"9404") ;
|
||||
|
||||
@ -335,6 +338,7 @@ select last_day("1997-12-1")+0.0;
|
||||
|
||||
# Test SAPDB UTC_% functions. This part is TZ dependant (It is supposed that
|
||||
# TZ variable set to GMT-3
|
||||
|
||||
select strcmp(date_sub(localtimestamp(), interval 3 hour), utc_timestamp())=0;
|
||||
select strcmp(date_format(date_sub(localtimestamp(), interval 3 hour),"%T"), utc_time())=0;
|
||||
select strcmp(date_format(date_sub(localtimestamp(), interval 3 hour),"%Y-%m-%d"), utc_date())=0;
|
||||
@ -513,3 +517,6 @@ SELECT * FROM t1, t2
|
||||
DROP TABLE t1,t2;
|
||||
|
||||
# End of 5.0 tests
|
||||
|
||||
# Restore timezone to default
|
||||
set time_zone= @@global.time_zone;
|
||||
|
Reference in New Issue
Block a user