mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-12-14 02:12:21 +00:00
72b9d75a84
SQL function toTimezone() converts a Date or DateTime into another timezone. The problem is that the timezone is part of the Date / DateTime type but not part of the internal representation (value). This led to the fact that toTimeZone() wqith non-const timezones produced wrong and misleading results until #48471 (shipped with v23.4) enforced a const timezone. Unfortunately, this PR also broke existing table definitions with non-const timezones, e.g. in ALIAS expressions. So while #48471 addressed the issue appropriately, it is really backwards-incompatible. This PR adds a setting to toggle the behavior and makes it also part of the compatibility profile.
15 lines
404 B
C++
15 lines
404 B
C++
#include <Functions/FunctionUnixTimestamp64.h>
|
|
#include <Functions/FunctionFactory.h>
|
|
|
|
namespace DB
|
|
{
|
|
|
|
REGISTER_FUNCTION(FromUnixTimestamp64Nano)
|
|
{
|
|
factory.registerFunction("fromUnixTimestamp64Nano",
|
|
[](ContextPtr context){ return std::make_unique<FunctionToOverloadResolverAdaptor>(
|
|
std::make_shared<FunctionFromUnixTimestamp64>(9, "fromUnixTimestamp64Nano", context)); });
|
|
}
|
|
|
|
}
|