You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@calcite.apache.org by "Zhong Yu (JIRA)" <ji...@apache.org> on 2018/04/22 05:31:00 UTC

[jira] [Updated] (CALCITE-2273) misinterpreted

     [ https://issues.apache.org/jira/browse/CALCITE-2273?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Zhong Yu updated CALCITE-2273:
------------------------------
    Description: 
 

 

The following string literal is accepted by Calcite parser, but the result value in Java is incorrect
{code:java}
U&'\+01F600'{code}
 

Cause: currently, SqlLiteral.unescapeUnicode() only intends to handle 4-digit unicode escape value in the form of "\xyzw" . When given the 6-digit form "\+xyzwrs", it parses the four chars "+xyz" as a hexadecimal, which succeeds too. Therefore the result value contains 4 characters: [\u0xyz, w, r, s]

  was:
 

 

The following string literal is accepted by Calcite parser, but the result value in Java is incorrect
{code:java}
U&'\+01F600'{code}
 

Cause: currently, SqlLiteral.unescapeUnicode() only intends to handle 4-digit unicode escape value in the form of \xyzw . When given the 6-digit form \+xyzwrs, it parses the first four chars "+xyz" as a hexadecimal, which succeeds too. Therefore the result value contains 4 characters: [\u0xyz, w, r, s]


> <Unicode 6 digit escape value> misinterpreted 
> ----------------------------------------------
>
>                 Key: CALCITE-2273
>                 URL: https://issues.apache.org/jira/browse/CALCITE-2273
>             Project: Calcite
>          Issue Type: Bug
>            Reporter: Zhong Yu
>            Assignee: Julian Hyde
>            Priority: Major
>
>  
>  
> The following string literal is accepted by Calcite parser, but the result value in Java is incorrect
> {code:java}
> U&'\+01F600'{code}
>  
> Cause: currently, SqlLiteral.unescapeUnicode() only intends to handle 4-digit unicode escape value in the form of "\xyzw" . When given the 6-digit form "\+xyzwrs", it parses the four chars "+xyz" as a hexadecimal, which succeeds too. Therefore the result value contains 4 characters: [\u0xyz, w, r, s]



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)