You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@kylin.apache.org by "Xiaoxiang Yu (Jira)" <ji...@apache.org> on 2021/02/20 06:59:00 UTC

[jira] [Updated] (KYLIN-4879) The function of sql to remove comments is not perfect. In some cases, the sql query conditions used will be modified

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

Xiaoxiang Yu updated KYLIN-4879:
--------------------------------
    Fix Version/s:     (was: v3.1.0)
                   v3.1.2

> The function of sql to remove comments is not perfect. In some cases, the sql query conditions used will be modified
> --------------------------------------------------------------------------------------------------------------------
>
>                 Key: KYLIN-4879
>                 URL: https://issues.apache.org/jira/browse/KYLIN-4879
>             Project: Kylin
>          Issue Type: Bug
>          Components: Query Engine
>    Affects Versions: v2.6.0
>            Reporter: wangjie
>            Priority: Critical
>             Fix For: v3.1.2
>
>
> In the removeCommentInSql method of QueryUtil of the query module, if the single quote character of the user's sql contains – or /**/, the regular expression will rewrite the sql query condition.
> E.g:
> (1) When the single quotation mark contains --, line break
> {quote}String sql = "select count(*) from test_kylin_fact WHERE column_name ='--this is not comment'\n "+ "LIMIT 100 offset 0";
> {quote}
> After the removeCommentInSql method, it will become:
> {quote}select count(*) from test_kylin_fact WHERE column_name = 'LIMIT 100 offset 0
> {quote}
> (2) Contain multiple lines of comments in single quotes
> {quote}String sql = "select count(*) from test_kylin_fact WHERE column_name ='/**--this *is not comment***/'";
> {quote}
> After the removeCommentInSql method, it will become:
> {quote}select count(*) from test_kylin_fact WHERE column_name =''
> {quote}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)