Description:
Create a table with, among other things, some binary and varbinary columns. Execute
databaseMetaData.getColumns(null, null, tablename, null). For the binary or varbinary
columns, the DATA_TYPE column in the result set contains the integer value
java.sql.Types.OTHER rather than the more appropriate Types.BINARY or Types.VARBINARY,
respectively. Other column types appear to be reported correctly. The TYPE_NAME column in
the result set has the proper string type for the column, but IMO this is a non-standard
place to look for the data type of the column.
Java VM: build 1.5.0_04-b05
MySql: 5.0.11-beta-nt
How to repeat:
Result set is repeatable; the getColumns() result set always contains DATA_TYPE of
Types.OTHER for binary and varbinary columns.
Suggested fix:
Map the MySql column type into a more appropriate value from java.sql.Types