Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Overview
Comment: | Add fault-injection and other tests (and fixes) to improve coverage of vdbesort.c. |
---|---|
Downloads: | Tarball | ZIP archive |
Timelines: | family | ancestors | descendants | both | experimental |
Files: | files | file ages | folders |
SHA1: |
0e6defa6aa540b413ea3f4bb6dcd8636 |
User & Date: | dan 2011-08-08 16:44:25.654 |
Context
2011-08-08
| ||
19:26 | Remove redundant parameter from vdbeSorterInitMerge() in vdbesort.c. (check-in: eec8c0df07 user: dan tags: experimental) | |
16:44 | Add fault-injection and other tests (and fixes) to improve coverage of vdbesort.c. (check-in: 0e6defa6aa user: dan tags: experimental) | |
2011-08-06
| ||
15:09 | Fix a problem with building large indexes introduced by the previous commit. (check-in: 038ec9ea92 user: dan tags: experimental) | |
Changes
Changes to src/vdbesort.c.
︙ | |||
392 393 394 395 396 397 398 | 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 | - - + + + + + - + | /* Write the size of the record in bytes to the output file */ (void)sqlite3BtreeKeySize(pCsr->pCursor, &nKey); rc = vdbeSorterWriteVarint(pSorter->pTemp1, nKey, &iWriteOff); /* Make sure the aMalloc[] buffer is large enough for the record */ if( rc==SQLITE_OK && nKey>nMalloc ){ aMalloc = sqlite3DbReallocOrFree(db, aMalloc, nKey); |
︙ | |||
644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 | 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 | + + + + + + + | ** Copy the current sorter key into the memory cell pOut. */ int sqlite3VdbeSorterRowkey(sqlite3 *db, VdbeCursor *pCsr, Mem *pOut){ VdbeSorter *pSorter = pCsr->pSorter; VdbeSorterIter *pIter; pIter = &pSorter->aIter[ pSorter->aTree[1] ]; /* Coverage testing note: As things are currently, this call will always ** succeed. This is because the memory cell passed by the VDBE layer ** happens to be the same one as was used to assemble the keys before they ** were passed to the sorter - meaning it is always large enough for the ** largest key. But this could change very easily, so we leave the call ** to sqlite3VdbeMemGrow() in. */ if( sqlite3VdbeMemGrow(pOut, pIter->nKey, 0) ){ return SQLITE_NOMEM; } pOut->n = pIter->nKey; MemSetTypeFlag(pOut, MEM_Blob); memcpy(pOut->z, pIter->aKey, pIter->nKey); return SQLITE_OK; } |
Changes to test/index4.test.
︙ | |||
62 63 64 65 66 67 68 69 70 | 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 | + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + | do_execsql_test 1.5 { PRAGMA integrity_check } {ok} sqlite3_soft_heap_limit $soft_limit } do_execsql_test 1.6 { BEGIN; DROP TABLE t1; CREATE TABLE t1(x); INSERT INTO t1 VALUES('a'); INSERT INTO t1 VALUES('b'); INSERT INTO t1 VALUES('c'); INSERT INTO t1 VALUES('d'); INSERT INTO t1 VALUES('e'); INSERT INTO t1 VALUES('f'); INSERT INTO t1 VALUES('g'); INSERT INTO t1 VALUES(NULL); INSERT INTO t1 SELECT randomblob(1202) FROM t1; -- 16 INSERT INTO t1 SELECT randomblob(2202) FROM t1; -- 32 INSERT INTO t1 SELECT randomblob(3202) FROM t1; -- 64 INSERT INTO t1 SELECT randomblob(4202) FROM t1; -- 128 INSERT INTO t1 SELECT randomblob(5202) FROM t1; -- 256 COMMIT; CREATE INDEX i1 ON t1(x); PRAGMA integrity_check } {ok} do_execsql_test 1.7 { BEGIN; DROP TABLE t1; CREATE TABLE t1(x); INSERT INTO t1 VALUES('a'); COMMIT; CREATE INDEX i1 ON t1(x); PRAGMA integrity_check } {ok} do_execsql_test 1.8 { BEGIN; DROP TABLE t1; CREATE TABLE t1(x); COMMIT; CREATE INDEX i1 ON t1(x); PRAGMA integrity_check } {ok} finish_test |
Added test/indexfault.test.