Skip to content

Commit

Permalink
Merge branch 'master' into table_data_deletion
Browse files Browse the repository at this point in the history
# Conflicts:
#	iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/load/LoadTsFileManager.java
  • Loading branch information
jt2594838 committed Oct 25, 2024
2 parents ba59a3f + 77a2dd7 commit 2ffd6b4
Show file tree
Hide file tree
Showing 144 changed files with 4,097 additions and 1,877 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1041,25 +1041,23 @@ public void testInvalidMaxPointNumber() {

@Test
public void testStorageGroupWithHyphenInName() {
try (Connection connection = EnvFactory.getEnv().getConnection();
Statement statement = connection.createStatement()) {
try (final Connection connection = EnvFactory.getEnv().getConnection();
final Statement statement = connection.createStatement()) {
statement.setFetchSize(5);
statement.execute("CREATE DATABASE root.group_with_hyphen");
} catch (SQLException e) {
} catch (final SQLException e) {
fail();
}

try (Connection connection = EnvFactory.getEnv().getConnection();
Statement statement = connection.createStatement()) {
try (ResultSet resultSet = statement.executeQuery("SHOW DATABASES")) {
ResultSetMetaData resultSetMetaData = resultSet.getMetaData();
try (final Connection connection = EnvFactory.getEnv().getConnection();
final Statement statement = connection.createStatement()) {
try (final ResultSet resultSet = statement.executeQuery("SHOW DATABASES DETAILS")) {
while (resultSet.next()) {
StringBuilder builder = new StringBuilder();
builder.append(resultSet.getString(1));
Assert.assertEquals(builder.toString(), "root.group_with_hyphen");
Assert.assertEquals("root.group_with_hyphen", resultSet.getString(1));
Assert.assertEquals("TREE", resultSet.getString(12));
}
}
} catch (SQLException e) {
} catch (final SQLException e) {
fail();
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;

Expand Down Expand Up @@ -954,7 +955,7 @@ public void testInsertTabletWithTTL()
Assert.assertTrue(record.getFields().get(0).getLongV() > timeLowerBound);
count++;
}
Assert.assertTrue(count > 0 && count < 4);
Assert.assertEquals(2, count);
}
}

Expand Down Expand Up @@ -1041,6 +1042,39 @@ public void testInsertUnsequenceData()
}
}

@Test
public void testInsertAllNullRow() throws SQLException {
try (Connection connection = EnvFactory.getEnv().getConnection(BaseEnv.TABLE_SQL_DIALECT);
Statement st1 = connection.createStatement()) {
st1.execute("use \"test\"");
st1.execute("create table table5(d1 string id, s1 int32 measurement, s2 int32 measurement)");

st1.execute("insert into table5(time, d1,s1,s2) values(1,'a',1,null)");
// insert all null row
st1.execute("insert into table5(time, d1,s1,s2) values(2,'a',null,null)");

ResultSet rs1 = st1.executeQuery("select * from table5");
assertTrue(rs1.next());
assertEquals("1", rs1.getString("s1"));
assertNull(rs1.getString("s2"));
assertTrue(rs1.next());
assertNull(rs1.getString("s1"));
assertNull(rs1.getString("s2"));
assertFalse(rs1.next());

st1.execute("flush");

rs1 = st1.executeQuery("select * from table5");
assertTrue(rs1.next());
assertEquals("1", rs1.getString("s1"));
assertNull(rs1.getString("s2"));
assertTrue(rs1.next());
assertNull(rs1.getString("s1"));
assertNull(rs1.getString("s2"));
assertFalse(rs1.next());
}
}

private List<Integer> checkHeader(
ResultSetMetaData resultSetMetaData, String expectedHeaderStrings, int[] expectedTypes)
throws SQLException {
Expand Down

Large diffs are not rendered by default.

Loading

0 comments on commit 2ffd6b4

Please sign in to comment.