From 09ea6030d91ad38ce8663be0346e4453219ecc74 Mon Sep 17 00:00:00 2001 From: Tyler Hobbs Date: Wed, 28 May 2014 17:59:55 -0500 Subject: [PATCH] Use v3 collection serialization inside UDTs --- cassandra/cqltypes.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cassandra/cqltypes.py b/cassandra/cqltypes.py index 09bf680d..749c23ff 100644 --- a/cassandra/cqltypes.py +++ b/cassandra/cqltypes.py @@ -800,7 +800,9 @@ class UserDefinedType(_ParameterizedType): p += cls.FIELD_LENGTH item = byts[p:p + itemlen] p += itemlen - result.append(col_type.from_binary(item, protocol_version)) + # collections inside UDTs are always encoded with at least the + # version 3 format + result.append(col_type.from_binary(item, max(3, protocol_version))) if len(result) < len(cls.subtypes): nones = [None] * (len(cls.subtypes) - len(result))