ing-bank / cassandra-jdbc-wrapper

A JDBC wrapper of Java Driver for Apache Cassandra®, which offers a simple JDBC compliant API to work with CQL3.
Apache License 2.0
70 stars 25 forks source link

Fix fetching varint values #59

Closed kornilova203 closed 4 months ago

kornilova203 commented 4 months ago

Before the fix it was throwing IndexOutOfBoundsException

java.lang.IndexOutOfBoundsException
    at java.base/java.nio.Buffer.checkIndex(Buffer.java:749)
    at java.base/java.nio.HeapByteBuffer.getInt(HeapByteBuffer.java:439)
    at com.ing.data.cassandra.jdbc.utils.ByteBufferUtil.toInt(ByteBufferUtil.java:113)
    at com.ing.data.cassandra.jdbc.codec.VarintToIntCodec.decode(VarintToIntCodec.java:65)
    at com.ing.data.cassandra.jdbc.codec.VarintToIntCodec.decode(VarintToIntCodec.java:31)
    at com.datastax.oss.driver.api.core.data.GettableByIndex.get(GettableByIndex.java:90)
    at com.datastax.oss.driver.api.core.data.GettableByIndex.getInt(GettableByIndex.java:270)
    at com.ing.data.cassandra.jdbc.CassandraResultSet.getObject(CassandraResultSet.java:986)
kornilova203 commented 4 months ago

@maximevw, thank you for the review! I'll push the fixes