This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 219429

Summary: sort doesn't work properly
Product: db Reporter: medeag
Component: CodeAssignee: Jaroslav Havlin <jhavlin>
Status: RESOLVED FIXED    
Severity: normal Keywords: NETFIX
Priority: P3    
Version: 7.3   
Hardware: PC   
OS: Windows 7   
Issue Type: DEFECT Exception Reporter:
Attachments: screenshot
proposed patch v1

Description medeag 2012-10-03 09:18:48 UTC
Created attachment 125280 [details]
screenshot

Tried to sort table by column which is  NUMBER(12), it was sorted like string (see attachment)

Product Version: NetBeans IDE 7.3 Beta (Build 201209272333)
Updates: Updates available
Java: 1.7.0_05; Java HotSpot(TM) 64-Bit Server VM 23.1-b03
System: Windows 7 version 6.1 running on amd64; Cp1252; en_US (nb)
Comment 1 matthias42 2012-10-03 10:51:09 UTC
Please provide some more information:
- What is your DBMS?
- Which version is you DBMS?
- What JDBC driver are you using?
- What version of the JDBC driver are you using.
Comment 2 medeag 2012-10-03 11:01:58 UTC
Oracle Database XE 11.2
ojdbc6
Comment 3 matthias42 2012-10-03 13:23:48 UTC
Created attachment 125307 [details]
proposed patch v1

Ok - problem is the ResultSetTableModel, this implements getColumnClass in parts as follows:

case Types.BIGINT:
case Types.DOUBLE:
case Types.FLOAT:
case Types.REAL:
case Types.DECIMAL:
case Types.NUMERIC:
case Types.INTEGER:
case Types.SMALLINT:
case Types.TINYINT:
    return Number.class;

Number is not comparable, so it falls through to a string comparison of <Object>.toString()

The attached patch fixes this.
Comment 4 Jaroslav Havlin 2012-10-03 14:42:07 UTC
Applied as http://hg.netbeans.org/core-main/rev/7e9a986c879f
Great job! Thank you.
Comment 5 Quality Engineering 2012-10-07 02:00:25 UTC
Integrated into 'main-golden', will be available in build *201210070002* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/7e9a986c879f
User: Jaroslav Havlin <jhavlin@netbeans.org>
Log: #219429: Sort doesn't work properly