diff --git a/tests/queries/0_stateless/03174_add_identified_with.reference b/tests/queries/0_stateless/03174_multiple_authentication_methods.reference similarity index 68% rename from tests/queries/0_stateless/03174_add_identified_with.reference rename to tests/queries/0_stateless/03174_multiple_authentication_methods.reference index 38f55c1c16d..27d5df20091 100644 --- a/tests/queries/0_stateless/03174_add_identified_with.reference +++ b/tests/queries/0_stateless/03174_multiple_authentication_methods.reference @@ -39,3 +39,11 @@ Replacing existing authentication methods in favor of no_password, should succee CREATE USER u01_03174 IDENTIFIED WITH no_password Trying to auth with no pwd, should succeed 1 +Create user with mix both implicit and explicit auth type, starting with with +CREATE USER u01_03174 IDENTIFIED WITH plaintext_password, sha256_password, bcrypt_password, sha256_password +Create user with mix both implicit and explicit auth type, starting with by +CREATE USER u01_03174 IDENTIFIED WITH sha256_password, plaintext_password, bcrypt_password, sha256_password +Use WITH without providing authentication type, should fail +Syntax error +Create user with ADD identification, should fail, add is not allowed for create query +BAD_ARGUMENTS diff --git a/tests/queries/0_stateless/03174_add_identified_with.sh b/tests/queries/0_stateless/03174_multiple_authentication_methods.sh similarity index 80% rename from tests/queries/0_stateless/03174_add_identified_with.sh rename to tests/queries/0_stateless/03174_multiple_authentication_methods.sh index 51414c77684..5503134d880 100755 --- a/tests/queries/0_stateless/03174_add_identified_with.sh +++ b/tests/queries/0_stateless/03174_multiple_authentication_methods.sh @@ -119,3 +119,23 @@ echo "Trying to auth with no pwd, should succeed" test_login_no_pwd ${user} ${CLICKHOUSE_CLIENT} --query "DROP USER IF EXISTS ${user}" + +echo "Create user with mix both implicit and explicit auth type, starting with with" +${CLICKHOUSE_CLIENT} --query "CREATE USER ${user} IDENTIFIED WITH plaintext_password by '1', by '2', bcrypt_password by '3', by '4';" +${CLICKHOUSE_CLIENT} --query "SHOW CREATE USER ${user}" + +${CLICKHOUSE_CLIENT} --query "DROP USER IF EXISTS ${user}" + +echo "Create user with mix both implicit and explicit auth type, starting with by" +${CLICKHOUSE_CLIENT} --query "CREATE USER ${user} IDENTIFIED by '1', plaintext_password by '2', bcrypt_password by '3', by '4';" +${CLICKHOUSE_CLIENT} --query "SHOW CREATE USER ${user}" + +${CLICKHOUSE_CLIENT} --query "DROP USER IF EXISTS ${user}" + +echo "Use WITH without providing authentication type, should fail" +${CLICKHOUSE_CLIENT} --query "CREATE USER ${user} IDENTIFIED WITH BY '1';" 2>&1 | grep -m1 -o "Syntax error" + +echo "Create user with ADD identification, should fail, add is not allowed for create query" +${CLICKHOUSE_CLIENT} --query "CREATE USER ${user} ADD IDENTIFIED WITH plaintext_password by '1'" 2>&1 | grep -m1 -o "BAD_ARGUMENTS" + +${CLICKHOUSE_CLIENT} --query "DROP USER IF EXISTS ${user}"