1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-17 06:41:09 +03:00

cancel row updates sets values to null by Kris Jurka

This commit is contained in:
Dave Cramer
2003-12-12 18:38:19 +00:00
parent 31769dcb02
commit 2712da556a
2 changed files with 74 additions and 17 deletions

View File

@ -9,7 +9,7 @@
* Copyright (c) 2003, PostgreSQL Global Development Group
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/interfaces/jdbc/org/postgresql/jdbc2/Attic/AbstractJdbc2ResultSet.java,v 1.25 2003/10/29 02:39:09 davec Exp $
* $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 $
*
*-------------------------------------------------------------------------
*/
@ -518,7 +518,7 @@ public abstract class AbstractJdbc2ResultSet extends org.postgresql.jdbc1.Abstra
{
doingUpdates = false;
clearRowBuffer();
clearRowBuffer(true);
}
}
@ -661,7 +661,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);
}
@ -706,7 +706,7 @@ public abstract class AbstractJdbc2ResultSet extends org.postgresql.jdbc1.Abstra
// make sure the underlying data is null
clearRowBuffer();
clearRowBuffer(false);
onInsertRow = true;
doingUpdates = false;
@ -714,12 +714,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();