cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mish...@apache.org
Subject [1/2] git commit: refs CASSANDRA-6687. Don't fail in checkAccess if table doesn't exist
Date Tue, 11 Feb 2014 05:46:48 GMT
Updated Branches:
  refs/heads/trunk 503a8a865 -> f05870ee8


refs CASSANDRA-6687. Don't fail in checkAccess if table doesn't exist


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

Branch: refs/heads/trunk
Commit: 87aca600fda47a1b72f27ee02cf5f854437ce2be
Parents: 9a6ae96
Author: Mikhail Stepura <mishail@apache.org>
Authored: Mon Feb 10 17:03:27 2014 -0800
Committer: Mikhail Stepura <mishail@apache.org>
Committed: Mon Feb 10 17:10:09 2014 -0800

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


http://git-wip-us.apache.org/repos/asf/cassandra/blob/87aca600/src/java/org/apache/cassandra/cql3/statements/DropTableStatement.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/cql3/statements/DropTableStatement.java b/src/java/org/apache/cassandra/cql3/statements/DropTableStatement.java
index fa620e8..d27261c 100644
--- a/src/java/org/apache/cassandra/cql3/statements/DropTableStatement.java
+++ b/src/java/org/apache/cassandra/cql3/statements/DropTableStatement.java
@@ -38,7 +38,15 @@ public class DropTableStatement extends SchemaAlteringStatement
 
     public void checkAccess(ClientState state) throws UnauthorizedException, InvalidRequestException
     {
-        state.hasColumnFamilyAccess(keyspace(), columnFamily(), Permission.DROP);
+        try
+        {
+            state.hasColumnFamilyAccess(keyspace(), columnFamily(), Permission.DROP);
+        }
+        catch (InvalidRequestException e)
+        {
+            if (!ifExists)
+                throw e;
+        }
     }
 
     public void validate(ClientState state)


Mime
View raw message