cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cassandra-jdbc.apache-extras....@codespot.com
Subject [cassandra-jdbc] push by jak...@gmail.com - Fix issue #31 by reading first row from iterator then resetting iterat... on 2012-05-10 13:29 GMT
Date Thu, 10 May 2012 13:29:29 GMT
Revision: 9043d6d0a1f7
Author:   T Jake Luciani <jakers@gmail.com>
Date:     Thu May 10 06:27:27 2012
Log:      Fix issue #31 by reading first row from iterator then resetting  
iterator in constructor.

Verified by testing in SQuirreLSQL and RJDBC

Signed-Off-By: Jake Luciani

http://code.google.com/a/apache-extras.org/p/cassandra-jdbc/source/detail?r=9043d6d0a1f7

Modified:
  /src/main/java/org/apache/cassandra/cql/jdbc/CResultSet.java

=======================================
--- /src/main/java/org/apache/cassandra/cql/jdbc/CResultSet.java	Mon Dec 19  
09:03:13 2011
+++ /src/main/java/org/apache/cassandra/cql/jdbc/CResultSet.java	Thu May 10  
06:27:27 2012
@@ -127,6 +127,13 @@

          rSetIter = resultSet.getRowsIterator();
          meta = new CResultSetMetaData();
+
+        //Most clients check metadata before results are read
+        //Load the first row, then reset iterator so metadata will return  
something
+        next();
+        rSetIter = resultSet.getRowsIterator();
+        rowNumber = 0;
+
      }

      public boolean absolute(int arg0) throws SQLException

Mime
View raw message