Description:
getColumnDisplaySize() returns 0 for columns returned by getProcedureColumns().
This does not happen for any other function such as getProcedures().
I presume this is so because createProcedureColumnsFields and createFunctionColumnsFields have been all initialized with 0.
How to repeat:
Run the java test case uploaded below
Suggested fix:
=== modified file 'src/com/mysql/jdbc/DatabaseMetaData.java'
--- src/com/mysql/jdbc/DatabaseMetaData.java 2010-01-28 23:59:15 +0000
+++ src/com/mysql/jdbc/DatabaseMetaData.java 2010-03-04 09:06:11 +0000
@@ -4065,19 +4065,19 @@
protected Field[] createProcedureColumnsFields() {
Field[] fields = new Field[13];
- fields[0] = new Field("", "PROCEDURE_CAT", Types.CHAR, 0);
+ fields[0] = new Field("", "PROCEDURE_CAT", Types.CHAR, 255);
fields[1] = new Field("", "PROCEDURE_SCHEM", Types.CHAR, 0);
- fields[2] = new Field("", "PROCEDURE_NAME", Types.CHAR, 0);
- fields[3] = new Field("", "COLUMN_NAME", Types.CHAR, 0);
- fields[4] = new Field("", "COLUMN_TYPE", Types.CHAR, 0);
- fields[5] = new Field("", "DATA_TYPE", Types.SMALLINT, 0);
- fields[6] = new Field("", "TYPE_NAME", Types.CHAR, 0);
- fields[7] = new Field("", "PRECISION", Types.INTEGER, 0);
- fields[8] = new Field("", "LENGTH", Types.INTEGER, 0);
- fields[9] = new Field("", "SCALE", Types.SMALLINT, 0);
- fields[10] = new Field("", "RADIX", Types.SMALLINT, 0);
- fields[11] = new Field("", "NULLABLE", Types.SMALLINT, 0);
- fields[12] = new Field("", "REMARKS", Types.CHAR, 0);
+ fields[2] = new Field("", "PROCEDURE_NAME", Types.CHAR, 255);
+ fields[3] = new Field("", "COLUMN_NAME", Types.CHAR, 32);
+ fields[4] = new Field("", "COLUMN_TYPE", Types.CHAR, 255);
+ fields[5] = new Field("", "DATA_TYPE", Types.SMALLINT, 5);
+ fields[6] = new Field("", "TYPE_NAME", Types.CHAR, 32);
+ fields[7] = new Field("", "PRECISION", Types.INTEGER, 10);
+ fields[8] = new Field("", "LENGTH", Types.INTEGER, 10);
+ fields[9] = new Field("", "SCALE", Types.SMALLINT, 5);
+ fields[10] = new Field("", "RADIX", Types.SMALLINT, 2);
+ fields[11] = new Field("", "NULLABLE", Types.SMALLINT, 1);
+ fields[12] = new Field("", "REMARKS", Types.CHAR, 255);
return fields;
}
@@ -8102,23 +8102,23 @@
protected Field[] createFunctionColumnsFields() {
Field[] fields = {
- new Field("", "FUNCTION_CAT", Types.VARCHAR, 0),
+ new Field("", "FUNCTION_CAT", Types.VARCHAR, 255),
new Field("", "FUNCTION_SCHEM", Types.VARCHAR, 0),
- new Field("", "FUNCTION_NAME", Types.VARCHAR, 0),
- new Field("", "COLUMN_NAME", Types.VARCHAR, 0),
- new Field("", "COLUMN_TYPE", Types.VARCHAR, 0),
- new Field("", "DATA_TYPE", Types.SMALLINT, 0),
- new Field("", "TYPE_NAME", Types.VARCHAR, 0),
- new Field("", "PRECISION", Types.INTEGER, 0),
- new Field("", "LENGTH", Types.INTEGER, 0),
- new Field("", "SCALE", Types.SMALLINT, 0),
- new Field("", "RADIX", Types.SMALLINT, 0),
- new Field("", "NULLABLE", Types.SMALLINT, 0),
- new Field("", "REMARKS", Types.VARCHAR, 0),
- new Field("", "CHAR_OCTET_LENGTH", Types.INTEGER, 0),
- new Field("", "ORDINAL_POSITION", Types.INTEGER, 0),
+ new Field("", "FUNCTION_NAME", Types.VARCHAR, 255),
+ new Field("", "COLUMN_NAME", Types.VARCHAR, 32),
+ new Field("", "COLUMN_TYPE", Types.VARCHAR, 255),
+ new Field("", "DATA_TYPE", Types.SMALLINT, 5),
+ new Field("", "TYPE_NAME", Types.VARCHAR, 32),
+ new Field("", "PRECISION", Types.INTEGER, 10),
+ new Field("", "LENGTH", Types.INTEGER, 10),
+ new Field("", "SCALE", Types.SMALLINT, 5),
+ new Field("", "RADIX", Types.SMALLINT, 2),
+ new Field("", "NULLABLE", Types.SMALLINT, 1),
+ new Field("", "REMARKS", Types.VARCHAR, 255),
+ new Field("", "CHAR_OCTET_LENGTH", Types.INTEGER, 10),
+ new Field("", "ORDINAL_POSITION", Types.INTEGER, 2),
new Field("", "IS_NULLABLE", Types.VARCHAR, 3),
- new Field("", "SPECIFIC_NAME", Types.VARCHAR, 0)};
+ new Field("", "SPECIFIC_NAME", Types.VARCHAR, 255)};
return fields;
}