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

   ### 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.
   
   
   ### Version
   
   1.1.1-rc03
   
   ### What's Wrong?
   
   My DB name is `default`, which is also an SQL keyword, but it shouldn't be a 
problem since I can easily escape it with a grave accent when writing SQL 
statements on my own. However, the SQL statements generated by FE sometimes 
forget to escape it, leaving a message like 
   ```
   Failed to execute sql: org.apache.doris.common.AnalysisException: errCode = 
2, detailMessage = Syntax error in line 1:
   SELECT * FROM default.TABLE_NAME LIMIT 10
                 ^
   Encountered: DEFAULT
   Expected: DEFAULT is keyword, maybe `DEFAULT`
   ```
   
   since the keyword `DEFAULT` is not escaped, the SQL statement was a syntax 
error.
   
   
   
   ### What You Expected?
   
   All keywords in the SQL queries be correctly escaped.
   
   ### How to Reproduce?
   
   1. Install Doris and run the BE and FE, and register the BE to the FE, 
namely following the instruction on 
https://doris.apache.org/zh-CN/docs/get-starting/
   2. Create a database named `default` with SQL statement `CREATE DATABASE 
`default``.
   3. Create a table named `TABLE_NAME` into the DB just created
   4. Enter the FE, click Playground, choose `default_cluster:default` on the 
left, then choose `TABLE_NAME` to select the table. Then click "Data preview" 
on the right panel. Instead of showing sample data, the user sees a pop-up 
error: 
   ```
   Failed to execute sql: org.apache.doris.common.AnalysisException: errCode = 
2, detailMessage = Syntax error in line 1:
   SELECT * FROM default.TABLE_NAME LIMIT 10
                 ^
   Encountered: DEFAULT
   Expected: DEFAULT is keyword, maybe `DEFAULT`
   ```
   
   
   ### Anything Else?
   
   _No response_
   
   ### Are you willing to submit PR?
   
   - [X] 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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to