You are viewing a plain text version of this content. The canonical link for it is here.
Posted to pr@cassandra.apache.org by GitBox <gi...@apache.org> on 2022/01/12 07:39:12 UTC

[GitHub] [cassandra] djanand commented on a change in pull request #1319: modify alter statements with IF EXISTS and IF NOT EXISTS

djanand commented on a change in pull request #1319:
URL: https://github.com/apache/cassandra/pull/1319#discussion_r782778568



##########
File path: src/java/org/apache/cassandra/cql3/statements/AlterRoleStatement.java
##########
@@ -62,7 +65,9 @@ public void validate(ClientState state) throws RequestValidationException
         // validate login here before authorize to avoid leaking user existence to anonymous users.
         state.ensureNotAnonymous();
         if (!DatabaseDescriptor.getRoleManager().isExistingRole(role))
-            throw new InvalidRequestException(String.format("%s doesn't exist", role.getRoleName()));
+        {
+            RequestValidations.checkTrue(ifExists, String.format("Role %s doesn't exist", role.getRoleName()));

Review comment:
       thanks, made this change and used static import 




-- 
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: pr-unsubscribe@cassandra.apache.org

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



---------------------------------------------------------------------
To unsubscribe, e-mail: pr-unsubscribe@cassandra.apache.org
For additional commands, e-mail: pr-help@cassandra.apache.org