You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-dev@db.apache.org by "Dag H. Wanvik (Created) (JIRA)" <ji...@apache.org> on 2011/12/14 00:03:30 UTC

[jira] [Created] (DERBY-5536) Client's ResultSet#getLong does not range check when converting from a DECIMAL column

Client's ResultSet#getLong does not range check when converting from a DECIMAL column
-------------------------------------------------------------------------------------

                 Key: DERBY-5536
                 URL: https://issues.apache.org/jira/browse/DERBY-5536
             Project: Derby
          Issue Type: Bug
          Components: JDBC, Network Client
            Reporter: Dag H. Wanvik
         Attachments: MissingRangeCheck.java

Derby's DECIMAL can contain an integer of 31 digits. This can overflow a long. The embedded JDBC driver catches this, but the client does not and can yield a corrupt long, cf enclosed repro.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (DERBY-5536) Client's ResultSet#getLong does not range check when converting from a DECIMAL column

Posted by "Dag H. Wanvik (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-5536?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13182424#comment-13182424 ] 

Dag H. Wanvik commented on DERBY-5536:
--------------------------------------

Uploading patch #3 which address your comments, Knut. This tests a non-zero fractional part as well (rounding towards zero) and adds a comment as suggested.
                
> Client's ResultSet#getLong does not range check when converting from a DECIMAL column
> -------------------------------------------------------------------------------------
>
>                 Key: DERBY-5536
>                 URL: https://issues.apache.org/jira/browse/DERBY-5536
>             Project: Derby
>          Issue Type: Bug
>          Components: JDBC, Network Client
>            Reporter: Dag H. Wanvik
>         Attachments: MissingRangeCheck.java, derby-5536-2.diff, derby-5536-2.stat, derby-5536-3.diff, derby-5536-3.stat, derby-5536.diff, derby-5536.stat
>
>
> Derby's DECIMAL can contain an integer of 31 digits. This can overflow a long. The embedded JDBC driver catches this, but the client does not and can yield a corrupt long, cf enclosed repro.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (DERBY-5536) Client's ResultSet#getLong does not range check when converting from a DECIMAL column

Posted by "Dag H. Wanvik (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DERBY-5536?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Dag H. Wanvik updated DERBY-5536:
---------------------------------

    Attachment:     (was: derby-5536-3.stat)
    
> Client's ResultSet#getLong does not range check when converting from a DECIMAL column
> -------------------------------------------------------------------------------------
>
>                 Key: DERBY-5536
>                 URL: https://issues.apache.org/jira/browse/DERBY-5536
>             Project: Derby
>          Issue Type: Bug
>          Components: JDBC, Network Client
>            Reporter: Dag H. Wanvik
>         Attachments: MissingRangeCheck.java, derby-5536-2.diff, derby-5536-2.stat, derby-5536-3.diff, derby-5536-3.stat, derby-5536.diff, derby-5536.stat
>
>
> Derby's DECIMAL can contain an integer of 31 digits. This can overflow a long. The embedded JDBC driver catches this, but the client does not and can yield a corrupt long, cf enclosed repro.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (DERBY-5536) Client's ResultSet#getLong does not range check when converting from a DECIMAL column

Posted by "Dag H. Wanvik (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DERBY-5536?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Dag H. Wanvik updated DERBY-5536:
---------------------------------

    Attachment: derby-5536.stat
                derby-5536.diff

Uploading derby-5536 which changes the implementation of am.Decimal#getLong to allow it to detect overflow. If the number of digits indicate it can't happen we use an optimized path. Uncommented a overflow test case in ParameterMappingTest which was disabled due to this error and and added a new positive test case since we changed the implementation. 

Running regressions.
                
> Client's ResultSet#getLong does not range check when converting from a DECIMAL column
> -------------------------------------------------------------------------------------
>
>                 Key: DERBY-5536
>                 URL: https://issues.apache.org/jira/browse/DERBY-5536
>             Project: Derby
>          Issue Type: Bug
>          Components: JDBC, Network Client
>            Reporter: Dag H. Wanvik
>         Attachments: MissingRangeCheck.java, derby-5536.diff, derby-5536.stat
>
>
> Derby's DECIMAL can contain an integer of 31 digits. This can overflow a long. The embedded JDBC driver catches this, but the client does not and can yield a corrupt long, cf enclosed repro.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (DERBY-5536) Client's ResultSet#getLong does not range check when converting from a DECIMAL column

Posted by "Dag H. Wanvik (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-5536?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13173324#comment-13173324 ] 

Dag H. Wanvik commented on DERBY-5536:
--------------------------------------

Regressions passed.
                
> Client's ResultSet#getLong does not range check when converting from a DECIMAL column
> -------------------------------------------------------------------------------------
>
>                 Key: DERBY-5536
>                 URL: https://issues.apache.org/jira/browse/DERBY-5536
>             Project: Derby
>          Issue Type: Bug
>          Components: JDBC, Network Client
>            Reporter: Dag H. Wanvik
>         Attachments: MissingRangeCheck.java, derby-5536.diff, derby-5536.stat
>
>
> Derby's DECIMAL can contain an integer of 31 digits. This can overflow a long. The embedded JDBC driver catches this, but the client does not and can yield a corrupt long, cf enclosed repro.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (DERBY-5536) Client's ResultSet#getLong does not range check when converting from a DECIMAL column

Posted by "Dag H. Wanvik (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-5536?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13182445#comment-13182445 ] 

Dag H. Wanvik commented on DERBY-5536:
--------------------------------------

Thanks, Knut. I committed before I saw your latest comment. I'll address this in a follow-up patch.

                
> Client's ResultSet#getLong does not range check when converting from a DECIMAL column
> -------------------------------------------------------------------------------------
>
>                 Key: DERBY-5536
>                 URL: https://issues.apache.org/jira/browse/DERBY-5536
>             Project: Derby
>          Issue Type: Bug
>          Components: JDBC, Network Client
>            Reporter: Dag H. Wanvik
>             Fix For: 10.9.0.0
>
>         Attachments: MissingRangeCheck.java, derby-5536-2.diff, derby-5536-2.stat, derby-5536-3.diff, derby-5536-3.stat, derby-5536.diff, derby-5536.stat
>
>
> Derby's DECIMAL can contain an integer of 31 digits. This can overflow a long. The embedded JDBC driver catches this, but the client does not and can yield a corrupt long, cf enclosed repro.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (DERBY-5536) Client's ResultSet#getLong does not range check when converting from a DECIMAL column

Posted by "Dag H. Wanvik (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DERBY-5536?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Dag H. Wanvik updated DERBY-5536:
---------------------------------

    Attachment: derby-5536-refactor.diff

Attaching a follow-up patch which factors out the test cases for DERBY-5536 into a separate fixture, adding "order by" to secure correct row retrieval order.
                
> Client's ResultSet#getLong does not range check when converting from a DECIMAL column
> -------------------------------------------------------------------------------------
>
>                 Key: DERBY-5536
>                 URL: https://issues.apache.org/jira/browse/DERBY-5536
>             Project: Derby
>          Issue Type: Bug
>          Components: JDBC, Network Client
>            Reporter: Dag H. Wanvik
>             Fix For: 10.9.0.0
>
>         Attachments: MissingRangeCheck.java, derby-5536-2.diff, derby-5536-2.stat, derby-5536-3.diff, derby-5536-3.stat, derby-5536-refactor.diff, derby-5536.diff, derby-5536.stat
>
>
> Derby's DECIMAL can contain an integer of 31 digits. This can overflow a long. The embedded JDBC driver catches this, but the client does not and can yield a corrupt long, cf enclosed repro.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (DERBY-5536) Client's ResultSet#getLong does not range check when converting from a DECIMAL column

Posted by "Knut Anders Hatlen (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-5536?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13182441#comment-13182441 ] 

Knut Anders Hatlen commented on DERBY-5536:
-------------------------------------------

Thanks, Dag. The changes look good to me. Maybe the select statement in the new test case for non-zero fraction should have an ORDER BY clause to ensure stable results, since the rows are not guaranteed to be returned in insertion order? And perhaps factor out that test case in a separate test method? (The test method in which it is currently located, is actually for testing that the SQLStates are correct.)
                
> Client's ResultSet#getLong does not range check when converting from a DECIMAL column
> -------------------------------------------------------------------------------------
>
>                 Key: DERBY-5536
>                 URL: https://issues.apache.org/jira/browse/DERBY-5536
>             Project: Derby
>          Issue Type: Bug
>          Components: JDBC, Network Client
>            Reporter: Dag H. Wanvik
>         Attachments: MissingRangeCheck.java, derby-5536-2.diff, derby-5536-2.stat, derby-5536-3.diff, derby-5536-3.stat, derby-5536.diff, derby-5536.stat
>
>
> Derby's DECIMAL can contain an integer of 31 digits. This can overflow a long. The embedded JDBC driver catches this, but the client does not and can yield a corrupt long, cf enclosed repro.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (DERBY-5536) Client's ResultSet#getLong does not range check when converting from a DECIMAL column

Posted by "Dag H. Wanvik (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-5536?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13182444#comment-13182444 ] 

Dag H. Wanvik commented on DERBY-5536:
--------------------------------------

Committed on trunk as svn 1229082, resolving.

                
> Client's ResultSet#getLong does not range check when converting from a DECIMAL column
> -------------------------------------------------------------------------------------
>
>                 Key: DERBY-5536
>                 URL: https://issues.apache.org/jira/browse/DERBY-5536
>             Project: Derby
>          Issue Type: Bug
>          Components: JDBC, Network Client
>            Reporter: Dag H. Wanvik
>         Attachments: MissingRangeCheck.java, derby-5536-2.diff, derby-5536-2.stat, derby-5536-3.diff, derby-5536-3.stat, derby-5536.diff, derby-5536.stat
>
>
> Derby's DECIMAL can contain an integer of 31 digits. This can overflow a long. The embedded JDBC driver catches this, but the client does not and can yield a corrupt long, cf enclosed repro.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (DERBY-5536) Client's ResultSet#getLong does not range check when converting from a DECIMAL column

Posted by "Dag H. Wanvik (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DERBY-5536?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Dag H. Wanvik updated DERBY-5536:
---------------------------------

    Attachment: derby-5536-3.stat
                derby-5536-3.diff
    
> Client's ResultSet#getLong does not range check when converting from a DECIMAL column
> -------------------------------------------------------------------------------------
>
>                 Key: DERBY-5536
>                 URL: https://issues.apache.org/jira/browse/DERBY-5536
>             Project: Derby
>          Issue Type: Bug
>          Components: JDBC, Network Client
>            Reporter: Dag H. Wanvik
>         Attachments: MissingRangeCheck.java, derby-5536-2.diff, derby-5536-2.stat, derby-5536-3.diff, derby-5536-3.stat, derby-5536.diff, derby-5536.stat
>
>
> Derby's DECIMAL can contain an integer of 31 digits. This can overflow a long. The embedded JDBC driver catches this, but the client does not and can yield a corrupt long, cf enclosed repro.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Assigned] (DERBY-5536) Client's ResultSet#getLong does not range check when converting from a DECIMAL column

Posted by "Dag H. Wanvik (Assigned) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DERBY-5536?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Dag H. Wanvik reassigned DERBY-5536:
------------------------------------

    Assignee: Dag H. Wanvik
    
> Client's ResultSet#getLong does not range check when converting from a DECIMAL column
> -------------------------------------------------------------------------------------
>
>                 Key: DERBY-5536
>                 URL: https://issues.apache.org/jira/browse/DERBY-5536
>             Project: Derby
>          Issue Type: Bug
>          Components: JDBC, Network Client
>            Reporter: Dag H. Wanvik
>            Assignee: Dag H. Wanvik
>             Fix For: 10.9.0.0
>
>         Attachments: MissingRangeCheck.java, derby-5536-2.diff, derby-5536-2.stat, derby-5536-3.diff, derby-5536-3.stat, derby-5536-refactor.diff, derby-5536.diff, derby-5536.stat
>
>
> Derby's DECIMAL can contain an integer of 31 digits. This can overflow a long. The embedded JDBC driver catches this, but the client does not and can yield a corrupt long, cf enclosed repro.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (DERBY-5536) Client's ResultSet#getLong does not range check when converting from a DECIMAL column

Posted by "Dag H. Wanvik (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-5536?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13169620#comment-13169620 ] 

Dag H. Wanvik commented on DERBY-5536:
--------------------------------------

The bug also is present for getInt, getShort and getByte sinc ethey rely on getLong. The error lies in am.Decimal#getLong, which contains this loop:

   // compute the integer part only.
   int leftOfDecimalPoint = length * 2 - 1 - scale;
   long integer = 0;
   if (leftOfDecimalPoint > 0) {
       int i = 0;
       for (; i < leftOfDecimalPoint / 2; i++) {
           integer = integer * 10 + signum * ((buffer[offset + i] & 0xF0) >>> 4); // high nybble.
           integer = integer * 10 + signum * (buffer[offset + i] & 0x0F);        // low nybble.
       }
    :

If the scale is high, say, 31, the accumulating value "integer" will wrap around here with no warning.

                
> Client's ResultSet#getLong does not range check when converting from a DECIMAL column
> -------------------------------------------------------------------------------------
>
>                 Key: DERBY-5536
>                 URL: https://issues.apache.org/jira/browse/DERBY-5536
>             Project: Derby
>          Issue Type: Bug
>          Components: JDBC, Network Client
>            Reporter: Dag H. Wanvik
>         Attachments: MissingRangeCheck.java
>
>
> Derby's DECIMAL can contain an integer of 31 digits. This can overflow a long. The embedded JDBC driver catches this, but the client does not and can yield a corrupt long, cf enclosed repro.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (DERBY-5536) Client's ResultSet#getLong does not range check when converting from a DECIMAL column

Posted by "Dag H. Wanvik (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DERBY-5536?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Dag H. Wanvik updated DERBY-5536:
---------------------------------

    Attachment: MissingRangeCheck.java
    
> Client's ResultSet#getLong does not range check when converting from a DECIMAL column
> -------------------------------------------------------------------------------------
>
>                 Key: DERBY-5536
>                 URL: https://issues.apache.org/jira/browse/DERBY-5536
>             Project: Derby
>          Issue Type: Bug
>          Components: JDBC, Network Client
>            Reporter: Dag H. Wanvik
>         Attachments: MissingRangeCheck.java
>
>
> Derby's DECIMAL can contain an integer of 31 digits. This can overflow a long. The embedded JDBC driver catches this, but the client does not and can yield a corrupt long, cf enclosed repro.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Resolved] (DERBY-5536) Client's ResultSet#getLong does not range check when converting from a DECIMAL column

Posted by "Dag H. Wanvik (Resolved) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DERBY-5536?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Dag H. Wanvik resolved DERBY-5536.
----------------------------------

          Resolution: Fixed
       Fix Version/s: 10.9.0.0
    Issue & fix info:   (was: Patch Available)
    
> Client's ResultSet#getLong does not range check when converting from a DECIMAL column
> -------------------------------------------------------------------------------------
>
>                 Key: DERBY-5536
>                 URL: https://issues.apache.org/jira/browse/DERBY-5536
>             Project: Derby
>          Issue Type: Bug
>          Components: JDBC, Network Client
>            Reporter: Dag H. Wanvik
>             Fix For: 10.9.0.0
>
>         Attachments: MissingRangeCheck.java, derby-5536-2.diff, derby-5536-2.stat, derby-5536-3.diff, derby-5536-3.stat, derby-5536.diff, derby-5536.stat
>
>
> Derby's DECIMAL can contain an integer of 31 digits. This can overflow a long. The embedded JDBC driver catches this, but the client does not and can yield a corrupt long, cf enclosed repro.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (DERBY-5536) Client's ResultSet#getLong does not range check when converting from a DECIMAL column

Posted by "Knut Anders Hatlen (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-5536?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13180490#comment-13180490 ] 

Knut Anders Hatlen commented on DERBY-5536:
-------------------------------------------

The patch looks good to me.

Might be worthwhile adding a comment saying that the conversion BigDecimal->BigInteger->BigDecimal in Decimal.getLong() is done to strip off the fraction part.

Do the existing tests cover the case where a DECIMAL with non-zero scale and non-zero fraction part is converted to long? The new test cases only test numbers with no fraction part, I think.
                
> Client's ResultSet#getLong does not range check when converting from a DECIMAL column
> -------------------------------------------------------------------------------------
>
>                 Key: DERBY-5536
>                 URL: https://issues.apache.org/jira/browse/DERBY-5536
>             Project: Derby
>          Issue Type: Bug
>          Components: JDBC, Network Client
>            Reporter: Dag H. Wanvik
>         Attachments: MissingRangeCheck.java, derby-5536-2.diff, derby-5536-2.stat, derby-5536.diff, derby-5536.stat
>
>
> Derby's DECIMAL can contain an integer of 31 digits. This can overflow a long. The embedded JDBC driver catches this, but the client does not and can yield a corrupt long, cf enclosed repro.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (DERBY-5536) Client's ResultSet#getLong does not range check when converting from a DECIMAL column

Posted by "Dag H. Wanvik (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DERBY-5536?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Dag H. Wanvik updated DERBY-5536:
---------------------------------

    Attachment: derby-5536-3.stat
                derby-5536-3.diff
    
> Client's ResultSet#getLong does not range check when converting from a DECIMAL column
> -------------------------------------------------------------------------------------
>
>                 Key: DERBY-5536
>                 URL: https://issues.apache.org/jira/browse/DERBY-5536
>             Project: Derby
>          Issue Type: Bug
>          Components: JDBC, Network Client
>            Reporter: Dag H. Wanvik
>         Attachments: MissingRangeCheck.java, derby-5536-2.diff, derby-5536-2.stat, derby-5536-3.diff, derby-5536-3.stat, derby-5536.diff, derby-5536.stat
>
>
> Derby's DECIMAL can contain an integer of 31 digits. This can overflow a long. The embedded JDBC driver catches this, but the client does not and can yield a corrupt long, cf enclosed repro.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (DERBY-5536) Client's ResultSet#getLong does not range check when converting from a DECIMAL column

Posted by "Dag H. Wanvik (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DERBY-5536?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Dag H. Wanvik updated DERBY-5536:
---------------------------------

    Issue & fix info: Patch Available
    
> Client's ResultSet#getLong does not range check when converting from a DECIMAL column
> -------------------------------------------------------------------------------------
>
>                 Key: DERBY-5536
>                 URL: https://issues.apache.org/jira/browse/DERBY-5536
>             Project: Derby
>          Issue Type: Bug
>          Components: JDBC, Network Client
>            Reporter: Dag H. Wanvik
>         Attachments: MissingRangeCheck.java, derby-5536.diff, derby-5536.stat
>
>
> Derby's DECIMAL can contain an integer of 31 digits. This can overflow a long. The embedded JDBC driver catches this, but the client does not and can yield a corrupt long, cf enclosed repro.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (DERBY-5536) Client's ResultSet#getLong does not range check when converting from a DECIMAL column

Posted by "Dag H. Wanvik (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DERBY-5536?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Dag H. Wanvik updated DERBY-5536:
---------------------------------

    Attachment: derby-5536-2.stat
                derby-5536-2.diff

Uploading a revised patch, derby-5536-2. Small test improvement only. Will commit soon, so please review.
                
> Client's ResultSet#getLong does not range check when converting from a DECIMAL column
> -------------------------------------------------------------------------------------
>
>                 Key: DERBY-5536
>                 URL: https://issues.apache.org/jira/browse/DERBY-5536
>             Project: Derby
>          Issue Type: Bug
>          Components: JDBC, Network Client
>            Reporter: Dag H. Wanvik
>         Attachments: MissingRangeCheck.java, derby-5536-2.diff, derby-5536-2.stat, derby-5536.diff, derby-5536.stat
>
>
> Derby's DECIMAL can contain an integer of 31 digits. This can overflow a long. The embedded JDBC driver catches this, but the client does not and can yield a corrupt long, cf enclosed repro.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (DERBY-5536) Client's ResultSet#getLong does not range check when converting from a DECIMAL column

Posted by "Dag H. Wanvik (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DERBY-5536?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Dag H. Wanvik updated DERBY-5536:
---------------------------------

    Attachment:     (was: derby-5536-3.diff)
    
> Client's ResultSet#getLong does not range check when converting from a DECIMAL column
> -------------------------------------------------------------------------------------
>
>                 Key: DERBY-5536
>                 URL: https://issues.apache.org/jira/browse/DERBY-5536
>             Project: Derby
>          Issue Type: Bug
>          Components: JDBC, Network Client
>            Reporter: Dag H. Wanvik
>         Attachments: MissingRangeCheck.java, derby-5536-2.diff, derby-5536-2.stat, derby-5536-3.diff, derby-5536-3.stat, derby-5536.diff, derby-5536.stat
>
>
> Derby's DECIMAL can contain an integer of 31 digits. This can overflow a long. The embedded JDBC driver catches this, but the client does not and can yield a corrupt long, cf enclosed repro.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (DERBY-5536) Client's ResultSet#getLong does not range check when converting from a DECIMAL column

Posted by "Dag H. Wanvik (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-5536?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13183134#comment-13183134 ] 

Dag H. Wanvik commented on DERBY-5536:
--------------------------------------

Committed the followup patch derby-5536-refactor as svn 1229481.

                
> Client's ResultSet#getLong does not range check when converting from a DECIMAL column
> -------------------------------------------------------------------------------------
>
>                 Key: DERBY-5536
>                 URL: https://issues.apache.org/jira/browse/DERBY-5536
>             Project: Derby
>          Issue Type: Bug
>          Components: JDBC, Network Client
>            Reporter: Dag H. Wanvik
>             Fix For: 10.9.0.0
>
>         Attachments: MissingRangeCheck.java, derby-5536-2.diff, derby-5536-2.stat, derby-5536-3.diff, derby-5536-3.stat, derby-5536-refactor.diff, derby-5536.diff, derby-5536.stat
>
>
> Derby's DECIMAL can contain an integer of 31 digits. This can overflow a long. The embedded JDBC driver catches this, but the client does not and can yield a corrupt long, cf enclosed repro.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira