/ Check-in [59ad912c]
Login
SQLite training in Houston TX on 2019-11-05 (details)
Part of the 2019 Tcl Conference

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

Overview
Comment:Change integrity_check to analyze the cells of a page in reverse order, as this will tend to insert the cells into the analysis heap in increasing order by address, which is the most efficient way to load a min-heap.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 59ad912c4c1f858e04d27b1b8f25581a5f6e5daf
User & Date: drh 2015-07-01 01:31:14
Context
2015-07-01
04:08
Fix some harmless compiler warnings. check-in: 307195c8 user: drh tags: trunk
01:31
Change integrity_check to analyze the cells of a page in reverse order, as this will tend to insert the cells into the analysis heap in increasing order by address, which is the most efficient way to load a min-heap. check-in: 59ad912c user: drh tags: trunk
2015-06-30
17:28
Make use of the _byteswap_ushort() and _byteswap_ulong() compiler intrinsics for MSVC, when available. check-in: fe144dd7 user: mistachkin tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/btree.c.

  9100   9100       ** number of cells on the page. */
  9101   9101       nCell = get2byte(&data[hdr+3]);
  9102   9102       /* EVIDENCE-OF: R-23882-45353 The cell pointer array of a b-tree page
  9103   9103       ** immediately follows the b-tree page header. */
  9104   9104       cellStart = hdr + 12 - 4*pPage->leaf;
  9105   9105       /* EVIDENCE-OF: R-02776-14802 The cell pointer array consists of K 2-byte
  9106   9106       ** integer offsets to the cell contents. */
  9107         -    for(i=0; i<nCell; i++){
         9107  +    for(i=nCell-1; i>=0; i--){
  9108   9108         int pc = get2byteAligned(&data[cellStart+i*2]);
  9109   9109         u32 size = 65536;
  9110   9110         if( pc<=usableSize-4 ){
  9111   9111           size = pPage->xCellSize(pPage, &data[pc]);
  9112   9112         }
  9113   9113         if( (int)(pc+size-1)>=usableSize ){
  9114   9114           pCheck->zPfx = 0;