[ 
https://issues.apache.org/jira/browse/CALCITE-6222?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17811389#comment-17811389
 ] 

Julian Hyde commented on CALCITE-6222:
--------------------------------------

The first step in this case should have been to contact the author of 
CALCITE-5619 and ask why they added 'm' to the list of supported dialects. I 
find [~jiajunbernoulli]'s hypothesis - that MariaDB supports {{TO_CHAR}} - to 
be compelling.

See .[Chesterton's fence|https://en.wiktionary.org/wiki/Chesterton%27s_fence]. 

Given that MariaDB has {{TO_CHAR}}, and one of the goals of the MYSQL library 
({{fun=mysql}}) is to make Calcite look like MariaDB, it seems that Calcite's 
behavior was correct before this bug was fixed.

It is much more harmful that {{TO_CHAR}} is missing for someone who expects 
MariaDB compatibility than for it to be present for someone who expects MySQL 
compatibility. Let's choose the lesser harm.

Reverted in commit 
[523bbf37|https://github.com/apache/calcite/commit/523bbf3730ac1670928ee4e0f54745cc337eefb0];
 now, the MYSQL library does support the {{TO_CHAR}} function.

> Mysql does not have to_char function
> ------------------------------------
>
>                 Key: CALCITE-6222
>                 URL: https://issues.apache.org/jira/browse/CALCITE-6222
>             Project: Calcite
>          Issue Type: Bug
>    Affects Versions: 1.36.0
>            Reporter: Caican Cai
>            Priority: Minor
>              Labels: pull-request-available
>             Fix For: 1.37.0
>
>
> {code:java}
> mysql> select to_char(timestamp '2002-04-20 17:31:12.66', 'HH12:MI:SS')
>     -> ;
> ERROR 1305 (42000): FUNCTION test.to_char does not exist
>  {code}
> mysql does not seem to have a to_char function
>  
> link:https://dev.mysql.com/doc/refman/8.0/en/date-and-time-functions.html#function_date-format



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to