cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tylerho...@apache.org
Subject git commit: Avoid NPE when creating table w/ frozen sets, lists
Date Tue, 14 Oct 2014 20:29:39 GMT
Repository: cassandra
Updated Branches:
  refs/heads/cassandra-2.1 3a94b3379 -> 932b5eb46


Avoid NPE when creating table w/ frozen sets, lists

Patch by Robert Stupp; reviewed by Tyler Hobbs for CASSANDRA-8104


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

Branch: refs/heads/cassandra-2.1
Commit: 932b5eb46d413af94add6ac199d4ef043234e55e
Parents: 3a94b33
Author: Robert Stupp <snazy@snazy.de>
Authored: Tue Oct 14 15:28:38 2014 -0500
Committer: Tyler Hobbs <tylerhobbs@apache.org>
Committed: Tue Oct 14 15:28:38 2014 -0500

----------------------------------------------------------------------
 CHANGES.txt                                      | 4 +++-
 src/java/org/apache/cassandra/cql3/CQL3Type.java | 8 +++++---
 2 files changed, 8 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/932b5eb4/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index 47bea3a..1c7ee38 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,5 +1,7 @@
 2.1.1
- * Fix high memory use due to tracking reads on incrementally opened sstable readers (CASSANDRA-8066)
+ * Fix NPE when creating a table with frozen sets, lists (CASSANDRA-8104)
+ * Fix high memory use due to tracking reads on incrementally opened sstable
+   readers (CASSANDRA-8066)
  * Fix EXECUTE request with skipMetadata=false returning no metadata
    (CASSANDRA-8054)
  * Allow concurrent use of CQLBulkOutputFormat (CASSANDRA-7776)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/932b5eb4/src/java/org/apache/cassandra/cql3/CQL3Type.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/cql3/CQL3Type.java b/src/java/org/apache/cassandra/cql3/CQL3Type.java
index 1589d6a..6d55285 100644
--- a/src/java/org/apache/cassandra/cql3/CQL3Type.java
+++ b/src/java/org/apache/cassandra/cql3/CQL3Type.java
@@ -347,7 +347,7 @@ public interface CQL3Type
         public static Raw tuple(List<CQL3Type.Raw> ts) throws InvalidRequestException
         {
             for (int i = 0; i < ts.size(); i++)
-                if (ts.get(i).isCounter())
+                if (ts.get(i) != null && ts.get(i).isCounter())
                     throw new InvalidRequestException("counters are not allowed inside tuples");
 
             return new RawTuple(ts);
@@ -404,7 +404,8 @@ public interface CQL3Type
 
             public Raw freeze()
             {
-                keys.freeze();
+                if (keys != null)
+                    keys.freeze();
                 values.freeze();
                 return super.freeze();
             }
@@ -500,7 +501,8 @@ public interface CQL3Type
             public Raw freeze()
             {
                 for (CQL3Type.Raw t : types)
-                    t.freeze();
+                    if (t != null)
+                        t.freeze();
                 return super.freeze();
             }
 


Mime
View raw message