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

jmclean pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/gravitino.git


The following commit(s) were added to refs/heads/main by this push:
     new c4828e0fbe [#7242] Improvement(authz): Fix possible bug in 
JdbcAuthorizationPlugin.java  (#7300)
c4828e0fbe is described below

commit c4828e0fbe6e295e5bb8a6d807b5721acc1097c4
Author: Xiaojian Sun <[email protected]>
AuthorDate: Fri May 30 15:12:01 2025 +0800

    [#7242] Improvement(authz): Fix possible bug in 
JdbcAuthorizationPlugin.java  (#7300)
    
    ### What changes were proposed in this pull request?
    
    Fix possible bug in JdbcAuthorizationPlugin.java
    
    ### Why are the changes needed?
    
    
    Fix: #([7242](https://github.com/apache/gravitino/issues/7242))
    
    ### Does this PR introduce _any_ user-facing change?
    
    N/A
    
    ### How was this patch tested?
    
    N/A
    
    ---------
    
    Co-authored-by: Justin Mclean <[email protected]>
---
 .../gravitino/authorization/jdbc/JdbcAuthorizationPlugin.java       | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git 
a/authorizations/authorization-common/src/main/java/org/apache/gravitino/authorization/jdbc/JdbcAuthorizationPlugin.java
 
b/authorizations/authorization-common/src/main/java/org/apache/gravitino/authorization/jdbc/JdbcAuthorizationPlugin.java
index a6ca50390e..31fcfe80ff 100644
--- 
a/authorizations/authorization-common/src/main/java/org/apache/gravitino/authorization/jdbc/JdbcAuthorizationPlugin.java
+++ 
b/authorizations/authorization-common/src/main/java/org/apache/gravitino/authorization/jdbc/JdbcAuthorizationPlugin.java
@@ -117,9 +117,11 @@ public abstract class JdbcAuthorizationPlugin implements 
AuthorizationPlugin, Jd
   @Override
   public Boolean onRoleCreated(Role role) throws AuthorizationPluginException {
     List<String> sqls = getCreateRoleSQL(role.name());
-    boolean createdNewly = false;
+    boolean createdNewly = true;
     for (String sql : sqls) {
-      createdNewly = executeUpdateSQL(sql, "already exists");
+      if (!executeUpdateSQL(sql, "already exists")) {
+        createdNewly = false;
+      }
     }
 
     if (!createdNewly) {

Reply via email to