This is an automated email from the ASF dual-hosted git repository.

yongzao 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 2c6e5b83120 Fix rename user ConfigNode physical plan 
serialize/deserialize NPE (#16582)
2c6e5b83120 is described below

commit 2c6e5b8312026c0cf57ede6518636cd4a37e7dc3
Author: Yongzao <[email protected]>
AuthorDate: Tue Oct 14 22:19:40 2025 +0800

    Fix rename user ConfigNode physical plan serialize/deserialize NPE (#16582)
---
 .../consensus/request/ConfigPhysicalPlan.java      |  2 ++
 .../request/ConfigPhysicalPlanSerDeTest.java       | 31 ++++++++++++++++++++++
 2 files changed, 33 insertions(+)

diff --git 
a/iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/consensus/request/ConfigPhysicalPlan.java
 
b/iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/consensus/request/ConfigPhysicalPlan.java
index 8f1a488ac9a..eb6d37064fd 100644
--- 
a/iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/consensus/request/ConfigPhysicalPlan.java
+++ 
b/iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/consensus/request/ConfigPhysicalPlan.java
@@ -301,6 +301,7 @@ public abstract class ConfigPhysicalPlan implements 
IConsensusRequest {
         case UpdateUser:
         case UpdateUserV2:
         case CreateUserWithRawPassword:
+        case RenameUser:
           plan = new AuthorTreePlan(configPhysicalPlanType);
           break;
         case RCreateUser:
@@ -332,6 +333,7 @@ public abstract class ConfigPhysicalPlan implements 
IConsensusRequest {
         case RGrantRoleSysPri:
         case RRevokeUserSysPri:
         case RRevokeRoleSysPri:
+        case RRenameUser:
           plan = new AuthorRelationalPlan(configPhysicalPlanType);
           break;
         case ApplyConfigNode:
diff --git 
a/iotdb-core/confignode/src/test/java/org/apache/iotdb/confignode/consensus/request/ConfigPhysicalPlanSerDeTest.java
 
b/iotdb-core/confignode/src/test/java/org/apache/iotdb/confignode/consensus/request/ConfigPhysicalPlanSerDeTest.java
index 6925fef09dc..4381c120cb4 100644
--- 
a/iotdb-core/confignode/src/test/java/org/apache/iotdb/confignode/consensus/request/ConfigPhysicalPlanSerDeTest.java
+++ 
b/iotdb-core/confignode/src/test/java/org/apache/iotdb/confignode/consensus/request/ConfigPhysicalPlanSerDeTest.java
@@ -65,6 +65,7 @@ import org.apache.iotdb.commons.udf.UDFInformation;
 import org.apache.iotdb.commons.udf.UDFType;
 import org.apache.iotdb.commons.utils.TimePartitionUtils;
 import org.apache.iotdb.confignode.consensus.request.write.auth.AuthorPlan;
+import 
org.apache.iotdb.confignode.consensus.request.write.auth.AuthorRelationalPlan;
 import org.apache.iotdb.confignode.consensus.request.write.auth.AuthorTreePlan;
 import 
org.apache.iotdb.confignode.consensus.request.write.confignode.ApplyConfigNodePlan;
 import 
org.apache.iotdb.confignode.consensus.request.write.confignode.RemoveConfigNodePlan;
@@ -644,6 +645,36 @@ public class ConfigPhysicalPlanSerDeTest {
             new ArrayList<>());
     req1 = (AuthorTreePlan) 
ConfigPhysicalPlan.Factory.create(req0.serializeToByteBuffer());
     Assert.assertEquals(req0, req1);
+
+    // rename user
+    req0 =
+        new AuthorTreePlan(
+            ConfigPhysicalPlanType.RenameUser,
+            "oldUserName",
+            "",
+            "",
+            "",
+            new HashSet<>(),
+            false,
+            new ArrayList<>(),
+            233,
+            "newUserName");
+    req1 = (AuthorTreePlan) 
ConfigPhysicalPlan.Factory.create(req0.serializeToByteBuffer());
+    Assert.assertEquals(req0, req1);
+    req0 =
+        new AuthorRelationalPlan(
+            ConfigPhysicalPlanType.RRenameUser,
+            "oldUserName",
+            "",
+            "",
+            "",
+            new HashSet<>(),
+            false,
+            "",
+            666,
+            "newUserName");
+    req1 = (AuthorRelationalPlan) 
ConfigPhysicalPlan.Factory.create(req0.serializeToByteBuffer());
+    Assert.assertEquals(req0, req1);
   }
 
   @Test

Reply via email to