Add toYear MySQL compatibility alias

This commit is contained in:
dankondr 2021-01-25 16:00:11 +03:00
parent 8f115f2923
commit d7c5dd3767
3 changed files with 4 additions and 0 deletions

View File

@ -12,6 +12,8 @@ using FunctionToYear = FunctionDateOrDateTimeToSomething<DataTypeUInt16, ToYearI
void registerFunctionToYear(FunctionFactory & factory)
{
factory.registerFunction<FunctionToYear>();
/// MysQL compatibility alias.
factory.registerFunction<FunctionToYear>("YEAR", FunctionFactory::CaseInsensitive);
}
}

View File

@ -0,0 +1 @@
2016

View File

@ -0,0 +1 @@
SELECT YEAR(toDateTime('2016-06-15 23:00:00'));