cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From slebre...@apache.org
Subject git commit: Add missing keyspace preparation to DropType too
Date Thu, 16 Jan 2014 10:19:58 GMT
Updated Branches:
  refs/heads/trunk eb4eb656e -> 49439ac9a


Add missing keyspace preparation to DropType too


Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo
Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/49439ac9
Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/49439ac9
Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/49439ac9

Branch: refs/heads/trunk
Commit: 49439ac9afa639aa16a76b8ca4168f3cf59aaf6b
Parents: eb4eb65
Author: Sylvain Lebresne <sylvain@datastax.com>
Authored: Thu Jan 16 11:18:12 2014 +0100
Committer: Sylvain Lebresne <sylvain@datastax.com>
Committed: Thu Jan 16 11:18:22 2014 +0100

----------------------------------------------------------------------
 .../cassandra/cql3/statements/DropTypeStatement.java      | 10 ++++++++++
 1 file changed, 10 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/49439ac9/src/java/org/apache/cassandra/cql3/statements/DropTypeStatement.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/cql3/statements/DropTypeStatement.java b/src/java/org/apache/cassandra/cql3/statements/DropTypeStatement.java
index 667ead4..08543bd 100644
--- a/src/java/org/apache/cassandra/cql3/statements/DropTypeStatement.java
+++ b/src/java/org/apache/cassandra/cql3/statements/DropTypeStatement.java
@@ -38,6 +38,16 @@ public class DropTypeStatement extends SchemaAlteringStatement
         this.ifExists = ifExists;
     }
 
+    @Override
+    public void prepareKeyspace(ClientState state) throws InvalidRequestException
+    {
+        if (!name.hasKeyspace())
+            name.setKeyspace(state.getKeyspace());
+
+        if (name.getKeyspace() == null)
+            throw new InvalidRequestException("You need to be logged in a keyspace or use
a fully qualified user type name");
+    }
+
     public void checkAccess(ClientState state) throws UnauthorizedException, InvalidRequestException
     {
         state.hasKeyspaceAccess(keyspace(), Permission.DROP);


Mime
View raw message