From 0fd928837436043be46ecddf47fd716a01bed965 Mon Sep 17 00:00:00 2001 From: bharatnc Date: Fri, 4 Sep 2020 13:22:20 -0700 Subject: [PATCH] add tests for - toStartOfInterval* functions --- ...Interval_disallow_empty_tz_field.reference | 7 +++++++ ...tartOfInterval_disallow_empty_tz_field.sql | 20 +++++++++++++++++++ 2 files changed, 27 insertions(+) create mode 100644 tests/queries/0_stateless/01471_toStartOfInterval_disallow_empty_tz_field.reference create mode 100644 tests/queries/0_stateless/01471_toStartOfInterval_disallow_empty_tz_field.sql diff --git a/tests/queries/0_stateless/01471_toStartOfInterval_disallow_empty_tz_field.reference b/tests/queries/0_stateless/01471_toStartOfInterval_disallow_empty_tz_field.reference new file mode 100644 index 00000000000..620f5269fd2 --- /dev/null +++ b/tests/queries/0_stateless/01471_toStartOfInterval_disallow_empty_tz_field.reference @@ -0,0 +1,7 @@ +2017-12-31 00:00:00 +2017-12-01 +2017-10-01 +2017-12-31 05:10:00 +2017-12-31 01:15:00 +2017-12-31 01:00:00 +2017-12-31 00:01:00 diff --git a/tests/queries/0_stateless/01471_toStartOfInterval_disallow_empty_tz_field.sql b/tests/queries/0_stateless/01471_toStartOfInterval_disallow_empty_tz_field.sql new file mode 100644 index 00000000000..2467317cef4 --- /dev/null +++ b/tests/queries/0_stateless/01471_toStartOfInterval_disallow_empty_tz_field.sql @@ -0,0 +1,20 @@ +SELECT toStartOfDay(toDateTime('2017-12-31 00:00:00', 'UTC'), '') -- {serverError 43} +SELECT toStartOfDay(toDateTime('2017-12-31 03:45:00', 'UTC'), 'UTC') -- success + +SELECT toStartOfMonth(toDateTime('2017-12-31 00:00:00', 'UTC'), '') -- {serverError 43} +SELECT toStartOfMonth(toDateTime('2017-12-31 00:00:00', 'UTC'), 'UTC') -- success + +SELECT toStartOfQuarter(toDateTime('2017-12-31 00:00:00', 'UTC'), '') -- {serverError 43} +SELECT toStartOfQuarter(toDateTime('2017-12-31 00:00:00', 'UTC'), 'UTC') -- success + +SELECT toStartOfTenMinutes(toDateTime('2017-12-31 00:00:00', 'UTC'), '') -- {serverError 43} +SELECT toStartOfTenMinutes(toDateTime('2017-12-31 05:12:30', 'UTC'), 'UTC') -- success + +SELECT toStartOfFifteenMinutes(toDateTime('2017-12-31 00:00:00', 'UTC'), '') -- {serverError 43} +SELECT toStartOfFifteenMinutes(toDateTime('2017-12-31 01:17:00', 'UTC'), 'UTC') -- success + +SELECT toStartOfHour(toDateTime('2017-12-31 00:00:00', 'UTC'), '') -- {serverError 43} +SELECT toStartOfHour(toDateTime('2017-12-31 01:59:00', 'UTC'), 'UTC') -- success + +SELECT toStartOfMinute(toDateTime('2017-12-31 00:00:00', 'UTC'), '') -- {serverError 43} +SELECT toStartOfMinute(toDateTime('2017-12-31 00:01:30', 'UTC'), 'UTC') -- success