cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jbel...@apache.org
Subject svn commit: r951249 - in /cassandra/branches/cassandra-0.6: CHANGES.txt src/java/org/apache/cassandra/thrift/ThriftValidation.java test/system/test_server.py
Date Fri, 04 Jun 2010 02:56:45 GMT
Author: jbellis
Date: Fri Jun  4 02:56:44 2010
New Revision: 951249

URL: http://svn.apache.org/viewvc?rev=951249&view=rev
Log:
reject deletions to supercolumns in CFs containing only standard columns.  patch by mdennis;
reviewed by jbellis for CASSANDRA-1139

Modified:
    cassandra/branches/cassandra-0.6/CHANGES.txt
    cassandra/branches/cassandra-0.6/src/java/org/apache/cassandra/thrift/ThriftValidation.java
    cassandra/branches/cassandra-0.6/test/system/test_server.py

Modified: cassandra/branches/cassandra-0.6/CHANGES.txt
URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-0.6/CHANGES.txt?rev=951249&r1=951248&r2=951249&view=diff
==============================================================================
--- cassandra/branches/cassandra-0.6/CHANGES.txt (original)
+++ cassandra/branches/cassandra-0.6/CHANGES.txt Fri Jun  4 02:56:44 2010
@@ -8,6 +8,8 @@
    missed a status change; instead, expose deliverHintsToEndpoint to JMX
    so it can be done manually, if necessary (CASSANDRA-1141)
  * don't reject reads at CL.ALL (CASSANDRA-1152)
+ * reject deletions to supercolumns in CFs containing only standard
+   columns (CASSANDRA-1139)
 
 
 0.6.2

Modified: cassandra/branches/cassandra-0.6/src/java/org/apache/cassandra/thrift/ThriftValidation.java
URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-0.6/src/java/org/apache/cassandra/thrift/ThriftValidation.java?rev=951249&r1=951248&r2=951249&view=diff
==============================================================================
--- cassandra/branches/cassandra-0.6/src/java/org/apache/cassandra/thrift/ThriftValidation.java
(original)
+++ cassandra/branches/cassandra-0.6/src/java/org/apache/cassandra/thrift/ThriftValidation.java
Fri Jun  4 02:56:44 2010
@@ -259,6 +259,12 @@ public class ThriftValidation
             if (del.predicate.slice_range != null)
                 throw new InvalidRequestException("Deletion does not yet support SliceRange
predicates.");
         }
+
+        if (DatabaseDescriptor.getColumnFamilyType(keyspace, cfName).equals("Standard") &&
del.super_column != null)
+        {
+            String msg = String.format("deletion of super_column is not possible on a standard
ColumnFamily (KeySpace=%s ColumnFamily=%s Deletion=%s)", keyspace, cfName, del);
+            throw new InvalidRequestException(msg);
+        }
     }
 
     public static void validateSlicePredicate(String keyspace, String cfName, byte[] scName,
SlicePredicate predicate) throws InvalidRequestException

Modified: cassandra/branches/cassandra-0.6/test/system/test_server.py
URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-0.6/test/system/test_server.py?rev=951249&r1=951248&r2=951249&view=diff
==============================================================================
--- cassandra/branches/cassandra-0.6/test/system/test_server.py (original)
+++ cassandra/branches/cassandra-0.6/test/system/test_server.py Fri Jun  4 02:56:44 2010
@@ -549,6 +549,12 @@ class TestMutations(CassandraTester):
                           InvalidRequestException)
         # start > finish, key version
         _expect_exception(lambda: client.get_range_slice('Keyspace1', ColumnParent('Standard1'),
SlicePredicate(column_names=['']), 'z', 'a', 1, ConsistencyLevel.ONE), InvalidRequestException)
+        # don't allow super_column in Deletion for standard ColumnFamily
+        deletion = Deletion(1, 'supercolumn', None)
+        mutation = Mutation(deletion=deletion)
+        mutations = { 'key' : { 'Standard1' : [ mutation ] } }
+        _expect_exception(lambda: client.batch_mutate("Keyspace1", mutations, ConsistencyLevel.QUORUM),
+                          InvalidRequestException)
 
     def test_batch_insert_super(self):
          cfmap = {'Super1': [ColumnOrSuperColumn(super_column=c) for c in _SUPER_COLUMNS],



Mime
View raw message