summaryrefslogtreecommitdiff
path: root/src/interfaces/jdbc/org/postgresql/jdbc2/AbstractJdbc2ResultSet.java
diff options
context:
space:
mode:
authorDave Cramer <davec@fastcrypt.com>2003-12-12 18:34:14 +0000
committerDave Cramer <davec@fastcrypt.com>2003-12-12 18:34:14 +0000
commit605c1e6df0b90bd3e7ce4396359f5d9003464fd1 (patch)
tree47942693c3deadde06b6f3d2ac65752672e2093c /src/interfaces/jdbc/org/postgresql/jdbc2/AbstractJdbc2ResultSet.java
parent06ec9044b5804dcb728d8e360e1c1f1e002df107 (diff)
downloadpostgresql-605c1e6df0b90bd3e7ce4396359f5d9003464fd1.tar.gz
cancel row updates sets values to null by Kris Jurka
Diffstat (limited to 'src/interfaces/jdbc/org/postgresql/jdbc2/AbstractJdbc2ResultSet.java')
-rw-r--r--src/interfaces/jdbc/org/postgresql/jdbc2/AbstractJdbc2ResultSet.java15
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();