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

morrysnow pushed a commit to branch branch-3.1
in repository https://gitbox.apache.org/repos/asf/doris.git


The following commit(s) were added to refs/heads/branch-3.1 by this push:
     new dd45af3a529 branch-3.1: [fix](auth)fix auth test case in cloud mode 
#53646 (#53788)
dd45af3a529 is described below

commit dd45af3a529ce081298f126523d8374d3ebb9934
Author: zfr95 <[email protected]>
AuthorDate: Thu Jul 24 14:28:17 2025 +0800

    branch-3.1: [fix](auth)fix auth test case in cloud mode #53646 (#53788)
    
    pick from #53646
---
 .../auth_call/test_account_management_grant_auth.groovy  | 16 ++++++++--------
 .../auth_call/test_account_management_role_auth.groovy   | 16 ++++++++--------
 .../auth_call/test_account_management_user_auth.groovy   | 16 ++++++++--------
 .../suites/auth_call/test_assistant_command_auth.groovy  | 14 +++++++-------
 .../suites/auth_call/test_cluster_management_auth.groovy |  8 ++++----
 .../auth_call/test_database_management_auth.groovy       | 14 +++++++-------
 .../suites/auth_call/test_ddl_catalog_auth.groovy        | 16 ++++++++--------
 .../suites/auth_call/test_ddl_database_auth.groovy       | 12 ++++++------
 .../suites/auth_call/test_ddl_encryptkey_auth.groovy     | 12 ++++++------
 .../suites/auth_call/test_ddl_file_auth.groovy           | 11 ++++++-----
 .../suites/auth_call/test_ddl_function_auth.groovy       | 16 ++++++++--------
 .../suites/auth_call/test_ddl_mask_view_auth.groovy      |  7 ++++---
 regression-test/suites/auth_call/test_ddl_mv_auth.groovy |  7 +++----
 .../suites/auth_call/test_ddl_part_table_auth.groovy     |  8 +++++---
 .../suites/auth_call/test_ddl_row_policy_auth.groovy     |  9 +++++----
 .../suites/auth_call/test_ddl_sql_block_rule_auth.groovy |  9 ++++-----
 .../suites/auth_call/test_ddl_view_auth.groovy           |  7 +++----
 .../suites/auth_call/test_dml_broker_load_auth.groovy    |  7 ++++---
 .../suites/auth_call/test_dml_cancel_profile_auth.groovy |  5 ++---
 .../suites/auth_call/test_dml_delete_table_auth.groovy   |  7 +++----
 .../suites/auth_call/test_dml_export_table_auth.groovy   |  7 +++----
 .../suites/auth_call/test_dml_insert_auth.groovy         |  7 +++----
 .../auth_call/test_dml_multi_routine_load_auth.groovy    |  7 +++----
 .../suites/auth_call/test_dml_mysql_load_auth.groovy     |  7 +++----
 .../suites/auth_call/test_dml_outfile_auth.groovy        |  7 +++----
 .../suites/auth_call/test_dml_routine_load_auth.groovy   |  7 +++----
 .../suites/auth_call/test_dml_select_udf_auth.groovy     |  7 +++----
 .../suites/auth_call/test_dml_stream_load_auth.groovy    |  7 +++----
 .../suites/auth_call/test_dml_update_table_auth.groovy   |  7 +++----
 .../auth_call/test_grant_show_view_priv_auth.groovy      | 11 +++++------
 .../suites/auth_call/test_hive_base_case_auth.groovy     | 15 +++++++--------
 .../suites/auth_call/test_show_backend_auth.groovy       |  5 ++---
 .../suites/auth_call/test_show_broker_auth.groovy        |  4 ++--
 .../suites/auth_call/test_show_charset_auth.groovy       | 13 +++++++------
 .../auth_call/test_show_convert_light_sc_auth.groovy     |  5 ++---
 .../suites/auth_call/test_show_create_table_auth.groovy  |  7 +++----
 .../suites/auth_call/test_show_data_auth.groovy          |  7 +++----
 .../suites/auth_call/test_show_database_id_auth.groovy   |  7 +++----
 .../suites/auth_call/test_show_dynamic_table_auth.groovy |  7 +++----
 .../suites/auth_call/test_show_frontend_auth.groovy      |  5 ++---
 .../suites/auth_call/test_show_grant_auth.groovy         |  5 ++---
 .../suites/auth_call/test_show_proc_auth.groovy          |  5 ++---
 .../suites/auth_call/test_show_query_stats_auth.groovy   |  5 ++---
 .../suites/auth_call/test_show_tablet_auth.groovy        |  7 +++----
 .../suites/auth_call/test_show_typecast_auth.groovy      |  5 ++---
 45 files changed, 186 insertions(+), 207 deletions(-)

diff --git 
a/regression-test/suites/auth_call/test_account_management_grant_auth.groovy 
b/regression-test/suites/auth_call/test_account_management_grant_auth.groovy
index a1e1f68916f..b957713d937 100644
--- a/regression-test/suites/auth_call/test_account_management_grant_auth.groovy
+++ b/regression-test/suites/auth_call/test_account_management_grant_auth.groovy
@@ -25,14 +25,6 @@ suite("test_account_management_grant_auth","p0,auth_call") {
     String dbName = 'test_account_management_grant_auth_db'
     String user_derive = 'test_account_management_grant_user_derive_role'
     String role_derive = 'test_account_management_grant_role_derive_role'
-
-    //cloud-mode
-    if (isCloudMode()) {
-        def clusters = sql " SHOW CLUSTERS; "
-        assertTrue(!clusters.isEmpty())
-        def validCluster = clusters[0][0]
-        sql """GRANT USAGE_PRIV ON CLUSTER `${validCluster}` TO ${user}""";
-    }
     
     try_sql("DROP USER ${user}")
     try_sql("DROP USER ${user_derive}")
@@ -42,6 +34,14 @@ suite("test_account_management_grant_auth","p0,auth_call") {
     sql """grant select_priv on regression_test to ${user}"""
     sql """create database ${dbName}"""
 
+    //cloud-mode
+    if (isCloudMode()) {
+        def clusters = sql " SHOW CLUSTERS; "
+        assertTrue(!clusters.isEmpty())
+        def validCluster = clusters[0][0]
+        sql """GRANT USAGE_PRIV ON CLUSTER `${validCluster}` TO ${user}""";
+    }
+
     connect(user, "${pwd}", context.config.jdbcUrl) {
         test {
             sql """CREATE USER ${user_derive} IDENTIFIED BY '${pwd}';"""
diff --git 
a/regression-test/suites/auth_call/test_account_management_role_auth.groovy 
b/regression-test/suites/auth_call/test_account_management_role_auth.groovy
index dab9596b8c2..d1b58662f2c 100644
--- a/regression-test/suites/auth_call/test_account_management_role_auth.groovy
+++ b/regression-test/suites/auth_call/test_account_management_role_auth.groovy
@@ -27,14 +27,6 @@ suite("test_account_management_role_auth","p0,auth_call") {
 
     String role_derive = 'test_account_management_role_auth_derive_role'
 
-    //cloud-mode
-    if (isCloudMode()) {
-        def clusters = sql " SHOW CLUSTERS; "
-        assertTrue(!clusters.isEmpty())
-        def validCluster = clusters[0][0]
-        sql """GRANT USAGE_PRIV ON CLUSTER `${validCluster}` TO ${user}""";
-    }
-
     try_sql("DROP USER ${user}")
     try_sql("DROP role ${role}")
     try_sql("DROP role ${role_derive}")
@@ -45,6 +37,14 @@ suite("test_account_management_role_auth","p0,auth_call") {
     sql """create database ${dbName}"""
     sql """GRANT '${role}' TO ${user};"""
 
+    //cloud-mode
+    if (isCloudMode()) {
+        def clusters = sql " SHOW CLUSTERS; "
+        assertTrue(!clusters.isEmpty())
+        def validCluster = clusters[0][0]
+        sql """GRANT USAGE_PRIV ON CLUSTER `${validCluster}` TO ${user}""";
+    }
+
     connect(user, "${pwd}", context.config.jdbcUrl) {
         test {
             sql """CREATE ROLE ${role_derive}"""
diff --git 
a/regression-test/suites/auth_call/test_account_management_user_auth.groovy 
b/regression-test/suites/auth_call/test_account_management_user_auth.groovy
index 9cbb489615b..4d9aa6eed3f 100644
--- a/regression-test/suites/auth_call/test_account_management_user_auth.groovy
+++ b/regression-test/suites/auth_call/test_account_management_user_auth.groovy
@@ -25,14 +25,6 @@ suite("test_account_management_user_auth","p0,auth_call") {
     String dbName = 'test_account_management_user_auth_db'
     String user_derive = 'test_account_management_user_derive_user'
 
-    //cloud-mode
-    if (isCloudMode()) {
-        def clusters = sql " SHOW CLUSTERS; "
-        assertTrue(!clusters.isEmpty())
-        def validCluster = clusters[0][0]
-        sql """GRANT USAGE_PRIV ON CLUSTER `${validCluster}` TO ${user}""";
-    }
-
     try_sql("DROP USER ${user}")
     try_sql("DROP USER ${user_derive}")
     try_sql """drop database if exists ${dbName}"""
@@ -41,6 +33,14 @@ suite("test_account_management_user_auth","p0,auth_call") {
     sql """grant select_priv on regression_test to ${user}"""
     sql """create database ${dbName}"""
 
+    //cloud-mode
+    if (isCloudMode()) {
+        def clusters = sql " SHOW CLUSTERS; "
+        assertTrue(!clusters.isEmpty())
+        def validCluster = clusters[0][0]
+        sql """GRANT USAGE_PRIV ON CLUSTER `${validCluster}` TO ${user}""";
+    }
+
     connect(user, "${pwd}", context.config.jdbcUrl) {
         test {
             sql """CREATE USER ${user_derive} IDENTIFIED BY '${pwd}';"""
diff --git 
a/regression-test/suites/auth_call/test_assistant_command_auth.groovy 
b/regression-test/suites/auth_call/test_assistant_command_auth.groovy
index ba539f129d7..1f150d196e1 100644
--- a/regression-test/suites/auth_call/test_assistant_command_auth.groovy
+++ b/regression-test/suites/auth_call/test_assistant_command_auth.groovy
@@ -26,6 +26,13 @@ suite("test_assistant_command_auth","p0,auth_call") {
     String tableName = 'test_assistant_command_auth_tb'
     String catalogName = 'test_assistant_command_auth_catalog'
 
+    try_sql("DROP USER ${user}")
+    try_sql """drop database if exists ${dbName}"""
+
+    sql """CREATE USER '${user}' IDENTIFIED BY '${pwd}'"""
+    sql """grant select_priv on regression_test to ${user}"""
+    sql """create database ${dbName}"""
+
     //cloud-mode
     if (isCloudMode()) {
         def clusters = sql " SHOW CLUSTERS; "
@@ -34,13 +41,6 @@ suite("test_assistant_command_auth","p0,auth_call") {
         sql """GRANT USAGE_PRIV ON CLUSTER `${validCluster}` TO ${user}""";
     }
 
-    try_sql("DROP USER ${user}")
-    try_sql """drop database if exists ${dbName}"""
-
-    sql """CREATE USER '${user}' IDENTIFIED BY '${pwd}'"""
-    sql """grant select_priv on regression_test to ${user}"""
-    sql """create database ${dbName}"""
-
     sql """create table ${dbName}.${tableName} (
                 id BIGINT,
                 username VARCHAR(20)
diff --git 
a/regression-test/suites/auth_call/test_cluster_management_auth.groovy 
b/regression-test/suites/auth_call/test_cluster_management_auth.groovy
index c3c1692c405..afef32b78ca 100644
--- a/regression-test/suites/auth_call/test_cluster_management_auth.groovy
+++ b/regression-test/suites/auth_call/test_cluster_management_auth.groovy
@@ -61,6 +61,10 @@ suite 
("test_cluster_management_auth","nonConcurrent,p0,auth_call") {
     String user = 'test_cluster_management_auth_user'
     String pwd = 'C123_567p'
 
+    try_sql("DROP USER ${user}")
+    sql """CREATE USER '${user}' IDENTIFIED BY '${pwd}'"""
+    sql """grant select_priv on regression_test to ${user}"""
+
     //cloud-mode
     if (isCloudMode()) {
         def clusters = sql " SHOW CLUSTERS; "
@@ -69,10 +73,6 @@ suite 
("test_cluster_management_auth","nonConcurrent,p0,auth_call") {
         sql """GRANT USAGE_PRIV ON CLUSTER `${validCluster}` TO ${user}""";
     }
 
-    try_sql("DROP USER ${user}")
-    sql """CREATE USER '${user}' IDENTIFIED BY '${pwd}'"""
-    sql """grant select_priv on regression_test to ${user}"""
-
     // pipeline can't support delete node, it can affect other case
     if (is_exists_follower()) {
         connect(user, "${pwd}", context.config.jdbcUrl) {
diff --git 
a/regression-test/suites/auth_call/test_database_management_auth.groovy 
b/regression-test/suites/auth_call/test_database_management_auth.groovy
index cbf979abc1e..e8e189aef7f 100644
--- a/regression-test/suites/auth_call/test_database_management_auth.groovy
+++ b/regression-test/suites/auth_call/test_database_management_auth.groovy
@@ -24,6 +24,13 @@ suite("test_database_management_auth","p0,auth_call") {
     String pwd = 'C123_567p'
     String dbName = 'test_database_management_auth_db'
 
+    try_sql("DROP USER ${user}")
+    try_sql """drop database if exists ${dbName}"""
+
+    sql """CREATE USER '${user}' IDENTIFIED BY '${pwd}'"""
+    sql """grant select_priv on regression_test to ${user}"""
+    sql """create database ${dbName}"""
+
     //cloud-mode
     if (isCloudMode()) {
         def clusters = sql " SHOW CLUSTERS; "
@@ -32,13 +39,6 @@ suite("test_database_management_auth","p0,auth_call") {
         sql """GRANT USAGE_PRIV ON CLUSTER `${validCluster}` TO ${user}""";
     }
 
-    try_sql("DROP USER ${user}")
-    try_sql """drop database if exists ${dbName}"""
-
-    sql """CREATE USER '${user}' IDENTIFIED BY '${pwd}'"""
-    sql """grant select_priv on regression_test to ${user}"""
-    sql """create database ${dbName}"""
-
     connect(user, "${pwd}", context.config.jdbcUrl) {
         test {
             sql """SHOW FRONTEND CONFIG"""
diff --git a/regression-test/suites/auth_call/test_ddl_catalog_auth.groovy 
b/regression-test/suites/auth_call/test_ddl_catalog_auth.groovy
index 8d6b31d35c9..89ad3b4c104 100644
--- a/regression-test/suites/auth_call/test_ddl_catalog_auth.groovy
+++ b/regression-test/suites/auth_call/test_ddl_catalog_auth.groovy
@@ -24,14 +24,6 @@ suite("test_ddl_catalog_auth","p0,auth_call") {
     String catalogNameNew = 'test_ddl_catalog_auth_catalog_new'
     String catalogNameOther = 'test_ddl_catalog_auth_catalog_other'
 
-    //cloud-mode
-    if (isCloudMode()) {
-        def clusters = sql " SHOW CLUSTERS; "
-        assertTrue(!clusters.isEmpty())
-        def validCluster = clusters[0][0]
-        sql """GRANT USAGE_PRIV ON CLUSTER `${validCluster}` TO ${user}""";
-    }
-
     sql """create catalog if not exists ${catalogNameOther} properties (
             'type'='hms'
         );"""
@@ -42,6 +34,14 @@ suite("test_ddl_catalog_auth","p0,auth_call") {
     sql """CREATE USER '${user}' IDENTIFIED BY '${pwd}'"""
     sql """grant select_priv on regression_test to ${user}"""
 
+    //cloud-mode
+    if (isCloudMode()) {
+        def clusters = sql " SHOW CLUSTERS; "
+        assertTrue(!clusters.isEmpty())
+        def validCluster = clusters[0][0]
+        sql """GRANT USAGE_PRIV ON CLUSTER `${validCluster}` TO ${user}""";
+    }
+
     // ddl create
     connect(user, "${pwd}", context.config.jdbcUrl) {
         test {
diff --git a/regression-test/suites/auth_call/test_ddl_database_auth.groovy 
b/regression-test/suites/auth_call/test_ddl_database_auth.groovy
index bdcf5ff7c39..982fd5ca966 100644
--- a/regression-test/suites/auth_call/test_ddl_database_auth.groovy
+++ b/regression-test/suites/auth_call/test_ddl_database_auth.groovy
@@ -25,6 +25,12 @@ suite("test_ddl_database_auth","p0,auth_call") {
     String tableName = 'test_ddl_database_auth_tb'
     String tableNameNew = 'test_ddl_database_auth_tb_new'
 
+    try_sql("DROP USER ${user}")
+    try_sql """drop database if exists ${dbName}"""
+    try_sql """drop database if exists ${dbNameNew}"""
+    sql """CREATE USER '${user}' IDENTIFIED BY '${pwd}'"""
+    sql """grant select_priv on regression_test to ${user}"""
+
     //cloud-mode
     if (isCloudMode()) {
         def clusters = sql " SHOW CLUSTERS; "
@@ -33,12 +39,6 @@ suite("test_ddl_database_auth","p0,auth_call") {
         sql """GRANT USAGE_PRIV ON CLUSTER `${validCluster}` TO ${user}""";
     }
 
-    try_sql("DROP USER ${user}")
-    try_sql """drop database if exists ${dbName}"""
-    try_sql """drop database if exists ${dbNameNew}"""
-    sql """CREATE USER '${user}' IDENTIFIED BY '${pwd}'"""
-    sql """grant select_priv on regression_test to ${user}"""
-
     // ddl create
     connect(user, "${pwd}", context.config.jdbcUrl) {
         test {
diff --git a/regression-test/suites/auth_call/test_ddl_encryptkey_auth.groovy 
b/regression-test/suites/auth_call/test_ddl_encryptkey_auth.groovy
index dfa469bfce0..951c2421dc7 100644
--- a/regression-test/suites/auth_call/test_ddl_encryptkey_auth.groovy
+++ b/regression-test/suites/auth_call/test_ddl_encryptkey_auth.groovy
@@ -23,6 +23,12 @@ suite("test_ddl_encryptkey_auth","p0,auth_call") {
     String dbName = 'test_ddl_encryptkey_auth_db'
     String encryptkeyName = 'test_ddl_encryptkey_auth_ecyk'
 
+    try_sql("DROP USER ${user}")
+    try_sql """drop database if exists ${dbName}"""
+    sql """CREATE USER '${user}' IDENTIFIED BY '${pwd}'"""
+    sql """grant select_priv on regression_test to ${user}"""
+    sql """create database ${dbName}"""
+
     //cloud-mode
     if (isCloudMode()) {
         def clusters = sql " SHOW CLUSTERS; "
@@ -31,12 +37,6 @@ suite("test_ddl_encryptkey_auth","p0,auth_call") {
         sql """GRANT USAGE_PRIV ON CLUSTER `${validCluster}` TO ${user}""";
     }
 
-    try_sql("DROP USER ${user}")
-    try_sql """drop database if exists ${dbName}"""
-    sql """CREATE USER '${user}' IDENTIFIED BY '${pwd}'"""
-    sql """grant select_priv on regression_test to ${user}"""
-    sql """create database ${dbName}"""
-
     // ddl create,show,drop
     connect(user, "${pwd}", context.config.jdbcUrl) {
         test {
diff --git a/regression-test/suites/auth_call/test_ddl_file_auth.groovy 
b/regression-test/suites/auth_call/test_ddl_file_auth.groovy
index 2cc60473406..335b206ea08 100644
--- a/regression-test/suites/auth_call/test_ddl_file_auth.groovy
+++ b/regression-test/suites/auth_call/test_ddl_file_auth.groovy
@@ -23,6 +23,12 @@ suite("test_ddl_file_auth","p0,auth_call") {
     String dbName = 'test_ddl_file_auth_db'
     String fileName = 'test_ddl_file_auth_file'
 
+    try_sql("DROP USER ${user}")
+    try_sql """drop database if exists ${dbName}"""
+    sql """CREATE USER '${user}' IDENTIFIED BY '${pwd}'"""
+    sql """grant select_priv on regression_test to ${user}"""
+    sql """create database ${dbName}"""
+
     //cloud-mode
     if (isCloudMode()) {
         def clusters = sql " SHOW CLUSTERS; "
@@ -31,11 +37,6 @@ suite("test_ddl_file_auth","p0,auth_call") {
         sql """GRANT USAGE_PRIV ON CLUSTER `${validCluster}` TO ${user}""";
     }
 
-    try_sql("DROP USER ${user}")
-    try_sql """drop database if exists ${dbName}"""
-    sql """CREATE USER '${user}' IDENTIFIED BY '${pwd}'"""
-    sql """grant select_priv on regression_test to ${user}"""
-    sql """create database ${dbName}"""
 
     String s3_endpoint = getS3Endpoint()
     String bucket = context.config.otherConfigs.get("s3BucketName");
diff --git a/regression-test/suites/auth_call/test_ddl_function_auth.groovy 
b/regression-test/suites/auth_call/test_ddl_function_auth.groovy
index a2e38f0eb6d..e14f8a25911 100644
--- a/regression-test/suites/auth_call/test_ddl_function_auth.groovy
+++ b/regression-test/suites/auth_call/test_ddl_function_auth.groovy
@@ -23,14 +23,6 @@ suite("test_ddl_function_auth","p0,auth_call") {
     String dbName = 'test_ddl_function_auth_db'
     String functionName = 'test_ddl_function_auth_fct'
 
-    //cloud-mode
-    if (isCloudMode()) {
-        def clusters = sql " SHOW CLUSTERS; "
-        assertTrue(!clusters.isEmpty())
-        def validCluster = clusters[0][0]
-        sql """GRANT USAGE_PRIV ON CLUSTER `${validCluster}` TO ${user}""";
-    }
-
     try_sql("DROP USER ${user}")
     try_sql """drop database if exists ${dbName}"""
     try_sql("""DROP FUNCTION ${dbName}.${functionName}(INT)""")
@@ -39,6 +31,14 @@ suite("test_ddl_function_auth","p0,auth_call") {
     sql """create database ${dbName}"""
     sql """grant select_priv on ${dbName}.* to ${user}"""
 
+    //cloud-mode
+    if (isCloudMode()) {
+        def clusters = sql " SHOW CLUSTERS; "
+        assertTrue(!clusters.isEmpty())
+        def validCluster = clusters[0][0]
+        sql """GRANT USAGE_PRIV ON CLUSTER `${validCluster}` TO ${user}""";
+    }
+
     // ddl create,show,drop
     connect(user, "${pwd}", context.config.jdbcUrl) {
         test {
diff --git a/regression-test/suites/auth_call/test_ddl_mask_view_auth.groovy 
b/regression-test/suites/auth_call/test_ddl_mask_view_auth.groovy
index 4a8bc2787dc..0f97477461f 100644
--- a/regression-test/suites/auth_call/test_ddl_mask_view_auth.groovy
+++ b/regression-test/suites/auth_call/test_ddl_mask_view_auth.groovy
@@ -24,6 +24,10 @@ suite("test_ddl_mask_view_auth","p0,auth_call") {
     String tableName = 'test_ddl_mask_view_auth_tb'
     String viewName = 'test_ddl_mask_view_auth_view'
 
+    try_sql("DROP USER ${user}")
+    try_sql """drop database if exists ${dbName}"""
+    sql """CREATE USER '${user}' IDENTIFIED BY '${pwd}'"""
+
     //cloud-mode
     if (isCloudMode()) {
         def clusters = sql " SHOW CLUSTERS; "
@@ -32,9 +36,6 @@ suite("test_ddl_mask_view_auth","p0,auth_call") {
         sql """GRANT USAGE_PRIV ON CLUSTER `${validCluster}` TO ${user}""";
     }
 
-    try_sql("DROP USER ${user}")
-    try_sql """drop database if exists ${dbName}"""
-    sql """CREATE USER '${user}' IDENTIFIED BY '${pwd}'"""
     sql """grant select_priv on regression_test to ${user}"""
     sql """create database ${dbName}"""
     sql """create table ${dbName}.${tableName} (
diff --git a/regression-test/suites/auth_call/test_ddl_mv_auth.groovy 
b/regression-test/suites/auth_call/test_ddl_mv_auth.groovy
index 4b481060440..cf466167daf 100644
--- a/regression-test/suites/auth_call/test_ddl_mv_auth.groovy
+++ b/regression-test/suites/auth_call/test_ddl_mv_auth.groovy
@@ -25,6 +25,9 @@ suite("test_ddl_mv_auth","p0,auth_call") {
     String mvName = 'test_ddl_mv_auth_mv'
     String rollupName = 'test_ddl_mv_auth_rollup'
 
+    try_sql("DROP USER ${user}")
+    try_sql """drop database if exists ${dbName}"""
+    sql """CREATE USER '${user}' IDENTIFIED BY '${pwd}'"""
     //cloud-mode
     if (isCloudMode()) {
         def clusters = sql " SHOW CLUSTERS; "
@@ -32,10 +35,6 @@ suite("test_ddl_mv_auth","p0,auth_call") {
         def validCluster = clusters[0][0]
         sql """GRANT USAGE_PRIV ON CLUSTER `${validCluster}` TO ${user}""";
     }
-
-    try_sql("DROP USER ${user}")
-    try_sql """drop database if exists ${dbName}"""
-    sql """CREATE USER '${user}' IDENTIFIED BY '${pwd}'"""
     sql """grant select_priv on regression_test to ${user}"""
     sql """create database ${dbName}"""
     sql """create table ${dbName}.${tableName} (
diff --git a/regression-test/suites/auth_call/test_ddl_part_table_auth.groovy 
b/regression-test/suites/auth_call/test_ddl_part_table_auth.groovy
index 5217dc2d051..797b0ae05ff 100644
--- a/regression-test/suites/auth_call/test_ddl_part_table_auth.groovy
+++ b/regression-test/suites/auth_call/test_ddl_part_table_auth.groovy
@@ -23,6 +23,10 @@ suite("test_ddl_part_table_auth","p0,auth_call") {
     String dbName = 'test_ddl_part_table_auth_db'
     String tableName = 'test_ddl_part_table_auth_tb'
 
+    try_sql("DROP USER ${user}")
+    try_sql """drop database if exists ${dbName}"""
+    sql """CREATE USER '${user}' IDENTIFIED BY '${pwd}'"""
+
     //cloud-mode
     if (isCloudMode()) {
         def clusters = sql " SHOW CLUSTERS; "
@@ -31,9 +35,7 @@ suite("test_ddl_part_table_auth","p0,auth_call") {
         sql """GRANT USAGE_PRIV ON CLUSTER `${validCluster}` TO ${user}""";
     }
 
-    try_sql("DROP USER ${user}")
-    try_sql """drop database if exists ${dbName}"""
-    sql """CREATE USER '${user}' IDENTIFIED BY '${pwd}'"""
+
     sql """grant select_priv on regression_test to ${user}"""
     sql """create database ${dbName}"""
 
diff --git a/regression-test/suites/auth_call/test_ddl_row_policy_auth.groovy 
b/regression-test/suites/auth_call/test_ddl_row_policy_auth.groovy
index f9ac109f7f3..477c553853c 100644
--- a/regression-test/suites/auth_call/test_ddl_row_policy_auth.groovy
+++ b/regression-test/suites/auth_call/test_ddl_row_policy_auth.groovy
@@ -24,6 +24,11 @@ suite("test_ddl_row_policy_auth","p0,auth_call") {
     String tableName = 'test_ddl_row_policy_auth_tb'
     String rowPolicyName = 'test_ddl_row_policy_auth_rp'
 
+    try_sql("DROP USER ${user}")
+    try_sql """drop database if exists ${dbName}"""
+    try_sql """DROP ROW POLICY ${rowPolicyName} on ${dbName}.${tableName}"""
+    sql """CREATE USER '${user}' IDENTIFIED BY '${pwd}'"""
+
     //cloud-mode
     if (isCloudMode()) {
         def clusters = sql " SHOW CLUSTERS; "
@@ -32,10 +37,6 @@ suite("test_ddl_row_policy_auth","p0,auth_call") {
         sql """GRANT USAGE_PRIV ON CLUSTER `${validCluster}` TO ${user}""";
     }
 
-    try_sql("DROP USER ${user}")
-    try_sql """drop database if exists ${dbName}"""
-    try_sql """DROP ROW POLICY ${rowPolicyName} on ${dbName}.${tableName}"""
-    sql """CREATE USER '${user}' IDENTIFIED BY '${pwd}'"""
     sql """grant select_priv on regression_test to ${user}"""
     sql """create database ${dbName}"""
     sql """create table ${dbName}.${tableName} (
diff --git 
a/regression-test/suites/auth_call/test_ddl_sql_block_rule_auth.groovy 
b/regression-test/suites/auth_call/test_ddl_sql_block_rule_auth.groovy
index 568ea9723d5..e519465f385 100644
--- a/regression-test/suites/auth_call/test_ddl_sql_block_rule_auth.groovy
+++ b/regression-test/suites/auth_call/test_ddl_sql_block_rule_auth.groovy
@@ -24,6 +24,10 @@ suite("test_ddl_sql_block_rule_auth","p0,auth_call") {
     String tableName = 'test_ddl_sbr_auth_tb'
     String sqlBlockRuleName = 'test_ddl_sbr_auth_sbr'
 
+    try_sql("DROP USER ${user}")
+    try_sql """drop database if exists ${dbName}"""
+    try_sql("""DROP SQL_BLOCK_RULE ${sqlBlockRuleName};""")
+    sql """CREATE USER '${user}' IDENTIFIED BY '${pwd}'"""
     //cloud-mode
     if (isCloudMode()) {
         def clusters = sql " SHOW CLUSTERS; "
@@ -31,11 +35,6 @@ suite("test_ddl_sql_block_rule_auth","p0,auth_call") {
         def validCluster = clusters[0][0]
         sql """GRANT USAGE_PRIV ON CLUSTER `${validCluster}` TO ${user}""";
     }
-
-    try_sql("DROP USER ${user}")
-    try_sql """drop database if exists ${dbName}"""
-    try_sql("""DROP SQL_BLOCK_RULE ${sqlBlockRuleName};""")
-    sql """CREATE USER '${user}' IDENTIFIED BY '${pwd}'"""
     sql """grant select_priv on regression_test to ${user}"""
     sql """create database ${dbName}"""
     sql """create table ${dbName}.${tableName} (
diff --git a/regression-test/suites/auth_call/test_ddl_view_auth.groovy 
b/regression-test/suites/auth_call/test_ddl_view_auth.groovy
index 1a915acdb3c..db17c25e786 100644
--- a/regression-test/suites/auth_call/test_ddl_view_auth.groovy
+++ b/regression-test/suites/auth_call/test_ddl_view_auth.groovy
@@ -24,6 +24,9 @@ suite("test_ddl_view_auth","p0,auth_call") {
     String tableName = 'test_ddl_view_auth_tb'
     String viewName = 'test_ddl_view_auth_view'
 
+    try_sql("DROP USER ${user}")
+    try_sql """drop database if exists ${dbName}"""
+    sql """CREATE USER '${user}' IDENTIFIED BY '${pwd}'"""
     //cloud-mode
     if (isCloudMode()) {
         def clusters = sql " SHOW CLUSTERS; "
@@ -31,10 +34,6 @@ suite("test_ddl_view_auth","p0,auth_call") {
         def validCluster = clusters[0][0]
         sql """GRANT USAGE_PRIV ON CLUSTER `${validCluster}` TO ${user}""";
     }
-
-    try_sql("DROP USER ${user}")
-    try_sql """drop database if exists ${dbName}"""
-    sql """CREATE USER '${user}' IDENTIFIED BY '${pwd}'"""
     sql """grant select_priv on regression_test to ${user}"""
     sql """create database ${dbName}"""
     sql """create table ${dbName}.${tableName} (
diff --git a/regression-test/suites/auth_call/test_dml_broker_load_auth.groovy 
b/regression-test/suites/auth_call/test_dml_broker_load_auth.groovy
index 4eb9202f6ee..5777d3f3077 100644
--- a/regression-test/suites/auth_call/test_dml_broker_load_auth.groovy
+++ b/regression-test/suites/auth_call/test_dml_broker_load_auth.groovy
@@ -37,6 +37,10 @@ suite("test_dml_broker_load_auth","p0,auth_call") {
     String region = getS3Region()
     String bucket = getS3BucketName()
 
+    try_sql("DROP USER ${user}")
+    try_sql """drop database if exists ${dbName}"""
+    sql """CREATE USER '${user}' IDENTIFIED BY '${pwd}'"""
+
     //cloud-mode
     if (isCloudMode()) {
         def clusters = sql " SHOW CLUSTERS; "
@@ -45,9 +49,6 @@ suite("test_dml_broker_load_auth","p0,auth_call") {
         sql """GRANT USAGE_PRIV ON CLUSTER `${validCluster}` TO ${user}""";
     }
 
-    try_sql("DROP USER ${user}")
-    try_sql """drop database if exists ${dbName}"""
-    sql """CREATE USER '${user}' IDENTIFIED BY '${pwd}'"""
     sql """grant select_priv on regression_test to ${user}"""
     sql """create database ${dbName}"""
 
diff --git 
a/regression-test/suites/auth_call/test_dml_cancel_profile_auth.groovy 
b/regression-test/suites/auth_call/test_dml_cancel_profile_auth.groovy
index 0b4d05ef88c..64a42b1217f 100644
--- a/regression-test/suites/auth_call/test_dml_cancel_profile_auth.groovy
+++ b/regression-test/suites/auth_call/test_dml_cancel_profile_auth.groovy
@@ -23,6 +23,8 @@ 
suite("test_dml_cancel_profile_auth","p0,auth_call,nonConcurrent") {
     String user = 'test_dml_cancel_profile_auth_user'
     String pwd = 'C123_567p'
 
+    try_sql("DROP USER ${user}")
+    sql """CREATE USER '${user}' IDENTIFIED BY '${pwd}'"""
     //cloud-mode
     if (isCloudMode()) {
         def clusters = sql " SHOW CLUSTERS; "
@@ -30,9 +32,6 @@ 
suite("test_dml_cancel_profile_auth","p0,auth_call,nonConcurrent") {
         def validCluster = clusters[0][0]
         sql """GRANT USAGE_PRIV ON CLUSTER `${validCluster}` TO ${user}""";
     }
-
-    try_sql("DROP USER ${user}")
-    sql """CREATE USER '${user}' IDENTIFIED BY '${pwd}'"""
     sql """grant select_priv on regression_test to ${user}"""
 
     connect(user, "${pwd}", context.config.jdbcUrl) {
diff --git a/regression-test/suites/auth_call/test_dml_delete_table_auth.groovy 
b/regression-test/suites/auth_call/test_dml_delete_table_auth.groovy
index f956e626103..030ab2f83c9 100644
--- a/regression-test/suites/auth_call/test_dml_delete_table_auth.groovy
+++ b/regression-test/suites/auth_call/test_dml_delete_table_auth.groovy
@@ -25,6 +25,9 @@ suite("test_dml_delete_table_auth","p0,auth_call") {
     String dbName = 'test_dml_delete_table_auth_db'
     String tableName = 'test_dml_delete_table_auth_tb'
 
+    try_sql("DROP USER ${user}")
+    try_sql """drop database if exists ${dbName}"""
+    sql """CREATE USER '${user}' IDENTIFIED BY '${pwd}'"""
     //cloud-mode
     if (isCloudMode()) {
         def clusters = sql " SHOW CLUSTERS; "
@@ -32,10 +35,6 @@ suite("test_dml_delete_table_auth","p0,auth_call") {
         def validCluster = clusters[0][0]
         sql """GRANT USAGE_PRIV ON CLUSTER `${validCluster}` TO ${user}""";
     }
-
-    try_sql("DROP USER ${user}")
-    try_sql """drop database if exists ${dbName}"""
-    sql """CREATE USER '${user}' IDENTIFIED BY '${pwd}'"""
     sql """grant select_priv on regression_test to ${user}"""
     sql """create database ${dbName}"""
 
diff --git a/regression-test/suites/auth_call/test_dml_export_table_auth.groovy 
b/regression-test/suites/auth_call/test_dml_export_table_auth.groovy
index 0112e86fee6..eddfe473cc5 100644
--- a/regression-test/suites/auth_call/test_dml_export_table_auth.groovy
+++ b/regression-test/suites/auth_call/test_dml_export_table_auth.groovy
@@ -31,6 +31,9 @@ suite("test_dml_export_table_auth","p0,auth_call") {
     String tableName = 'test_dml_export_table_auth_tb'
     String exportLabel = 'test_dml_export_table_auth_label' + 
hashCode.toString()
 
+    try_sql("DROP USER ${user}")
+    try_sql """drop database if exists ${dbName}"""
+    sql """CREATE USER '${user}' IDENTIFIED BY '${pwd}'"""
     //cloud-mode
     if (isCloudMode()) {
         def clusters = sql " SHOW CLUSTERS; "
@@ -38,10 +41,6 @@ suite("test_dml_export_table_auth","p0,auth_call") {
         def validCluster = clusters[0][0]
         sql """GRANT USAGE_PRIV ON CLUSTER `${validCluster}` TO ${user}""";
     }
-
-    try_sql("DROP USER ${user}")
-    try_sql """drop database if exists ${dbName}"""
-    sql """CREATE USER '${user}' IDENTIFIED BY '${pwd}'"""
     sql """grant select_priv on regression_test to ${user}"""
     sql """create database ${dbName}"""
 
diff --git a/regression-test/suites/auth_call/test_dml_insert_auth.groovy 
b/regression-test/suites/auth_call/test_dml_insert_auth.groovy
index 5b8a20e18f9..3e1ba7e4b3b 100644
--- a/regression-test/suites/auth_call/test_dml_insert_auth.groovy
+++ b/regression-test/suites/auth_call/test_dml_insert_auth.groovy
@@ -26,6 +26,9 @@ suite("test_dml_insert_auth","p0,auth_call") {
     String tableName = 'test_dml_insert_auth_tb'
     String srcTableName = 'test_dml_insert_auth_tb_src'
 
+    try_sql("DROP USER ${user}")
+    try_sql """drop database if exists ${dbName}"""
+    sql """CREATE USER '${user}' IDENTIFIED BY '${pwd}'"""
     //cloud-mode
     if (isCloudMode()) {
         def clusters = sql " SHOW CLUSTERS; "
@@ -33,10 +36,6 @@ suite("test_dml_insert_auth","p0,auth_call") {
         def validCluster = clusters[0][0]
         sql """GRANT USAGE_PRIV ON CLUSTER `${validCluster}` TO ${user}""";
     }
-
-    try_sql("DROP USER ${user}")
-    try_sql """drop database if exists ${dbName}"""
-    sql """CREATE USER '${user}' IDENTIFIED BY '${pwd}'"""
     sql """grant select_priv on regression_test to ${user}"""
     sql """create database ${dbName}"""
 
diff --git 
a/regression-test/suites/auth_call/test_dml_multi_routine_load_auth.groovy 
b/regression-test/suites/auth_call/test_dml_multi_routine_load_auth.groovy
index 5b8ecef7e57..42d771950de 100644
--- a/regression-test/suites/auth_call/test_dml_multi_routine_load_auth.groovy
+++ b/regression-test/suites/auth_call/test_dml_multi_routine_load_auth.groovy
@@ -29,6 +29,9 @@ suite("test_dml_multi_routine_load_auth","p0,auth_call") {
     String tableName2 = 'test_dml_multi_routine_load_auth_tb2'
     String labelName = 'test_dml_multi_routine_load_auth_label'
 
+    try_sql("DROP USER ${user}")
+    try_sql """drop database if exists ${dbName}"""
+    sql """CREATE USER '${user}' IDENTIFIED BY '${pwd}'"""
     //cloud-mode
     if (isCloudMode()) {
         def clusters = sql " SHOW CLUSTERS; "
@@ -36,10 +39,6 @@ suite("test_dml_multi_routine_load_auth","p0,auth_call") {
         def validCluster = clusters[0][0]
         sql """GRANT USAGE_PRIV ON CLUSTER `${validCluster}` TO ${user}""";
     }
-
-    try_sql("DROP USER ${user}")
-    try_sql """drop database if exists ${dbName}"""
-    sql """CREATE USER '${user}' IDENTIFIED BY '${pwd}'"""
     sql """grant select_priv on regression_test to ${user}"""
     sql """create database ${dbName}"""
 
diff --git a/regression-test/suites/auth_call/test_dml_mysql_load_auth.groovy 
b/regression-test/suites/auth_call/test_dml_mysql_load_auth.groovy
index 97151a0d001..acb6bbea691 100644
--- a/regression-test/suites/auth_call/test_dml_mysql_load_auth.groovy
+++ b/regression-test/suites/auth_call/test_dml_mysql_load_auth.groovy
@@ -25,6 +25,9 @@ suite("test_dml_mysql_load_auth","p0,auth_call") {
     String dbName = 'test_dml_mysql_load_auth_db'
     String tableName = 'test_dml_mysql_load_auth_tb'
 
+    try_sql("DROP USER ${user}")
+    try_sql """drop database if exists ${dbName}"""
+    sql """CREATE USER '${user}' IDENTIFIED BY '${pwd}'"""
     //cloud-mode
     if (isCloudMode()) {
         def clusters = sql " SHOW CLUSTERS; "
@@ -32,10 +35,6 @@ suite("test_dml_mysql_load_auth","p0,auth_call") {
         def validCluster = clusters[0][0]
         sql """GRANT USAGE_PRIV ON CLUSTER `${validCluster}` TO ${user}""";
     }
-
-    try_sql("DROP USER ${user}")
-    try_sql """drop database if exists ${dbName}"""
-    sql """CREATE USER '${user}' IDENTIFIED BY '${pwd}'"""
     sql """grant select_priv on regression_test to ${user}"""
     sql """create database ${dbName}"""
 
diff --git a/regression-test/suites/auth_call/test_dml_outfile_auth.groovy 
b/regression-test/suites/auth_call/test_dml_outfile_auth.groovy
index 5f4096344b8..0649430d1e2 100644
--- a/regression-test/suites/auth_call/test_dml_outfile_auth.groovy
+++ b/regression-test/suites/auth_call/test_dml_outfile_auth.groovy
@@ -29,6 +29,9 @@ suite("test_dml_outfile_auth","p0,auth_call") {
     String dbName = 'test_dml_outfile_auth_db'
     String tableName = 'test_dml_outfile_auth_tb'
 
+    try_sql("DROP USER ${user}")
+    try_sql """drop database if exists ${dbName}"""
+    sql """CREATE USER '${user}' IDENTIFIED BY '${pwd}'"""
     //cloud-mode
     if (isCloudMode()) {
         def clusters = sql " SHOW CLUSTERS; "
@@ -36,10 +39,6 @@ suite("test_dml_outfile_auth","p0,auth_call") {
         def validCluster = clusters[0][0]
         sql """GRANT USAGE_PRIV ON CLUSTER `${validCluster}` TO ${user}""";
     }
-
-    try_sql("DROP USER ${user}")
-    try_sql """drop database if exists ${dbName}"""
-    sql """CREATE USER '${user}' IDENTIFIED BY '${pwd}'"""
     sql """grant select_priv on regression_test to ${user}"""
     sql """create database ${dbName}"""
 
diff --git a/regression-test/suites/auth_call/test_dml_routine_load_auth.groovy 
b/regression-test/suites/auth_call/test_dml_routine_load_auth.groovy
index 025ac555356..5b4f6b720f2 100644
--- a/regression-test/suites/auth_call/test_dml_routine_load_auth.groovy
+++ b/regression-test/suites/auth_call/test_dml_routine_load_auth.groovy
@@ -28,6 +28,9 @@ suite("test_dml_routine_load_auth","p0,auth_call") {
     String tableName = 'test_dml_routine_load_auth_tb'
     String labelName = 'test_dml_routine_load_auth_label'
 
+    try_sql("DROP USER ${user}")
+    try_sql """drop database if exists ${dbName}"""
+    sql """CREATE USER '${user}' IDENTIFIED BY '${pwd}'"""
     //cloud-mode
     if (isCloudMode()) {
         def clusters = sql " SHOW CLUSTERS; "
@@ -35,10 +38,6 @@ suite("test_dml_routine_load_auth","p0,auth_call") {
         def validCluster = clusters[0][0]
         sql """GRANT USAGE_PRIV ON CLUSTER `${validCluster}` TO ${user}""";
     }
-
-    try_sql("DROP USER ${user}")
-    try_sql """drop database if exists ${dbName}"""
-    sql """CREATE USER '${user}' IDENTIFIED BY '${pwd}'"""
     sql """grant select_priv on regression_test to ${user}"""
     sql """create database ${dbName}"""
 
diff --git a/regression-test/suites/auth_call/test_dml_select_udf_auth.groovy 
b/regression-test/suites/auth_call/test_dml_select_udf_auth.groovy
index 6aa74784969..f09d28b167c 100644
--- a/regression-test/suites/auth_call/test_dml_select_udf_auth.groovy
+++ b/regression-test/suites/auth_call/test_dml_select_udf_auth.groovy
@@ -29,6 +29,9 @@ suite("test_dml_select_udf_auth","p0,auth_call") {
     String tableName = 'test_dml_select_udf_auth_tb'
     String udfName = 'test_dml_select_udf_auth_udf'
 
+    try_sql("DROP USER ${user}")
+    try_sql """drop database if exists ${dbName}"""
+    sql """CREATE USER '${user}' IDENTIFIED BY '${pwd}'"""
     //cloud-mode
     if (isCloudMode()) {
         def clusters = sql " SHOW CLUSTERS; "
@@ -36,10 +39,6 @@ suite("test_dml_select_udf_auth","p0,auth_call") {
         def validCluster = clusters[0][0]
         sql """GRANT USAGE_PRIV ON CLUSTER `${validCluster}` TO ${user}""";
     }
-
-    try_sql("DROP USER ${user}")
-    try_sql """drop database if exists ${dbName}"""
-    sql """CREATE USER '${user}' IDENTIFIED BY '${pwd}'"""
     sql """grant select_priv on regression_test to ${user}"""
     sql """create database ${dbName}"""
 
diff --git a/regression-test/suites/auth_call/test_dml_stream_load_auth.groovy 
b/regression-test/suites/auth_call/test_dml_stream_load_auth.groovy
index 4a4f19641b2..8531a193da7 100644
--- a/regression-test/suites/auth_call/test_dml_stream_load_auth.groovy
+++ b/regression-test/suites/auth_call/test_dml_stream_load_auth.groovy
@@ -24,6 +24,9 @@ suite("test_dml_stream_load_auth","p0,auth_call") {
     String dbName = 'test_dml_stream_load_auth_db'
     String tableName = 'test_dml_stream_load_auth_tb'
 
+    try_sql("DROP USER ${user}")
+    try_sql """drop database if exists ${dbName}"""
+    sql """CREATE USER '${user}' IDENTIFIED BY '${pwd}'"""
     //cloud-mode
     if (isCloudMode()) {
         def clusters = sql " SHOW CLUSTERS; "
@@ -31,10 +34,6 @@ suite("test_dml_stream_load_auth","p0,auth_call") {
         def validCluster = clusters[0][0]
         sql """GRANT USAGE_PRIV ON CLUSTER `${validCluster}` TO ${user}""";
     }
-
-    try_sql("DROP USER ${user}")
-    try_sql """drop database if exists ${dbName}"""
-    sql """CREATE USER '${user}' IDENTIFIED BY '${pwd}'"""
     sql """grant select_priv on regression_test to ${user}"""
     sql """create database ${dbName}"""
     sql """create table ${dbName}.${tableName} (
diff --git a/regression-test/suites/auth_call/test_dml_update_table_auth.groovy 
b/regression-test/suites/auth_call/test_dml_update_table_auth.groovy
index eb258df2df2..f323645231f 100644
--- a/regression-test/suites/auth_call/test_dml_update_table_auth.groovy
+++ b/regression-test/suites/auth_call/test_dml_update_table_auth.groovy
@@ -25,6 +25,9 @@ suite("test_dml_update_table_auth","p0,auth_call") {
     String dbName = 'test_dml_update_table_auth_db'
     String tableName = 'test_dml_update_table_auth_tb'
 
+    try_sql("DROP USER ${user}")
+    try_sql """drop database if exists ${dbName}"""
+    sql """CREATE USER '${user}' IDENTIFIED BY '${pwd}'"""
     //cloud-mode
     if (isCloudMode()) {
         def clusters = sql " SHOW CLUSTERS; "
@@ -32,10 +35,6 @@ suite("test_dml_update_table_auth","p0,auth_call") {
         def validCluster = clusters[0][0]
         sql """GRANT USAGE_PRIV ON CLUSTER `${validCluster}` TO ${user}""";
     }
-
-    try_sql("DROP USER ${user}")
-    try_sql """drop database if exists ${dbName}"""
-    sql """CREATE USER '${user}' IDENTIFIED BY '${pwd}'"""
     sql """grant select_priv on regression_test to ${user}"""
     sql """create database ${dbName}"""
 
diff --git 
a/regression-test/suites/auth_call/test_grant_show_view_priv_auth.groovy 
b/regression-test/suites/auth_call/test_grant_show_view_priv_auth.groovy
index c05da39ce2e..070d4f5f2b3 100644
--- a/regression-test/suites/auth_call/test_grant_show_view_priv_auth.groovy
+++ b/regression-test/suites/auth_call/test_grant_show_view_priv_auth.groovy
@@ -27,6 +27,11 @@ suite("test_grant_show_view_priv_auth","p0,auth_call") {
     String tableName = 'test_grant_show_view_priv_auth_tb'
     String viewName = 'test_grant_show_view_priv_auth_view'
 
+    try_sql("DROP USER ${user}")
+    try_sql("DROP USER ${user_derive}")
+    try_sql """drop database if exists ${dbName}"""
+
+    sql """CREATE USER '${user}' IDENTIFIED BY '${pwd}'"""
     //cloud-mode
     if (isCloudMode()) {
         def clusters = sql " SHOW CLUSTERS; "
@@ -34,12 +39,6 @@ suite("test_grant_show_view_priv_auth","p0,auth_call") {
         def validCluster = clusters[0][0]
         sql """GRANT USAGE_PRIV ON CLUSTER `${validCluster}` TO ${user}""";
     }
-
-    try_sql("DROP USER ${user}")
-    try_sql("DROP USER ${user_derive}")
-    try_sql """drop database if exists ${dbName}"""
-
-    sql """CREATE USER '${user}' IDENTIFIED BY '${pwd}'"""
     sql """grant select_priv on regression_test to ${user}"""
     sql """create database ${dbName}"""
     sql """create table ${dbName}.${tableName} (
diff --git a/regression-test/suites/auth_call/test_hive_base_case_auth.groovy 
b/regression-test/suites/auth_call/test_hive_base_case_auth.groovy
index 0fb0d422ebd..a02c620862b 100644
--- a/regression-test/suites/auth_call/test_hive_base_case_auth.groovy
+++ b/regression-test/suites/auth_call/test_hive_base_case_auth.groovy
@@ -24,14 +24,6 @@ suite("test_hive_base_case_auth", "p0,auth_call") {
     String tableName = 'test_hive_base_case_auth_tb'
     String tableNameNew = 'test_hive_base_case_auth_tb_new'
 
-    //cloud-mode
-    if (isCloudMode()) {
-        def clusters = sql " SHOW CLUSTERS; "
-        assertTrue(!clusters.isEmpty())
-        def validCluster = clusters[0][0]
-        sql """GRANT USAGE_PRIV ON CLUSTER `${validCluster}` TO ${user}""";
-    }
-
     String enabled = context.config.otherConfigs.get("enableHiveTest")
     if (enabled == null || !enabled.equalsIgnoreCase("true")) {
         logger.info("diable Hive test.")
@@ -49,6 +41,13 @@ suite("test_hive_base_case_auth", "p0,auth_call") {
         try_sql """drop catalog if exists ${catalogName}"""
         try_sql """drop database if exists ${dbName}"""
         sql """CREATE USER '${user}' IDENTIFIED BY '${pwd}'"""
+        //cloud-mode
+        if (isCloudMode()) {
+            def clusters = sql " SHOW CLUSTERS; "
+            assertTrue(!clusters.isEmpty())
+            def validCluster = clusters[0][0]
+            sql """GRANT USAGE_PRIV ON CLUSTER `${validCluster}` TO ${user}""";
+        }
         sql """grant select_priv on regression_test to ${user}"""
 
         // create catalog
diff --git a/regression-test/suites/auth_call/test_show_backend_auth.groovy 
b/regression-test/suites/auth_call/test_show_backend_auth.groovy
index 627e28c57d1..a28acfb5db7 100644
--- a/regression-test/suites/auth_call/test_show_backend_auth.groovy
+++ b/regression-test/suites/auth_call/test_show_backend_auth.groovy
@@ -21,6 +21,8 @@ suite("test_show_backend_auth","p0,auth_call") {
     String user = 'test_show_backend_auth_user'
     String pwd = 'C123_567p'
 
+    try_sql("DROP USER ${user}")
+    sql """CREATE USER '${user}' IDENTIFIED BY '${pwd}'"""
     //cloud-mode
     if (isCloudMode()) {
         def clusters = sql " SHOW CLUSTERS; "
@@ -28,9 +30,6 @@ suite("test_show_backend_auth","p0,auth_call") {
         def validCluster = clusters[0][0]
         sql """GRANT USAGE_PRIV ON CLUSTER `${validCluster}` TO ${user}""";
     }
-
-    try_sql("DROP USER ${user}")
-    sql """CREATE USER '${user}' IDENTIFIED BY '${pwd}'"""
     sql """grant select_priv on regression_test to ${user}"""
     sql """grant select_priv on internal.information_schema.* to ${user}"""
     def show_grants_result = sql """show grants for ${user}"""
diff --git a/regression-test/suites/auth_call/test_show_broker_auth.groovy 
b/regression-test/suites/auth_call/test_show_broker_auth.groovy
index a364ad5b331..ee0560a2026 100644
--- a/regression-test/suites/auth_call/test_show_broker_auth.groovy
+++ b/regression-test/suites/auth_call/test_show_broker_auth.groovy
@@ -21,6 +21,8 @@ suite("test_show_broker_auth","p0,auth_call") {
     String user = 'test_show_broker_auth_user'
     String pwd = 'C123_567p'
 
+    try_sql("DROP USER ${user}")
+    sql """CREATE USER '${user}' IDENTIFIED BY '${pwd}'"""
     //cloud-mode
     if (isCloudMode()) {
         def clusters = sql " SHOW CLUSTERS; "
@@ -29,8 +31,6 @@ suite("test_show_broker_auth","p0,auth_call") {
         sql """GRANT USAGE_PRIV ON CLUSTER `${validCluster}` TO ${user}""";
     }
 
-    try_sql("DROP USER ${user}")
-    sql """CREATE USER '${user}' IDENTIFIED BY '${pwd}'"""
     sql """grant select_priv on regression_test to ${user}"""
 
     connect(user, "${pwd}", context.config.jdbcUrl) {
diff --git a/regression-test/suites/auth_call/test_show_charset_auth.groovy 
b/regression-test/suites/auth_call/test_show_charset_auth.groovy
index 14991bc99f9..d1b69a51992 100644
--- a/regression-test/suites/auth_call/test_show_charset_auth.groovy
+++ b/regression-test/suites/auth_call/test_show_charset_auth.groovy
@@ -22,20 +22,21 @@ suite("test_show_no_auth","p0,auth_call") {
     String user1 = 'test_show_charset_auth_user1'
     String pwd = 'C123_567p'
 
+    try_sql("DROP USER ${user}")
+    try_sql("DROP USER ${user1}")
+    sql """CREATE USER '${user}' IDENTIFIED BY '${pwd}'"""
+    sql """CREATE USER '${user1}' IDENTIFIED BY '${pwd}'"""
+    sql """grant select_priv on regression_test to ${user}"""
+
     //cloud-mode
     if (isCloudMode()) {
         def clusters = sql " SHOW CLUSTERS; "
         assertTrue(!clusters.isEmpty())
         def validCluster = clusters[0][0]
         sql """GRANT USAGE_PRIV ON CLUSTER `${validCluster}` TO ${user}""";
+        sql """GRANT USAGE_PRIV ON CLUSTER `${validCluster}` TO ${user1}""";
     }
 
-    try_sql("DROP USER ${user}")
-    try_sql("DROP USER ${user1}")
-    sql """CREATE USER '${user}' IDENTIFIED BY '${pwd}'"""
-    sql """CREATE USER '${user1}' IDENTIFIED BY '${pwd}'"""
-    sql """grant select_priv on regression_test to ${user}"""
-
     connect(user, "${pwd}", context.config.jdbcUrl) {
         sql """SHOW CHARSET"""
         sql """SHOW DATA TYPES"""
diff --git 
a/regression-test/suites/auth_call/test_show_convert_light_sc_auth.groovy 
b/regression-test/suites/auth_call/test_show_convert_light_sc_auth.groovy
index 6f8387d8929..d43ee604554 100644
--- a/regression-test/suites/auth_call/test_show_convert_light_sc_auth.groovy
+++ b/regression-test/suites/auth_call/test_show_convert_light_sc_auth.groovy
@@ -21,6 +21,8 @@ suite("test_show_convert_light_sc_auth","p0,auth_call") {
     String user = 'test_show_convert_light_sc_auth_user'
     String pwd = 'C123_567p'
 
+    try_sql("DROP USER ${user}")
+    sql """CREATE USER '${user}' IDENTIFIED BY '${pwd}'"""
     //cloud-mode
     if (isCloudMode()) {
         def clusters = sql " SHOW CLUSTERS; "
@@ -28,9 +30,6 @@ suite("test_show_convert_light_sc_auth","p0,auth_call") {
         def validCluster = clusters[0][0]
         sql """GRANT USAGE_PRIV ON CLUSTER `${validCluster}` TO ${user}""";
     }
-
-    try_sql("DROP USER ${user}")
-    sql """CREATE USER '${user}' IDENTIFIED BY '${pwd}'"""
     sql """grant select_priv on regression_test to ${user}"""
 
     connect(user, "${pwd}", context.config.jdbcUrl) {
diff --git 
a/regression-test/suites/auth_call/test_show_create_table_auth.groovy 
b/regression-test/suites/auth_call/test_show_create_table_auth.groovy
index 166179bae5f..58c0915b86b 100644
--- a/regression-test/suites/auth_call/test_show_create_table_auth.groovy
+++ b/regression-test/suites/auth_call/test_show_create_table_auth.groovy
@@ -23,6 +23,9 @@ suite("test_show_create_table_auth","p0,auth_call") {
     String dbName = 'test_show_create_table_auth_db'
     String tableName = 'test_show_create_table_auth_tb'
 
+    try_sql("DROP USER ${user}")
+    try_sql """drop database if exists ${dbName}"""
+    sql """CREATE USER '${user}' IDENTIFIED BY '${pwd}'"""
     //cloud-mode
     if (isCloudMode()) {
         def clusters = sql " SHOW CLUSTERS; "
@@ -30,10 +33,6 @@ suite("test_show_create_table_auth","p0,auth_call") {
         def validCluster = clusters[0][0]
         sql """GRANT USAGE_PRIV ON CLUSTER `${validCluster}` TO ${user}""";
     }
-
-    try_sql("DROP USER ${user}")
-    try_sql """drop database if exists ${dbName}"""
-    sql """CREATE USER '${user}' IDENTIFIED BY '${pwd}'"""
     sql """grant select_priv on regression_test to ${user}"""
     sql """create database ${dbName}"""
     sql """create table ${dbName}.${tableName} (
diff --git a/regression-test/suites/auth_call/test_show_data_auth.groovy 
b/regression-test/suites/auth_call/test_show_data_auth.groovy
index 951ba564d42..98ae37b88b1 100644
--- a/regression-test/suites/auth_call/test_show_data_auth.groovy
+++ b/regression-test/suites/auth_call/test_show_data_auth.groovy
@@ -24,6 +24,9 @@ suite("test_show_data_auth","p0,auth_call") {
     String tableName = 'test_show_data_auth_tb'
     String tableName2 = 'test_show_data_auth_tb2'
 
+    try_sql("DROP USER ${user}")
+    try_sql """drop database if exists ${dbName}"""
+    sql """CREATE USER '${user}' IDENTIFIED BY '${pwd}'"""
     //cloud-mode
     if (isCloudMode()) {
         def clusters = sql " SHOW CLUSTERS; "
@@ -31,10 +34,6 @@ suite("test_show_data_auth","p0,auth_call") {
         def validCluster = clusters[0][0]
         sql """GRANT USAGE_PRIV ON CLUSTER `${validCluster}` TO ${user}""";
     }
-
-    try_sql("DROP USER ${user}")
-    try_sql """drop database if exists ${dbName}"""
-    sql """CREATE USER '${user}' IDENTIFIED BY '${pwd}'"""
     sql """grant select_priv on regression_test to ${user}"""
     sql """create database ${dbName}"""
     sql """create table ${dbName}.${tableName} (
diff --git a/regression-test/suites/auth_call/test_show_database_id_auth.groovy 
b/regression-test/suites/auth_call/test_show_database_id_auth.groovy
index d9d131ee779..120979eb3a1 100644
--- a/regression-test/suites/auth_call/test_show_database_id_auth.groovy
+++ b/regression-test/suites/auth_call/test_show_database_id_auth.groovy
@@ -23,6 +23,9 @@ suite("test_show_database_id_auth","p0,auth_call") {
     String dbName = 'test_show_database_id_auth_db'
     String tableName = 'test_show_database_id_auth_tb'
 
+    try_sql("DROP USER ${user}")
+    try_sql """drop database if exists ${dbName}"""
+    sql """CREATE USER '${user}' IDENTIFIED BY '${pwd}'"""
     //cloud-mode
     if (isCloudMode()) {
         def clusters = sql " SHOW CLUSTERS; "
@@ -30,10 +33,6 @@ suite("test_show_database_id_auth","p0,auth_call") {
         def validCluster = clusters[0][0]
         sql """GRANT USAGE_PRIV ON CLUSTER `${validCluster}` TO ${user}""";
     }
-
-    try_sql("DROP USER ${user}")
-    try_sql """drop database if exists ${dbName}"""
-    sql """CREATE USER '${user}' IDENTIFIED BY '${pwd}'"""
     sql """grant select_priv on regression_test to ${user}"""
     sql """create database ${dbName}"""
 
diff --git 
a/regression-test/suites/auth_call/test_show_dynamic_table_auth.groovy 
b/regression-test/suites/auth_call/test_show_dynamic_table_auth.groovy
index ccfc42455f6..a716616989d 100644
--- a/regression-test/suites/auth_call/test_show_dynamic_table_auth.groovy
+++ b/regression-test/suites/auth_call/test_show_dynamic_table_auth.groovy
@@ -23,6 +23,9 @@ suite("test_show_dynamic_table_auth","p0,auth_call") {
     String dbName = 'test_show_dynamic_table_auth_db'
     String tableName = 'test_show_dynamic_table_auth_tb'
 
+    try_sql("DROP USER ${user}")
+    try_sql """drop database if exists ${dbName}"""
+    sql """CREATE USER '${user}' IDENTIFIED BY '${pwd}'"""
     //cloud-mode
     if (isCloudMode()) {
         def clusters = sql " SHOW CLUSTERS; "
@@ -30,10 +33,6 @@ suite("test_show_dynamic_table_auth","p0,auth_call") {
         def validCluster = clusters[0][0]
         sql """GRANT USAGE_PRIV ON CLUSTER `${validCluster}` TO ${user}""";
     }
-
-    try_sql("DROP USER ${user}")
-    try_sql """drop database if exists ${dbName}"""
-    sql """CREATE USER '${user}' IDENTIFIED BY '${pwd}'"""
     sql """grant select_priv on regression_test to ${user}"""
     sql """create database ${dbName}"""
     sql """create table ${dbName}.${tableName} (
diff --git a/regression-test/suites/auth_call/test_show_frontend_auth.groovy 
b/regression-test/suites/auth_call/test_show_frontend_auth.groovy
index 12069803970..0d0aa0fc2e7 100644
--- a/regression-test/suites/auth_call/test_show_frontend_auth.groovy
+++ b/regression-test/suites/auth_call/test_show_frontend_auth.groovy
@@ -21,6 +21,8 @@ suite("test_show_frontend_auth","p0,auth_call") {
     String user = 'test_show_frontend_auth_user'
     String pwd = 'C123_567p'
 
+    try_sql("DROP USER ${user}")
+    sql """CREATE USER '${user}' IDENTIFIED BY '${pwd}'"""
     //cloud-mode
     if (isCloudMode()) {
         def clusters = sql " SHOW CLUSTERS; "
@@ -28,9 +30,6 @@ suite("test_show_frontend_auth","p0,auth_call") {
         def validCluster = clusters[0][0]
         sql """GRANT USAGE_PRIV ON CLUSTER `${validCluster}` TO ${user}""";
     }
-
-    try_sql("DROP USER ${user}")
-    sql """CREATE USER '${user}' IDENTIFIED BY '${pwd}'"""
     sql """grant select_priv on regression_test to ${user}"""
     sql """grant select_priv on internal.information_schema.* to ${user}"""
     def show_grants_result = sql """show grants for ${user}"""
diff --git a/regression-test/suites/auth_call/test_show_grant_auth.groovy 
b/regression-test/suites/auth_call/test_show_grant_auth.groovy
index efd2e84e38a..de7ef41e509 100644
--- a/regression-test/suites/auth_call/test_show_grant_auth.groovy
+++ b/regression-test/suites/auth_call/test_show_grant_auth.groovy
@@ -21,6 +21,8 @@ suite("test_show_grant_auth","p0,auth_call") {
     String user = 'test_show_grant_auth_user'
     String pwd = 'C123_567p'
 
+    try_sql("DROP USER ${user}")
+    sql """CREATE USER '${user}' IDENTIFIED BY '${pwd}'"""
     //cloud-mode
     if (isCloudMode()) {
         def clusters = sql " SHOW CLUSTERS; "
@@ -28,9 +30,6 @@ suite("test_show_grant_auth","p0,auth_call") {
         def validCluster = clusters[0][0]
         sql """GRANT USAGE_PRIV ON CLUSTER `${validCluster}` TO ${user}""";
     }
-
-    try_sql("DROP USER ${user}")
-    sql """CREATE USER '${user}' IDENTIFIED BY '${pwd}'"""
     sql """grant select_priv on regression_test to ${user}"""
 
     connect(user, "${pwd}", context.config.jdbcUrl) {
diff --git a/regression-test/suites/auth_call/test_show_proc_auth.groovy 
b/regression-test/suites/auth_call/test_show_proc_auth.groovy
index 4608c64ca67..d5b672d3155 100644
--- a/regression-test/suites/auth_call/test_show_proc_auth.groovy
+++ b/regression-test/suites/auth_call/test_show_proc_auth.groovy
@@ -21,6 +21,8 @@ suite("test_show_proc_auth","p0,auth_call") {
     String user = 'test_show_proc_auth_user'
     String pwd = 'C123_567p'
 
+    try_sql("DROP USER ${user}")
+    sql """CREATE USER '${user}' IDENTIFIED BY '${pwd}'"""
     //cloud-mode
     if (isCloudMode()) {
         def clusters = sql " SHOW CLUSTERS; "
@@ -28,9 +30,6 @@ suite("test_show_proc_auth","p0,auth_call") {
         def validCluster = clusters[0][0]
         sql """GRANT USAGE_PRIV ON CLUSTER `${validCluster}` TO ${user}""";
     }
-
-    try_sql("DROP USER ${user}")
-    sql """CREATE USER '${user}' IDENTIFIED BY '${pwd}'"""
     sql """grant select_priv on regression_test to ${user}"""
 
     connect(user, "${pwd}", context.config.jdbcUrl) {
diff --git a/regression-test/suites/auth_call/test_show_query_stats_auth.groovy 
b/regression-test/suites/auth_call/test_show_query_stats_auth.groovy
index 7552038a743..82927157261 100644
--- a/regression-test/suites/auth_call/test_show_query_stats_auth.groovy
+++ b/regression-test/suites/auth_call/test_show_query_stats_auth.groovy
@@ -21,6 +21,8 @@ suite("test_show_query_stats_auth","p0,auth_call") {
     String user = 'test_show_query_stats_auth_user'
     String pwd = 'C123_567p'
 
+    try_sql("DROP USER ${user}")
+    sql """CREATE USER '${user}' IDENTIFIED BY '${pwd}'"""
     //cloud-mode
     if (isCloudMode()) {
         def clusters = sql " SHOW CLUSTERS; "
@@ -28,9 +30,6 @@ suite("test_show_query_stats_auth","p0,auth_call") {
         def validCluster = clusters[0][0]
         sql """GRANT USAGE_PRIV ON CLUSTER `${validCluster}` TO ${user}""";
     }
-
-    try_sql("DROP USER ${user}")
-    sql """CREATE USER '${user}' IDENTIFIED BY '${pwd}'"""
     sql """grant select_priv on regression_test to ${user}"""
 
     logger.info("context.config.jdbcUrl: " + context.config.jdbcUrl)
diff --git a/regression-test/suites/auth_call/test_show_tablet_auth.groovy 
b/regression-test/suites/auth_call/test_show_tablet_auth.groovy
index b3201d4b8af..0183e36add7 100644
--- a/regression-test/suites/auth_call/test_show_tablet_auth.groovy
+++ b/regression-test/suites/auth_call/test_show_tablet_auth.groovy
@@ -23,6 +23,9 @@ suite("test_show_tablet_auth","p0,auth_call") {
     String dbName = 'test_show_tablet_auth_db'
     String tableName = 'test_show_tablet_auth_tb'
 
+    try_sql("DROP USER ${user}")
+    try_sql """drop database if exists ${dbName}"""
+    sql """CREATE USER '${user}' IDENTIFIED BY '${pwd}'"""
     //cloud-mode
     if (isCloudMode()) {
         def clusters = sql " SHOW CLUSTERS; "
@@ -30,10 +33,6 @@ suite("test_show_tablet_auth","p0,auth_call") {
         def validCluster = clusters[0][0]
         sql """GRANT USAGE_PRIV ON CLUSTER `${validCluster}` TO ${user}""";
     }
-
-    try_sql("DROP USER ${user}")
-    try_sql """drop database if exists ${dbName}"""
-    sql """CREATE USER '${user}' IDENTIFIED BY '${pwd}'"""
     sql """grant select_priv on regression_test to ${user}"""
     sql """create database ${dbName}"""
     sql """create table ${dbName}.${tableName} (
diff --git a/regression-test/suites/auth_call/test_show_typecast_auth.groovy 
b/regression-test/suites/auth_call/test_show_typecast_auth.groovy
index 9e5d7186f01..237834267ca 100644
--- a/regression-test/suites/auth_call/test_show_typecast_auth.groovy
+++ b/regression-test/suites/auth_call/test_show_typecast_auth.groovy
@@ -21,6 +21,8 @@ suite("test_show_typecast_auth","p0,auth_call") {
     String user = 'test_show_typecast_auth_user'
     String pwd = 'C123_567p'
 
+    try_sql("DROP USER ${user}")
+    sql """CREATE USER '${user}' IDENTIFIED BY '${pwd}'"""
     //cloud-mode
     if (isCloudMode()) {
         def clusters = sql " SHOW CLUSTERS; "
@@ -28,9 +30,6 @@ suite("test_show_typecast_auth","p0,auth_call") {
         def validCluster = clusters[0][0]
         sql """GRANT USAGE_PRIV ON CLUSTER `${validCluster}` TO ${user}""";
     }
-
-    try_sql("DROP USER ${user}")
-    sql """CREATE USER '${user}' IDENTIFIED BY '${pwd}'"""
     sql """grant select_priv on regression_test to ${user}"""
 
     connect(user, "${pwd}", context.config.jdbcUrl) {


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to