Uploaded image for project: 'Derby'
  1. Derby
  2. DERBY-3589

AllocPage.createPage() doesn't initialize minimumRecordSize correctly

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 10.3.1.4, 10.4.1.3
    • Fix Version/s: 10.3.3.1, 10.4.1.3, 10.5.1.1
    • Component/s: Store
    • Labels:
      None

      Description

      AllocPage.createPage() will initialize minimumRecordSize to the same
      value as borrowedSpace. See this code taken from AllocPage.java:

      -------------------
      protected void createPage(PageKey newIdentity, int[] args)
      throws StandardException
      {

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

      Here it correctly takes args[5] and puts into the local variable
      minimumRecordSize. However, that variable hides a field with the same
      name, and that field is set to args[4] in the call to
      super.createPage() at the first line in the method. The local variable
      is never used.

        Attachments

        1. d3589-1a.diff
          15 kB
          Knut Anders Hatlen
        2. d3589-1a.stat
          0.4 kB
          Knut Anders Hatlen

          Issue Links

            Activity

              People

              • Assignee:
                knutanders Knut Anders Hatlen
                Reporter:
                knutanders Knut Anders Hatlen
              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: