apache / shardingsphere

Distributed SQL transaction & query engine for data sharding, scaling, encryption, and more - on any database.
Apache License 2.0
19.89k stars 6.73k forks source link

sharding Key "not in " how to route query to all databases #18146

Closed lshirong closed 3 months ago

lshirong commented 2 years ago

Question

Which version of ShardingSphere did you use? 5.1.1

Which project did you use? shardingsphere-jdbc-core-spring-boot-starter

Question When sql "id not in ('1')", there are no route query all database, but only route query the database where '1' is located

Demo

sharding-config

spring.shardingsphere.rules.sharding.default-database-strategy.standard.sharding-column=id spring.shardingsphere.rules.sharding.default-database-strategy.standard.sharding-algorithm-name=id-sharding spring.shardingsphere.rules.sharding.sharding-algorithms.id-shardingtype=CLASS_BASED spring.shardingsphere.rules.sharding.sharding-algorithms.id-sharding.props.strategy=STANDARD spring.shardingsphere.rules.sharding.sharding-algorithms.id-sharding.props.algorithmClassName=com.ShardingAlgorithm

ShardingAlgorithm

public class ShardingAlgorithm implements StandardShardingAlgorithm

query sql

select * from demo where id not in ('1')

terrymanu commented 2 years ago

I cannot get your point from the title, can you change it?

github-actions[bot] commented 2 years ago

Hello , this issue has not received a reply for several days. This issue is supposed to be closed.