This is an automated email from the ASF dual-hosted git repository.

zhangliang pushed a commit to branch revert-14159-fix-ci1219
in repository https://gitbox.apache.org/repos/asf/shardingsphere.git

commit a81252adfe2352e54c0a5f5ce4454cd131618b3d
Author: Liang Zhang <[email protected]>
AuthorDate: Mon Dec 20 00:23:27 2021 +0800

    Revert "Fix ci npe (#14159)"
    
    This reverts commit a0d4e77537cd5a6cc5be2c6e09e138c464f01a29.
---
 .../apache/shardingsphere/authority/checker/AuthorityChecker.java | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git 
a/shardingsphere-kernel/shardingsphere-authority/shardingsphere-authority-core/src/main/java/org/apache/shardingsphere/authority/checker/AuthorityChecker.java
 
b/shardingsphere-kernel/shardingsphere-authority/shardingsphere-authority-core/src/main/java/org/apache/shardingsphere/authority/checker/AuthorityChecker.java
index 0092cd9..c02f899 100644
--- 
a/shardingsphere-kernel/shardingsphere-authority/shardingsphere-authority-core/src/main/java/org/apache/shardingsphere/authority/checker/AuthorityChecker.java
+++ 
b/shardingsphere-kernel/shardingsphere-authority/shardingsphere-authority-core/src/main/java/org/apache/shardingsphere/authority/checker/AuthorityChecker.java
@@ -75,13 +75,9 @@ public final class AuthorityChecker implements 
SQLChecker<AuthorityRule> {
         if (!privileges.filter(optional -> 
optional.hasPrivileges(currentSchema)).isPresent()) {
             return new SQLCheckResult(false, String.format("Unknown database 
'%s'", currentSchema));
         }
-        PrivilegeType privilegeType = getPrivilege(sqlStatement);
-        if (null == privilegeType) {
-            return new SQLCheckResult(true, "");
-        }
         // TODO add error msg
-        return privileges.map(optional -> new 
SQLCheckResult(optional.hasPrivileges(Collections.singletonList(privilegeType)),
 
-                        String.format("Access denied for operation %s", 
privilegeType.name()))).orElseGet(() -> new SQLCheckResult(false, ""));
+        return privileges.map(optional -> new 
SQLCheckResult(optional.hasPrivileges(Collections.singletonList(getPrivilege(sqlStatement))),
 
+                        String.format("Access denied for operation %s", 
getPrivilege(sqlStatement).name()))).orElseGet(() -> new SQLCheckResult(false, 
""));
     }
     
     @Override

Reply via email to