Bug #2855 ResultSetMetaData.getColumnClassName() return wrong type for FLOAT

Submitted: 17 Feb 2004 23:40 Modified: 18 Feb 2004 13:51
Reporter: [ name withheld ] Email Updates:
Status: Closed Impact on me:
None 
Category:Connector / J Severity:S2 (Serious)
Version:3.0.10 OS:Java
Assigned to: CPU Architecture:Any

[17 Feb 2004 23:40] [ name withheld ]
Description:
To be consistent with ResultSet.getColumnClassName() in the case of a FLOAT, 
ResultSetMetaData.getObject() 
should return "java.lang.Double" not "java.lang.Float"

The behavior of ResultSet.getColumnClassName() is appropriate per Table 9.3 at http://java.sun.com/
j2se/1.4.2/docs/guide/jdbc/getstart/mapping.html

How to repeat:
Invoke ResultSetMetaData.getColumnClassName() on a FLOAT

Suggested fix:
    public String getColumnClassName(int column) throws SQLException {

...

        case Types.REAL:
        case Types.FLOAT:
            return "java.lang.Float";

        case Types.DOUBLE:
            return "java.lang.Double";

should become:

        case Types.REAL:
            return "java.lang.Float";

        case Types.FLOAT:
       case Types.DOUBLE:
            return "java.lang.Double";

...
[18 Feb 2004 13:51] Mark Matthews
Thank you for your bug report. This issue has been committed to our
source repository of that product and will be incorporated into the
next release.

If necessary, you can access the source repository and build the latest
available version, including the bugfix, yourself. More information 
about accessing the source trees is available at
    http://www.mysql.com/doc/en/Installing_source_tree.html

Portions of this website are copyright © 2001, 2002 The PHP Group

Page generated in 0.049 sec. using MySQL 8.4.7-u6-cloud

Timestamp references displayed by the system are UTC.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.