54uso commented on issue #28070:
URL:
https://github.com/apache/shardingsphere/issues/28070#issuecomment-1687321694
@strongduanmu @prajwalbandak Thanks for your reply, here are some of my
configuration information
### config
``` properties
spring.shardingsphere.datasource.names = ds0,ds1
spring.shardingsphere.datasource.ds0.driverClassName =
com.mysql.cj.jdbc.Driver
spring.shardingsphere.datasource.ds0.type =
com.alibaba.druid.pool.DruidDataSource
spring.shardingsphere.datasource.ds0.url =
jdbc:mysql://127.0.0.1:3306/loan_order_center_0?useUnicode=true&useSSL=false&characterEncoding=utf8&serverTimezone=Asia/Shanghai&allowMultiQueries=true&sessionVariables=SQL_SAFE_UPDATES=1
spring.shardingsphere.datasource.ds0.password =
spring.shardingsphere.datasource.ds0.username =
spring.shardingsphere.datasource.ds0.maxActive =
spring.shardingsphere.datasource.ds1.driverClassName =
com.mysql.cj.jdbc.Driver
spring.shardingsphere.datasource.ds1.type =
com.alibaba.druid.pool.DruidDataSource
spring.shardingsphere.datasource.ds1.url =
jdbc:mysql://127.0.0.1:3306/loan_order_center_1?useUnicode=true&useSSL=false&characterEncoding=utf8&serverTimezone=Asia/Shanghai&allowMultiQueries=true&sessionVariables=SQL_SAFE_UPDATES=1
spring.shardingsphere.datasource.ds1.password =
spring.shardingsphere.datasource.ds1.username =
spring.shardingsphere.datasource.ds1.maxActive =
spring.shardingsphere.rules.sharding.sharding-algorithms.loan-order-database-inline.type
= INLINE
spring.shardingsphere.rules.sharding.sharding-algorithms.loan-order-database-inline.props.algorithm-expression
= ds$->{((user_id >> 31) % 4) >> 1}
spring.shardingsphere.rules.sharding.sharding-algorithms.loan-order-info-tables-inline.type
= INLINE
spring.shardingsphere.rules.sharding.sharding-algorithms.loan-order-info-tables-inline.props.algorithm-expression
= loan_order_info_$->{((user_id >> 31) % 4) % 2}
```
### table init sql
``` sql
CREATE TABLE `loan_order_info` (
`id` bigint unsigned NOT NULL COMMENT '主键',
`create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE
CURRENT_TIMESTAMP COMMENT '更新时间',
`instruction_id` bigint unsigned NOT NULL COMMENT '流水号',
`trade_status` tinyint unsigned NOT NULL COMMENT
'交易状态(1:交易成功,2:交易失败,3:处理中)',
`inside_error_code` int DEFAULT NULL COMMENT '内部错误码',
`inside_error_msg` varchar(255) COLLATE utf8mb4_bin DEFAULT NULL COMMENT
'内部错误信息',
PRIMARY KEY (`id`),
UNIQUE KEY `uniq_instruction_id` (`instruction_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin COMMENT='订单状态表'
```
--
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]