diff --git a/tests/queries/0_stateless/01099_operators_date_and_timestamp.reference b/tests/queries/0_stateless/01099_operators_date_and_timestamp.reference index 5654471ebc1..24f609fcf30 100644 --- a/tests/queries/0_stateless/01099_operators_date_and_timestamp.reference +++ b/tests/queries/0_stateless/01099_operators_date_and_timestamp.reference @@ -16,3 +16,6 @@ 2001-09-29 03:25:45.000 DateTime64(3) 2001-09-28 20:34:15.000 DateTime64(3) 140400 Int32 +-23 +(1,1) +(1,-1) diff --git a/tests/queries/0_stateless/01099_operators_date_and_timestamp.sql b/tests/queries/0_stateless/01099_operators_date_and_timestamp.sql index f17f062eda5..feffd08562a 100644 --- a/tests/queries/0_stateless/01099_operators_date_and_timestamp.sql +++ b/tests/queries/0_stateless/01099_operators_date_and_timestamp.sql @@ -13,6 +13,8 @@ select (date '2001-10-01' - date '2001-09-28') x, toTypeName(x); select timestamp '2001-09-28 01:00:00' + interval 23 hour; select timestamp '2001-09-28 23:00:00' - interval 23 hour; +SET session_timezone = 'Europe/Amsterdam'; + select (date '2001-09-29' + interval 12345 second) x, toTypeName(x); select (date '2001-09-29' + interval 12345 millisecond) x, toTypeName(x); -- { serverError 43 } select (date '2001-09-29' + interval 12345 microsecond) x, toTypeName(x); -- { serverError 43 } @@ -30,17 +32,16 @@ select (toDate32('2001-09-29') - interval 12345 millisecond) x, toTypeName(x); - select (toDate32('2001-09-29') - interval 12345 microsecond) x, toTypeName(x); -- { serverError 43 } select (toDate32('2001-09-29') - interval 12345 nanosecond) x, toTypeName(x); -- { serverError 43 } --- TODO: return interval -select (timestamp '2001-12-29 03:00:00' - timestamp '2001-12-27 12:00:00') x, toTypeName(x); -- interval '1 day 15:00:00' +select (timestamp '2001-12-29 03:00:00' - timestamp '2001-12-27 12:00:00') x, toTypeName(x); --- select -interval 23 hour; -- interval '-23:00:00' --- select interval 1 day + interval 1 hour; -- interval '1 day 01:00:00' --- select interval '1 day' - interval '1 hour'; -- interval '1 day -01:00:00' +select -interval 23 hour; +select interval 1 day + interval 1 hour; +select interval '1 day' - interval '1 hour'; --- select date '2001-09-28' + time '03:00'; -- timestamp '2001-09-28 03:00:00' --- select time '01:00' + interval '3 hours'; -- time '04:00:00' --- select time '05:00' - time '03:00'; -- interval '02:00:00' --- select time '05:00' - interval '2 hours'; -- time '03:00:00' +-- select date '2001-09-28' + time '03:00'; +-- select time '01:00' + interval '3 hours'; +-- select time '05:00' - time '03:00'; +-- select time '05:00' - interval '2 hours'; -- select 900 * interval '1 second'; -- interval '00:15:00' -- select (21 * interval '1 day') x, toTypeName(x); -- interval '21 days'