Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Overview
Comment: | Fix test cases. Avoid unnecessary tests for MemPage.nFree less than zero. |
---|---|
Downloads: | Tarball | ZIP archive |
Timelines: | family | ancestors | descendants | both | deferred-free-space |
Files: | files | file ages | folders |
SHA3-256: |
480a5090befdc29eaeb6f0b22831c980 |
User & Date: | drh 2019-02-11 17:22:30.984 |
Context
2019-02-11
| ||
19:27 | Improvements to comments. No changes to code. (check-in: 16eb0fc8f8 user: drh tags: deferred-free-space) | |
17:22 | Fix test cases. Avoid unnecessary tests for MemPage.nFree less than zero. (check-in: 480a5090be user: drh tags: deferred-free-space) | |
12:51 | Updates to a comment to keep it in alignment to the changes on this branch. (check-in: 7499f74351 user: drh tags: deferred-free-space) | |
Changes
Changes to src/btree.c.
︙ | |||
7221 7222 7223 7224 7225 7226 7227 | 7221 7222 7223 7224 7225 7226 7227 7228 7229 7230 7231 7232 7233 7234 7235 7236 | - + - - - - + - - - - | Pgno pgnoNew; /* Page number of pNew */ assert( sqlite3_mutex_held(pPage->pBt->mutex) ); assert( sqlite3PagerIswriteable(pParent->pDbPage) ); assert( pPage->nOverflow==1 ); if( pPage->nCell==0 ) return SQLITE_CORRUPT_BKPT; /* dbfuzz001.test */ |
︙ | |||
7507 7508 7509 7510 7511 7512 7513 | 7500 7501 7502 7503 7504 7505 7506 7507 7508 7509 7510 7511 7512 7513 7514 | - + - - - | */ assert( pParent->nOverflow==0 || pParent->nOverflow==1 ); assert( pParent->nOverflow==0 || pParent->aiOvfl[0]==iParentIdx ); if( !aOvflSpace ){ return SQLITE_NOMEM_BKPT; } |
︙ | |||
8332 8333 8334 8335 8336 8337 8338 8339 8340 8341 8342 8343 8344 8345 | 8322 8323 8324 8325 8326 8327 8328 8329 8330 8331 8332 8333 8334 8335 8336 8337 8338 | + + + | }else if( pPage->nOverflow==0 && pPage->nFree<=nMin ){ break; }else{ MemPage * const pParent = pCur->apPage[iPage-1]; int const iIdx = pCur->aiIdx[iPage-1]; rc = sqlite3PagerWrite(pParent->pDbPage); if( rc==SQLITE_OK && pParent->nFree<0 ){ rc = btreeComputeFreeSpace(pParent); } if( rc==SQLITE_OK ){ #ifndef SQLITE_OMIT_QUICKBALANCE if( pPage->intKeyLeaf && pPage->nOverflow==1 && pPage->aiOvfl[0]==pPage->nCell && pParent->pgno!=1 && pParent->nCell==iIdx |
︙ |
Changes to test/corrupt2.test.
︙ | |||
91 92 93 94 95 96 97 | 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 | + + - + - - - - + + - + - - - - + + | set f [open corrupt.db RDWR] fconfigure $f -encoding binary seek $f 101 start puts -nonewline $f "\xFF\xFF" close $f sqlite3 db2 corrupt.db # Note: This test is no longer meaningful due to the deferred computation # of MemPage.nFree |
︙ |
Changes to test/corruptD.test.
︙ | |||
107 108 109 110 111 112 113 | 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 | - - + + + | #------------------------------------------------------------------------- # The following tests, corruptD-1.1.*, focus on the page header field # containing the offset of the first free block in a page. # do_test corruptD-1.1.1 { incr_change_counter hexio_write test.db [expr 1024+1] FFFF |
︙ |
Changes to test/corruptK.test.
︙ | |||
64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 | 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 | + + + + + + | seek $fd 30 puts -nonewline $fd "\x18" close $fd } {} do_execsql_test 1.3 { INSERT INTO t1 VALUES(randomblob(20)); } # This test no longer functions due to the deferred computation of # MemPage.nFree. # if 0 { do_catchsql_test 1.4 { INSERT INTO t1 VALUES(randomblob(90)); } {1 {database disk image is malformed}} } #------------------------------------------------------------------------- reset_db do_execsql_test 2.1 { PRAGMA page_size=1024; PRAGMA auto_vacuum=0; CREATE TABLE t1(x); |
︙ |