Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -301,6 +301,7 @@ public static ConfigPhysicalPlan create(final ByteBuffer buffer) throws IOExcept
case UpdateUser:
case UpdateUserV2:
case CreateUserWithRawPassword:
case RenameUser:
plan = new AuthorTreePlan(configPhysicalPlanType);
break;
case RCreateUser:
Expand Down Expand Up @@ -332,6 +333,7 @@ public static ConfigPhysicalPlan create(final ByteBuffer buffer) throws IOExcept
case RGrantRoleSysPri:
case RRevokeUserSysPri:
case RRevokeRoleSysPri:
case RRenameUser:
plan = new AuthorRelationalPlan(configPhysicalPlanType);
break;
case ApplyConfigNode:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@
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;
Expand Down Expand Up @@ -644,6 +645,36 @@ public void AuthorPlanTest() throws IOException, IllegalPathException {
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
Expand Down