diff --git a/fe/fe-core/src/main/java/org/apache/doris/mysql/privilege/Auth.java b/fe/fe-core/src/main/java/org/apache/doris/mysql/privilege/Auth.java index a0ff3140bc4b48..1b953620fd1b15 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/mysql/privilege/Auth.java +++ b/fe/fe-core/src/main/java/org/apache/doris/mysql/privilege/Auth.java @@ -718,11 +718,11 @@ public void replayGrant(PrivInfo privInfo) { private void grantInternal(UserIdentity userIdent, String role, TablePattern tblPattern, PrivBitSet privs, Map> colPrivileges, boolean errOnNonExist, boolean isReplay) throws DdlException { + if (!isReplay) { + checkTablePatternExist(tblPattern, privs); + } writeLock(); try { - if (!isReplay) { - checkTablePatternExist(tblPattern, privs); - } if (role == null) { if (!doesUserExist(userIdent)) { throw new DdlException("user " + userIdent + " does not exist");