Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ public void testSetDefaultSGLevel() throws SQLException {
statement.execute("INSERT INTO root.fail(timestamp, s1) VALUES (1, 1)");
} catch (SQLException e) {
assertEquals(
"509: root.fail is not a legal path, because it is no longer than default sg level: 3",
"509: An error occurred when executing getDeviceToDatabase():root.fail is not a legal path, because it is no longer than default sg level: 3",
e.getMessage());
}

Expand All @@ -176,6 +176,7 @@ public void testSetDefaultSGLevel() throws SQLException {
assertTrue(e.getMessage().contains("Illegal defaultStorageGroupLevel: -1, should >= 1"));
}

// Failed updates will not change the files.
// Failed updates will not change the files.
assertFalse(
checkConfigFileContains(
Expand All @@ -197,6 +198,15 @@ public void testSetDefaultSGLevel() throws SQLException {
// the default value should take effect
Assert.assertEquals("root.a", databases.getString(1));
assertFalse(databases.next());

// create timeseries with an illegal path
try {
statement.execute("CREATE TIMESERIES root.db1.s3 WITH datatype=INT32");
} catch (SQLException e) {
assertEquals(
"509: An error occurred when executing getDeviceToDatabase():root.db1 is not a legal path, because it is no longer than default sg level: 3",
e.getMessage());
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -481,7 +481,11 @@ private void getDatabaseCacheResult(
throw new StatementAnalyzeException("Failed to get database Map");
}
}
} catch (final TException | MetadataException | ClientManagerException e) {
} catch (MetadataException e) {
throw new IoTDBRuntimeException(
"An error occurred when executing getDeviceToDatabase():" + e.getMessage(),
e.getErrorCode());
} catch (TException | ClientManagerException e) {
throw new StatementAnalyzeException(
"An error occurred when executing getDeviceToDatabase():" + e.getMessage(), e);
}
Expand Down
Loading