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

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


The following commit(s) were added to refs/heads/master by this push:
     new 024b05cc4d8 Fixed the bug that the database is not totally separated 
in partition cache
024b05cc4d8 is described below

commit 024b05cc4d8e72f4ab9272db353b692084253ff1
Author: Caideyipi <[email protected]>
AuthorDate: Sun Jan 26 14:19:06 2025 +0800

    Fixed the bug that the database is not totally separated in partition cache
---
 .../java/org/apache/iotdb/relational/it/schema/IoTDBDatabaseIT.java | 6 ++++--
 .../iotdb/confignode/persistence/schema/ClusterSchemaInfo.java      | 6 +++---
 2 files changed, 7 insertions(+), 5 deletions(-)

diff --git 
a/integration-test/src/test/java/org/apache/iotdb/relational/it/schema/IoTDBDatabaseIT.java
 
b/integration-test/src/test/java/org/apache/iotdb/relational/it/schema/IoTDBDatabaseIT.java
index c98421e2772..160495e40fb 100644
--- 
a/integration-test/src/test/java/org/apache/iotdb/relational/it/schema/IoTDBDatabaseIT.java
+++ 
b/integration-test/src/test/java/org/apache/iotdb/relational/it/schema/IoTDBDatabaseIT.java
@@ -456,6 +456,9 @@ public class IoTDBDatabaseIT {
             EnvFactory.getEnv().getConnection(BaseEnv.TABLE_SQL_DIALECT);
         final Statement statement = connection.createStatement()) {
       statement.execute("create database test");
+      statement.execute("use test");
+      statement.execute("create table table1(id1 tag, s1 string)");
+      statement.execute("insert into table1 values(0, 'd1', null), (1,'d1', 
1)");
     }
 
     try (final Connection connection = EnvFactory.getEnv().getConnection();
@@ -463,6 +466,7 @@ public class IoTDBDatabaseIT {
       statement.execute("create database root.test");
       statement.execute(
           "alter database root.test WITH SCHEMA_REGION_GROUP_NUM=2, 
DATA_REGION_GROUP_NUM=3");
+      statement.execute("insert into root.test.d1 (s1) values(1)");
       statement.execute("drop database root.test");
     }
 
@@ -475,8 +479,6 @@ public class IoTDBDatabaseIT {
           assertTrue(resultSet.next());
         }
         assertEquals("test", resultSet.getString(1));
-        assertEquals(0, resultSet.getInt(6));
-        assertEquals(0, resultSet.getInt(7));
         assertFalse(resultSet.next());
       }
 
diff --git 
a/iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/persistence/schema/ClusterSchemaInfo.java
 
b/iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/persistence/schema/ClusterSchemaInfo.java
index f9f93486782..d0019f33989 100644
--- 
a/iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/persistence/schema/ClusterSchemaInfo.java
+++ 
b/iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/persistence/schema/ClusterSchemaInfo.java
@@ -358,9 +358,9 @@ public class ClusterSchemaInfo implements SnapshotProcessor 
{
       final List<PartialPath> matchedPaths =
           mTree.getMatchedDatabases(patternPath, plan.getScope(), false);
       for (final PartialPath path : matchedPaths) {
-        schemaMap.put(
-            path.getFullPath(),
-            
mTree.getDatabaseNodeByDatabasePath(path).getAsMNode().getDatabaseSchema());
+        final TDatabaseSchema schema =
+            
mTree.getDatabaseNodeByDatabasePath(path).getAsMNode().getDatabaseSchema();
+        schemaMap.put(schema.getName(), schema);
       }
       result.setSchemaMap(schemaMap);
       result.setStatus(new 
TSStatus(TSStatusCode.SUCCESS_STATUS.getStatusCode()));

Reply via email to