AbstractJdbc1DatabaseMetaData.getColumns doesn't set DECIMAL_DIGITS
AbstractJdbc1DatabaseMetaData.getColumns doesn't set DECIMAL_DIGITS
От:
Florian Wunderlich <fwunderlich@devbrain.de>
Дата:
In the CVS, getColumns in AbstractJdbc1DatabaseMetaData.java:2257 does not set DECIMAL_DIGITS for types other than "numeric" and "decimal". A subsequent ResultSet.getInt for this column then fails with a java.lang.StringIndexOutOfBoundsException. The JDBC API documentation seems to indicate that this field should always be an int. In any case, ResultSet.getInt should not fail.
Re: AbstractJdbc1DatabaseMetaData.getColumns doesn't set DECIMAL_DIGITS
От:
Barry Lind <blind@xythos.com>
Дата:
Florian,
I think this should be fixed by a patch that Kris Jurka submitted
yesterday. I haven't had a chance to apply the patch yet, but I have
included it here if you want to try it out before it gets applied to CVS.
thanks,
--Barry
Index:
src/interfaces/jdbc/org/postgresql/jdbc1/AbstractJdbc1DatabaseMetaData.java
===================================================================
RCS file:
/projects/cvsroot/pgsql-server/src/interfaces/jdbc/org/postgresql/jdbc1/AbstractJdbc1DatabaseMetaData.java,v
retrieving revision 1.8
diff -c -r1.8 AbstractJdbc1DatabaseMetaData.java
***
src/interfaces/jdbc/org/postgresql/jdbc1/AbstractJdbc1DatabaseMetaData.java
2002/10/08 01:47:55 1.8
---
src/interfaces/jdbc/org/postgresql/jdbc1/AbstractJdbc1DatabaseMetaData.java
2002/10/22 21:00:52
***************
*** 1854,1860 ****
// decide if we are returning a single column result.
if (!returnTypeType.equals("c")) {
! byte[][] tuple = new byte[13][0];
tuple[0] = null;
tuple[1] = schema;
tuple[2] = procedureName;
--- 1854,1860 ----
// decide if we are returning a single column result.
if (!returnTypeType.equals("c")) {
! byte[][] tuple = new byte[13][];
tuple[0] = null;
tuple[1] = schema;
tuple[2] = procedureName;
***************
*** 1874,1880 ****
// Add a row for each argument.
for (int i=0; i In the CVS, getColumns in AbstractJdbc1DatabaseMetaData.java:2257 does
> not set DECIMAL_DIGITS for types other than "numeric" and "decimal".
>
> A subsequent ResultSet.getInt for this column then fails with a
> java.lang.StringIndexOutOfBoundsException.
>
> The JDBC API documentation seems to indicate that this field should
> always be an int. In any case, ResultSet.getInt should not fail.
>
> ---------------------------(end of broadcast)---------------------------
> TIP 5: Have you checked our extensive FAQ?
>
> http://www.postgresql.org/users-lounge/docs/faq.html
>