lazyboyl opened a new issue #9291:
URL: https://github.com/apache/shardingsphere/issues/9291


   ## Bug Report
   
   ### Which version of ShardingSphere did you use?
   
   ShardingSphere-5.0.0-alpha
   
   ### Which project did you use? ShardingSphere-JDBC or ShardingSphere-Proxy?
   
   ShardingSphere-JDBC
   
   ### Expected behavior
   
   `Actual SQL: db1 ::: select t.ORDER_ID,t.user_Id,t.create_time,toi.* from 
T_ORDER3 t inner join T_ORDER_ITEM3 toi on t.order_id = toi.order_id where 
t.order_id = ? ::: [3]`
   
   ### Actual behavior
   
   `Actual SQL: db1 ::: select t.ORDER_ID,t.user_Id,t.create_time,toi.* from 
T_ORDER3 t inner join t_order_item3 toi on t.order_id = toi.order_id where 
t.order_id = ? ::: [3]`
   
   ### Reason analyze (If you can)
   
   ### Steps to reproduce the behavior, such as: SQL to execute, sharding rule 
configuration, when exception occur etc.
   
   - SQL in Dao's XML of mybatis
   
   ```
   <select id="queryMyOrder" resultMap="OrderResultMap" >
           select t.ORDER_ID,t.user_Id,t.create_time,toi.* from T_ORDER t inner 
join T_ORDER_ITEM toi on t.order_id = toi.order_id where t.order_id = #{orderId}
   </select>
   ```
   - application.yml configuration file
   
   ```
   spring:
     shardingsphere:
       props:
         sql-show: true
       datasource:
         common:
           driver-class-name: com.mysql.jdbc.Driver
           type: com.alibaba.druid.pool.DruidDataSource
         names: db0,db1
         db0:
           url: 
jdbc:mysql://127.0.0.1:3306/db0?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=GMT%2b8
           username: root
           password: '123456'
         db1:
           url: 
jdbc:mysql://127.0.0.1:3306/db1?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=GMT%2b8
           username: root
           password: '123456'
       rules:
         sharding:
           binding-tables[0]: T_ORDER,T_ORDER_ITEM
           key-generators:
             snowflake:
               type: SNOWFLAKE
               props:
                 worker-id: 123
           sharding-algorithms:
             order-item-inline:
               type: INLINE
               props:
                 algorithm-expression: T_ORDER_ITEM$->{order_id % 4}
             table-inline:
               type: INLINE
               props:
                 algorithm-expression: T_ORDER$->{order_id % 4}
             database-inline:
               type: INLINE
               props:
                 algorithm-expression: db$->{order_id % 2}
           tables:
             T_ORDER_ITEM:
               actual-data-nodes: db$->{0..1}.T_ORDER_ITEM$->{0..3}
               table-strategy:
                 standard:
                   sharding-column: order_id
                   sharding-algorithm-name: order-item-inline
               database-strategy:
                 standard:
                   sharding-column: order_id
                   sharding-algorithm-name: database-inline
             T_ORDER:
               actual-data-nodes: db$->{0..1}.T_ORDER$->{0..3}
               table-strategy:
                 standard:
                   sharding-column: order_id
                   sharding-algorithm-name: table-inline
               database-strategy:
                 standard:
                   sharding-column: order_id
                   sharding-algorithm-name: database-inline
       enabled: true
   ```
   
   ### 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:
[email protected]


Reply via email to