From ac5062d5925819a8e65a5b3894b42a05e40bbf48 Mon Sep 17 00:00:00 2001 From: Alexey Milovidov Date: Thu, 26 Oct 2017 21:09:02 +0300 Subject: [PATCH] Fixed incorrect usage of "toRelative" family of functions in tests [#CLICKHOUSE-2]. --- .../0_stateless/00189_time_zones.reference | 30 ++++---- .../queries/0_stateless/00189_time_zones.sql | 70 +++++++++---------- 2 files changed, 50 insertions(+), 50 deletions(-) diff --git a/dbms/tests/queries/0_stateless/00189_time_zones.reference b/dbms/tests/queries/0_stateless/00189_time_zones.reference index 3c14c067b18..3acf697c359 100644 --- a/dbms/tests/queries/0_stateless/00189_time_zones.reference +++ b/dbms/tests/queries/0_stateless/00189_time_zones.reference @@ -68,21 +68,21 @@ 2014-09-30 20:00:00 2014-10-01 04:00:00 2014-09-30 11:00:00 -2014 -2014 -2014 -2014 -2014 -24177 -24177 -24177 -24178 -24177 -2334 -2334 -2334 -2334 -2334 +44 +44 +44 +44 +44 +536 +536 +536 +537 +536 +2335 +2335 +2335 +2335 +2335 16343 16343 16343 diff --git a/dbms/tests/queries/0_stateless/00189_time_zones.sql b/dbms/tests/queries/0_stateless/00189_time_zones.sql index 8147e4dbc6e..0c7b1ab065d 100644 --- a/dbms/tests/queries/0_stateless/00189_time_zones.sql +++ b/dbms/tests/queries/0_stateless/00189_time_zones.sql @@ -120,59 +120,59 @@ SELECT toString(toStartOfHour(toDateTime(1412106600), 'Pacific/Pitcairn'), 'Paci /* toRelativeYearNum */ -SELECT toRelativeYearNum(toDateTime(1412106600), 'Europe/Moscow'); -SELECT toRelativeYearNum(toDateTime(1412106600), 'Europe/Paris'); -SELECT toRelativeYearNum(toDateTime(1412106600), 'Europe/London'); -SELECT toRelativeYearNum(toDateTime(1412106600), 'Asia/Tokyo'); -SELECT toRelativeYearNum(toDateTime(1412106600), 'Pacific/Pitcairn'); +SELECT toRelativeYearNum(toDateTime(1412106600), 'Europe/Moscow') - toRelativeYearNum(toDateTime(0), 'Europe/Moscow'); +SELECT toRelativeYearNum(toDateTime(1412106600), 'Europe/Paris') - toRelativeYearNum(toDateTime(0), 'Europe/Paris'); +SELECT toRelativeYearNum(toDateTime(1412106600), 'Europe/London') - toRelativeYearNum(toDateTime(0), 'Europe/London'); +SELECT toRelativeYearNum(toDateTime(1412106600), 'Asia/Tokyo') - toRelativeYearNum(toDateTime(0), 'Asia/Tokyo'); +SELECT toRelativeYearNum(toDateTime(1412106600), 'Pacific/Pitcairn') - toRelativeYearNum(toDateTime(0), 'Pacific/Pitcairn'); /* toRelativeMonthNum */ -SELECT toRelativeMonthNum(toDateTime(1412106600), 'Europe/Moscow'); -SELECT toRelativeMonthNum(toDateTime(1412106600), 'Europe/Paris'); -SELECT toRelativeMonthNum(toDateTime(1412106600), 'Europe/London'); -SELECT toRelativeMonthNum(toDateTime(1412106600), 'Asia/Tokyo'); -SELECT toRelativeMonthNum(toDateTime(1412106600), 'Pacific/Pitcairn'); +SELECT toRelativeMonthNum(toDateTime(1412106600), 'Europe/Moscow') - toRelativeMonthNum(toDateTime(0), 'Europe/Moscow'); +SELECT toRelativeMonthNum(toDateTime(1412106600), 'Europe/Paris') - toRelativeMonthNum(toDateTime(0), 'Europe/Paris'); +SELECT toRelativeMonthNum(toDateTime(1412106600), 'Europe/London') - toRelativeMonthNum(toDateTime(0), 'Europe/London'); +SELECT toRelativeMonthNum(toDateTime(1412106600), 'Asia/Tokyo') - toRelativeMonthNum(toDateTime(0), 'Asia/Tokyo'); +SELECT toRelativeMonthNum(toDateTime(1412106600), 'Pacific/Pitcairn') - toRelativeMonthNum(toDateTime(0), 'Pacific/Pitcairn'); /* toRelativeWeekNum */ -SELECT toRelativeWeekNum(toDateTime(1412106600), 'Europe/Moscow'); -SELECT toRelativeWeekNum(toDateTime(1412106600), 'Europe/Paris'); -SELECT toRelativeWeekNum(toDateTime(1412106600), 'Europe/London'); -SELECT toRelativeWeekNum(toDateTime(1412106600), 'Asia/Tokyo'); -SELECT toRelativeWeekNum(toDateTime(1412106600), 'Pacific/Pitcairn'); +SELECT toRelativeWeekNum(toDateTime(1412106600), 'Europe/Moscow') - toRelativeWeekNum(toDateTime(0), 'Europe/Moscow'); +SELECT toRelativeWeekNum(toDateTime(1412106600), 'Europe/Paris') - toRelativeWeekNum(toDateTime(0), 'Europe/Paris'); +SELECT toRelativeWeekNum(toDateTime(1412106600), 'Europe/London') - toRelativeWeekNum(toDateTime(0), 'Europe/London'); +SELECT toRelativeWeekNum(toDateTime(1412106600), 'Asia/Tokyo') - toRelativeWeekNum(toDateTime(0), 'Asia/Tokyo'); +SELECT toRelativeWeekNum(toDateTime(1412106600), 'Pacific/Pitcairn') - toRelativeWeekNum(toDateTime(0), 'Pacific/Pitcairn'); /* toRelativeDayNum */ -SELECT toRelativeDayNum(toDateTime(1412106600), 'Europe/Moscow'); -SELECT toRelativeDayNum(toDateTime(1412106600), 'Europe/Paris'); -SELECT toRelativeDayNum(toDateTime(1412106600), 'Europe/London'); -SELECT toRelativeDayNum(toDateTime(1412106600), 'Asia/Tokyo'); -SELECT toRelativeDayNum(toDateTime(1412106600), 'Pacific/Pitcairn'); +SELECT toRelativeDayNum(toDateTime(1412106600), 'Europe/Moscow') - toRelativeDayNum(toDateTime(0), 'Europe/Moscow'); +SELECT toRelativeDayNum(toDateTime(1412106600), 'Europe/Paris') - toRelativeDayNum(toDateTime(0), 'Europe/Paris'); +SELECT toRelativeDayNum(toDateTime(1412106600), 'Europe/London') - toRelativeDayNum(toDateTime(0), 'Europe/London'); +SELECT toRelativeDayNum(toDateTime(1412106600), 'Asia/Tokyo') - toRelativeDayNum(toDateTime(0), 'Asia/Tokyo'); +SELECT toRelativeDayNum(toDateTime(1412106600), 'Pacific/Pitcairn') - toRelativeDayNum(toDateTime(0), 'Pacific/Pitcairn'); /* toRelativeHourNum */ -SELECT toRelativeHourNum(toDateTime(1412106600), 'Europe/Moscow'); -SELECT toRelativeHourNum(toDateTime(1412106600), 'Europe/Paris'); -SELECT toRelativeHourNum(toDateTime(1412106600), 'Europe/London'); -SELECT toRelativeHourNum(toDateTime(1412106600), 'Asia/Tokyo'); -SELECT toRelativeHourNum(toDateTime(1412106600), 'Pacific/Pitcairn'); +SELECT toRelativeHourNum(toDateTime(1412106600), 'Europe/Moscow') - toRelativeHourNum(toDateTime(0), 'Europe/Moscow'); +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), 'Asia/Tokyo') - toRelativeHourNum(toDateTime(0), 'Asia/Tokyo'); +SELECT toRelativeHourNum(toDateTime(1412106600), 'Pacific/Pitcairn') - toRelativeHourNum(toDateTime(0), 'Pacific/Pitcairn'); /* toRelativeMinuteNum */ -SELECT toRelativeMinuteNum(toDateTime(1412106600), 'Europe/Moscow'); -SELECT toRelativeMinuteNum(toDateTime(1412106600), 'Europe/Paris'); -SELECT toRelativeMinuteNum(toDateTime(1412106600), 'Europe/London'); -SELECT toRelativeMinuteNum(toDateTime(1412106600), 'Asia/Tokyo'); -SELECT toRelativeMinuteNum(toDateTime(1412106600), 'Pacific/Pitcairn'); +SELECT toRelativeMinuteNum(toDateTime(1412106600), 'Europe/Moscow') - toRelativeMinuteNum(toDateTime(0), 'Europe/Moscow'); +SELECT toRelativeMinuteNum(toDateTime(1412106600), 'Europe/Paris') - toRelativeMinuteNum(toDateTime(0), 'Europe/Paris'); +SELECT toRelativeMinuteNum(toDateTime(1412106600), 'Europe/London') - toRelativeMinuteNum(toDateTime(0), 'Europe/London'); +SELECT toRelativeMinuteNum(toDateTime(1412106600), 'Asia/Tokyo') - toRelativeMinuteNum(toDateTime(0), 'Asia/Tokyo'); +SELECT toRelativeMinuteNum(toDateTime(1412106600), 'Pacific/Pitcairn') - toRelativeMinuteNum(toDateTime(0), 'Pacific/Pitcairn'); /* toRelativeSecondNum */ -SELECT toRelativeSecondNum(toDateTime(1412106600), 'Europe/Moscow'); -SELECT toRelativeSecondNum(toDateTime(1412106600), 'Europe/Paris'); -SELECT toRelativeSecondNum(toDateTime(1412106600), 'Europe/London'); -SELECT toRelativeSecondNum(toDateTime(1412106600), 'Asia/Tokyo'); -SELECT toRelativeSecondNum(toDateTime(1412106600), 'Pacific/Pitcairn'); +SELECT toRelativeSecondNum(toDateTime(1412106600), 'Europe/Moscow') - toRelativeSecondNum(toDateTime(0), 'Europe/Moscow'); +SELECT toRelativeSecondNum(toDateTime(1412106600), 'Europe/Paris') - toRelativeSecondNum(toDateTime(0), 'Europe/Paris'); +SELECT toRelativeSecondNum(toDateTime(1412106600), 'Europe/London') - toRelativeSecondNum(toDateTime(0), 'Europe/London'); +SELECT toRelativeSecondNum(toDateTime(1412106600), 'Asia/Tokyo') - toRelativeSecondNum(toDateTime(0), 'Asia/Tokyo'); +SELECT toRelativeSecondNum(toDateTime(1412106600), 'Pacific/Pitcairn') - toRelativeSecondNum(toDateTime(0), 'Pacific/Pitcairn'); /* toDate */