Updated test [#CLICKHOUSE-2099].

This commit is contained in:
Alexey Milovidov 2017-10-30 09:27:21 +03:00
parent b7e006213b
commit e29604b7f9
3 changed files with 16 additions and 16 deletions

View File

@ -8,21 +8,21 @@
2014-12-01 2014-12-01
2014-12-01 2014-12-01
2014-12-01 2014-12-01
2014-12-01
2014-12-01
2014-12-01
2014-12-01
2014-12-01
2014-07-01 2014-07-01
2014-07-01 2014-07-01
2014-07-01 2014-07-01
2014-10-01 2014-10-01
2014-07-01 2014-07-01
2014-01-01
2014-01-01
2014-01-01
2014-01-01
2014-01-01
1970-01-02 12:00:00 1970-01-02 12:00:00 1970-01-02 12:00:00 1970-01-02 12:00:00
1970-01-02 10:00:00 1970-01-02 11:00:00 1970-01-02 10:00:00 1970-01-02 11:00:00
1970-01-02 09:00:00 1970-01-02 10:00:00 1970-01-02 09:00:00 1970-01-02 10:00:00
1970-01-02 18:00:00 1970-01-02 18:00:00 1970-01-02 18:00:00 1970-01-02 18:00:00
1970-01-02 01:30:00 1970-01-02 01:30:00 1970-01-02 01:00:00 1970-01-02 01:00:00
2014 2014
2014 2014
2014 2014
@ -92,7 +92,6 @@
392251 392251
392251 392251
392251 392251
392251
23535110 23535110
23535110 23535110
23535110 23535110

View File

@ -24,20 +24,20 @@ SELECT toStartOfMonth(toDateTime(1419800400), 'Pacific/Pitcairn');
/* toStartOfQuarter */ /* toStartOfQuarter */
SELECT toStartOfMonth(toDateTime(1419800400), 'Europe/Moscow');
SELECT toStartOfMonth(toDateTime(1419800400), 'Europe/Paris');
SELECT toStartOfMonth(toDateTime(1419800400), 'Europe/London');
SELECT toStartOfMonth(toDateTime(1419800400), 'Asia/Tokyo');
SELECT toStartOfMonth(toDateTime(1419800400), 'Pacific/Pitcairn');
/* toStartOfYear */
SELECT toStartOfQuarter(toDateTime(1412106600), 'Europe/Moscow'); SELECT toStartOfQuarter(toDateTime(1412106600), 'Europe/Moscow');
SELECT toStartOfQuarter(toDateTime(1412106600), 'Europe/Paris'); SELECT toStartOfQuarter(toDateTime(1412106600), 'Europe/Paris');
SELECT toStartOfQuarter(toDateTime(1412106600), 'Europe/London'); SELECT toStartOfQuarter(toDateTime(1412106600), 'Europe/London');
SELECT toStartOfQuarter(toDateTime(1412106600), 'Asia/Tokyo'); SELECT toStartOfQuarter(toDateTime(1412106600), 'Asia/Tokyo');
SELECT toStartOfQuarter(toDateTime(1412106600), 'Pacific/Pitcairn'); SELECT toStartOfQuarter(toDateTime(1412106600), 'Pacific/Pitcairn');
/* toStartOfYear */
SELECT toStartOfYear(toDateTime(1419800400), 'Europe/Moscow');
SELECT toStartOfYear(toDateTime(1419800400), 'Europe/Paris');
SELECT toStartOfYear(toDateTime(1419800400), 'Europe/London');
SELECT toStartOfYear(toDateTime(1419800400), 'Asia/Tokyo');
SELECT toStartOfYear(toDateTime(1419800400), 'Pacific/Pitcairn');
/* toTime */ /* toTime */
SELECT toString(toTime(toDateTime(1420102800), 'Europe/Moscow'), 'Europe/Moscow'), toString(toTime(toDateTime(1428310800), 'Europe/Moscow'), 'Europe/Moscow'); SELECT toString(toTime(toDateTime(1420102800), 'Europe/Moscow'), 'Europe/Moscow'), toString(toTime(toDateTime(1428310800), 'Europe/Moscow'), 'Europe/Moscow');
@ -156,7 +156,7 @@ SELECT toRelativeHourNum(toDateTime(1412106600), 'Europe/Moscow') - toRelativeHo
SELECT toRelativeHourNum(toDateTime(1412106600), 'Europe/Paris') - toRelativeHourNum(toDateTime(0), 'Europe/Paris'); SELECT toRelativeHourNum(toDateTime(1412106600), 'Europe/Paris') - toRelativeHourNum(toDateTime(0), 'Europe/Paris');
SELECT toRelativeHourNum(toDateTime(1412106600), 'Europe/London') - toRelativeHourNum(toDateTime(0), 'Europe/London'); SELECT toRelativeHourNum(toDateTime(1412106600), 'Europe/London') - toRelativeHourNum(toDateTime(0), 'Europe/London');
SELECT toRelativeHourNum(toDateTime(1412106600), 'Asia/Tokyo') - toRelativeHourNum(toDateTime(0), 'Asia/Tokyo'); SELECT toRelativeHourNum(toDateTime(1412106600), 'Asia/Tokyo') - toRelativeHourNum(toDateTime(0), 'Asia/Tokyo');
SELECT toRelativeHourNum(toDateTime(1412106600), 'Pacific/Pitcairn') - toRelativeHourNum(toDateTime(0), 'Pacific/Pitcairn'); -- known wrong result: SELECT toRelativeHourNum(toDateTime(1412106600), 'Pacific/Pitcairn') - toRelativeHourNum(toDateTime(0), 'Pacific/Pitcairn');
/* toRelativeMinuteNum */ /* toRelativeMinuteNum */

View File

@ -336,6 +336,7 @@ public:
return t / 3600; return t / 3600;
/// Assume that if offset was fractional, then the fraction is the same as at the beginning of epoch. /// Assume that if offset was fractional, then the fraction is the same as at the beginning of epoch.
/// NOTE This assumption is false for "Pacific/Pitcairn" time zone.
return (t + 86400 - offset_at_start_of_epoch) / 3600; return (t + 86400 - offset_at_start_of_epoch) / 3600;
} }