zddr commented on code in PR #30784:
URL: https://github.com/apache/doris/pull/30784#discussion_r1497219391
##########
fe/fe-core/src/main/java/org/apache/doris/mysql/privilege/RoleManager.java:
##########
@@ -261,6 +279,43 @@ public static RoleManager read(DataInput in) throws
IOException {
} else {
String json = Text.readString(in);
RoleManager rm = GsonUtils.GSON.fromJson(json, RoleManager.class);
+ if (Env.getCurrentEnvJournalVersion() >=
FeMetaVersion.VERSION_130) {
Review Comment:
It's best to put this logic in `Role` because `Role.gsonPostProcess` also
needs to maintain the `globalPrivTable '
##########
fe/fe-core/src/main/java/org/apache/doris/mysql/privilege/Privilege.java:
##########
@@ -31,25 +34,43 @@ public enum Privilege {
CREATE_PRIV("Create_priv", 6, "Privilege for creating database or table"),
DROP_PRIV("Drop_priv", 7, "Privilege for dropping database or table"),
USAGE_PRIV("Usage_priv", 8, "Privilege for using resource or
workloadGroup"),
+ // in doris code < VERSION_130
SHOW_VIEW_PRIV("Show_view_priv", 9, "Privilege for show create view"),
- CLUSTER_USAGE_PRIV("Cluster_Usage_priv", 10, "Privilege for using
cluster");
- public static Privilege[] privileges = {
- NODE_PRIV,
- ADMIN_PRIV,
- GRANT_PRIV,
- SELECT_PRIV,
- LOAD_PRIV,
- ALTER_PRIV,
- CREATE_PRIV,
- DROP_PRIV,
- USAGE_PRIV,
- SHOW_VIEW_PRIV,
- CLUSTER_USAGE_PRIV
- };
+ // in cloud code < VERSION_130
+ CLUSTER_USAGE_PRIV("Cluster_Usage_priv", 9, "Privilege for using cluster"),
+ // compatible doris and cloud, and 9 ~ 11 has been contaminated
+ CLUSTER_USAGE_PRIV_COMPATIBLE("Cluster_Usage_priv", 12, "Privilege for
using cluster"),
+ // 13 placeholder for stage
+ STAGE_USAGE_PRIV_COMPATIBLE("Stage_Usage_priv", 13, "Privilege for using
stage"),
+ SHOW_VIEW_PRIV_COMPATIBLE("Show_view_priv", 14, "Privilege for show create
view");
Review Comment:
SHOW_VIEW_PRIV_COMPATIBLE==》 SHOW_VIEW_PRIV
SHOW_VIEW_PRIV==>SHOW_VIEW_PRIV_Deprecated
Can we name it this way? This can reduce some modifications?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]