mirror of
https://github.com/postgres/postgres.git
synced 2025-07-28 23:42:10 +03:00
Patches submitted by Kris Jurka (jurka@ejurka.com) for the following bugs:
- Properly drop tables in jdbc regression tests with cascade for 7.3 - problem with Statement.execute() and executeUpdate() not clearing binds - problem with ResultSet not correctly handling default encoding - changes to correctly support show transaction isolation level in 7.3 - changed DatabaseMetaDataTest to handle differences in FK names in 7.3 - better fix for dynamically checking server NAME data length (With the fixes above the jdbc regression tests pass on jdbc2 and jdbc3 against both a 7.2 and 7.3 server) Patchs submitted by David Wall (d.wall@computer.org): - problem with getBlob when largeobject oid is null - improvements to BlobOutputStream Patch submitted by Haris Peco (snpe@snpe.co.yu): - problem with callable statement not supporting prepared statement methods Modified Files: jdbc/org/postgresql/Driver.java.in jdbc/org/postgresql/jdbc1/AbstractJdbc1Connection.java jdbc/org/postgresql/jdbc1/AbstractJdbc1DatabaseMetaData.java jdbc/org/postgresql/jdbc1/AbstractJdbc1Statement.java jdbc/org/postgresql/jdbc2/AbstractJdbc2ResultSet.java jdbc/org/postgresql/jdbc2/AbstractJdbc2Statement.java jdbc/org/postgresql/jdbc2/Jdbc2ResultSet.java jdbc/org/postgresql/jdbc3/Jdbc3ResultSet.java jdbc/org/postgresql/largeobject/BlobOutputStream.java jdbc/org/postgresql/largeobject/LargeObject.java jdbc/org/postgresql/test/TestUtil.java jdbc/org/postgresql/test/jdbc2/DatabaseMetaDataTest.java jdbc/org/postgresql/test/jdbc2/UpdateableResultTest.java jdbc/org/postgresql/test/jdbc2/optional/BaseDataSourceTest.java jdbc/org/postgresql/test/jdbc2/optional/ConnectionPoolTest.java jdbc/org/postgresql/test/jdbc2/optional/SimpleDataSourceTest.java
This commit is contained in:
@ -15,7 +15,7 @@ import org.postgresql.util.PGbytea;
|
||||
import org.postgresql.util.PSQLException;
|
||||
|
||||
|
||||
/* $Header: /cvsroot/pgsql/src/interfaces/jdbc/org/postgresql/jdbc2/Attic/AbstractJdbc2ResultSet.java,v 1.7 2002/09/06 21:23:06 momjian Exp $
|
||||
/* $Header: /cvsroot/pgsql/src/interfaces/jdbc/org/postgresql/jdbc2/Attic/AbstractJdbc2ResultSet.java,v 1.8 2002/09/11 05:38:45 barry Exp $
|
||||
* This class defines methods of the jdbc2 specification. This class extends
|
||||
* org.postgresql.jdbc1.AbstractJdbc1ResultSet which provides the jdbc1
|
||||
* methods. The real Statement class (for jdbc2) is org.postgresql.jdbc2.Jdbc2ResultSet
|
||||
@ -1546,14 +1546,7 @@ public abstract class AbstractJdbc2ResultSet extends org.postgresql.jdbc1.Abstra
|
||||
case Types.REAL:
|
||||
case Types.TINYINT:
|
||||
|
||||
try
|
||||
{
|
||||
rowBuffer[columnIndex] = String.valueOf( updateValues.get( columnName ) ).getBytes(connection.getEncoding().name() );
|
||||
}
|
||||
catch ( UnsupportedEncodingException ex)
|
||||
{
|
||||
throw new SQLException("Unsupported Encoding " + connection.getEncoding().name());
|
||||
}
|
||||
rowBuffer[columnIndex] = connection.getEncoding().encode(String.valueOf( updateValues.get( columnName ) ));
|
||||
|
||||
case Types.NULL:
|
||||
continue;
|
||||
|
@ -8,7 +8,7 @@ import java.util.Vector;
|
||||
import org.postgresql.largeobject.*;
|
||||
import org.postgresql.util.PSQLException;
|
||||
|
||||
/* $Header: /cvsroot/pgsql/src/interfaces/jdbc/org/postgresql/jdbc2/Attic/AbstractJdbc2Statement.java,v 1.6 2002/09/06 21:23:06 momjian Exp $
|
||||
/* $Header: /cvsroot/pgsql/src/interfaces/jdbc/org/postgresql/jdbc2/Attic/AbstractJdbc2Statement.java,v 1.7 2002/09/11 05:38:45 barry Exp $
|
||||
* This class defines methods of the jdbc2 specification. This class extends
|
||||
* org.postgresql.jdbc1.AbstractJdbc1Statement which provides the jdbc1
|
||||
* methods. The real Statement class (for jdbc2) is org.postgresql.jdbc2.Jdbc2Statement
|
||||
@ -187,16 +187,26 @@ public abstract class AbstractJdbc2Statement extends org.postgresql.jdbc1.Abstra
|
||||
while (numRead != -1 && bytesRemaining > 0)
|
||||
{
|
||||
bytesRemaining -= numRead;
|
||||
los.write(buf, 0, numRead);
|
||||
if ( numRead == buf.length )
|
||||
los.write(buf); // saves a buffer creation and copy in LargeObject since it's full
|
||||
else
|
||||
los.write(buf,0,numRead);
|
||||
numRead = l_inStream.read(buf, 0, Math.min(buf.length, bytesRemaining));
|
||||
}
|
||||
los.close();
|
||||
}
|
||||
catch (IOException se)
|
||||
{
|
||||
throw new PSQLException("postgresql.unusual", se);
|
||||
}
|
||||
// lob is closed by the stream so don't call lob.close()
|
||||
finally
|
||||
{
|
||||
try
|
||||
{
|
||||
los.close();
|
||||
l_inStream.close();
|
||||
}
|
||||
catch( Exception e ) {}
|
||||
}
|
||||
setInt(i, oid);
|
||||
}
|
||||
|
||||
|
@ -5,7 +5,7 @@ import java.sql.*;
|
||||
import java.util.Vector;
|
||||
import org.postgresql.Field;
|
||||
|
||||
/* $Header: /cvsroot/pgsql/src/interfaces/jdbc/org/postgresql/jdbc2/Attic/Jdbc2ResultSet.java,v 1.5 2002/09/06 21:23:06 momjian Exp $
|
||||
/* $Header: /cvsroot/pgsql/src/interfaces/jdbc/org/postgresql/jdbc2/Attic/Jdbc2ResultSet.java,v 1.6 2002/09/11 05:38:45 barry Exp $
|
||||
* This class implements the java.sql.ResultSet interface for JDBC2.
|
||||
* However most of the implementation is really done in
|
||||
* org.postgresql.jdbc2.AbstractJdbc2ResultSet or one of it's parents
|
||||
@ -25,11 +25,19 @@ public class Jdbc2ResultSet extends org.postgresql.jdbc2.AbstractJdbc2ResultSet
|
||||
|
||||
public java.sql.Clob getClob(int i) throws SQLException
|
||||
{
|
||||
wasNullFlag = (this_row[i - 1] == null);
|
||||
if (wasNullFlag)
|
||||
return null;
|
||||
|
||||
return new org.postgresql.jdbc2.Jdbc2Clob(connection, getInt(i));
|
||||
}
|
||||
|
||||
public java.sql.Blob getBlob(int i) throws SQLException
|
||||
{
|
||||
wasNullFlag = (this_row[i - 1] == null);
|
||||
if (wasNullFlag)
|
||||
return null;
|
||||
|
||||
return new org.postgresql.jdbc2.Jdbc2Blob(connection, getInt(i));
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user