You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by GitBox <gi...@apache.org> on 2020/02/25 10:26:25 UTC

[GitHub] [incubator-shardingsphere] tristaZero commented on issue #4456: #4406 fix MySQL, PostgreSQL DDL cannot parse Integer, Double, Decimal

tristaZero commented on issue #4456: #4406 fix MySQL, PostgreSQL DDL cannot parse Integer, Double, Decimal
URL: https://github.com/apache/incubator-shardingsphere/pull/4456#issuecomment-590795865
 
 
   Hi @yuzel Your PR told me that you have a good understand of `g4` flie and `ANTLR`. Thanks for this PR. 
   After my investigation, the root cause for issue #4406 is that the wrong definition of `dataTypeName` in [BaseRule.g4](https://github.com/apache/incubator-shardingsphere/blob/master/shardingsphere-sql-parser/shardingsphere-sql-parser-mysql/src/main/antlr4/imports/mysql/BaseRule.g4). In other words, it is supposed to enumerate all the names of data type, rather than use `identifier` to define `dataTypeName`.
   
   Besides, `DECIMAL`, `DOUBLE` and ` INTEGER` is considered as [reserved word](https://dev.mysql.com/doc/refman/8.0/en/keywords.html). Based on that, i think there are some more modifications for you to do before it is merged. Please look at the following items,
   
   - [ ] Correct  the wrong definition of `dataTypeName` in [BaseRule.g4](https://github.com/apache/incubator-shardingsphere/blob/master/shardingsphere-sql-parser/shardingsphere-sql-parser-mysql/src/main/antlr4/imports/mysql/BaseRule.g4). ([Antlr MySQL](https://github.com/mysql/mysql-workbench/blob/d6dcc4254205a2a8aff01efd9aa9d1afd2711ee5/library/parsers/grammars/MySQLParser.g4#L3192) is a good reference. 😃 )
   
   - [ ] Delete modification of `unreservedWord` in your PR
   - [ ] Keep the existing test cases.
   
   Welcome your opinion, and if you need any help, please contact me.
   Looking forward to your reply.
   Trista
   

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


With regards,
Apache Git Services