This is an automated email from the ASF dual-hosted git repository.
morningman pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/doris.git
The following commit(s) were added to refs/heads/master by this push:
new 9745ee60a7 [fix](priv) fix bug of grant priv on ctl.db.* not work
(#17612)
9745ee60a7 is described below
commit 9745ee60a729de0033b608321f8672b49d497892
Author: Yulei-Yang <[email protected]>
AuthorDate: Sat Mar 11 22:27:26 2023 +0800
[fix](priv) fix bug of grant priv on ctl.db.* not work (#17612)
currently, when use grant xxx_priv on ctl.db.* to user_a, it does not work.
When user_a switch to ctl,
he cannot see or use any database.
---
.../main/java/org/apache/doris/mysql/privilege/DbPrivTable.java | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git
a/fe/fe-core/src/main/java/org/apache/doris/mysql/privilege/DbPrivTable.java
b/fe/fe-core/src/main/java/org/apache/doris/mysql/privilege/DbPrivTable.java
index 8c9daa6abe..1104057c29 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/mysql/privilege/DbPrivTable.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/mysql/privilege/DbPrivTable.java
@@ -17,6 +17,9 @@
package org.apache.doris.mysql.privilege;
+import org.apache.doris.cluster.ClusterNamespace;
+import org.apache.doris.system.SystemInfoService;
+
import com.google.common.base.Preconditions;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
@@ -42,7 +45,9 @@ public class DbPrivTable extends PrivTable {
}
// check db
- if (!dbPrivEntry.isAnyDb() &&
!dbPrivEntry.getDbPattern().match(db)) {
+ // dbPrivEntry.getDbPattern() is always constructed by string as
of form: 'default_cluster:xxx_db'
+ if (!dbPrivEntry.isAnyDb() &&
!dbPrivEntry.getDbPattern().match(db) && !dbPrivEntry.getDbPattern()
+
.match(ClusterNamespace.getFullName(SystemInfoService.DEFAULT_CLUSTER, db))) {
continue;
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]