-
Notifications
You must be signed in to change notification settings - Fork 6.6k
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
Shard table name error when exec select sql in multi thread concurrent #1967
Comments
hi, linyuliang, thanks for your feedback. |
I use sharding-jdbc for single database and sub-table。 my sharding config file is sharding.yml :
My DateStringStandardShardingAlgorithm.java:
|
hi, would you please make "sql.show: true", and paste the Log information. |
YamlConfigurationExampleTest.java:
PreciseModuloShardingTableAlgorithm.java
Expected print: Actual print: |
thanks for reply,let me check it lately |
From your screenshot, it's still wrong. but the 5th line it print: |
ok , I have got your point ,thanks |
it's ok in 4.0.0.M1, you can verify it using dev branch. I will trace the bug reason continually. |
hi, this is the bug in |
would you post the patch file link please?I want to merge it in Version 3.1.0 . |
please reference this file AbstractFromWhereExtractor.java the point is that make |
thanks,it seems work. The modified file:
|
@codefairy08 please make a check of above modified file |
@linyuliang thanks for your code, but your modification does not fix this bug, i commit code. |
@codefairy08 ExpressionExtractor.java:
FromWhereExtractor .java
PredicateExtractor.java
|
we'd like to close this issue, any question? |
After modification, in my environment 3.1.0 Version, it works, can be closed |
hi @linyuliang , I would like to clone your modified 3.1.0 version, would you please make it public in your personal fork, or is it exactly the same as the code pasted above? Any help would be appreciated |
@jakara It exactly the same as the code pasted above, You can copy it directly. |
Which version of ShardingSphere did you use?
it happened in version3.1.0, I tested 3.00 && 3.1.0M1, it's ok
Which project did you use? Sharding-JDBC or Sharding-Proxy?
Sharding-JDBC
Expected behavior
for example my sql is:
select a from test1 where ymd =?
select b from test2 where ymd =?
expected
select a from test1_20190305 where ymd =20190305
select b from test2_20190303 where ymd =20190303
Actual behavior
select a from test2_20190305 where ymd =20190305 --table name error
select b from test1_20190303 where ymd =20190303 --table name error
select a from test1_20190305 where ymd =20190305
select b from test2_20190303 where ymd =20190303
Reason analyze (If you can)
I trace it in SQLParserEngine.java, i think it error in this line:
ParseTree parseTree = SQLParserFactory.newInstance(databaseType, sql).execute().getChild(0);
Steps to reproduce the behavior, such as: SQL to execute, sharding rule configuration, when exception occur etc.
just test it in junit test case
Example codes for reproduce this issue (such as a github link).
The text was updated successfully, but these errors were encountered: