cardigan1008 commented on issue #25763:
URL:
https://github.com/apache/shardingsphere/issues/25763#issuecomment-1568551929
Hi @tuichenchuxin ,
I hope this message finds you well. I have been trying to modify the
BaseRule.g4 file in /parser/sql/dialect/mysql/src/main/antlr4/imports/mysql to
add the "SYSTEM" keyword to the identifierKeywordsUnambiguous list. However,
despite adding it to the list, the test still fails. Interestingly, when I
replaced "SYSTEM" with "STATUS", which is also a keyword in MySQL, the test
passed.
Could you please give me some advice on this? Thank you for your time and
consideration.
Here is my test:
```xml
<sql-case id="select_with_keyword_system" value="SELECT * FROM vtx_project
WHERE system = ?" />
<select sql-case-id="select_with_keyword_system" parameters="0">
<from>
<simple-table name="vtx_project" start-index="14" stop-index="24" />
</from>
<projections start-index="7" stop-index="7">
<shorthand-projection start-index="7" stop-index="7" />
</projections>
<where start-index="26" stop-index="41">
<expr>
<binary-operation-expression start-index="32" stop-index="41">
<left>
<column name="system" start-index="32" stop-index="37"/>
</left>
<operator>=</operator>
<right>
<literal-expression value="0" start-index="41"
stop-index="41"/>
<parameter-marker-expression parameter-index="0"
start-index="41" stop-index="41"/>
</right>
</binary-operation-expression>
</expr>
</where>
</select>
```
The error:
org.apache.shardingsphere.sql.parser.exception.SQLParsingException: You have
an error in your SQL syntax: SELECT * FROM vtx_project WHERE system = 0, no
viable alternative at input 'SELECT*FROMvtx_projectWHEREsystem' at line 1,
position 32, near [@5,32:37='system',<689>,1:32]
--
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]