From f256bb8d3938be15e58bc9c81900a1de408a98d7 Mon Sep 17 00:00:00 2001 From: Mingyu Chen Date: Mon, 9 Jan 2023 08:38:26 +0800 Subject: [PATCH] [fix](meta) fix priv table load bug when upgrading to 1.2.x (#15706) In old version, NODE_PRIV will be incorrectly assigned to normal users. So when upgrading to 1.2.x, it will failed to handle this unexpected case. This PR fix this by removing NODE_PRIV from normal user. --- .../java/org/apache/doris/mysql/privilege/UserPrivTable.java | 1 + 1 file changed, 1 insertion(+) diff --git a/fe/fe-core/src/main/java/org/apache/doris/mysql/privilege/UserPrivTable.java b/fe/fe-core/src/main/java/org/apache/doris/mysql/privilege/UserPrivTable.java index 354da66904..35736b29fe 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/mysql/privilege/UserPrivTable.java +++ b/fe/fe-core/src/main/java/org/apache/doris/mysql/privilege/UserPrivTable.java @@ -208,6 +208,7 @@ public class UserPrivTable extends PrivTable { // USAGE_PRIV is no need to degrade. PrivBitSet removeUsagePriv = globalPrivEntry.privSet.copy(); removeUsagePriv.unset(PaloPrivilege.USAGE_PRIV.getIdx()); + removeUsagePriv.unset(PaloPrivilege.NODE_PRIV.getIdx()); CatalogPrivEntry entry = CatalogPrivEntry.create(globalPrivEntry.origUser, globalPrivEntry.origHost, InternalCatalog.INTERNAL_CATALOG_NAME, globalPrivEntry.isDomain, removeUsagePriv); entry.setSetByDomainResolver(false);