db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Kathey Marsden (JIRA)" <derby-...@db.apache.org>
Subject [jira] Commented: (DERBY-1516) Inconsistent behavior for getBytes and getSubString for embedded versus network
Date Tue, 01 Aug 2006 12:53:14 GMT
    [ http://issues.apache.org/jira/browse/DERBY-1516?page=comments#action_12424850 ] 
            
Kathey Marsden commented on DERBY-1516:
---------------------------------------

The new positive cases sound fine to me. 

 If I understand all you wrote, you are saying that getSubstring(pos,0) where pos > the
length of the clob  should throw an exception for now while spec clarification is underway.
 Is that correct?  If so,  that sounds good to me as it is always *much* easier to change
an exception case to work in the future if need be.  What we want to avoid is a situation
where something works and then we have to throw an exception later  to be compliant.  Can
you add negative cases for this to make sure we are throwing an appropriate exception?  Then
I think all the needed zero length cases will be covered.


Thanks

Kathey



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

        

Mime
View raw message