strongduanmu opened a new issue #14708:
URL: https://github.com/apache/shardingsphere/issues/14708


   ## Bug Report
   
   ### Which version of ShardingSphere did you use?
   
   e46fa62cc140c2728c9b024255759c47c25e4abe
   
   ### Which project did you use? ShardingSphere-JDBC or ShardingSphere-Proxy?
   
   ShardingSphere-Proxy
   
   ### Expected behavior
   
   Execute insert statement successfully
   
   ### Actual behavior
   
   mysql> INSERT INTO tb_order ( title, HOSPITAL_SOID ) VALUES('222',256181);
   ERROR 1997 (C1997): Runtime exception: [Route table hisnull does not exist, 
available actual table: [his256181, his256182]]
   mysql>  select *  from  tb_order  where HOSPITAL_SOID=256182;
   Empty set (1.90 sec)
   
   ### Reason analyze (If you can)
   
   
![middle_img_v2_6422d094-9fbd-409f-93fd-145e894ccc3g](https://user-images.githubusercontent.com/10829171/149086883-1ec92e8d-697b-4494-8638-bdad1a629af0.png)
   
   ### Steps to reproduce the behavior, such as: SQL to execute, sharding rule 
configuration, when exception occur etc.
   
   Config like follow:
   
   ```yaml
   schemaName: sharding_db
   
   dataSources:
     his256181:
       url: 
jdbc:mysql://127.0.0.1:3306/winex_test_0?serverTimezone=UTC&useSSL=false
       username: root
       password: 123456
       connectionTimeoutMilliseconds: 30000
       idleTimeoutMilliseconds: 60000
       maxLifetimeMilliseconds: 1800000
       maxPoolSize: 50
       minPoolSize: 1
     his256182:
       url: 
jdbc:mysql://127.0.0.1:3306/winex_test_1?serverTimezone=UTC&useSSL=false
       username: root
       password: 123456
       connectionTimeoutMilliseconds: 30000
       idleTimeoutMilliseconds: 60000
       maxLifetimeMilliseconds: 1800000
       maxPoolSize: 50
       minPoolSize: 1
   
   rules:
   - !SHARDING
     tables:
       tb_order:
         actualDataNodes: his${[256181,256182]}.tb_order
         
     defaultDatabaseStrategy:
       standard:
         shardingColumn: HOSPITAL_SOID
         shardingAlgorithmName: database_inline
     defaultTableStrategy:
       none:
   
     shardingAlgorithms:
       database_inline:
         type: INLINE
         props:
           algorithm-expression: his${HOSPITAL_SOID}
   ```
   
   And then execute:
   
   ```sql
   CREATE TABLE `tb_order` (
     `id` int(11) NOT NULL AUTO_INCREMENT,
     `hospital_soid` int(11) DEFAULT NULL,
     `title` varchar(255) DEFAULT NULL,
     PRIMARY KEY (`id`) USING BTREE
   )
   
   INSERT INTO tb_order ( title, HOSPITAL_SOID ) VALUES('222',256181);
   ```
   
   
   ### 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