From ec8925aa4022ecac493e08021ec74a12246574e7 Mon Sep 17 00:00:00 2001 From: Alexey Arno Date: Thu, 2 Jul 2015 03:19:31 +0300 Subject: [PATCH] dbms: Server: Support for multiple time zones: development [#METR-15618] --- .../0_stateless/00189_time_zones.reference | 35 ++++++++++++ .../queries/0_stateless/00189_time_zones.sql | 57 +++++++++++++++++++ 2 files changed, 92 insertions(+) create mode 100644 dbms/tests/queries/0_stateless/00189_time_zones.reference create mode 100644 dbms/tests/queries/0_stateless/00189_time_zones.sql diff --git a/dbms/tests/queries/0_stateless/00189_time_zones.reference b/dbms/tests/queries/0_stateless/00189_time_zones.reference new file mode 100644 index 00000000000..0f401f2b805 --- /dev/null +++ b/dbms/tests/queries/0_stateless/00189_time_zones.reference @@ -0,0 +1,35 @@ +2014-12-29 +2014-12-22 +2014-12-22 +2014-12-29 +2014-12-22 +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-10-01 +2014-07-01 +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 09:00:00 1970-01-02 10: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 +2015-07-15 13:30:00 +2015-07-15 12:30:00 +2015-07-15 11:30:00 +2015-07-15 19:30:00 +2015-07-15 02:30:00 +1426415400 +1426422600 +1426426200 +1426393800 +1426455000 diff --git a/dbms/tests/queries/0_stateless/00189_time_zones.sql b/dbms/tests/queries/0_stateless/00189_time_zones.sql new file mode 100644 index 00000000000..0a9f0a6accb --- /dev/null +++ b/dbms/tests/queries/0_stateless/00189_time_zones.sql @@ -0,0 +1,57 @@ + +/* toMonday */ + +SELECT toMonday(toDateTime('2014-12-29 00:00:00'), 'Europe/Moscow'); +SELECT toMonday(toDateTime('2014-12-29 00:00:00'), 'Europe/Paris'); +SELECT toMonday(toDateTime('2014-12-29 00:00:00'), 'Europe/London'); +SELECT toMonday(toDateTime('2014-12-29 00:00:00'), 'Asia/Tokyo'); +SELECT toMonday(toDateTime('2014-12-29 00:00:00'), 'Pacific/Pitcairn'); + +/* toStartOfMonth */ + +SELECT toStartOfMonth(toDateTime('2014-12-29 00:00:00'), 'Europe/Moscow'); +SELECT toStartOfMonth(toDateTime('2014-12-29 00:00:00'), 'Europe/Paris'); +SELECT toStartOfMonth(toDateTime('2014-12-29 00:00:00'), 'Europe/London'); +SELECT toStartOfMonth(toDateTime('2014-12-29 00:00:00'), 'Asia/Tokyo'); +SELECT toStartOfMonth(toDateTime('2014-12-29 00:00:00'), 'Pacific/Pitcairn'); + +/* toStartOfQuarter */ + +SELECT toStartOfMonth(toDateTime('2014-12-29 00:00:00'), 'Europe/Moscow'); +SELECT toStartOfMonth(toDateTime('2014-12-29 00:00:00'), 'Europe/Paris'); +SELECT toStartOfMonth(toDateTime('2014-12-29 00:00:00'), 'Europe/London'); +SELECT toStartOfMonth(toDateTime('2014-12-29 00:00:00'), 'Asia/Tokyo'); +SELECT toStartOfMonth(toDateTime('2014-12-29 00:00:00'), 'Pacific/Pitcairn'); + +/* toStartOfYear */ + +SELECT toStartOfQuarter(toDateTime('2014-09-30 23:50:00'), 'Europe/Moscow'); +SELECT toStartOfQuarter(toDateTime('2014-09-30 23:50:00'), 'Europe/Paris'); +SELECT toStartOfQuarter(toDateTime('2014-09-30 23:50:00'), 'Europe/London'); +SELECT toStartOfQuarter(toDateTime('2014-09-30 23:50:00'), 'Asia/Tokyo'); +SELECT toStartOfQuarter(toDateTime('2014-09-30 23:50:00'), 'Pacific/Pitcairn'); + +/* toTime */ + +SELECT toTime(toDateTime('2015-01-01 12:00:00'), 'Europe/Moscow'), toTime(toDateTime('2015-04-06 12:00:00'), 'Europe/Moscow'); +SELECT toTime(toDateTime('2015-01-01 12:00:00'), 'Europe/Paris'), toTime(toDateTime('2015-04-06 12:00:00'), 'Europe/Paris'); +SELECT toTime(toDateTime('2015-01-01 12:00:00'), 'Europe/London'), toTime(toDateTime('2015-04-06 12:00:00'), 'Europe/London'); +SELECT toTime(toDateTime('2015-01-01 12:00:00'), 'Asia/Tokyo'), toTime(toDateTime('2015-04-06 12:00:00'), 'Asia/Tokyo'); +SELECT toTime(toDateTime('2015-01-01 12:00:00'), 'Pacific/Pitcairn'), toTime(toDateTime('2015-04-06 12:00:00'), 'Pacific/Pitcairn'); + +/* toString */ + +SELECT toString(toDateTime('2015-07-15 13:30:00'), 'Europe/Moscow'); +SELECT toString(toDateTime('2015-07-15 13:30:00'), 'Europe/Paris'); +SELECT toString(toDateTime('2015-07-15 13:30:00'), 'Europe/London'); +SELECT toString(toDateTime('2015-07-15 13:30:00'), 'Asia/Tokyo'); +SELECT toString(toDateTime('2015-07-15 13:30:00'), 'Pacific/Pitcairn'); + +/* toUnixTimestamp */ + +SELECT toUnixTimestamp('2015-03-15 13:30:00', 'Europe/Moscow'); +SELECT toUnixTimestamp('2015-03-15 13:30:00', 'Europe/Paris'); +SELECT toUnixTimestamp('2015-03-15 13:30:00', 'Europe/London'); +SELECT toUnixTimestamp('2015-03-15 13:30:00', 'Asia/Tokyo'); +SELECT toUnixTimestamp('2015-03-15 13:30:00', 'Pacific/Pitcairn'); +