cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jbel...@apache.org
Subject svn commit: r1097141 - in /cassandra/branches/cassandra-0.8: CHANGES.txt src/java/org/apache/cassandra/cql/QueryProcessor.java test/system/test_cql.py
Date Wed, 27 Apr 2011 15:17:40 GMT
Author: jbellis
Date: Wed Apr 27 15:17:40 2011
New Revision: 1097141

URL: http://svn.apache.org/viewvc?rev=1097141&view=rev
Log:
validate cql TRUNCATE columnfamily before truncating
patch by Pavel Yaskevich and jbellis for CASSANDRA-2570

Modified:
    cassandra/branches/cassandra-0.8/CHANGES.txt
    cassandra/branches/cassandra-0.8/src/java/org/apache/cassandra/cql/QueryProcessor.java
    cassandra/branches/cassandra-0.8/test/system/test_cql.py

Modified: cassandra/branches/cassandra-0.8/CHANGES.txt
URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-0.8/CHANGES.txt?rev=1097141&r1=1097140&r2=1097141&view=diff
==============================================================================
--- cassandra/branches/cassandra-0.8/CHANGES.txt (original)
+++ cassandra/branches/cassandra-0.8/CHANGES.txt Wed Apr 27 15:17:40 2011
@@ -4,6 +4,7 @@
  * validate CQL create keyspace options (CASSANDRA-2525)
  * fix nodetool setcompactionthroughput (CASSANDRA-2550)
  * move	gossip heartbeat back to its own thread (CASSANDRA-2554)
+ * validate cql TRUNCATE columnfamily before truncating (CASSANDRA-2570)
 
 
 0.8.0-beta1

Modified: cassandra/branches/cassandra-0.8/src/java/org/apache/cassandra/cql/QueryProcessor.java
URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-0.8/src/java/org/apache/cassandra/cql/QueryProcessor.java?rev=1097141&r1=1097140&r2=1097141&view=diff
==============================================================================
--- cassandra/branches/cassandra-0.8/src/java/org/apache/cassandra/cql/QueryProcessor.java
(original)
+++ cassandra/branches/cassandra-0.8/src/java/org/apache/cassandra/cql/QueryProcessor.java
Wed Apr 27 15:17:40 2011
@@ -563,6 +563,7 @@ public class QueryProcessor
             
             case TRUNCATE:
                 String columnFamily = (String)statement.statement;
+                validateColumnFamily(keyspace, columnFamily);
                 clientState.hasColumnFamilyAccess(columnFamily, Permission.WRITE);
                 
                 try

Modified: cassandra/branches/cassandra-0.8/test/system/test_cql.py
URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-0.8/test/system/test_cql.py?rev=1097141&r1=1097140&r2=1097141&view=diff
==============================================================================
--- cassandra/branches/cassandra-0.8/test/system/test_cql.py (original)
+++ cassandra/branches/cassandra-0.8/test/system/test_cql.py Wed Apr 27 15:17:40 2011
@@ -304,6 +304,11 @@ class TestCql(ThriftTester):
         cursor.execute("SELECT 'cd1' FROM StandardString1 WHERE KEY = 'kd'")
         assert cursor.rowcount == 0
 
+        # truncate against non-existing CF
+        assert_raises(cql.ProgrammingError,
+                      cursor.execute,
+                      "TRUNCATE notExistingCFAAAABB")
+
     def test_delete_columns(self):
         "delete columns from a row"
         cursor = init()



Mime
View raw message