/ Check-in [b15abf98]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Comment changes in btree.c. No changes to code. (CVS 1988)
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: b15abf984fa06ae968d92fa9533dab20dcebd323
User & Date: drh 2004-09-27 13:19:52
Context
2004-09-30
13:43
Allow functions to be created when there are outstanding VMs. (Ticket #926) Fix problems with sqlite3_errcode(). Add tests for sqlite3_errcode(). (CVS 1989) check-in: d0f1dc58 user: drh tags: trunk
2004-09-27
13:19
Comment changes in btree.c. No changes to code. (CVS 1988) check-in: b15abf98 user: drh tags: trunk
12:20
Bug fix in btree.c in cases where usableSize!=pageSize. Ticket #925. (CVS 1987) check-in: cb3e1237 user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/btree.c.

     5      5   ** a legal notice, here is a blessing:
     6      6   **
     7      7   **    May you do good and not evil.
     8      8   **    May you find forgiveness for yourself and forgive others.
     9      9   **    May you share freely, never taking more than you give.
    10     10   **
    11     11   *************************************************************************
    12         -** $Id: btree.c,v 1.190 2004/09/27 12:20:52 drh Exp $
           12  +** $Id: btree.c,v 1.191 2004/09/27 13:19:52 drh Exp $
    13     13   **
    14     14   ** This file implements a external (disk-based) database using BTrees.
    15     15   ** For a detailed discussion of BTrees, refer to
    16     16   **
    17     17   **     Donald E. Knuth, THE ART OF COMPUTER PROGRAMMING, Volume 3:
    18     18   **     "Sorting And Searching", pages 473-480. Addison-Wesley
    19     19   **     Publishing Company, Reading, Massachusetts.
................................................................................
   123    123   **      3       2      number of cells on this page
   124    124   **      5       2      first byte of the cell content area
   125    125   **      7       1      number of fragmented free bytes
   126    126   **      8       4      Right child (the Ptr(N+1) value).  Omitted on leaves.
   127    127   **
   128    128   ** The flags define the format of this btree page.  The leaf flag means that
   129    129   ** this page has no children.  The zerodata flag means that this page carries
   130         -** only keys and no data.  The intkey flag means that the key is a single
   131         -** variable length integer at the beginning of the payload.
          130  +** only keys and no data.  The intkey flag means that the key is a integer
          131  +** which is stored in the key size entry of the cell header rather than in
          132  +** the payload area.
   132    133   **
   133    134   ** The cell pointer array begins on the first byte after the page header.
   134    135   ** The cell pointer array contains zero or more 2-byte numbers which are
   135    136   ** offsets from the beginning of the page to the cell content in the cell
   136    137   ** content area.  The cell pointers occur in sorted order.  The system strives
   137    138   ** to keep free space after the last cell pointer so that new cells can
   138         -** be easily added without have to defragment the page.
          139  +** be easily added without having to defragment the page.
   139    140   **
   140    141   ** Cell content is stored at the very end of the page and grows toward the
   141    142   ** beginning of the page.
   142    143   **
   143    144   ** Unused space within the cell content area is collected into a linked list of
   144    145   ** freeblocks.  Each freeblock is at least 4 bytes in size.  The byte offset
   145    146   ** to the first freeblock is given in the header.  Freeblocks occur in