kkfnui opened a new issue, #11435:
URL: https://github.com/apache/doris/issues/11435

   ### Search before asking
   
   - [X] I had searched in the 
[issues](https://github.com/apache/incubator-doris/issues?q=is%3Aissue) and 
found no similar issues.
   
   
   ### Description
   
   When use sqlalchemy with doris. There will be numbers wanging logs:
   
   ```
   2022-08-02 08:05:05,358 WARN (doris-mysql-nio-pool-65575|435146) 
[ConnectProcessor.handleQuery():226] Process one query failed because.
   org.apache.doris.common.AnalysisException: errCode = 2, detailMessage = 
Syntax error in line 1:
   ...collated returns' AS CHAR CHARACTER SET utf8mb4) COLLA...
                                ^
   Encountered: CHARACTER
   Expected: COMMA
   
        at 
org.apache.doris.qe.ConnectProcessor.analyze(ConnectProcessor.java:274) 
~[palo-fe.jar:0.15-SNAPSHOT]
        at 
org.apache.doris.qe.ConnectProcessor.handleQuery(ConnectProcessor.java:200) 
~[palo-fe.jar:0.15-SNAPSHOT]
        at 
org.apache.doris.qe.ConnectProcessor.dispatch(ConnectProcessor.java:349) 
~[palo-fe.jar:0.15-SNAPSHOT]
        at 
org.apache.doris.qe.ConnectProcessor.processOnce(ConnectProcessor.java:538) 
~[palo-fe.jar:0.15-SNAPSHOT]
        at 
org.apache.doris.mysql.nio.ReadListener.lambda$handleEvent$0(ReadListener.java:50)
 ~[palo-fe.jar:0.15-SNAPSHOT]
        at 
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) 
[?:?]
        at 
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) 
[?:?]
        at java.lang.Thread.run(Thread.java:829) [?:?]
   Caused by: org.apache.doris.common.AnalysisException: errCode = 2, 
detailMessage = Syntax error
        at 
org.apache.doris.analysis.SqlParser.unrecovered_syntax_error(SqlParser.java:2076)
 ~[palo-fe.jar:0.15-SNAPSHOT]
        at java_cup.runtime.lr_parser.parse(lr_parser.java:616) 
~[jflex-1.4.3.jar:?]
        at 
org.apache.doris.common.util.SqlParserUtils.getMultiStmts(SqlParserUtils.java:59)
 ~[palo-fe.jar:0.15-SNAPSHOT]
        at 
org.apache.doris.qe.ConnectProcessor.analyze(ConnectProcessor.java:265) 
~[palo-fe.jar:0.15-SNAPSHOT]
        ... 7 more
   
   ```
   
   And It is valid for mysql. So it makes  warning log to useless.
   
   ### Use case
   
   
   unicode test sql:
   ```
   SELECT CAST('test collated returns' AS CHAR CHARACTER SET utf8) COLLATE 
utf8mb4_bin AS anon_1;
   ```
   
   
https://github.com/sqlalchemy/sqlalchemy/blob/1536bc4664a248faf81c62326fe1be3dbe18b8cd/lib/sqlalchemy/dialects/mysql/mysqldb.py#L90
   
   ### Related issues
   
   _No response_
   
   ### Are you willing to submit PR?
   
   - [ ] Yes I am willing to submit a PR!
   
   ### Code of Conduct
   
   - [X] I agree to follow this project's [Code of 
Conduct](https://www.apache.org/foundation/policies/conduct)
   


-- 
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.

To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org
For additional commands, e-mail: commits-h...@doris.apache.org

Reply via email to