diff --git a/src/Functions/toSecond.cpp b/src/Functions/toSecond.cpp index 90196cc6722..a631a2646d6 100644 --- a/src/Functions/toSecond.cpp +++ b/src/Functions/toSecond.cpp @@ -12,6 +12,8 @@ using FunctionToSecond = FunctionDateOrDateTimeToSomething(); + /// MysQL compatibility alias. + factory.registerFunction("SECOND", FunctionFactory::CaseInsensitive); } } diff --git a/tests/queries/0_stateless/01672_test_toSecond_mysql_dialect.reference b/tests/queries/0_stateless/01672_test_toSecond_mysql_dialect.reference new file mode 100644 index 00000000000..573541ac970 --- /dev/null +++ b/tests/queries/0_stateless/01672_test_toSecond_mysql_dialect.reference @@ -0,0 +1 @@ +0 diff --git a/tests/queries/0_stateless/01672_test_toSecond_mysql_dialect.sql b/tests/queries/0_stateless/01672_test_toSecond_mysql_dialect.sql new file mode 100644 index 00000000000..adb72b9843c --- /dev/null +++ b/tests/queries/0_stateless/01672_test_toSecond_mysql_dialect.sql @@ -0,0 +1 @@ +SELECT SECOND(toDateTime('2016-06-15 23:00:00')); \ No newline at end of file