mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-21 23:21:59 +00:00
Added test for enhanced time zones support [#CLICKHOUSE-3402].
This commit is contained in:
parent
60477a9aaa
commit
2d1702f8e6
@ -20,6 +20,7 @@ static std::string extractTimeZoneNameFromColumn(const IColumn & column)
|
||||
|
||||
std::string extractTimeZoneNameFromFunctionArguments(const ColumnsWithTypeAndName & arguments, size_t time_zone_arg_num)
|
||||
{
|
||||
/// Explicit time zone may be passed in last argument.
|
||||
if (arguments.size() == time_zone_arg_num + 1)
|
||||
{
|
||||
return extractTimeZoneNameFromColumn(*arguments[time_zone_arg_num].column);
|
||||
|
@ -0,0 +1,18 @@
|
||||
2017-12-05 10:37:47
|
||||
2017-12-05 10:37:47
|
||||
2017-12-05 10:37:47
|
||||
2017-12-05 08:07:47
|
||||
2017-12-05 08:07:47
|
||||
2017-12-05 08:07:47
|
||||
2017-12-05 08:07:47
|
||||
2017-10-05 08:07:47
|
||||
2017-10-05 08:07:47
|
||||
2017-10-05 08:07:47
|
||||
2017-10-05 08:07:47
|
||||
1509858467
|
||||
1509858467
|
||||
2017-11-05 08:07:47
|
||||
2017-11-05 10:37:47
|
||||
2017-11-05 08:07:47
|
||||
2017-11-05 10:37:47
|
||||
2017-11-05 10:37:47
|
22
dbms/tests/queries/0_stateless/00515_enhanced_time_zones.sql
Normal file
22
dbms/tests/queries/0_stateless/00515_enhanced_time_zones.sql
Normal file
@ -0,0 +1,22 @@
|
||||
SELECT addMonths(toDateTime('2017-11-05 08:07:47', 'Europe/Moscow'), 1, 'Asia/Kolkata');
|
||||
SELECT addMonths(toDateTime('2017-11-05 10:37:47', 'Asia/Kolkata'), 1);
|
||||
SELECT addMonths(toTimeZone(toDateTime('2017-11-05 08:07:47', 'Europe/Moscow'), 'Asia/Kolkata'), 1);
|
||||
|
||||
SELECT addMonths(toDateTime('2017-11-05 08:07:47'), 1);
|
||||
SELECT addMonths(materialize(toDateTime('2017-11-05 08:07:47')), 1);
|
||||
SELECT addMonths(toDateTime('2017-11-05 08:07:47'), materialize(1));
|
||||
SELECT addMonths(materialize(toDateTime('2017-11-05 08:07:47')), materialize(1));
|
||||
|
||||
SELECT addMonths(toDateTime('2017-11-05 08:07:47'), -1);
|
||||
SELECT addMonths(materialize(toDateTime('2017-11-05 08:07:47')), -1);
|
||||
SELECT addMonths(toDateTime('2017-11-05 08:07:47'), materialize(-1));
|
||||
SELECT addMonths(materialize(toDateTime('2017-11-05 08:07:47')), materialize(-1));
|
||||
|
||||
SELECT toUnixTimestamp('2017-11-05 08:07:47', 'Europe/Moscow');
|
||||
SELECT toUnixTimestamp(toDateTime('2017-11-05 08:07:47', 'Europe/Moscow'), 'Europe/Moscow');
|
||||
|
||||
SELECT toDateTime('2017-11-05 08:07:47', 'Europe/Moscow');
|
||||
SELECT toTimeZone(toDateTime('2017-11-05 08:07:47', 'Europe/Moscow'), 'Asia/Kolkata');
|
||||
SELECT toString(toDateTime('2017-11-05 08:07:47', 'Europe/Moscow'));
|
||||
SELECT toString(toTimeZone(toDateTime('2017-11-05 08:07:47', 'Europe/Moscow'), 'Asia/Kolkata'));
|
||||
SELECT toString(toDateTime('2017-11-05 08:07:47', 'Europe/Moscow'), 'Asia/Kolkata');
|
Loading…
Reference in New Issue
Block a user