cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From slebre...@apache.org
Subject [2/5] git commit: Fix UDT field selection with empty field
Date Wed, 06 Aug 2014 09:11:49 GMT
Fix UDT field selection with empty field

patch by mstepura; reviewed by slebresne for CASSANDRA-7670


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

Branch: refs/heads/trunk
Commit: 1adc39f1713a826e833b393798b4eea4a64f9e3a
Parents: 7b112db
Author: Sylvain Lebresne <sylvain@datastax.com>
Authored: Tue Aug 5 17:59:44 2014 +0200
Committer: Sylvain Lebresne <sylvain@datastax.com>
Committed: Tue Aug 5 17:59:44 2014 +0200

----------------------------------------------------------------------
 CHANGES.txt                                                  | 1 +
 src/java/org/apache/cassandra/cql3/statements/Selection.java | 5 ++++-
 2 files changed, 5 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/1adc39f1/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index 98a0246..f650182 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,6 +1,7 @@
 2.1.0-final
  * cqlsh DESC CLUSTER fails retrieving ring information (CASSANDRA-7687)
  * Fix binding null values inside UDT (CASSANDRA-7685)
+ * Fix UDT field selection with empty fields (CASSANDRA-7670)
 Merged from 2.0:
  * Update java driver (for hadoop) (CASSANDRA-7618)
  * Support connecting to ipv6 jmx with nodetool (CASSANDRA-7669)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/1adc39f1/src/java/org/apache/cassandra/cql3/statements/Selection.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/cql3/statements/Selection.java b/src/java/org/apache/cassandra/cql3/statements/Selection.java
index dc31dde..0f0cb62 100644
--- a/src/java/org/apache/cassandra/cql3/statements/Selection.java
+++ b/src/java/org/apache/cassandra/cql3/statements/Selection.java
@@ -466,7 +466,10 @@ public abstract class Selection
 
         public ByteBuffer compute(ResultSetBuilder rs) throws InvalidRequestException
         {
-            ByteBuffer[] buffers = type.split(selected.compute(rs));
+            ByteBuffer value = selected.compute(rs);
+            if (value == null)
+                return null;
+            ByteBuffer[] buffers = type.split(value);
             return field < buffers.length ? buffers[field] : null;
         }
 


Mime
View raw message