lukasz-antoniak opened a new pull request, #3482: URL: https://github.com/apache/cassandra/pull/3482
Fix [JAVA-3164](https://datastax-oss.atlassian.net/jira/software/c/projects/JAVA/issues/JAVA-3164). Without the change, request with unset collection type fails with: ``` java.lang.IndexOutOfBoundsException: null at java.base/java.nio.Buffer.checkIndex(Buffer.java:693) at java.base/java.nio.HeapByteBuffer.getInt(HeapByteBuffer.java:406) at org.apache.cassandra.utils.ByteBufferUtil.toInt(ByteBufferUtil.java:476) at org.apache.cassandra.db.marshal.ByteBufferAccessor.toInt(ByteBufferAccessor.java:208) at org.apache.cassandra.db.marshal.ByteBufferAccessor.toInt(ByteBufferAccessor.java:42) at org.apache.cassandra.serializers.CollectionSerializer.readCollectionSize(CollectionSerializer.java:147) at org.apache.cassandra.cql3.CQL3Type$Collection.toCQLLiteral(CQL3Type.java:222) at org.apache.cassandra.transport.messages.ExecuteMessage.traceQuery(ExecuteMessage.java:223) at org.apache.cassandra.transport.messages.ExecuteMessage.execute(ExecuteMessage.java:155) at org.apache.cassandra.transport.Message$Request.execute(Message.java:259) at org.apache.cassandra.transport.Dispatcher.processRequest(Dispatcher.java:416) at org.apache.cassandra.transport.Dispatcher.processRequest(Dispatcher.java:435) at org.apache.cassandra.transport.Dispatcher.processRequest(Dispatcher.java:462) at org.apache.cassandra.transport.Dispatcher$RequestProcessor.run(Dispatcher.java:307) at org.apache.cassandra.concurrent.FutureTask$1.call(FutureTask.java:99) at org.apache.cassandra.concurrent.FutureTask.call(FutureTask.java:61) at org.apache.cassandra.concurrent.FutureTask.run(FutureTask.java:71) at org.apache.cassandra.concurrent.SEPWorker.run(SEPWorker.java:143) at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30) at java.base/java.lang.Thread.run(Thread.java:829) ``` Unset collection length (-2) is replaced by empty byte buffer. All other implementation of `toCQLLiteral()` use `isNull(buffer)` to return `NULL` for empty byte buffers. Issue was wrongly submitted by the requestor to Java driver project. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]

