Skip to content

Commit def810d

Browse files
committed
IT-fix
1 parent da3fbc6 commit def810d

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

integration-test/src/test/java/org/apache/iotdb/relational/it/schema/IoTDBDatabaseIT.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -832,7 +832,7 @@ public void testDBAuth() throws SQLException {
832832
Collections.singleton("information_schema,INF,null,null,null,"));
833833
TestUtils.assertResultSetEqual(
834834
userStmt.executeQuery("select * from information_schema.databases"),
835-
"database,ttl(ms),schema_replication_factor,data_replication_factor,time_partition_interval,schema_region_group_num,data_region_group_num,",
835+
"database,ttl(ms),schema_replication_factor,data_replication_factor,time_partition_interval,schema_region_group_num,data_region_group_num,need_last_cache,",
836836
Collections.singleton("information_schema,INF,null,null,null,null,null,"));
837837
}
838838

integration-test/src/test/java/org/apache/iotdb/relational/it/schema/IoTDBTableIT.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -646,7 +646,7 @@ public void testTableAuth() throws SQLException {
646646
Assert.assertThrows(SQLException.class, () -> userStmt.execute("select * from db.test"));
647647
TestUtils.assertResultSetEqual(
648648
userStmt.executeQuery("select * from information_schema.tables where database = 'db'"),
649-
"database,table_name,ttl(ms),status,comment,table_type,",
649+
"database,table_name,ttl(ms),status,comment,table_type,need_last_cache,",
650650
Collections.emptySet());
651651
TestUtils.assertResultSetEqual(
652652
userStmt.executeQuery("select * from information_schema.columns where database = 'db'"),

iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/persistence/schema/ClusterSchemaInfo.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,9 @@ public TSStatus alterDatabase(final DatabaseSchemaPlan plan) {
272272
currentSchema.getTTL());
273273
}
274274

275-
if (alterSchema.isSetNeedLastCache()) {
275+
if (alterSchema.isSetNeedLastCache()
276+
&& alterSchema.isNeedLastCache()
277+
!= (!currentSchema.isSetNeedLastCache() || currentSchema.isNeedLastCache())) {
276278
if (!currentSchema.isIsTableModel()) {
277279
result.setCode(TSStatusCode.SEMANTIC_ERROR.getStatusCode());
278280
result.setMessage("The tree model database does not support alter need last cache now.");

0 commit comments

Comments
 (0)