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/09/01 09:54:06 UTC

[GitHub] [shardingsphere] tuohai666 opened a new issue #7200: LockSegment absent of PostgreSQL parser

tuohai666 opened a new issue #7200:
URL: https://github.com/apache/shardingsphere/issues/7200


   ## Bug Report
   
   **For English only**, other languages will not accept.
   
   Before report a bug, make sure you have:
   
   - Searched open and closed [GitHub issues](https://github.com/apache/shardingsphere/issues).
   - Read documentation: [ShardingSphere Doc](https://shardingsphere.apache.org/document/current/en/overview).
   
   Please pay attention on issues you submitted, because we maybe need more details. 
   If no response anymore and we cannot reproduce it on current information, we will **close it**.
   
   Please answer these questions before submitting your issue. Thanks!
   
   ### Which version of ShardingSphere did you use?
   
   5.0.0-RC1-SNAPSHOT
   
   ### Which project did you use? ShardingSphere-JDBC or ShardingSphere-Proxy?
   
   ShardingSphere-JDBC
   
   ### Expected behavior
   
   Under MasterSlave rule:
   
   `SELECT * FROM t_order WHERE user_id = ? FOR UPDATE`
   
   should be routed to Master node
   
   ### Actual behavior
   
   The SQL is routed to Slave node
   
   ### Reason analyze (If you can)
   
   LockSegment absent of PostgreSQL parser 
   
   Please refer to the route logic in MasterSlaveDataSourceRouter:
   
    ```
       private boolean isMasterRoute(final SQLStatement sqlStatement) {
           return containsLockSegment(sqlStatement) || !(sqlStatement instanceof SelectStatement) || MasterVisitedManager.isMasterVisited() || HintManager.isMasterRouteOnly();
       }
       
       private boolean containsLockSegment(final SQLStatement sqlStatement) {
           return sqlStatement instanceof SelectStatement && ((SelectStatement) sqlStatement).getLock().isPresent();
       }
   ```
   
   ### Steps to reproduce the behavior, such as: SQL to execute, sharding rule configuration, when exception occur etc.
   
   ### Example codes for reproduce this issue (such as a github link).
   


----------------------------------------------------------------
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] kfwang90 commented on issue #7200: LockSegment absent of PostgreSQL parser

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


   Hi, I have a similar problem when execute sql like this `select nextval('seq_name');`  The SQL is routed to Slave node.
   Does this PR resolved the problem? @tuohai666 


-- 
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 #7200: LockSegment absent of PostgreSQL parser

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


   


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