This is an automated email from the ASF dual-hosted git repository.

panjuan pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/shardingsphere.git


The following commit(s) were added to refs/heads/master by this push:
     new 38554970cf3 Use null databaseName when creating 
ShardingSphereDataSource in scaling for now (#17997)
38554970cf3 is described below

commit 38554970cf39722d9261473a2013b02ef1d55efc
Author: Hongsheng Zhong <[email protected]>
AuthorDate: Fri May 27 14:39:29 2022 +0800

    Use null databaseName when creating ShardingSphereDataSource in scaling for 
now (#17997)
---
 .../datasource/creator/ShardingSpherePipelineDataSourceCreator.java    | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git 
a/shardingsphere-jdbc/shardingsphere-jdbc-core/src/main/java/org/apache/shardingsphere/driver/data/pipeline/datasource/creator/ShardingSpherePipelineDataSourceCreator.java
 
b/shardingsphere-jdbc/shardingsphere-jdbc-core/src/main/java/org/apache/shardingsphere/driver/data/pipeline/datasource/creator/ShardingSpherePipelineDataSourceCreator.java
index 7cdad2284ff..87219fd6cbe 100644
--- 
a/shardingsphere-jdbc/shardingsphere-jdbc-core/src/main/java/org/apache/shardingsphere/driver/data/pipeline/datasource/creator/ShardingSpherePipelineDataSourceCreator.java
+++ 
b/shardingsphere-jdbc/shardingsphere-jdbc-core/src/main/java/org/apache/shardingsphere/driver/data/pipeline/datasource/creator/ShardingSpherePipelineDataSourceCreator.java
@@ -44,10 +44,11 @@ public final class ShardingSpherePipelineDataSourceCreator 
implements PipelineDa
         YamlRootConfiguration rootConfig = (YamlRootConfiguration) 
pipelineDataSourceConfig;
         YamlShardingRuleConfiguration shardingRuleConfig = 
ShardingRuleConfigurationConverter.findYamlShardingRuleConfiguration(rootConfig.getRules());
         enableRangeQueryForInline(shardingRuleConfig);
+        String databaseName = null;
         Map<String, DataSource> dataSourceMap = new 
YamlDataSourceConfigurationSwapper().swapToDataSources(rootConfig.getDataSources());
         Collection<RuleConfiguration> ruleConfigs = new 
YamlRuleConfigurationSwapperEngine().swapToRuleConfigurations(rootConfig.getRules());
         try {
-            return 
ShardingSphereDataSourceFactory.createDataSource(rootConfig.getDatabaseName(), 
dataSourceMap, ruleConfigs, null);
+            return 
ShardingSphereDataSourceFactory.createDataSource(databaseName, dataSourceMap, 
ruleConfigs, null);
             // CHECKSTYLE:OFF
         } catch (final Exception ex) {
             // CHECKSTYLE:ON

Reply via email to