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 2021/05/07 11:36:57 UTC

[GitHub] [shardingsphere] tristaZero opened a new issue #10271: PostgreSQL `SHOW xxx` syntax conflicting with DistSQL

tristaZero opened a new issue #10271:
URL: https://github.com/apache/shardingsphere/issues/10271


   As you know, ShardingSphere defines [DistSQL](https://shardingsphere.apache.org/document/current/cn/features/dist-sql/) for distributed metadata queries. 
   
   There is an issue that `SHOW xxx` DistSQL has conflicts with PostgreSQL standard SQL syntax.
   
   ### How to reproduce?
   - Start Proxy using PostgreSQL
   - Execute DistSQL `show REPLICA_QUERY rule from schem_name`
   
   ### Expected and actual results
   **Expected** 
   `ShardingSphereSQLParserEngine` return `ShowRuleStatement`.
   **Actual**
   `ShardingSphereSQLParserEngine` return `PostgreSQLShowStatement`.
   
   ### Some hints for solution
   - Please check the definition of `show` in `shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-postgresql/src/main/antlr4/imports/postgresql/DALStatement.g4` is aligned with PostgreSQL or not
   - Consider working on its definition to avoid the visitor entering into `show colId` branch
   
   **Note**
   I am unsure these hints can help us fix this conflict, but it is worth more investigation since this method is the cheapest for pushing the development of the DistSQL feature. If you have any progress, please contact me.
   


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



[GitHub] [shardingsphere] strongduanmu commented on issue #10271: PostgreSQL `SHOW xxx` syntax conflicting with DistSQL

Posted by GitBox <gi...@apache.org>.
strongduanmu commented on issue #10271:
URL: https://github.com/apache/shardingsphere/issues/10271#issuecomment-834997974


   @tristaZero I tested PG `show statement` parsing, and found that antlr can match invalid content by default, which caused the `show statement` in distsql to fail to be executed. By specifying a explicit `EOF` lexical symbol, we can force to match all inputs, and invalid content will cause exceptions. 
   
   Before adding `EOF`:
   ![image](https://user-images.githubusercontent.com/10829171/117523407-fefaf600-afea-11eb-8307-06cd83223cf0.png)
   
   After adding `EOF`:
   ![image](https://user-images.githubusercontent.com/10829171/117523479-1c2fc480-afeb-11eb-8a7d-f9d69243ffc7.png)
   


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



[GitHub] [shardingsphere] tristaZero closed issue #10271: PostgreSQL `SHOW xxx` syntax conflicting with DistSQL

Posted by GitBox <gi...@apache.org>.
tristaZero closed issue #10271:
URL: https://github.com/apache/shardingsphere/issues/10271


   


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



[GitHub] [shardingsphere] tristaZero commented on issue #10271: PostgreSQL `SHOW xxx` syntax conflicting with DistSQL

Posted by GitBox <gi...@apache.org>.
tristaZero commented on issue #10271:
URL: https://github.com/apache/shardingsphere/issues/10271#issuecomment-835803195


   @strongduanmu Bingo, elegant. :)


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