Update tests

This commit is contained in:
Alexey Milovidov 2021-03-08 03:14:39 +03:00
parent 019ed517bc
commit 6b309dcc5c
4 changed files with 14 additions and 12 deletions

View File

@ -179,13 +179,13 @@ toRelativeYearNum
44
44
44
44
45
toRelativeMonthNum
536
536
536
537
536
537
toRelativeWeekNum
2335
2335
@ -197,12 +197,13 @@ toRelativeDayNum
16343
16343
16344
16343
16344
toRelativeHourNum
392251
392251
392251
392251
392252
toRelativeMinuteNum
23535110
23535110

View File

@ -277,7 +277,8 @@ SELECT toRelativeDayNum(toDateTime(1412106600), 'Europe/Moscow') - toRelativeDay
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');
-- NOTE: toRelativeDayNum(toDateTime(0), 'Pacific/Pitcairn') overflows from -1 to 65535
SELECT toUInt16(toRelativeDayNum(toDateTime(1412106600), 'Pacific/Pitcairn') - toRelativeDayNum(toDateTime(0), 'Pacific/Pitcairn'));
/* toRelativeHourNum */
@ -286,7 +287,7 @@ SELECT toRelativeHourNum(toDateTime(1412106600), 'Europe/Moscow') - toRelativeHo
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');
-- known wrong result: SELECT toRelativeHourNum(toDateTime(1412106600), 'Pacific/Pitcairn') - toRelativeHourNum(toDateTime(0), 'Pacific/Pitcairn');
SELECT toRelativeHourNum(toDateTime(1412106600), 'Pacific/Pitcairn') - toRelativeHourNum(toDateTime(0), 'Pacific/Pitcairn');
/* toRelativeMinuteNum */

View File

@ -17,11 +17,11 @@ SELECT toDateTime64(toFloat32(bitShiftLeft(toUInt64(1),33)), 2, 'Europe/Moscow')
2106-02-07 09:28:16.00
SELECT toDateTime64(toFloat64(bitShiftLeft(toUInt64(1),33)), 2, 'Europe/Moscow') FORMAT Null;
-- These are outsize of extended range and hence clamped
SELECT toDateTime64(-1 * bitShiftLeft(toUInt64(1),35), 2);
SELECT toDateTime64(-1 * bitShiftLeft(toUInt64(1), 35), 2);
1925-01-01 02:00:00.00
SELECT CAST(-1 * bitShiftLeft(toUInt64(1),35) AS DateTime64);
SELECT CAST(-1 * bitShiftLeft(toUInt64(1), 35) AS DateTime64);
1925-01-01 02:00:00.000
SELECT CAST(bitShiftLeft(toUInt64(1),35) AS DateTime64);
SELECT CAST(bitShiftLeft(toUInt64(1), 35) AS DateTime64);
2282-12-31 03:00:00.000
SELECT toDateTime64(bitShiftLeft(toUInt64(1),35), 2);
SELECT toDateTime64(bitShiftLeft(toUInt64(1), 35), 2);
2282-12-31 03:00:00.00

View File

@ -2,8 +2,8 @@
SELECT toString(toDateTime('-922337203.6854775808', 1));
1940-10-09 22:13:17.6
SELECT toString(toDateTime('9922337203.6854775808', 1));
1925-07-26 23:46:43.6
2283-11-11 23:46:43.6
SELECT toDateTime64(CAST('10000000000.1' AS Decimal64(1)), 1);
1928-01-11 23:46:40.1
2283-11-11 23:46:40.1
SELECT toDateTime64(CAST('-10000000000.1' AS Decimal64(1)), 1);
2011-12-22 23:38:20.1
1925-01-01 23:09:20.1