SpectralKylin commented on issue #6241:
URL: 
https://github.com/apache/incubator-seata/issues/6241#issuecomment-1880323069

   > You can paste the table structure here by executing show create table.
   
   ```
   CREATE TABLE `bill_storage` (
     `id` bigint(20) NOT NULL,
     `project_id` bigint(20) NOT NULL,
     `group_id` bigint(20) NOT NULL,
     `company_id` bigint(20) NOT NULL,
     `dept_id` bigint(20) DEFAULT NULL,
     `code` varchar(50) DEFAULT NULL,
     `type` char(2) DEFAULT '0',
     `audit_user_ids` varchar(200) DEFAULT NULL,
     `audit_user_names` varchar(200) DEFAULT NULL,
     `remark` varchar(100) DEFAULT NULL,
     `status` varchar(2) DEFAULT '0',
     `create_user_id` bigint(20) DEFAULT NULL,
     `create_user_name` varchar(100) DEFAULT NULL,
     `create_time` datetime DEFAULT NULL,
     `update_time` datetime DEFAULT NULL,
     PRIMARY KEY (`id`)
   ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4
   ```
   ```
   CREATE TABLE `bill_storage_data_0` (
     `id` bigint(20) NOT NULL,
     `project_id` bigint(20) NOT NULL,
     `group_id` bigint(20) NOT NULL,
     `company_id` bigint(20) NOT NULL,
     `dept_id` bigint(20) DEFAULT NULL,
     `tag_no` varchar(7) DEFAULT NULL,
     `tag_sn` varchar(50) DEFAULT NULL,
     `tag_serial` varchar(50) DEFAULT NULL,
     `device_sn` varchar(50) DEFAULT NULL,
     `device_serial` varchar(50) DEFAULT NULL,
     `name` varchar(255) DEFAULT NULL,
     `epc` varchar(100) DEFAULT NULL,
     `assets_type_id` bigint(20) DEFAULT NULL,
     `source` varchar(200) DEFAULT NULL,
     `brand` varchar(200) DEFAULT NULL,
     `model` varchar(200) DEFAULT NULL,
     `spec` varchar(200) DEFAULT NULL,
     `unit` varchar(50) DEFAULT NULL,
     `supplier_name` varchar(100) DEFAULT NULL,
     `supplier_contact` varchar(100) DEFAULT NULL,
     `supplier_phone` varchar(100) DEFAULT NULL,
     `agent_name` varchar(100) DEFAULT NULL,
     `agent_contact` varchar(100) DEFAULT NULL,
     `agent_phone` varchar(100) DEFAULT NULL,
     `purchase_time` date DEFAULT NULL,
     `stock_in_time` date DEFAULT NULL,
     `install_time` date DEFAULT NULL,
     `purchase_price` double(11,2) DEFAULT '1.00',
     `current_price` double(11,2) DEFAULT '0.00',
     `purchase_user_id` bigint(10) DEFAULT NULL,
     `purchase_user_name` varchar(50) DEFAULT NULL,
     `receive_date` datetime DEFAULT NULL,
     `extend1` varchar(100) DEFAULT NULL,
     `extend2` varchar(100) DEFAULT NULL,
     `extend3` varchar(100) DEFAULT NULL,
     `extend4` varchar(100) DEFAULT NULL,
     `extend5` varchar(100) DEFAULT NULL,
     `create_time` datetime DEFAULT NULL,
     `update_time` datetime DEFAULT NULL,
     `bill_id` bigint(20) NOT NULL,
     `tag_id` bigint(20) DEFAULT NULL,
     PRIMARY KEY (`id`) USING BTREE
   ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4
   ```
   ShardingSphere-JDBC may have configuration problems. We formatted the 
configuration rules ourselves and finally loaded them by ShardingSphere-JDBC
   ```
   - logic-table: bill_storage
     algorithm-inline-expression: bill_storage
     sharding-column: id
     algorithm-expression: bill_storage
   - logic-table: bill_storage_data
     algorithm-inline-expression: bill_storage_data_${0..0}
     sharding-column: id
     algorithm-expression: bill_storage_data_${id % 1}
   ```
   just delete the next part and it'll work
   ```
   - logic-table: bill_storage
     algorithm-inline-expression: bill_storage
     sharding-column: id
     algorithm-expression: bill_storage
   ```
   if there is a configuration, mysql-connector-java:8.0.21 will find two tables
   
   
![image](https://github.com/apache/incubator-seata/assets/21182236/15cf0c91-690a-42af-a528-a95e4562207f)
   
   seata-all:1.5.2 atches the id of bill_storage_data_0 with the data of 
bill_storage once
   
   
![image](https://github.com/apache/incubator-seata/assets/21182236/792f70b5-1831-4388-b8e0-b9306c2467dc)
   
   


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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to