This is an automated email from the ASF dual-hosted git repository.
jackietien pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/iotdb.git
The following commit(s) were added to refs/heads/master by this push:
new 7267aedc574 fix: add test case for insert into query
7267aedc574 is described below
commit 7267aedc5741bd9180be52ddff8b129b3adc4683
Author: shizy <[email protected]>
AuthorDate: Tue Aug 5 18:02:22 2025 +0800
fix: add test case for insert into query
---
.../it/insertquery/IoTDBInsertQueryIT.java | 29 ++++++++++++++++++++++
1 file changed, 29 insertions(+)
diff --git
a/integration-test/src/test/java/org/apache/iotdb/relational/it/insertquery/IoTDBInsertQueryIT.java
b/integration-test/src/test/java/org/apache/iotdb/relational/it/insertquery/IoTDBInsertQueryIT.java
index cdf1d733778..7948f4b7a30 100644
---
a/integration-test/src/test/java/org/apache/iotdb/relational/it/insertquery/IoTDBInsertQueryIT.java
+++
b/integration-test/src/test/java/org/apache/iotdb/relational/it/insertquery/IoTDBInsertQueryIT.java
@@ -164,6 +164,35 @@ public class IoTDBInsertQueryIT {
}
}
+ @Test
+ public void testInsertIntoSourceTable() throws SQLException {
+ try (Connection connection =
EnvFactory.getEnv().getConnection(BaseEnv.TABLE_SQL_DIALECT);
+ Statement statement = connection.createStatement()) {
+ statement.execute("USE test");
+ // prepare vehicle1
+ statement.execute(String.format(createTableTemplate, 1));
+ statement.execute("INSERT INTO vehicle1 SELECT * FROM vehicle0");
+
+ // vehicle1 row count
+ ResultSet resultSet = statement.executeQuery("select count(*) from
vehicle1");
+ if (!resultSet.next()) {
+ fail("Should get count value!");
+ }
+ long count = resultSet.getLong(1);
+
+ statement.execute(
+ "INSERT INTO vehicle1(time,deviceId,manufacturer,s0,s1,s2,s3,s4)
SELECT time+1000,deviceId,manufacturer,s0,s1,s2,s3,s4 FROM vehicle1");
+ resultSet = statement.executeQuery("select count(*) from vehicle1");
+ if (!resultSet.next()) {
+ fail("Should get count value!");
+ }
+ long newCount = resultSet.getLong(1);
+ assertEquals(count * 2, newCount);
+
+ statement.execute(String.format(dropTableTemplate, 1));
+ }
+ }
+
@Test
public void testTagCategory() throws SQLException {
try (Connection connection =
EnvFactory.getEnv().getConnection(BaseEnv.TABLE_SQL_DIALECT);