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 "Knut Anders Hatlen (JIRA)" <ji...@apache.org> on 2008/04/08 12:59:25 UTC

[jira] Closed: (DERBY-3112) AllocPages have wrong minimumRecordSize

     [ https://issues.apache.org/jira/browse/DERBY-3112?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Knut Anders Hatlen closed DERBY-3112.
-------------------------------------

    Resolution: Duplicate

I had forgotten that I had logged this issue, so I logged it again and fixed it as DERBY-3589. Closing this issue as a duplicate.

> AllocPages have wrong minimumRecordSize
> ---------------------------------------
>
>                 Key: DERBY-3112
>                 URL: https://issues.apache.org/jira/browse/DERBY-3112
>             Project: Derby
>          Issue Type: Bug
>          Components: Store
>    Affects Versions: 10.4.0.0
>            Reporter: Knut Anders Hatlen
>            Priority: Minor
>         Attachments: d3112-1.diff
>
>
> AllocPage.createPage() contains this code at its beginning:
> 		super.createPage(newIdentity, args);
> 		// args[0] is the format id
> 		// args[1] is whether to sync the page to disk or not
> 		// args[2] is the pagesize (used by StoredPage)
> 		// args[3] is the spareSize (used by StoredPage)
> 		// args[4] is the number of bytes to reserve for container header
> 		// args[5] is the minimumRecordSize
> 		// NOTE: the arg list here must match the one in FileContainer
> 		int pageSize = args[2];
> 		int minimumRecordSize = args[5];
> 		borrowedSpace = args[4];
> The variable minimumRecordSize is local and unused, so setting it has no effect. The local variable hides a field with the same name inherited from StoredPage. That field is initialized to args[4] when super.createPage() is called. According to the comment in AllocPage, args[4] is the number of bytes to reserve for the container header (aka borrowedSpace), not the minimum record size. (args[4] is however the minimum record size if the page is a plain StoredPage, that's why super.createPage() will use that value.) I therefore believe that this code intended to update StoredPage.minimumRecordSize, not a local, unused variable.
> I don't know if this can lead to incorrect behaviour, but it doesn't look right.

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