jmbkeyes opened a new issue #12510:
URL: https://github.com/apache/shardingsphere/issues/12510


   ## Bug Report
   
   **For English only**, other languages will not accept.
   1. table trainee_center_info with sharding key(centerId) in 
databases(bocaicheckin2018,bocaicheckin2019,bocaicheckin2020).
   2. working with seata
   `
       @RequestMapping(value = "tci")
       @Transactional(rollbackFor = Exception.class)
       @ShardingTransactionType(value = TransactionType.BASE)
       public Object testTraineeCenterInfo() throws Exception {
           TraineeCenterInfo tci = new TraineeCenterInfo();
           tci.setCenterId(1L);
           tci.setName("abc1");
           tci.setId(1L);
           traineeCenterInfoRepository.save(tci);
   
           return "ok";
       }
   `
   3. sharding-jdbc log as below.
   2021-09-17 09:29:34.597  INFO 15196 --- [nio-9090-exec-2] 
i.seata.tm.api.DefaultGlobalTransaction  : Begin new global transaction 
[192.168.150.1:8091:182062047173808128]
   2021-09-17 09:29:34.652  INFO 15196 --- [nio-9090-exec-2] ShardingSphere-SQL 
                      : Logic SQL: select traineecen0_.id as id1_0_0_, 
traineecen0_.centerId as centerid2_0_0_, traineecen0_.name as name3_0_0_ from 
trainee_center_info traineecen0_ where traineecen0_.id=?
   2021-09-17 09:29:34.652  INFO 15196 --- [nio-9090-exec-2] ShardingSphere-SQL 
                      : SQLStatement: 
MySQLSelectStatement(limit=Optional.empty, lock=Optional.empty, 
window=Optional.empty)
   2021-09-17 09:29:34.652  INFO 15196 --- [nio-9090-exec-2] ShardingSphere-SQL 
                      : Actual SQL: bocaicheckin2018 ::: select traineecen0_.id 
as id1_0_0_, traineecen0_.centerId as centerid2_0_0_, traineecen0_.name as 
name3_0_0_ , id AS ORDER_BY_DERIVED_0 from trainee_center_info traineecen0_ 
where traineecen0_.id=? ORDER BY id ASC  ::: [1]
   2021-09-17 09:29:34.652  INFO 15196 --- [nio-9090-exec-2] ShardingSphere-SQL 
                      : Actual SQL: bocaicheckin2019 ::: select traineecen0_.id 
as id1_0_0_, traineecen0_.centerId as centerid2_0_0_, traineecen0_.name as 
name3_0_0_ , id AS ORDER_BY_DERIVED_0 from trainee_center_info traineecen0_ 
where traineecen0_.id=? ORDER BY id ASC  ::: [1]
   2021-09-17 09:29:34.652  INFO 15196 --- [nio-9090-exec-2] ShardingSphere-SQL 
                      : Actual SQL: bocaicheckin2020 ::: select traineecen0_.id 
as id1_0_0_, traineecen0_.centerId as centerid2_0_0_, traineecen0_.name as 
name3_0_0_ , id AS ORDER_BY_DERIVED_0 from trainee_center_info traineecen0_ 
where traineecen0_.id=? ORDER BY id ASC  ::: [1]
   2021-09-17 09:29:34.669  INFO 15196 --- [nio-9090-exec-2] 
i.seata.tm.api.DefaultGlobalTransaction  : 
[192.168.150.1:8091:182062047173808128] commit status: Committed
   2021-09-17 09:29:34.792  INFO 15196 --- [nio-9090-exec-2] ShardingSphere-SQL 
                      : Logic SQL: insert into trainee_center_info (centerId, 
name, id) values (?, ?, ?)
   2021-09-17 09:29:34.792  INFO 15196 --- [nio-9090-exec-2] ShardingSphere-SQL 
                      : SQLStatement: 
MySQLInsertStatement(setAssignment=Optional.empty, 
onDuplicateKeyColumns=Optional.empty)
   2021-09-17 09:29:34.792  INFO 15196 --- [nio-9090-exec-2] ShardingSphere-SQL 
                      : Actual SQL: bocaicheckin2018 ::: insert into 
trainee_center_info (centerId, name, id) values (?, ?, ?) ::: [1, abc1, 1]
   
   
   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.0beta
   ### Which project did you use? ShardingSphere-JDBC or ShardingSphere-Proxy?
   ShardingSphere-JDBC
   ### Expected behavior
   one sql query to specific datanode.
   ### Actual behavior
   three sql query to all data nodes.
   ### Reason analyze (If you can)
    Maybe caused by seata which needs to load beforeImage and save it to 
undo_log
   ### 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.

To unsubscribe, e-mail: [email protected]

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


Reply via email to