kylin-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (KYLIN-3620) "--" should not be a comment marker use between single quotes in SQL
Date Tue, 23 Oct 2018 00:45:00 GMT

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

ASF GitHub Bot commented on KYLIN-3620:
---------------------------------------

caolijun1166 commented on a change in pull request #302: KYLIN-3620 resolve "--" is treated
as comment marker between singe qu…
URL: https://github.com/apache/kylin/pull/302#discussion_r227185213
 
 

 ##########
 File path: query/src/main/java/org/apache/kylin/query/util/QueryUtil.java
 ##########
 @@ -184,7 +184,7 @@ public static boolean isSelectStatement(String sql) {
 
     public static String removeCommentInSql(String sql1) {
         // match two patterns, one is "-- comment", the other is "/* comment */"
-        final String[] commentPatterns = new String[] { "--[^\r\n]*", "/\\*[\\s\\S]*?\\*/"
};
+        final String[] commentPatterns = new String[]{"--(?!.*\\*/).*?[\r\n]", "/\\*(.|\r|\n)*?\\*/"};
 
 Review comment:
   Yes, it had been formatted.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


> "--" should not be a comment marker use between single quotes in SQL
> --------------------------------------------------------------------
>
>                 Key: KYLIN-3620
>                 URL: https://issues.apache.org/jira/browse/KYLIN-3620
>             Project: Kylin
>          Issue Type: Bug
>          Components: Query Engine
>    Affects Versions: v2.4.1
>            Reporter: Scott Fan
>            Assignee: Lijun Cao
>            Priority: Major
>             Fix For: v2.6.0
>
>
> Hi,
> When I exec a SQL like below, there was an error.
> SELECT * FROM TABLEA WHERE NAME='Jason--Arthur'
> Seems like KYLIN use  the – as a comment marker.
> It should not be that between single quotes, I think.
>   
>  Even I send a REST POST contains SQL like that, or do an ODBC query, there was an error
too.
> You may tell me that I can use a \ as escape, but I can't change the SQL generated by
BI tools like tableau.  
> Thanks
>   



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

Mime
View raw message