You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@calcite.apache.org by "Jesus Camacho Rodriguez (JIRA)" <ji...@apache.org> on 2016/04/13 11:40:25 UTC

[jira] [Commented] (CALCITE-1199) Incorrect trimming of CHAR when performing cast to VARCHAR

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

Jesus Camacho Rodriguez commented on CALCITE-1199:
--------------------------------------------------

[~julianhyde], what is your take? I think it is sufficient to add an additional check on the type to cast to (it should be CHAR) before trimming the value?

> Incorrect trimming of CHAR when performing cast to VARCHAR
> ----------------------------------------------------------
>
>                 Key: CALCITE-1199
>                 URL: https://issues.apache.org/jira/browse/CALCITE-1199
>             Project: Calcite
>          Issue Type: Bug
>          Components: core
>            Reporter: Jesus Camacho Rodriguez
>            Assignee: Jesus Camacho Rodriguez
>
> Assume the value ' ' with type CHAR(1) that needs to be cast to VARCHAR(10).
> The method {{makeCast}} (line 488 in RexBuilder.java) trims the right hand side of the CHAR value, but this seems incorrect as it could lead to incorrect results.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)