db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Craig Russell (JIRA)" <derby-...@db.apache.org>
Subject [jira] Commented: (DERBY-1516) Inconsistent behavior for getBytes and getSubString for embedded versus network
Date Thu, 10 Aug 2006 18:07:18 GMT
    [ http://issues.apache.org/jira/browse/DERBY-1516?page=comments#action_12427294 ] 
Craig Russell commented on DERBY-1516:

Hi David,

>From my comments 31-Jul-2006:

> I did not update master/DerbyNet/blobclob4BLOB.out canon because this canon seems out
of date wrt the code. If this is incorrect, please let me know. 

I recommend checking in the new DerbyNet canon for the blobclob4BLOB output. The differences
in the DerbyNet canon are expected due to the additional tests that I wrote. The "unexpected
exception" in DerbyNet is expected in this scenario due to the blobTest6 stimulating the DerbyNet
driver to throw an exception that is not a SQLException. Once the driver is fixed to properly
handle boundary errors (length < 0; pos > lob.length + 1; etc.), this unexpected exception
will go away.

There is a general issue in many of the tests that I looked at, that result sets, statements,
and connections are not closed in a finally block but are in the main line code. So "unexpected
exceptions" in general will cause subsequent tests to behave unpredictably. But it's not specific
to this issue.

> 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


View raw message