cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From slebre...@apache.org
Subject [1/3] git commit: Fix validation when using counter and regular columns in the same table
Date Wed, 26 Sep 2012 12:10:25 GMT
Updated Branches:
  refs/heads/trunk f6bb970a4 -> 0dda10d76


Fix validation when using counter and regular columns in the same table

patch by slebresne; reviewed by jbellis for CASSANDRA-4706


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

Branch: refs/heads/trunk
Commit: 0dda10d76509391308e1e31bf99beca326629a3d
Parents: 2d76556
Author: Sylvain Lebresne <sylvain@datastax.com>
Authored: Wed Sep 26 14:09:48 2012 +0200
Committer: Sylvain Lebresne <sylvain@datastax.com>
Committed: Wed Sep 26 14:09:48 2012 +0200

----------------------------------------------------------------------
 CHANGES.txt                                        |    4 +++-
 .../org/apache/cassandra/config/CFMetaData.java    |    4 ++--
 2 files changed, 5 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/0dda10d7/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index 9972c7c..2b77d13 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -3,8 +3,10 @@
  * adjust blockFor calculation to account for pending ranges due to node 
    movement (CASSANDRA-833)
  * Change CQL version to 3.0.0 and stop accepting 3.0.0-beta1 (CASSANDRA-4649)
- * Make prepared statement global instead of per connection (CASSANDRA-4449)
+ * (CQL3) Make prepared statement global instead of per connection (CASSANDRA-4449)
  * Fix scrubbing of CQL3 created tables (CASSANDRA-4685)
+ * (CQL3) Fix validation when using counter and regular columns in the same table
+   (CASSANDRA-4706)
 
 1.2-beta1
  * add atomic_batch_mutate (CASSANDRA-4542, -4635)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/0dda10d7/src/java/org/apache/cassandra/config/CFMetaData.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/config/CFMetaData.java b/src/java/org/apache/cassandra/config/CFMetaData.java
index f15ca00..05b0cd7 100644
--- a/src/java/org/apache/cassandra/config/CFMetaData.java
+++ b/src/java/org/apache/cassandra/config/CFMetaData.java
@@ -1070,13 +1070,13 @@ public final class CFMetaData
         {
             for (ColumnDefinition def : column_metadata.values())
                 if (!(def.getValidator() instanceof CounterColumnType))
-                    throw new ConfigurationException("Cannot add a non counter column ("
+ comparator.getString(def.name) + ") in a counter column family");
+                    throw new ConfigurationException("Cannot add a non counter column ("
+ getColumnDefinitionComparator(def).getString(def.name) + ") in a counter column family");
         }
         else
         {
             for (ColumnDefinition def : column_metadata.values())
                 if (def.getValidator() instanceof CounterColumnType)
-                    throw new ConfigurationException("Cannot add a counter column (" + comparator.getString(def.name)
+ ") in a non counter column family");
+                    throw new ConfigurationException("Cannot add a counter column (" + getColumnDefinitionComparator(def).getString(def.name)
+ ") in a non counter column family");
         }
 
         // check if any of the columns has name equal to the cf.key_alias


Mime
View raw message