You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@druid.apache.org by GitBox <gi...@apache.org> on 2021/03/05 15:31:13 UTC

[GitHub] [druid] angbisoft opened a new issue #10952: Unicode Characters Problem when parsing MsSql Query

angbisoft opened a new issue #10952:
URL: https://github.com/apache/druid/issues/10952


   ### Affected Version
   
   The v1.2.5 of Druid.
   
   ### Description
   
   Please include as much detailed information about the problem as possible.
   Druid can parse this query just fine (notice unicode, i.e. Turkish characters in schema)
   ```
   select [Ülke]
   from [Örnek VeriTabanı].dbo.[MÜŞteri Bilgisi]
   ```
   However, it fails to parse the same query
   ```
   select Ülke
   from [Örnek VeriTabanı].dbo.[MÜŞteri Bilgisi]
   ```
   with an 
   ```
   com.alibaba.druid.sql.parser.ParserException: illegal identifier. pos 7, line 1, column 8, token SELECT
           at com.alibaba.druid.sql.parser.Lexer.scanIdentifier(Lexer.java:2282)
           at com.alibaba.druid.sql.parser.Lexer.nextToken(Lexer.java:1126)
           at com.alibaba.druid.sql.dialect.sqlserver.parser.SQLServerSelectParser.query(SQLServerSelectParser.java:132)
           at com.alibaba.druid.sql.parser.SQLSelectParser.query(SQLSelectParser.java:374)
           at com.alibaba.druid.sql.dialect.sqlserver.parser.SQLServerSelectParser.select(SQLServerSelectParser.java:48)
           at com.alibaba.druid.sql.parser.SQLStatementParser.parseSelect(SQLStatementParser.java:4190)
           at com.alibaba.druid.sql.parser.SQLStatementParser.parseStatementList(SQLStatementParser.java:204)
           at com.alibaba.druid.sql.SQLUtils.parseStatements(SQLUtils.java:562)
           at com.alibaba.druid.sql.SQLUtils.parseStatements(SQLUtils.java:556)
           at com.alibaba.druid.sql.SQLUtils.parseStatements(SQLUtils.java:579)
   ```
   error. Note that, both of the queries are valid T-SQL statements and Ms Sql Server can parse (and return the same result) without any problems. Actually, I expect that 
    
   ```
       @Test
       public void withBracketsTest() {
           var sql = "select [Ülke]\n        from [Örnek VeriTabanı].dbo.[MÜŞteri Bilgisi]";
           assertDoesNotThrow(() -> SQLUtils.parseSingleStatement(sql, DbType.sqlserver.toString()));
       }
   
       @Test
       public void withoutBracketsTest() {
           var sql = "select Ülke\n        from [Örnek VeriTabanı].dbo.[MÜŞteri Bilgisi]";
           assertDoesNotThrow(() -> SQLUtils.parseSingleStatement(sql, DbType.sqlserver.toString()));
       }
   ```
   both of these test to pass. Although `withBracketsTest` test passes `withoutBracketsTest` fails. 
   
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org


[GitHub] [druid] angbisoft edited a comment on issue #10952: Unicode Characters Problem when parsing MsSql Query

Posted by GitBox <gi...@apache.org>.
angbisoft edited a comment on issue #10952:
URL: https://github.com/apache/druid/issues/10952#issuecomment-791506653


   You are right, I meant to do that. I can close the issue, but the same issue may apply to Apache Druid as well. That's why, I'm leaving it as open. One of the project owners may triage and close accordingly.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org


[GitHub] [druid] FrankChen021 commented on issue #10952: Unicode Characters Problem when parsing MsSql Query

Posted by GitBox <gi...@apache.org>.
FrankChen021 commented on issue #10952:
URL: https://github.com/apache/druid/issues/10952#issuecomment-791497943


   From the stack trace message you provided above, you're using [Alibaba Druid](https://github.com/alibaba/druid), which is a JDBC connection pool. You should open issue there.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org


[GitHub] [druid] angbisoft commented on issue #10952: Unicode Characters Problem when parsing MsSql Query

Posted by GitBox <gi...@apache.org>.
angbisoft commented on issue #10952:
URL: https://github.com/apache/druid/issues/10952#issuecomment-791506653


   You are right I meant to that. I can close the issue, but the same issue may apply to Apache Druid as well. That's why, I'm leaving it as open. One of the project owners may triage and close accordingly.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org