cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From slebre...@apache.org
Subject git commit: Make sure both type name are prepared for a type rename
Date Wed, 15 Jan 2014 18:09:23 GMT
Updated Branches:
  refs/heads/trunk 312286772 -> 2966852a0


Make sure both type name are prepared for a type rename


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

Branch: refs/heads/trunk
Commit: 2966852a03faecf4ef2dbbc99da98f414826d0cf
Parents: 3122867
Author: Sylvain Lebresne <sylvain@datastax.com>
Authored: Wed Jan 15 19:08:44 2014 +0100
Committer: Sylvain Lebresne <sylvain@datastax.com>
Committed: Wed Jan 15 19:09:18 2014 +0100

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


http://git-wip-us.apache.org/repos/asf/cassandra/blob/2966852a/src/java/org/apache/cassandra/cql3/statements/AlterTypeStatement.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/cql3/statements/AlterTypeStatement.java b/src/java/org/apache/cassandra/cql3/statements/AlterTypeStatement.java
index dd88aca..61a4e35 100644
--- a/src/java/org/apache/cassandra/cql3/statements/AlterTypeStatement.java
+++ b/src/java/org/apache/cassandra/cql3/statements/AlterTypeStatement.java
@@ -352,6 +352,18 @@ public abstract class AlterTypeStatement extends SchemaAlteringStatement
             this.newName = newName;
         }
 
+        @Override
+        public void prepareKeyspace(ClientState state) throws InvalidRequestException
+        {
+            super.prepareKeyspace(state);
+
+            if (!newName.hasKeyspace())
+                newName.setKeyspace(state.getKeyspace());
+
+            if (newName.getKeyspace() == null)
+                throw new InvalidRequestException("You need to be logged in a keyspace or
use a fully qualified user type name");
+        }
+
         protected UserType makeUpdatedType(UserType toUpdate) throws InvalidRequestException
         {
             KSMetaData ksm = Schema.instance.getKSMetaData(newName.getKeyspace());


Mime
View raw message