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 "Yun Lee (JIRA)" <ji...@apache.org> on 2009/03/29 07:24:51 UTC

[jira] Commented: (DERBY-3941) Unsafe use of DataInput.skipBytes() in StoredPage and StoredFieldHeader

    [ https://issues.apache.org/jira/browse/DERBY-3941?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12693521#action_12693521 ] 

Yun Lee commented on DERBY-3941:
--------------------------------

Hi, Knut. I'm interested in this issue, and  wonder what's your favorite way to correct this problem. 

1.) to throw a IOException.
2.) retry to skip  for some define times, if failed throw a IOExcetion.

Besides, there are still many other invocation on skipBytes(), i.e.*ImageReader, BlockDataInputStream, an so on. Should they be correct altogether for this issue? If so, is there a wrapped function to resolve this problem uniformly.

Thanks!

> Unsafe use of DataInput.skipBytes() in StoredPage and StoredFieldHeader
> -----------------------------------------------------------------------
>
>                 Key: DERBY-3941
>                 URL: https://issues.apache.org/jira/browse/DERBY-3941
>             Project: Derby
>          Issue Type: Bug
>          Components: Newcomer, Store
>            Reporter: Knut Anders Hatlen
>            Priority: Minor
>
> Some methods in StoredFileHeader and StoredPage call java.io.DataInput.skipBytes(int) with the assumption that it always skips the requested number of bytes. According to the javadoc for skipBytes, it may skip fewer bytes than requested, possibly 0, even if the end of the stream hasn't been reached.
> The problem exists in these methods:
>   StoredFieldHeader.readFieldDataLength()
>   StoredPage.readRecordFromStream()
>   StoredPage.skipField()
>   StoredPage.readOneColumnFromPage()
>   StoredPage.readRecordFromArray()
> We should change the code so that it works correctly even if skipBytes() were to skip fewer bytes than requested.

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