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

zyk pushed a commit to branch rel/1.2
in repository https://gitbox.apache.org/repos/asf/iotdb.git


The following commit(s) were added to refs/heads/rel/1.2 by this push:
     new 6e5c0d4e9c8 [To rel/1.2] Fix SQL parse of privileges on view and pipe 
(#10128)
6e5c0d4e9c8 is described below

commit 6e5c0d4e9c8b0829f6b433ab7b7a33b7bc701cc8
Author: Marcos_Zyk <[email protected]>
AuthorDate: Mon Jun 12 19:02:49 2023 +0800

    [To rel/1.2] Fix SQL parse of privileges on view and pipe (#10128)
---
 .../antlr4/org/apache/iotdb/db/qp/sql/SqlLexer.g4  | 49 ++++++++++++++++++++++
 .../org/apache/iotdb/commons/utils/AuthUtils.java  |  8 ++++
 2 files changed, 57 insertions(+)

diff --git a/antlr/src/main/antlr4/org/apache/iotdb/db/qp/sql/SqlLexer.g4 
b/antlr/src/main/antlr4/org/apache/iotdb/db/qp/sql/SqlLexer.g4
index b702f0ec251..9014377237c 100644
--- a/antlr/src/main/antlr4/org/apache/iotdb/db/qp/sql/SqlLexer.g4
+++ b/antlr/src/main/antlr4/org/apache/iotdb/db/qp/sql/SqlLexer.g4
@@ -861,6 +861,8 @@ PRIVILEGE_VALUE
     | CREATE_FUNCTION | DROP_FUNCTION | CREATE_TRIGGER | DROP_TRIGGER | 
START_TRIGGER | STOP_TRIGGER
     | CREATE_CONTINUOUS_QUERY | DROP_CONTINUOUS_QUERY | SHOW_CONTINUOUS_QUERIES
     | APPLY_TEMPLATE | UPDATE_TEMPLATE | READ_TEMPLATE | 
READ_TEMPLATE_APPLICATION
+    | CREATE_PIPEPLUGIN | DROP_PIPEPLUGIN | SHOW_PIPEPLUGINS | CREATE_PIPE | 
START_PIPE | STOP_PIPE | DROP_PIPE | SHOW_PIPES
+    | CREATE_VIEW | ALTER_VIEW | RENAME_VIEW | DELETE_VIEW
     ;
 
 SET_STORAGE_GROUP
@@ -1023,6 +1025,53 @@ READ_TEMPLATE_APPLICATION
     : R E A D '_' T E M P L A T E '_' A P P L I C A T I O N
     ;
 
+CREATE_PIPEPLUGIN
+    : C R E A T E '_' P I P E P L U G I N
+    ;
+
+DROP_PIPEPLUGIN
+    : D R O P '_' P I P E P L U G I N
+    ;
+
+SHOW_PIPEPLUGINS
+    : S H O W '_' P I P E P L U G I N S
+    ;
+CREATE_PIPE
+    : C R E A T E '_' P I P E
+    ;
+
+START_PIPE
+    : S T A R T '_' P I P E
+    ;
+
+STOP_PIPE
+    : S T O P '_' P I P E
+    ;
+
+DROP_PIPE
+    : D R O P '_' P I P E
+    ;
+
+SHOW_PIPES
+    : S H O W '_' P I P E S
+    ;
+
+CREATE_VIEW
+    : C R E A T E '_' V I E W
+    ;
+
+ALTER_VIEW
+    : A L T E R '_' V I E W
+    ;
+
+RENAME_VIEW
+    : R E N A M E '_' V I E W
+    ;
+
+DELETE_VIEW
+    : D E L E T E '_' V I E W
+    ;
+
 /**
  * 3. Operators
  */
diff --git 
a/node-commons/src/main/java/org/apache/iotdb/commons/utils/AuthUtils.java 
b/node-commons/src/main/java/org/apache/iotdb/commons/utils/AuthUtils.java
index dd26ff8f4ec..a1a3507e38e 100644
--- a/node-commons/src/main/java/org/apache/iotdb/commons/utils/AuthUtils.java
+++ b/node-commons/src/main/java/org/apache/iotdb/commons/utils/AuthUtils.java
@@ -188,6 +188,10 @@ public class AuthUtils {
         case START_TRIGGER:
         case STOP_TRIGGER:
         case APPLY_TEMPLATE:
+        case CREATE_VIEW:
+        case ALTER_VIEW:
+        case RENAME_VIEW:
+        case DELETE_VIEW:
           return;
         default:
           throw new AuthException(
@@ -203,6 +207,10 @@ public class AuthUtils {
         case DELETE_TIMESERIES:
         case INSERT_TIMESERIES:
         case ALTER_TIMESERIES:
+        case CREATE_VIEW:
+        case ALTER_VIEW:
+        case RENAME_VIEW:
+        case DELETE_VIEW:
           validatePath(path);
           return;
         default:

Reply via email to