[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.
This commit is contained in:
Mingyu Chen
2023-01-09 08:38:26 +08:00
committed by GitHub
parent 36590da24b
commit f256bb8d39

View File

@ -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);