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 "David Van Couvering (JIRA)" <de...@db.apache.org> on 2006/08/11 18:51:14 UTC

[jira] Resolved: (DERBY-1516) Inconsistent behavior for getBytes and getSubString for embedded versus network

     [ http://issues.apache.org/jira/browse/DERBY-1516?page=all ]

David Van Couvering resolved DERBY-1516.
----------------------------------------

    Resolution: Fixed
    Derby Info:   (was: [Patch Available])

Sending        java/client/org/apache/derby/client/am/Blob.java
Sending        java/client/org/apache/derby/client/am/Clob.java
Sending        java/engine/org/apache/derby/impl/jdbc/EmbedBlob.java
Sending        java/engine/org/apache/derby/impl/jdbc/EmbedClob.java
Sending        java/engine/org/apache/derby/loc/messages_en.properties
Sending        java/testing/org/apache/derbyTesting/functionTests/master/DerbyNet/blobclob4BLOB.out
Sending        java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/blobclob4BLOB.out
Sending        java/testing/org/apache/derbyTesting/functionTests/master/blobclob4BLOB.out
Sending        java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/blobclob4BLOB.java
Transmitting file data .........
Committed revision 430825.


> Inconsistent behavior for getBytes and getSubString for embedded versus network
> -------------------------------------------------------------------------------
>
>                 Key: DERBY-1516
>                 URL: http://issues.apache.org/jira/browse/DERBY-1516
>             Project: Derby
>          Issue Type: Bug
>          Components: JDBC
>            Reporter: Craig Russell
>         Assigned To: Craig Russell
>            Priority: Minor
>         Attachments: DERBY-1516.patch, DERBY-1516.patch, DERBY-1516.patch, DERBY-1516.patch, DERBY-1516.patch, DERBY-1516.patch, DERBY-1516.patch
>
>
> org.apache.derby.client.am.Clob.getSubString(pos, length) and org.apache.derby.client.am.Blob.getBytes(pos, length) check the length for less than zero. 
>             if ((pos <= 0) || (length < 0)) {
>                 throw new SqlException(agent_.logWriter_, "Invalid position " + pos + " or length " + length);
> But org.apache.derby.impl.jdbc.EmbedClob(pos, length) and org.apache.derby.impl.jdbc.EmbedBlob(pos, length) check the length for less than or equal to zero.
>        if (length <= 0)
>             throw Util.generateCsSQLException(
>                 SQLState.BLOB_NONPOSITIVE_LENGTH, new Integer(length));
> The specification does not disallow length of zero, so zero length should be allowed. I believe that the implementation in org.apache.derby.client.am is correct, and the implementation in org.apache.derby.impl.jdbc is incorrect. 

-- 
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