Repository: cassandra Updated Branches: refs/heads/trunk 96f40e66b -> 08a868f2c
Fix IAE in Tuples.InValue with pre-v3 protocol Patch by Tyler Hobbs; reviewed by Sylvain Lebresne for CASSANDRA-8062 Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/1ef7d056 Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/1ef7d056 Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/1ef7d056 Branch: refs/heads/trunk Commit: 1ef7d056d1246b308f5c2c45f213a590b939bc2e Parents: 2966b61 Author: Tyler Hobbs <ty...@datastax.com> Authored: Thu Oct 16 11:23:39 2014 -0500 Committer: Tyler Hobbs <ty...@datastax.com> Committed: Thu Oct 16 11:23:39 2014 -0500 ---------------------------------------------------------------------- CHANGES.txt | 3 +++ src/java/org/apache/cassandra/cql3/Tuples.java | 8 ++++---- 2 files changed, 7 insertions(+), 4 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cassandra/blob/1ef7d056/CHANGES.txt ---------------------------------------------------------------------- diff --git a/CHANGES.txt b/CHANGES.txt index aa14be9..9d10d84 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -1,4 +1,7 @@ 2.1.1 + * Fix IllegalArgumentException when a list of IN values containing tuples + is passed as a single arg to a prepared statement with the v1 or v2 + protocol (CASSANDRA-8062) * Fix ClassCastException in DISTINCT query on static columns with query paging (CASSANDRA-8108) * Fix NPE on null nested UDT inside a set (CASSANDRA-8105) http://git-wip-us.apache.org/repos/asf/cassandra/blob/1ef7d056/src/java/org/apache/cassandra/cql3/Tuples.java ---------------------------------------------------------------------- diff --git a/src/java/org/apache/cassandra/cql3/Tuples.java b/src/java/org/apache/cassandra/cql3/Tuples.java index f0d7a13..883cc60 100644 --- a/src/java/org/apache/cassandra/cql3/Tuples.java +++ b/src/java/org/apache/cassandra/cql3/Tuples.java @@ -240,13 +240,13 @@ public class Tuples this.elements = items; } - public static InValue fromSerialized(ByteBuffer value, ListType type) throws InvalidRequestException + public static InValue fromSerialized(ByteBuffer value, ListType type, QueryOptions options) throws InvalidRequestException { try { // Collections have this small hack that validate cannot be called on a serialized object, - // but compose does the validation (so we're fine). - List<?> l = (List<?>)type.compose(value); + // but the deserialization does the validation (so we're fine). + List<?> l = (List<?>)type.getSerializer().deserializeForNativeProtocol(value, options.getProtocolVersion()); assert type.elements instanceof TupleType; TupleType tupleType = (TupleType) type.elements; @@ -391,7 +391,7 @@ public class Tuples public InValue bind(QueryOptions options) throws InvalidRequestException { ByteBuffer value = options.getValues().get(bindIndex); - return value == null ? null : InValue.fromSerialized(value, (ListType)receiver.type); + return value == null ? null : InValue.fromSerialized(value, (ListType)receiver.type, options); } }