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
Fixes #2629 #2666
Fixes #2629 #2666
Conversation
…ith null ShardingRule 2. avoid NPE when execute ShardingDataSourceNames.getDefaultDataSourceName() with null shardingRuleConfig
Hi, thanks for your pr. |
…onfig is null condition.
Thank you for reply. I agree with you, and In my view, I think |
Hi, Considering user will create ShardingRule to create ShardingDataSource, i think it is better to judge whether null == shardingRuleConfig, but do you think it is better to add this judgement in ShardingRule.java?
Once ShardingRule, i.e, ShardingDataSource is created, it is impossible that shardingRule will be null in RoutingEngineFactory. What do you think? |
You are right, ShardingRule is meaningless with a null ShardingRuleConfig. So, we need a judge in ShardingRule's constructor. and I notice there may throw a NPE in |
2. modify SHardingDataSourceNames UT
…ectOptimizedStatement
…ardingSelectOptimizedStatement
…ngSelectOptimizedStatement
…ms to ShardingSelectOptimizedStatement
… ShardingSelectOptimizedStatement
…o optimize module
Confuse the commit log by rebase, so I send a new and close this. |
Changes proposed in this pull request:
ShardingException
when executeRoutingEngine.newInstance()
with nullShardingRule
ShardingDataSourceNames.getDefaultDataSourceName()
with nullshardingRuleConfig
Hello, this is my first PR for
shardingsphere
. so If I do something wrong, please let me know. Thank U.