Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
deardeng committed Aug 13, 2024
1 parent ab08cd8 commit 4f31734
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ public ResourcePattern(String resourceName, ResourceTypeEnum type) {
resourceName = "%";
}
this.resourceName = Strings.isNullOrEmpty(resourceName) ? "%" : resourceName;
resourceType = type;
resourceType = type == null ? ResourceTypeEnum.GENERAL : type;
}

public void setResourceType(ResourceTypeEnum type) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -836,6 +836,11 @@ private void revokeCols(Map<ColPrivilegeKey, Set<String>> colPrivileges) {
public void revokePrivs(ResourcePattern resourcePattern, PrivBitSet privs, boolean errOnNonExist)
throws DdlException {
PrivBitSet existingPriv;
// 2.x -> 3.0 compatibility logic
if (resourcePattern.getResourceType() == null) {
// 2.x not have cloud auth, so just transfer to ResourceTypeEnum.GENERAL
resourcePattern.setResourceType(ResourceTypeEnum.GENERAL);
}
switch (resourcePattern.getResourceType()) {
case GENERAL:
existingPriv = resourcePatternToPrivs.get(resourcePattern);
Expand Down

0 comments on commit 4f31734

Please sign in to comment.