Fixed formatDateTime handling explicit timezone argument.

Updated reference of the 00921_datetime64_compatibility, issues caused
by Date implicitly using server's timezone (and I was not in GMT+3) at
the moment of updating tests.
This commit is contained in:
Vasily Nemkov 2020-03-24 19:58:24 +03:00
parent 2cb3d37913
commit d0e23a503e
2 changed files with 6 additions and 6 deletions

View File

@ -315,7 +315,7 @@ public:
const DateLUTImpl * time_zone_tmp = nullptr;
if (std::is_same_v<DataType, DataTypeDateTime64> || std::is_same_v<DataType, DataTypeDateTime>)
time_zone_tmp = &extractTimeZoneFromFunctionArguments(block, arguments, 3, 0);
time_zone_tmp = &extractTimeZoneFromFunctionArguments(block, arguments, 2, 0);
else
time_zone_tmp = &DateLUT::instance();

View File

@ -311,7 +311,7 @@ SELECT subtractQuarters(N, 1)
"DateTime64(3, 'Europe/Minsk')","2019-06-16 19:20:11.234"
------------------------------------------
SELECT CAST(N as DateTime(\'Europe/Minsk\'))
"DateTime('Europe/Minsk')","2019-09-15 19:00:00"
"DateTime('Europe/Minsk')","2019-09-16 00:00:00"
"DateTime('Europe/Minsk')","2019-09-16 19:20:11"
"DateTime('Europe/Minsk')","2019-09-16 19:20:11"
------------------------------------------
@ -326,22 +326,22 @@ SELECT CAST(N as UInt64)
"UInt64",1568650811
------------------------------------------
SELECT CAST(N as DateTime64(0, \'Europe/Minsk\'))
"DateTime64(0, 'Europe/Minsk')","2019-09-15 19:00:00"
"DateTime64(0, 'Europe/Minsk')","2019-09-16 00:00:00"
"DateTime64(0, 'Europe/Minsk')","2019-09-16 19:20:11"
"DateTime64(0, 'Europe/Minsk')","2019-09-16 19:20:11"
------------------------------------------
SELECT CAST(N as DateTime64(3, \'Europe/Minsk\'))
"DateTime64(3, 'Europe/Minsk')","2019-09-15 19:00:00.000"
"DateTime64(3, 'Europe/Minsk')","2019-09-16 00:00:00.000"
"DateTime64(3, 'Europe/Minsk')","2019-09-16 19:20:11.000"
"DateTime64(3, 'Europe/Minsk')","2019-09-16 19:20:11.234"
------------------------------------------
SELECT CAST(N as DateTime64(6, \'Europe/Minsk\'))
"DateTime64(6, 'Europe/Minsk')","2019-09-15 19:00:00.000000"
"DateTime64(6, 'Europe/Minsk')","2019-09-16 00:00:00.000000"
"DateTime64(6, 'Europe/Minsk')","2019-09-16 19:20:11.000000"
"DateTime64(6, 'Europe/Minsk')","2019-09-16 19:20:11.234000"
------------------------------------------
SELECT CAST(N as DateTime64(9, \'Europe/Minsk\'))
"DateTime64(9, 'Europe/Minsk')","2019-09-15 19:00:00.000000000"
"DateTime64(9, 'Europe/Minsk')","2019-09-16 00:00:00.000000000"
"DateTime64(9, 'Europe/Minsk')","2019-09-16 19:20:11.000000000"
"DateTime64(9, 'Europe/Minsk')","2019-09-16 19:20:11.234000000"
------------------------------------------