This is an automated email from the ASF dual-hosted git repository.
chaow pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/iotdb.git
The following commit(s) were added to refs/heads/master by this push:
new 323808c2e4 [IOTDB-3977] Solve the problem of permission type lower
case execution failure when granting permission (#6794)
323808c2e4 is described below
commit 323808c2e4e1285b467d412c0d5a871f889e0fc0
Author: 任宇华 <[email protected]>
AuthorDate: Wed Jul 27 18:31:18 2022 +0800
[IOTDB-3977] Solve the problem of permission type lower case execution
failure when granting permission (#6794)
---
.../src/main/java/org/apache/iotdb/db/mpp/plan/parser/ASTVisitor.java | 4 ++--
server/src/main/java/org/apache/iotdb/db/qp/sql/IoTDBSqlVisitor.java | 4 ++--
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git
a/server/src/main/java/org/apache/iotdb/db/mpp/plan/parser/ASTVisitor.java
b/server/src/main/java/org/apache/iotdb/db/mpp/plan/parser/ASTVisitor.java
index aecf817cd5..bc94f050a8 100644
--- a/server/src/main/java/org/apache/iotdb/db/mpp/plan/parser/ASTVisitor.java
+++ b/server/src/main/java/org/apache/iotdb/db/mpp/plan/parser/ASTVisitor.java
@@ -1599,7 +1599,7 @@ public class ASTVisitor extends
IoTDBSqlParserBaseVisitor<Statement> {
String privilege = parsePrivilege(ctx.privileges())[0];
PartialPath prefixPath;
- if (!PrivilegeType.valueOf(privilege).isPathRelevant()) {
+ if (!PrivilegeType.valueOf(privilege.toUpperCase()).isPathRelevant()) {
String[] path = {"root"};
prefixPath = new PartialPath(path);
} else {
@@ -1644,7 +1644,7 @@ public class ASTVisitor extends
IoTDBSqlParserBaseVisitor<Statement> {
String privilege = parsePrivilege(ctx.privileges())[0];
PartialPath prefixPath;
- if (privilege.equalsIgnoreCase("CREATE_USER")) {
+ if (!PrivilegeType.valueOf(privilege.toUpperCase()).isPathRelevant()) {
String[] path = {"root"};
prefixPath = new PartialPath(path);
} else {
diff --git
a/server/src/main/java/org/apache/iotdb/db/qp/sql/IoTDBSqlVisitor.java
b/server/src/main/java/org/apache/iotdb/db/qp/sql/IoTDBSqlVisitor.java
index 650095f01e..0164e3decf 100644
--- a/server/src/main/java/org/apache/iotdb/db/qp/sql/IoTDBSqlVisitor.java
+++ b/server/src/main/java/org/apache/iotdb/db/qp/sql/IoTDBSqlVisitor.java
@@ -1975,7 +1975,7 @@ public class IoTDBSqlVisitor extends
IoTDBSqlParserBaseVisitor<Operator> {
String privilege = parsePrivilege(ctx.privileges())[0];
PartialPath prefixPath;
- if (!PrivilegeType.valueOf(privilege).isPathRelevant()) {
+ if (!PrivilegeType.valueOf(privilege.toUpperCase()).isPathRelevant()) {
String[] path = {"root"};
prefixPath = new PartialPath(path);
} else {
@@ -2023,7 +2023,7 @@ public class IoTDBSqlVisitor extends
IoTDBSqlParserBaseVisitor<Operator> {
String privilege = parsePrivilege(ctx.privileges())[0];
PartialPath prefixPath;
- if (privilege.equalsIgnoreCase("CREATE_USER")) {
+ if (!PrivilegeType.valueOf(privilege.toUpperCase()).isPathRelevant()) {
String[] path = {"root"};
prefixPath = new PartialPath(path);
} else {