Fix IllegalArgumentException in CqlStorage

patch by slebresne; reviewed by driftx for CASSANDRA-7287
This commit is contained in:
Sylvain Lebresne 2014-05-23 18:01:58 +02:00
parent 465a09c468
commit dfcb73426c
2 changed files with 10 additions and 2 deletions

View File

@ -23,6 +23,7 @@
* Fix potential ClassCastException in HintedHandoffManager (CASSANDRA-7284)
* Use prepared statements internally (CASSANDRA-6975)
* Fix broken paging state with prepared statement (CASSANDRA-7120)
* Fix IllegalArgumentException in CqlStorage (CASSANDRA-7287)
Merged from 2.0:
* Always reallocate buffers in HSHA (CASSANDRA-6285)
* (Hadoop) support authentication in CqlRecordReader (CASSANDRA-7221)

View File

@ -788,8 +788,15 @@ public abstract class AbstractCassandraStorage extends LoadFunc implements Store
{
if (validator instanceof DecimalType || validator instanceof InetAddressType)
return validator.getString(value);
else
return validator.compose(value);
if (validator instanceof CollectionType)
{
// For CollectionType, the compose() method assumes the v3 protocol format of collection, which
// is not correct here since we query using the CQL-over-thrift interface which use the pre-v3 format
return ((CollectionSerializer)validator.getSerializer()).deserializeForNativeProtocol(value, 1);
}
return validator.compose(value);
}
protected static class CfInfo