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-3112) AllocPages have wrong minimumRecordSize
Date Mon, 08 Oct 2007 14:40:50 GMT

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

Knut Anders Hatlen commented on DERBY-3112:

It's probably better to have a method in StoredPage which parses the args[] array and override
the method in AllocPage. With the d3112-1 patch, minimumRecordSize would first be initialized
with an incorrect value and later updated with the correct value. It's better to get the right
value from the beginning.

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

View raw message