SQLite

Check-in [54c537eead]
Login

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

Overview
Comment:The BtCursor.info fields are only valid if info.nSize!=0.
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | cell-overwrite-prototype
Files: files | file ages | folders
SHA3-256: 54c537eead5b08104cfaf0d5b1e2706e53d6f74be2ca02e06229024fd889fc94
User & Date: drh 2018-05-03 14:07:18.080
Context
2018-05-03
16:56
Fix various error handling conditions on the cell overwrite optimization. Fix a test case so that it works with the new optimization. (check-in: f89b54f414 user: drh tags: cell-overwrite-prototype)
14:07
The BtCursor.info fields are only valid if info.nSize!=0. (check-in: 54c537eead user: drh tags: cell-overwrite-prototype)
13:56
Add more corruption checking to the cell overwrite logic. (check-in: 58d14afe1e user: drh tags: cell-overwrite-prototype)
Changes
Unified Diff Ignore Whitespace Patch
Changes to src/btree.c.
8331
8332
8333
8334
8335
8336
8337
8338
8339
8340
8341
8342
8343
8344
8345

    /* If the cursor is currently on the last row and we are appending a
    ** new row onto the end, set the "loc" to avoid an unnecessary
    ** btreeMoveto() call */
    if( (pCur->curFlags&BTCF_ValidNKey)!=0 && pX->nKey==pCur->info.nKey ){
      /* The current is currently pointing to the entry that is to be
      ** overwritten */
      if( pCur->info.nPayload==pX->nData+pX->nZero ){
        return btreeOverwriteCell(pCur, pX);
      }
      loc = 0;
    }else if( loc==0 ){
      rc = sqlite3BtreeMovetoUnpacked(pCur, 0, pX->nKey, flags!=0, &loc);
      if( rc ) return rc;
    }







|







8331
8332
8333
8334
8335
8336
8337
8338
8339
8340
8341
8342
8343
8344
8345

    /* If the cursor is currently on the last row and we are appending a
    ** new row onto the end, set the "loc" to avoid an unnecessary
    ** btreeMoveto() call */
    if( (pCur->curFlags&BTCF_ValidNKey)!=0 && pX->nKey==pCur->info.nKey ){
      /* The current is currently pointing to the entry that is to be
      ** overwritten */
      if( pCur->info.nSize!=0 && pCur->info.nPayload==pX->nData+pX->nZero ){
        return btreeOverwriteCell(pCur, pX);
      }
      loc = 0;
    }else if( loc==0 ){
      rc = sqlite3BtreeMovetoUnpacked(pCur, 0, pX->nKey, flags!=0, &loc);
      if( rc ) return rc;
    }