Skip to content
Merged
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 @@ -72,24 +72,24 @@ public void tearDown() throws Exception {
/** Test if creating a time series will cause the database with same name to disappear */
@Test
public void testCreateTimeseries() throws Exception {
String storageGroup = "root.sg1.a.b.c";
String database = "root.sg1.a.b.c";

try (Connection connection = EnvFactory.getEnv().getConnection();
Statement statement = connection.createStatement()) {
statement.execute(String.format("CREATE DATABASE %s", storageGroup));
statement.execute(String.format("CREATE DATABASE %s", database));
statement.execute(
String.format(
"create timeseries %s with datatype=INT64, encoding=PLAIN, compression=SNAPPY",
storageGroup));
database));

} catch (Exception ignored) {
}

// ensure that current database in cache is right.
createTimeSeriesTool(storageGroup);
createTimeSeriesTool(database);
}

private void createTimeSeriesTool(String storageGroup) throws SQLException {
private void createTimeSeriesTool(String database) throws SQLException {
Set<String> resultList = new HashSet<>();
try (Connection connection = EnvFactory.getEnv().getConnection();
Statement statement = connection.createStatement();
Expand All @@ -99,7 +99,7 @@ private void createTimeSeriesTool(String storageGroup) throws SQLException {
resultList.add(str);
}
}
Assert.assertFalse(resultList.contains(storageGroup));
Assert.assertFalse(resultList.contains(database));
resultList.clear();
try (Connection connection = EnvFactory.getEnv().getConnection();
Statement statement = connection.createStatement();
Expand All @@ -109,11 +109,16 @@ private void createTimeSeriesTool(String storageGroup) throws SQLException {
resultList.add(res);
}
}
Assert.assertTrue(resultList.contains(storageGroup));
Assert.assertTrue(resultList.contains(database));
}

@Test
public void testCreateTimeseriesWithSpecialCharacter() throws Exception {
// Currently this test may fail in PBTree
// Will solve this in the future
if (schemaTestMode == SchemaTestMode.PBTree) {
return;
}
try (Connection connection = EnvFactory.getEnv().getConnection()) {
try (Statement statement = connection.createStatement()) {
statement.execute(
Expand Down
Loading