You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by me...@apache.org on 2026/04/08 03:57:57 UTC

(shardingsphere) branch master updated: Add to string for IdentifierIndex (#38597)

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

menghaoran 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 c8efed892b8 Add to string for IdentifierIndex (#38597)
c8efed892b8 is described below

commit c8efed892b89933d4745a2450423977f3826e18f
Author: Haoran Meng <me...@gmail.com>
AuthorDate: Wed Apr 8 11:57:51 2026 +0800

    Add to string for IdentifierIndex (#38597)
---
 .../shardingsphere/infra/metadata/identifier/IdentifierIndex.java    | 5 +++++
 .../metadata/database/schema/manager/GenericSchemaManagerTest.java   | 2 +-
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/infra/common/src/main/java/org/apache/shardingsphere/infra/metadata/identifier/IdentifierIndex.java b/infra/common/src/main/java/org/apache/shardingsphere/infra/metadata/identifier/IdentifierIndex.java
index 7d37fc5c382..372d35a2a99 100644
--- a/infra/common/src/main/java/org/apache/shardingsphere/infra/metadata/identifier/IdentifierIndex.java
+++ b/infra/common/src/main/java/org/apache/shardingsphere/infra/metadata/identifier/IdentifierIndex.java
@@ -216,6 +216,11 @@ public final class IdentifierIndex<T> {
         return new Snapshot<>(Collections.unmodifiableMap(new LinkedHashMap<>(exactValues)), Collections.unmodifiableMap(immutableNormalizedIdentifiers));
     }
     
+    @Override
+    public String toString() {
+        return snapshot.getExactValues().toString();
+    }
+    
     private static final class Snapshot<T> {
         
         private static final Snapshot<?> EMPTY = new Snapshot<>(Collections.emptyMap(), Collections.emptyMap());
diff --git a/infra/common/src/test/java/org/apache/shardingsphere/infra/metadata/database/schema/manager/GenericSchemaManagerTest.java b/infra/common/src/test/java/org/apache/shardingsphere/infra/metadata/database/schema/manager/GenericSchemaManagerTest.java
index ab97af9b481..81c22cd262b 100644
--- a/infra/common/src/test/java/org/apache/shardingsphere/infra/metadata/database/schema/manager/GenericSchemaManagerTest.java
+++ b/infra/common/src/test/java/org/apache/shardingsphere/infra/metadata/database/schema/manager/GenericSchemaManagerTest.java
@@ -124,7 +124,7 @@ class GenericSchemaManagerTest {
                 Arguments.of("table absent in current schema",
                         createSchema("foo_schema", createTable("foo_tbl", TableType.TABLE)), createSchema("foo_schema"), Collections.singleton("foo_tbl")),
                 Arguments.of("same table definition already exists",
-                        createSchema("foo_schema", createTable("foo_tbl", TableType.TABLE)), createSchema("foo_schema", createTable("foo_tbl", TableType.TABLE)), Collections.singleton("foo_tbl")),
+                        createSchema("foo_schema", createTable("foo_tbl", TableType.TABLE)), createSchema("foo_schema", createTable("foo_tbl", TableType.TABLE)), Collections.emptySet()),
                 Arguments.of("same table name but different definition",
                         createSchema("foo_schema", createTable("foo_tbl", TableType.TABLE)), createSchema("foo_schema", createTable("foo_tbl", TableType.VIEW)), Collections.singleton("foo_tbl")));
     }