1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-03 20:02:46 +03:00

backpatch for rs.previous from Kris Jurka, reported by Andrew Fyfe

This commit is contained in:
Dave Cramer
2003-12-18 03:35:55 +00:00
parent 2864c18ee5
commit 6096a72a54
2 changed files with 12 additions and 1 deletions

View File

@ -9,7 +9,7 @@
* Copyright (c) 2003, PostgreSQL Global Development Group * Copyright (c) 2003, PostgreSQL Global Development Group
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/interfaces/jdbc/org/postgresql/jdbc2/Attic/AbstractJdbc2ResultSet.java,v 1.25.2.1 2003/12/12 18:38:19 davec Exp $ * $Header: /cvsroot/pgsql/src/interfaces/jdbc/org/postgresql/jdbc2/Attic/AbstractJdbc2ResultSet.java,v 1.25.2.2 2003/12/18 03:35:55 davec Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
@ -493,6 +493,7 @@ public abstract class AbstractJdbc2ResultSet extends org.postgresql.jdbc1.Abstra
if (--current_row < 0) if (--current_row < 0)
return false; return false;
this_row = (byte[][]) rows.elementAt(current_row); this_row = (byte[][]) rows.elementAt(current_row);
rowBuffer = new byte[this_row.length][];
System.arraycopy(this_row, 0, rowBuffer, 0, this_row.length); System.arraycopy(this_row, 0, rowBuffer, 0, this_row.length);
return true; return true;
} }

View File

@ -83,6 +83,16 @@ public class ResultSetTest extends TestCase
TestUtil.closeDB(con); TestUtil.closeDB(con);
} }
public void testBackward() throws Exception
{
Statement stmt = con.createStatement();
ResultSet rs = stmt.executeQuery("SELECT * FROM testrs");
rs.afterLast();
assertTrue(rs.previous());
rs.close();
stmt.close();
}
public void testAbsolute() throws Exception public void testAbsolute() throws Exception
{ {
Statement stmt = con.createStatement(); Statement stmt = con.createStatement();