diff options
Diffstat (limited to 'src/interfaces/jdbc/org/postgresql/jdbc2/AbstractJdbc2ResultSet.java')
| -rw-r--r-- | src/interfaces/jdbc/org/postgresql/jdbc2/AbstractJdbc2ResultSet.java | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/src/interfaces/jdbc/org/postgresql/jdbc2/AbstractJdbc2ResultSet.java b/src/interfaces/jdbc/org/postgresql/jdbc2/AbstractJdbc2ResultSet.java index 817b5d0f18..37d7f9cf07 100644 --- a/src/interfaces/jdbc/org/postgresql/jdbc2/AbstractJdbc2ResultSet.java +++ b/src/interfaces/jdbc/org/postgresql/jdbc2/AbstractJdbc2ResultSet.java @@ -9,7 +9,7 @@ * Copyright (c) 2003, PostgreSQL Global Development Group * * IDENTIFICATION - * $PostgreSQL: pgsql/src/interfaces/jdbc/org/postgresql/jdbc2/AbstractJdbc2ResultSet.java,v 1.27 2003/11/29 19:52:10 pgsql Exp $ + * $PostgreSQL: pgsql/src/interfaces/jdbc/org/postgresql/jdbc2/AbstractJdbc2ResultSet.java,v 1.28 2003/12/12 18:34:14 davec Exp $ * *------------------------------------------------------------------------- */ @@ -519,7 +519,7 @@ public abstract class AbstractJdbc2ResultSet extends org.postgresql.jdbc1.Abstra { doingUpdates = false; - clearRowBuffer(); + clearRowBuffer(true); } } @@ -662,7 +662,7 @@ public abstract class AbstractJdbc2ResultSet extends org.postgresql.jdbc1.Abstra this_row = rowBuffer; // need to clear this in case of another insert - clearRowBuffer(); + clearRowBuffer(false); } @@ -707,7 +707,7 @@ public abstract class AbstractJdbc2ResultSet extends org.postgresql.jdbc1.Abstra // make sure the underlying data is null - clearRowBuffer(); + clearRowBuffer(false); onInsertRow = true; doingUpdates = false; @@ -715,12 +715,17 @@ public abstract class AbstractJdbc2ResultSet extends org.postgresql.jdbc1.Abstra } - private synchronized void clearRowBuffer() + private synchronized void clearRowBuffer(boolean copyCurrentRow) throws SQLException { // rowBuffer is the temporary storage for the row rowBuffer = new byte[fields.length][]; + // inserts want an empty array while updates want a copy of the current row + if (copyCurrentRow) { + System.arraycopy(this_row, 0, rowBuffer, 0, this_row.length); + } + // clear the updateValues hashTable for the next set of updates updateValues.clear(); |
