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

Sergey Nuyanzin commented on CALCITE-7499:
------------------------------------------

Merged as 
[b2e1ab3e46643f30c7263c1520564c11c0e40053|https://github.com/apache/calcite/commit/b2e1ab3e46643f30c7263c1520564c11c0e40053]

> COALESCE with args of different types might be incorrectly simplified
> ---------------------------------------------------------------------
>
>                 Key: CALCITE-7499
>                 URL: https://issues.apache.org/jira/browse/CALCITE-7499
>             Project: Calcite
>          Issue Type: Bug
>          Components: core
>            Reporter: Sergey Nuyanzin
>            Assignee: Sergey Nuyanzin
>            Priority: Major
>              Labels: pull-request-available
>
> In case {{COALESCE}} has at least 2 args as input of different types (e.g. 
> INT and BIGINT) like 
> {code:sql}
> SELECT COALESCE(1, CAST(1 AS BIGINT));
> {code}
> it returns 1 as INT while {{leastRestrictiveType}} is BIGINT.
> Similar issue for other types and for types with different precision.
> Postgres takes into account types of input args 
> https://onecompiler.com/postgresql/44n48bnc8
> also MySql https://onecompiler.com/mysql/44n4cgk4q



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

Reply via email to