Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

select xxx limit has bug when using database spliting #33251

Open
Mrjyw opened this issue Oct 15, 2024 · 3 comments
Open

select xxx limit has bug when using database spliting #33251

Mrjyw opened this issue Oct 15, 2024 · 3 comments

Comments

@Mrjyw
Copy link

Mrjyw commented Oct 15, 2024

Bug Report

when I execute sql:
select * from user_0003 limit 2,2
Actually the sql statement executed is
select * from user_0003 limit 0,4

Which version of ShardingSphere did you use?

5.1.1

Which project did you use? ShardingSphere-JDBC or ShardingSphere-Proxy?

ShardingSphere-JDBC

Expected behavior

execute sql:
select * from user_0003 limit 2,2

Actual behavior

execute
select * from user_0003 limit 0,4

Reason analyze (If you can)

I use database spliting and table spliting both. But the sql only use one table and one dataSource which is default-data-source-name.

I debug the source code and find the reason. When sharding check if the routeContext is single routing, sharding checks the metaData not the sql using. So sharding find 5 dataSources, then the routeContext is not single routing.

image

Steps to reproduce the behavior, such as: SQL to execute, sharding rule configuration, when exception occur etc.

use database spliting and table spliting both. But the sql only use one table and one dataSource which is default-data-source-name.

Example codes for reproduce this issue (such as a github link).

@terrymanu
Copy link
Member

DefaultDataSource has been removed in the new version.
Could you try to the lasted version?

@Mrjyw
Copy link
Author

Mrjyw commented Oct 15, 2024 via email

@Mrjyw
Copy link
Author

Mrjyw commented Oct 16, 2024

To remove 'DefaultDataSource ', I would need to change a lot of code because a lot of tables are using 'DefaultDataSource '. Is there another solution? o(╥﹏╥)o

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants