HappenLee commented on code in PR #58828:
URL: https://github.com/apache/doris/pull/58828#discussion_r2601509693
##########
fe/fe-core/src/main/java/org/apache/doris/mysql/privilege/PrivTable.java:
##########
@@ -74,24 +74,25 @@ public PrivEntry addEntry(PrivEntry entry, boolean
errOnExist, boolean errOnNonE
}
}
- PrivEntry existingEntry = getExistingEntry(newEntry);
- if (existingEntry == null) {
+ int idx = Collections.binarySearch(entries, newEntry);
+ if (idx < 0) {
if (errOnNonExist) {
throw new DdlException("entry does not exist");
}
- entries.add(newEntry);
- Collections.sort(entries);
+ int insertPos = -idx - 1;
+ entries.add(insertPos, newEntry);
LOG.info("add priv entry: {}", newEntry);
Review Comment:
why here each entry need log the info ?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]