You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@calcite.apache.org by "Julian Hyde (Jira)" <ji...@apache.org> on 2021/01/23 22:41:00 UTC
[jira] [Commented] (CALCITE-4474) SqlSimpleParser inner Tokenizer
should not recognize the sql of TokenType.ID or some keywords in some case
[ https://issues.apache.org/jira/browse/CALCITE-4474?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17270776#comment-17270776 ]
Julian Hyde commented on CALCITE-4474:
--------------------------------------
The helper method needs a better name than "filterCommentHelper"; it basically does the same as "assertSimplify", so name it and document it accordingly.
Remove the description of the cause of the bug from the test case. In future, no one will care what the bug was, they will only care that the test case is clear, simple and works.
> SqlSimpleParser inner Tokenizer should not recognize the sql of TokenType.ID or some keywords in some case
> ----------------------------------------------------------------------------------------------------------
>
> Key: CALCITE-4474
> URL: https://issues.apache.org/jira/browse/CALCITE-4474
> Project: Calcite
> Issue Type: Bug
> Components: core
> Affects Versions: 1.26.0
> Reporter: wangjie
> Priority: Minor
> Labels: pull-request-available
> Fix For: 1.26.0
>
> Time Spent: 1h 50m
> Remaining Estimate: 0h
>
> in SqlSimpleParser.Tokenizer#nextToken() lines 401 - 423, is used to recognize the sql of TokenType.ID or some keywords.
> If a certain segment of characters is continuously composed of Token,the function of this code may be wrong.
>
> E.g :
> (1)select * from a where price> 10.0\-–comment
> 【10.0\-–comment】should be recognize as TokenType.ID("10.0") and TokenType.COMMENT, but it recognize as TokenType.ID("10.0--comment")
> (2)select * from a where column_b='/* this is not comment */'
> 【/\* this is not comment \*/】should be recognize as TokenType.SQID("/\* this is not comment \*/"), but it was not
>
> you can see reproduce-demo in [https://github.com/wangjie-fourth/calcite-reproduce]
--
This message was sent by Atlassian Jira
(v8.3.4#803005)