Bug #21770 | MetaData getColumnClassName() Returning Strange Result & Some Text as Blob | ||
---|---|---|---|
Submitted: | 22 Aug 2006 5:44 | Modified: | 18 Sep 2006 6:39 |
Reporter: | dana | Email Updates: | |
Status: | Not a Bug | Impact on me: | |
Category: | Connector / J | Severity: | S2 (Serious) |
Version: | mysql-connector-java-3.1.13 | OS: | Linux (linux and win) |
Assigned to: | CPU Architecture: | Any |
[22 Aug 2006 5:44]
dana
[31 Aug 2006 10:32]
Tonci Grgin
Test case
Attachment: TestBug21770.java (text/x-java), 4.16 KiB.
[31 Aug 2006 10:41]
Tonci Grgin
Hi dana and thanks for your problem report. Test case result: Connected to 5.0.23-log BK, Win XP 1 data_type_id java.lang.Long INTEGER UNSIGNED 10 2 char_type java.lang.String CHAR 30 3 varchar_type java.lang.String VARCHAR 30 4 tinyBlob_type [B TINYBLOB 255 5 blob_type [B BLOB 65535 6 mediumBlob_type [B MEDIUMBLOB 16777215 7 longBlob_type [B LONGBLOB 2147483647 8 tinyText_type java.lang.String VARCHAR 255 9 text_type java.lang.String VARCHAR 65535 10 mediumText_type java.lang.String VARCHAR 16777215 11 longText_type java.lang.String VARCHAR 2147483647 12 enum_type java.lang.String CHAR 4 13 set_type java.lang.String CHAR 5 14 tinyInt_type java.lang.Integer TINYINT 4 15 smallInt_type java.lang.Integer SMALLINT UNSIGNED 5 16 mediumInt_type java.lang.Integer MEDIUMINT 9 17 int_type java.lang.Integer INTEGER 11 18 bigInt_type java.lang.Long BIGINT 20 19 float_type java.lang.Float FLOAT 12 20 double_type java.lang.Double DOUBLE 22 21 decimal_type java.math.BigDecimal DECIMAL 18 22 date_type java.sql.Date DATE 10 23 time_type java.sql.Time TIME 8 24 dateTime_type java.sql.Timestamp DATETIME 19 25 timeStamp_type java.sql.Timestamp TIMESTAMP 19 26 year_type java.sql.Date YEAR 4 Test info: - Test was run from svn repo against latest 3.1 branch - MySQL server used is 5.0.23-log BK on WinXP Pro SP2 localhost - jre1.5.0_07 No assertation failed. VARCHAR types longer than 65535 bytes would have been silently converted to corresponding TEXT types by server. If you have new info to provide, please post it and reopen report.
[15 Sep 2006 18:46]
dana
Tonci, Notice your test output for blob type, the returned Meta getColumnClassName get "[B" instead of the java.lang.Object. 4 tinyBlob_type [B TINYBLOB 255 5 blob_type [B BLOB 65535 6 mediumBlob_type [B MEDIUMBLOB 16777215 7 longBlob_type [B LONGBLOB 2147483647 3.0.10-stable Output: 4 tinyBlob_type TinyBlob Type java.lang.Object BLOB 255 5 blob_type Blob Type java.lang.Object BLOB 65535 6 mediumBlob_type MediumBlob Type java.lang.Object BLOB 16777215 7 longBlob_type LongBlob Type java.lang.Object BLOB 16777215
[18 Sep 2006 6:39]
Tonci Grgin
Hi Dana. This change is noted in the manual: Changes in MySQL Connector/J 3.0.11-stable (19 February 2004) • Return [B instead of java.lang.Object for BINARY, VARBINARY and LONGVARBINARY types from ResultSetMetaData.getColumnClassName() (JDBC compliance).