Uploaded image for project: 'Cassandra'
  1. Cassandra
  2. CASSANDRA-3413

Off by one on column index retrieval in org.apache.cassandra.cql.jdbc.CResultSet getColumn

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Normal
    • Resolution: Invalid
    • None
    • None
    • Normal

    Description

      When using org.apache.cassandra.cql.jdbc.CResultSet getColumn to retrieve col data you will always be missing the first one.

      ex: SELECT name, pwd from user;
      returns only pwd.

      The issue is at http://code.google.com/a/apache-extras.org/p/cassandra-jdbc/source/browse/src/org/apache/cassandra/cql/jdbc/CResultSet.java#348

      The call to checkIndex passes, but the values.get(index) call causes the lookup to go over the ArrayList size.

      This needs to be changed to:

      values.get(index - 1)

      patch file: http://code.google.com/a/apache-extras.org/p/cassandra-jdbc/issues/attachmentText?id=4&aid=40000000&name=patchfile&token=b3a8df347e76a90ca4837a3771bf2406

      Attachments

        Activity

          People

            Unassigned Unassigned
            mpenet Max Penet
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: