This is an automated email from the ASF dual-hosted git repository. jackietien pushed a commit to branch rc/2.0.6 in repository https://gitbox.apache.org/repos/asf/iotdb.git
commit be6857f2122573af3f33b392527fbdca0aa1b644 Author: shiwenyan <[email protected]> AuthorDate: Wed Dec 17 10:58:47 2025 +0800 fixIT --- .../iotdb/ainode/it/AINodeConcurrentInferenceIT.java | 10 +++++----- .../java/org/apache/iotdb/db/it/auth/IoTDBAuthIT.java | 18 ++++++------------ .../apache/iotdb/db/it/auth/IoTDBRelationalAuthIT.java | 10 ---------- .../iotdb/db/queryengine/plan/udf/UDTFForecast.java | 2 +- .../iotdb/commons/auth/user/BasicUserManager.java | 1 - 5 files changed, 12 insertions(+), 29 deletions(-) diff --git a/integration-test/src/test/java/org/apache/iotdb/ainode/it/AINodeConcurrentInferenceIT.java b/integration-test/src/test/java/org/apache/iotdb/ainode/it/AINodeConcurrentInferenceIT.java index 8bbda568cab..a08990d472f 100644 --- a/integration-test/src/test/java/org/apache/iotdb/ainode/it/AINodeConcurrentInferenceIT.java +++ b/integration-test/src/test/java/org/apache/iotdb/ainode/it/AINodeConcurrentInferenceIT.java @@ -65,7 +65,7 @@ public class AINodeConcurrentInferenceIT { private static void prepareDataForTreeModel() throws SQLException { try (Connection connection = EnvFactory.getEnv().getConnection(BaseEnv.TREE_SQL_DIALECT); - Statement statement = connection.createStatement()) { + Statement statement = connection.createStatement()) { statement.execute("CREATE DATABASE root.AI"); statement.execute("CREATE TIMESERIES root.AI.s WITH DATATYPE=DOUBLE, ENCODING=RLE"); for (int i = 0; i < 2880; i++) { @@ -79,7 +79,7 @@ public class AINodeConcurrentInferenceIT { private static void prepareDataForTableModel() throws SQLException { try (Connection connection = EnvFactory.getEnv().getConnection(BaseEnv.TABLE_SQL_DIALECT); - Statement statement = connection.createStatement()) { + Statement statement = connection.createStatement()) { statement.execute("CREATE DATABASE root"); statement.execute("CREATE TABLE root.AI (s DOUBLE FIELD)"); for (int i = 0; i < 2880; i++) { @@ -99,7 +99,7 @@ public class AINodeConcurrentInferenceIT { private void concurrentGPUCallInferenceTest(String modelId) throws SQLException, InterruptedException { try (Connection connection = EnvFactory.getEnv().getConnection(BaseEnv.TREE_SQL_DIALECT); - Statement statement = connection.createStatement()) { + Statement statement = connection.createStatement()) { final int threadCnt = 10; final int loop = 100; final int predictLength = 512; @@ -134,7 +134,7 @@ public class AINodeConcurrentInferenceIT { public void concurrentGPUForecastTest(String modelId, String selectSql) throws SQLException, InterruptedException { try (Connection connection = EnvFactory.getEnv().getConnection(BaseEnv.TABLE_SQL_DIALECT); - Statement statement = connection.createStatement()) { + Statement statement = connection.createStatement()) { final int threadCnt = 10; final int loop = 100; final int predictLength = 512; @@ -164,7 +164,7 @@ public class AINodeConcurrentInferenceIT { for (int retry = 0; retry < 200; retry++) { Set<String> foundDevices = new HashSet<>(); try (final ResultSet resultSet = - statement.executeQuery(String.format("SHOW LOADED MODELS '%s'", device))) { + statement.executeQuery(String.format("SHOW LOADED MODELS '%s'", device))) { while (resultSet.next()) { String deviceId = resultSet.getString("DeviceId"); String loadedModelId = resultSet.getString("ModelId"); diff --git a/integration-test/src/test/java/org/apache/iotdb/db/it/auth/IoTDBAuthIT.java b/integration-test/src/test/java/org/apache/iotdb/db/it/auth/IoTDBAuthIT.java index 97bccfd263a..39bff0c01ad 100644 --- a/integration-test/src/test/java/org/apache/iotdb/db/it/auth/IoTDBAuthIT.java +++ b/integration-test/src/test/java/org/apache/iotdb/db/it/auth/IoTDBAuthIT.java @@ -97,13 +97,9 @@ public class IoTDBAuthIT { Assert.assertThrows( SQLException.class, () -> userStmt.execute("LIST PRIVILEGES OF USER root")); - ResultSet resultSet = userStmt.executeQuery("LIST USER"); - Assert.assertTrue(resultSet.next()); - Assert.assertEquals("10000", resultSet.getString(1)); - Assert.assertEquals("tempuser", resultSet.getString(2)); - Assert.assertFalse(resultSet.next()); + Assert.assertThrows(SQLException.class, () -> userStmt.execute("LIST USER")); - resultSet = userStmt.executeQuery("LIST PRIVILEGES OF USER tempuser"); + ResultSet resultSet = userStmt.executeQuery("LIST PRIVILEGES OF USER tempuser"); Assert.assertFalse(resultSet.next()); // 2. admin grant all privileges to user tempuser, So tempuser can do anything. @@ -872,13 +868,11 @@ public class IoTDBAuthIT { try (Connection userCon = EnvFactory.getEnv().getConnection("tempuser", "temppw123456"); Statement userStmt = userCon.createStatement()) { try { - String ans = "10010,tempuser,\n"; - ResultSet resultSet = userStmt.executeQuery("LIST USER"); - validateResultSet(resultSet, ans); + Assert.assertThrows(SQLException.class, () -> userStmt.execute("LIST USER")); // with list user privilege - adminStmt.execute("GRANT SECURITY on root.** TO USER tempuser"); - resultSet = userStmt.executeQuery("LIST USER"); - ans = + adminStmt.execute("GRANT MANAGE_USER on root.** TO USER tempuser"); + ResultSet resultSet = userStmt.executeQuery("LIST USER"); + String ans = "0,root,\n" + "10010,tempuser,\n" + "10000,user0,\n" diff --git a/integration-test/src/test/java/org/apache/iotdb/db/it/auth/IoTDBRelationalAuthIT.java b/integration-test/src/test/java/org/apache/iotdb/db/it/auth/IoTDBRelationalAuthIT.java index a364630906f..09cce54ef49 100644 --- a/integration-test/src/test/java/org/apache/iotdb/db/it/auth/IoTDBRelationalAuthIT.java +++ b/integration-test/src/test/java/org/apache/iotdb/db/it/auth/IoTDBRelationalAuthIT.java @@ -66,16 +66,6 @@ public class IoTDBRelationalAuthIT { Statement adminStmt = adminCon.createStatement()) { adminStmt.execute("create user testuser 'password123456'"); - try (Connection userCon = - EnvFactory.getEnv() - .getConnection("testuser", "password123456", BaseEnv.TABLE_SQL_DIALECT); - Statement userStmt = userCon.createStatement()) { - ResultSet resultSet = userStmt.executeQuery("LIST USER"); - Assert.assertTrue(resultSet.next()); - Assert.assertEquals("10000", resultSet.getString(1)); - Assert.assertEquals("testuser", resultSet.getString(2)); - Assert.assertFalse(resultSet.next()); - } adminStmt.execute("create database testdb"); adminStmt.execute("GRANT MANAGE_USER to user testuser"); Assert.assertThrows( diff --git a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/udf/UDTFForecast.java b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/udf/UDTFForecast.java index b15013f78d7..260410954d4 100644 --- a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/udf/UDTFForecast.java +++ b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/udf/UDTFForecast.java @@ -129,7 +129,7 @@ public class UDTFForecast implements UDTF { .collect( Collectors.toMap( arr -> arr[0].trim(), arr -> arr[1].trim(), (v1, v2) -> v2 // 如果 key 重复,保留后一个 - )); + )); this.inputRows = new LinkedList<>(); List<TSDataType> tsDataTypeList = new ArrayList<>(this.types.size() - 1); for (int i = 0; i < this.types.size(); i++) { diff --git a/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/auth/user/BasicUserManager.java b/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/auth/user/BasicUserManager.java index 4f73cb38fba..1db5cce414e 100644 --- a/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/auth/user/BasicUserManager.java +++ b/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/auth/user/BasicUserManager.java @@ -41,7 +41,6 @@ import java.util.Map; import static org.apache.iotdb.commons.auth.entity.User.INTERNAL_USER_END_ID; - /** This class stores information of each user. */ public abstract class BasicUserManager extends BasicRoleManager {
