Skip to content

Commit 338e715

Browse files
Fix NPE of RelationalDeleteDataNode merge method (#14834)
* done * done * fix IT * fix IT
1 parent 4d2ac44 commit 338e715

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

integration-test/src/test/java/org/apache/iotdb/relational/it/db/it/IoTDBInsertTableIT.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -877,7 +877,7 @@ public void testInsertKeyword() throws IoTDBConnectionException, StatementExecut
877877
}
878878

879879
@Test
880-
public void testInsertSingleColumn() throws SQLException {
880+
public void testInsertSingleColumn() throws SQLException, InterruptedException {
881881
try (Connection connection = EnvFactory.getEnv().getConnection(BaseEnv.TABLE_SQL_DIALECT);
882882
Statement st1 = connection.createStatement()) {
883883
st1.execute("use \"test\"");
@@ -893,8 +893,12 @@ public void testInsertSingleColumn() throws SQLException {
893893
"305: [INTERNAL_SERVER_ERROR(305)] Exception occurred: \"insert into sg21(time) values(1)\". executeStatement failed. No column other than Time present, please check the request",
894894
e.getMessage());
895895
}
896+
// sleep a while to avoid the same timestamp between two insertions
897+
Thread.sleep(10);
896898
// only attribute
897899
st1.execute("insert into sg21(ss1) values('1')");
900+
// sleep a while to avoid the same timestamp between two insertions
901+
Thread.sleep(10);
898902
// only field
899903
st1.execute("insert into sg21(ss2) values(1)");
900904

iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/planner/plan/node/write/RelationalDeleteDataNode.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -318,7 +318,9 @@ public SearchNode merge(List<SearchNode> searchNodes) {
318318
if (relationalDeleteDataNodeList.stream()
319319
.anyMatch(
320320
relationalDeleteDataNode ->
321-
!this.getDatabaseName().equals(relationalDeleteDataNode.getDatabaseName()))) {
321+
this.getDatabaseName() != null
322+
&& !this.getDatabaseName()
323+
.equals(relationalDeleteDataNode.getDatabaseName()))) {
322324
throw new IllegalArgumentException("All database name need to be same");
323325
}
324326
List<TableDeletionEntry> allTableDeletionEntries =

0 commit comments

Comments
 (0)