db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Knut Anders Hatlen (JIRA)" <j...@apache.org>
Subject [jira] Commented: (DERBY-4738) correct error prompt for nonpositive length in Blob.setBytesX()
Date Thu, 08 Jul 2010 15:04:50 GMT

    [ https://issues.apache.org/jira/browse/DERBY-4738?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12886340#action_12886340

Knut Anders Hatlen commented on DERBY-4738:

Hi Yun. Thanks for the patch. The fix looks correct to me. Did the regression tests run cleanly
with patch?

Perhaps it would also be a good idea to stop setting length to 0 in the beginning of the method,
so that the compiler could tell us if someone tries to use the variable before it's initialized.

> correct error prompt for nonpositive length in Blob.setBytesX()
> ---------------------------------------------------------------
>                 Key: DERBY-4738
>                 URL: https://issues.apache.org/jira/browse/DERBY-4738
>             Project: Derby
>          Issue Type: Bug
>          Components: JDBC
>            Reporter: Yun Lee
>            Assignee: Yun Lee
>         Attachments: derby-4738.patch, derby-4738.stat
> In Blob.setBytesX(), when a nonpositive length value (len) is passed in, a SqlException
with ClientMessageId of SQLState.BLOB_NONPOSITIVE_LENGTH is created, however, it uses length,
a wrong length value, which is still zero here.
> if ( len < 0 ) {
>             throw new SqlException(agent_.logWriter_,
>                 new ClientMessageId(SQLState.BLOB_NONPOSITIVE_LENGTH),
>                 new Integer(length));
>         }

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

View raw message