cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From slebre...@apache.org
Subject [1/2] git commit: Fix UDT field selection with empty field
Date Tue, 05 Aug 2014 16:02:29 GMT
Repository: cassandra
Updated Branches:
  refs/heads/cassandra-2.1 b4741d04b -> fa8e5158a


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/fa8e5158
Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/fa8e5158
Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/fa8e5158

Branch: refs/heads/cassandra-2.1
Commit: fa8e5158a56b37caf7f2507256992e776ef1afa8
Parents: ef27851
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 18:00:38 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/fa8e5158/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index 3588553..d3e2f5a 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -17,6 +17,7 @@ Merged from 2.0:
 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/fa8e5158/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