mirror of
https://github.com/postgres/postgres.git
synced 2025-06-30 21:42:05 +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:
@ -27,19 +27,28 @@ public abstract class AbstractJdbc1DatabaseMetaData
|
||||
protected static final int iInt2Oid = 21; // OID for int2
|
||||
protected static final int iInt4Oid = 23; // OID for int4
|
||||
protected static final int VARHDRSZ = 4; // length for int4
|
||||
protected static int NAME_SIZE = 64; // length for name datatype
|
||||
protected static int NAME_SIZE = 63; // length for name datatype
|
||||
|
||||
public AbstractJdbc1DatabaseMetaData(AbstractJdbc1Connection conn)
|
||||
{
|
||||
this.connection = conn;
|
||||
String sql;
|
||||
try {
|
||||
if (connection.haveMinimumServerVersion("7.3")) {
|
||||
NAME_SIZE = 64;
|
||||
sql = "SELECT t.typlen FROM pg_catalog.pg_type t, pg_catalog.pg_namespace n WHERE t.typnamespace=n.oid AND t.typname='name' AND n.nspname='pg_catalog'";
|
||||
NAME_SIZE = 63;
|
||||
} else {
|
||||
NAME_SIZE = 32;
|
||||
sql = "SELECT typlen FROM pg_type WHERE typname='name'";
|
||||
NAME_SIZE = 31;
|
||||
}
|
||||
ResultSet rs = connection.createStatement().executeQuery(sql);
|
||||
if (rs.next()) {
|
||||
NAME_SIZE = rs.getInt("typlen") - 1;
|
||||
}
|
||||
rs.close();
|
||||
} catch (SQLException l_se) {
|
||||
//leave value at default
|
||||
// depending on the error the NAME_SIZE value will
|
||||
// be the original or the value set before the query.
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user