[
https://issues.apache.org/jira/browse/CASSANDRA-16147?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17204365#comment-17204365
]
David Capwell commented on CASSANDRA-16147:
-------------------------------------------
the test passes on trunk, and one of the reasons is that
org.apache.cassandra.db.marshal.CompositeType#build(org.apache.cassandra.db.marshal.ValueAccessor<V>,
boolean, V...) uses ByteBuffer directly
{code}
@SafeVarargs
public static <V> V build(ValueAccessor<V> accessor, boolean isStatic, V...
values)
{
..
ByteBuffer out = ByteBuffer.allocate(totalLength);
...
for (V v : values)
{
ByteBufferUtil.writeShortLength(out, accessor.size(v));
...
}
{code}
And org.apache.cassandra.db.marshal.CompositeType#split also does the same
{code}
while (bb.remaining() > 0)
{
l[i++] = ByteBufferUtil.readBytesWithShortLength(bb);
bb.get(); // skip end-of-component
}
{code}
> ValueAccessor is using signed shorts in sliceWithShortLength
> ------------------------------------------------------------
>
> Key: CASSANDRA-16147
> URL: https://issues.apache.org/jira/browse/CASSANDRA-16147
> Project: Cassandra
> Issue Type: Bug
> Components: Local/Other
> Reporter: Blake Eggleston
> Assignee: Blake Eggleston
> Priority: Normal
> Fix For: 4.0-beta
>
>
> ValueAccessor is using a signed short when interpreting byte lengths, causing
> exceptions when reading blobs over 32767 bytes in length
--
This message was sent by Atlassian Jira
(v8.3.4#803005)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]