db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mayuresh Nirhali (JIRA)" <derby-...@db.apache.org>
Subject [jira] Updated: (DERBY-836) ResultSetMetaData.getColumnDisplaySize sometimes returns wrong values for DECIMAL columns
Date Thu, 06 Apr 2006 06:48:49 GMT
     [ http://issues.apache.org/jira/browse/DERBY-836?page=all ]

Mayuresh Nirhali updated DERBY-836:
-----------------------------------

    Attachment: derby836.diff

There are 3 possible cases with respect to finding the correct maximum width for DECIMAL type.

1. If scale = 0, only sign should be added to precision to compute max width.
2. scale = precision, in this case 3 should be added to precision for sign, decimal and an
additional char '0'.
3. precision > scale > 0, 2 shoud be added to precision for sign and decimal.

In the embedded codepath, Only first and third is implemented. The second case is implemented
in the fix attached.
With respect to netclient codepath, only the third case is implemented. The fix attached does
attempt to cover all the three..
Also, all the required canon files are modified to now test the fix with correct values.

> ResultSetMetaData.getColumnDisplaySize sometimes returns wrong values for DECIMAL columns
> -----------------------------------------------------------------------------------------
>
>          Key: DERBY-836
>          URL: http://issues.apache.org/jira/browse/DERBY-836
>      Project: Derby
>         Type: Bug

>   Components: JDBC, Newcomer
>     Versions: 10.2.0.0
>     Reporter: Daniel John Debrunner
>     Assignee: Mayuresh Nirhali
>     Priority: Minor
>  Attachments: derby836.diff
>
> DECIMAL(10,0)
> max display width value:   -1234567890  length 11
> embedded : 11 correct
> client: 12 WRONG
> DECIMAL(10,10)
> max display width value:   -0.1234567890  length 13
> embedded : 13 correct
> client: 12 WRONG
> DECIMAL(10,2)
> max display width value:   -12345678.90  length 12
> embedded : 13 WRONG
> client: 12 correct
> I've added output early on in jdbcapi/metadata_test.java (and hence the tests metadata.jar
and odbc_metadata.java) to show this issue:
> E.g. for embedded
> DECIMAL(10,0) -- precision: 10 scale: 0 display size: 12 type name: DECIMAL
> DECIMAL(10,10) -- precision: 10 scale: 10 display size: 12 type name: DECIMAL
> DECIMAL(10,2) -- precision: 10 scale: 2 display size: 12 type name: DECIMAL
> I will add this test output once DERBY-829 is fixed so as not to cause conflicts.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


Mime
View raw message