You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by "Administrator-Xorex (via GitHub)" <gi...@apache.org> on 2023/04/11 07:22:08 UTC

[GitHub] [shardingsphere] Administrator-Xorex opened a new issue, #25100: The shadow algorithm VALUE_MATCH was successfully set, but did not work.

Administrator-Xorex opened a new issue, #25100:
URL: https://github.com/apache/shardingsphere/issues/25100

   ## Bug Report
   ShardingSphere-Proxy 5.3.2
   
   MySQL table design:
   ```sql
   CREATE TABLE `user` (
     `id` int NOT NULL AUTO_INCREMENT,
     `username` varchar(255) NOT NULL,
     `password` varchar(255) NOT NULL,
     `status` int DEFAULT NULL,
     PRIMARY KEY (`id`)
   ) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
   ```
   
   Use DistSQL to set the VALUE_MATCH shadow algorithm to table user, and test the insert preview route.
   Insert statements should be routed to the two databases separately, but are not.
   ![image](https://user-images.githubusercontent.com/26794746/231085167-a26f1494-d871-4a0a-b15b-584865f0900b.png)
   
   There is the exprot database configuration result:
   ```yaml
   dataSources:
     product_shadow:
       password: xxxxx
       url: jdbc:mysql://xxxxx:3315/shadow
       username: root
       minPoolSize: 1
       connectionTimeoutMilliseconds: 30000
       maxLifetimeMilliseconds: 2100000
       readOnly: false
       idleTimeoutMilliseconds: 60000
       maxPoolSize: 50
     product:
       password: xxxxx
       url: jdbc:mysql://xxxxx:3315/product
       username: root
       minPoolSize: 1
       connectionTimeoutMilliseconds: 30000
       maxLifetimeMilliseconds: 2100000
       readOnly: false
       idleTimeoutMilliseconds: 60000
       maxPoolSize: 50
   rules:
   - !SHADOW
     dataSources:
       shadow_rule_value:
         productionDataSourceName: product
         shadowDataSourceName: product_shadow
     shadowAlgorithms:
       shadow_rule_value_user_value_match_0:
         props:
           operation: insert
           column: status
           value: '1'
         type: VALUE_MATCH
     tables:
       user:
         dataSourceNames:
         - shadow_rule_value
         shadowAlgorithmNames:
         - shadow_rule_value_user_value_match_0
   ```
   
   
   
   
   
   


-- 
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: notifications-unsubscribe@shardingsphere.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [shardingsphere] RaigorJiang commented on issue #25100: The shadow algorithm VALUE_MATCH was successfully set, but did not work.

Posted by "RaigorJiang (via GitHub)" <gi...@apache.org>.
RaigorJiang commented on issue #25100:
URL: https://github.com/apache/shardingsphere/issues/25100#issuecomment-1503609401

   @Administrator-Xorex  
   I can't reproduce your problem, I think the reason is that you don't specify column names in your INSERT statement.
   
   <img width="987" alt="image" src="https://user-images.githubusercontent.com/5668787/231211819-aea5c7f8-76bb-4b4a-8d15-fea0ff29980f.png">
   


-- 
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: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [shardingsphere] Administrator-Xorex commented on issue #25100: The shadow algorithm VALUE_MATCH was successfully set, but did not work.

Posted by "Administrator-Xorex (via GitHub)" <gi...@apache.org>.
Administrator-Xorex commented on issue #25100:
URL: https://github.com/apache/shardingsphere/issues/25100#issuecomment-1503621591

    Got it, thank you!


-- 
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: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [shardingsphere] Administrator-Xorex closed issue #25100: The shadow algorithm VALUE_MATCH was successfully set, but did not work.

Posted by "Administrator-Xorex (via GitHub)" <gi...@apache.org>.
Administrator-Xorex closed issue #25100: The shadow algorithm VALUE_MATCH was successfully set, but did not work.
URL: https://github.com/apache/shardingsphere/issues/25100


-- 
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: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org