Skip to content

Commit

Permalink
Fixed the bug that the database is not totally separated in partition…
Browse files Browse the repository at this point in the history
… cache
  • Loading branch information
Caideyipi authored Jan 26, 2025
1 parent 9c9b239 commit 024b05c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -456,13 +456,17 @@ public void testMixedDatabase() throws SQLException {
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();
final Statement statement = connection.createStatement()) {
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");
}

Expand All @@ -475,8 +479,6 @@ public void testMixedDatabase() throws SQLException {
assertTrue(resultSet.next());
}
assertEquals("test", resultSet.getString(1));
assertEquals(0, resultSet.getInt(6));
assertEquals(0, resultSet.getInt(7));
assertFalse(resultSet.next());
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -358,9 +358,9 @@ public DatabaseSchemaResp getMatchedDatabaseSchemas(final GetDatabasePlan plan)
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()));
Expand Down

0 comments on commit 024b05c

Please sign in to comment.