[
https://issues.apache.org/jira/browse/CALCITE-4474?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
wangjie updated CALCITE-4474:
-----------------------------
Description:
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】
【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]
was:
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】
【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]
> SqlSimpleParser inner Tokenizer ignore comment in some special 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 10m
> 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】
> 【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)