You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by so...@apache.org on 2022/10/27 11:16:55 UTC

[shardingsphere] branch master updated: Support migration target database name case insensitive (#21796)

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

soulasuna 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 e3f6fbb0b57 Support migration target database name case insensitive (#21796)
e3f6fbb0b57 is described below

commit e3f6fbb0b57d6b788b93b1196cdab355d13da085
Author: Hongsheng Zhong <zh...@apache.org>
AuthorDate: Thu Oct 27 19:16:49 2022 +0800

    Support migration target database name case insensitive (#21796)
    
    * Support migration target database name case insensitive
    
    * Fix stale DROP MIGRATION SOURCE RESOURCE DistSQL in IT
---
 .../data/pipeline/core/prepare/PipelineJobPreparerUtils.java          | 2 +-
 .../data/pipeline/cases/migration/AbstractMigrationITCase.java        | 2 +-
 .../scaling/src/test/resources/env/common/migration-command.xml       | 4 ++--
 3 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/kernel/data-pipeline/core/src/main/java/org/apache/shardingsphere/data/pipeline/core/prepare/PipelineJobPreparerUtils.java b/kernel/data-pipeline/core/src/main/java/org/apache/shardingsphere/data/pipeline/core/prepare/PipelineJobPreparerUtils.java
index c58c67eaad7..7fb523081eb 100644
--- a/kernel/data-pipeline/core/src/main/java/org/apache/shardingsphere/data/pipeline/core/prepare/PipelineJobPreparerUtils.java
+++ b/kernel/data-pipeline/core/src/main/java/org/apache/shardingsphere/data/pipeline/core/prepare/PipelineJobPreparerUtils.java
@@ -93,7 +93,7 @@ public final class PipelineJobPreparerUtils {
      */
     public static ShardingSphereSQLParserEngine getSQLParserEngine(final String targetDatabaseName) {
         ShardingSphereMetaData metaData = PipelineContext.getContextManager().getMetaDataContexts().getMetaData();
-        ShardingSphereDatabase database = metaData.getDatabases().get(targetDatabaseName);
+        ShardingSphereDatabase database = metaData.getDatabase(targetDatabaseName);
         return metaData.getGlobalRuleMetaData().getSingleRule(SQLParserRule.class).getSQLParserEngine(database.getProtocolType().getType());
     }
     
diff --git a/test/integration-test/scaling/src/test/java/org/apache/shardingsphere/integration/data/pipeline/cases/migration/AbstractMigrationITCase.java b/test/integration-test/scaling/src/test/java/org/apache/shardingsphere/integration/data/pipeline/cases/migration/AbstractMigrationITCase.java
index 763a53ad07f..fdfcc22959d 100644
--- a/test/integration-test/scaling/src/test/java/org/apache/shardingsphere/integration/data/pipeline/cases/migration/AbstractMigrationITCase.java
+++ b/test/integration-test/scaling/src/test/java/org/apache/shardingsphere/integration/data/pipeline/cases/migration/AbstractMigrationITCase.java
@@ -69,7 +69,7 @@ public abstract class AbstractMigrationITCase extends BaseITCase {
     protected void addMigrationSourceResource() throws SQLException {
         if (ITEnvTypeEnum.NATIVE == ENV.getItEnvType()) {
             try {
-                proxyExecuteWithLog("DROP MIGRATION SOURCE RESOURCE ds_0", 2);
+                proxyExecuteWithLog("UNREGISTER MIGRATION SOURCE STORAGE UNIT ds_0", 2);
             } catch (final SQLException ex) {
                 log.warn("Drop sharding_db failed, maybe it's not exist. error msg={}", ex.getMessage());
             }
diff --git a/test/integration-test/scaling/src/test/resources/env/common/migration-command.xml b/test/integration-test/scaling/src/test/resources/env/common/migration-command.xml
index 795c33684a7..11a0fa76b34 100644
--- a/test/integration-test/scaling/src/test/resources/env/common/migration-command.xml
+++ b/test/integration-test/scaling/src/test/resources/env/common/migration-command.xml
@@ -82,10 +82,10 @@
     </create-target-order-item-table-rule>
     
     <migration-single-table>
-        MIGRATE TABLE ds_0.%s INTO sharding_db.%s;
+        MIGRATE TABLE ds_0.%s INTO sharding_DB.%s;
     </migration-single-table>
     
     <migration-single-table-with-schema>
-        MIGRATE TABLE ds_0.test.%s INTO sharding_db.%s;
+        MIGRATE TABLE ds_0.test.%s INTO sharding_DB.%s;
     </migration-single-table-with-schema>
 </command>