zddr commented on code in PR #47708:
URL: https://github.com/apache/doris/pull/47708#discussion_r2048607793


##########
regression-test/suites/auth_p0/test_show_transaction_auth.groovy:
##########
@@ -17,19 +17,38 @@
 
 import org.junit.Assert;
 
-suite("test_show_transaction_auth","p0,auth") {
+suite("test_show_transaction_auth", "p0,auth") {
     String user = 'test_show_transaction_auth_user'
     String pwd = 'C123_567p'
+    String dbName = 'test_show_transaction_db'
+    String tableName = 'test_show_transaction_table'
+    String label = 'test_show_transaction_label'
     try_sql("DROP USER ${user}")
     sql """CREATE USER '${user}' IDENTIFIED BY '${pwd}'"""
-    sql """grant select_priv on regression_test to ${user}"""
+    sql """drop database if exists ${dbName}"""
+    sql """create database ${dbName}"""
+    sql """
+            CREATE TABLE IF NOT EXISTS ${dbName}.`${tableName}` (
+            user_id            BIGINT       NOT NULL COMMENT "user id",
+            name               VARCHAR(20)           COMMENT "name",
+            age                INT                   COMMENT "age"
+            )
+            DUPLICATE KEY(user_id)
+            DISTRIBUTED BY HASH(user_id) BUCKETS 10;
+            """
+    sql """grant select_priv,load_priv on ${dbName}.* to ${user}"""

Review Comment:
   Is it unnecessary to give select permission?
   



##########
regression-test/suites/auth_p0/test_show_transaction_auth.groovy:
##########
@@ -17,19 +17,38 @@
 
 import org.junit.Assert;
 
-suite("test_show_transaction_auth","p0,auth") {
+suite("test_show_transaction_auth", "p0,auth") {
     String user = 'test_show_transaction_auth_user'
     String pwd = 'C123_567p'
+    String dbName = 'test_show_transaction_db'
+    String tableName = 'test_show_transaction_table'
+    String label = 'test_show_transaction_label'
     try_sql("DROP USER ${user}")
     sql """CREATE USER '${user}' IDENTIFIED BY '${pwd}'"""
-    sql """grant select_priv on regression_test to ${user}"""
+    sql """drop database if exists ${dbName}"""
+    sql """create database ${dbName}"""
+    sql """
+            CREATE TABLE IF NOT EXISTS ${dbName}.`${tableName}` (
+            user_id            BIGINT       NOT NULL COMMENT "user id",
+            name               VARCHAR(20)           COMMENT "name",
+            age                INT                   COMMENT "age"
+            )
+            DUPLICATE KEY(user_id)
+            DISTRIBUTED BY HASH(user_id) BUCKETS 10;
+            """
+    sql """grant select_priv,load_priv on ${dbName}.* to ${user}"""
     connect(user, "${pwd}", context.config.jdbcUrl) {
-        try {
-            sql "SHOW TRANSACTION WHERE ID=4005;"
-        } catch (Exception e) {
-            log.info(e.getMessage())
-            assertTrue(e.getMessage().contains("Admin_priv"))
-        }
+        sql """ 
+                INSERT INTO ${dbName}.${tableName} with label ${label} 
(user_id, name, age)
+                VALUES (1, "Emily", 25),
+                       (2, "Benjamin", 35),
+                       (3, "Olivia", 28),
+                       (4, "Alexander", 60),
+                       (5, "Ava", 17);
+            """
+        sql """SHOW TRANSACTION FROM ${dbName} WHERE label='${dbName}';"""

Review Comment:
   We should perform this operation even before granting the LOAD permission to 
verify whether the behavior meets expectations.



-- 
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: commits-unsubscr...@doris.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org
For additional commands, e-mail: commits-h...@doris.apache.org

Reply via email to