Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Changes In Branch permutations-fix Excluding Merge-Ins
This is equivalent to a diff from 33e62747 to 89b0ee33
2016-04-29
| ||
11:33 | Modify the permutations.test script so as to set any permutation specific configuration values before running each individual test script. Fix a mostly harmless buffer overread in the sessions module. (check-in: 4cbd5024 user: dan tags: trunk) | |
10:13 | Fix an almost entirely harmless buffer overread in the sessions module. (Closed-Leaf check-in: 89b0ee33 user: dan tags: permutations-fix) | |
2016-04-28
| ||
18:53 | Rearrange some code in the RowSet logic for clarity of presentation, while adding an /*OPTIMIZATION-IF-TRUE*/ comment. It should operate identically. (check-in: 5748e643 user: drh tags: trunk) | |
14:59 | Merge latest changes from trunk with this branch. (check-in: 45467ee4 user: dan tags: permutations-fix) | |
14:15 | Use comments to mark several branches as optimizations. No changes to code. (check-in: 33e62747 user: drh tags: trunk) | |
03:52 | Remove an unnecessary conditional from the sqlite3DecOrHexToI64() routine. (check-in: fcf85bfe user: drh tags: trunk) | |
Changes to ext/session/sessionfault.test.
︙ | |||
13 14 15 16 17 18 19 20 21 22 23 24 25 26 | 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 | + | # if {![info exists testdir]} { set testdir [file join [file dirname [info script]] .. .. test] } source [file join [file dirname [info script]] session_common.tcl] source $testdir/tester.tcl ifcapable !session {finish_test; return} set testprefix sessionfault forcedelete test.db2 sqlite3 db2 test.db2 do_common_sql { CREATE TABLE t1(a, b, c, PRIMARY KEY(a, b)); |
︙ |
Changes to ext/session/sessionfault2.test.
︙ | |||
13 14 15 16 17 18 19 20 21 22 23 24 25 26 | 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 | + | # if {![info exists testdir]} { set testdir [file join [file dirname [info script]] .. .. test] } source [file join [file dirname [info script]] session_common.tcl] source $testdir/tester.tcl ifcapable !session {finish_test; return} set testprefix sessionfault2 do_execsql_test 1.0.0 { CREATE TABLE t1(a PRIMARY KEY, b UNIQUE); INSERT INTO t1 VALUES(1, 1); INSERT INTO t1 VALUES(2, 2); INSERT INTO t1 VALUES(3, 3); |
︙ |
Changes to ext/session/sqlite3session.c.
︙ | |||
588 589 590 591 592 593 594 | 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 | + - - + + - - - - - + + + + + + + + + | u8 *aRight /* Change record */ ){ u8 *a1 = aLeft; /* Cursor to iterate through aLeft */ u8 *a2 = aRight; /* Cursor to iterate through aRight */ int iCol; /* Used to iterate through table columns */ for(iCol=0; iCol<pTab->nCol; iCol++){ if( pTab->abPK[iCol] ){ |
︙ |
Changes to src/test1.c.
︙ | |||
5209 5210 5211 5212 5213 5214 5215 | 5209 5210 5211 5212 5213 5214 5215 5216 5217 5218 5219 5220 5221 5222 5223 5224 5225 5226 5227 5228 5229 5230 5231 5232 5233 5234 5235 | - + + + - - + + | } nVfs = i; return TCL_OK; } /* ** tclcmd: vfs_reregister_all ** |
︙ |
Changes to src/test6.c.
︙ | |||
697 698 699 700 701 702 703 704 705 706 707 708 709 710 | 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 | + + + + | sqlite3_vfs *pVfs = (sqlite3_vfs *)pCfVfs->pAppData; return pVfs->xSleep(pVfs, nMicro); } static int cfCurrentTime(sqlite3_vfs *pCfVfs, double *pTimeOut){ sqlite3_vfs *pVfs = (sqlite3_vfs *)pCfVfs->pAppData; return pVfs->xCurrentTime(pVfs, pTimeOut); } static int cfGetLastError(sqlite3_vfs *pCfVfs, int n, char *z){ sqlite3_vfs *pVfs = (sqlite3_vfs *)pCfVfs->pAppData; return pVfs->xGetLastError(pVfs, n, z); } static int processDevSymArgs( Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[], int *piDeviceChar, int *piSectorSize |
︙ | |||
823 824 825 826 827 828 829 | 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 | - + | cfDlOpen, /* xDlOpen */ cfDlError, /* xDlError */ cfDlSym, /* xDlSym */ cfDlClose, /* xDlClose */ cfRandomness, /* xRandomness */ cfSleep, /* xSleep */ cfCurrentTime, /* xCurrentTime */ |
︙ | |||
936 937 938 939 940 941 942 943 944 945 946 947 948 949 | 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 | + + + + + + + + + + + + + + + + + + + + + | if( processDevSymArgs(interp, objc-1, &objv[1], &iDc, &iSectorSize) ){ return TCL_ERROR; } devsym_register(iDc, iSectorSize); return TCL_OK; } /* ** tclcmd: unregister_devsim */ static int dsUnregisterObjCmd( void * clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[] ){ void devsym_unregister(void); if( objc!=1 ){ Tcl_WrongNumArgs(interp, 1, objv, ""); return TCL_ERROR; } devsym_unregister(); return TCL_OK; } /* ** tclcmd: register_jt_vfs ?-default? PARENT-VFS */ static int jtObjCmd( void * clientData, |
︙ | |||
1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 | 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 | + | ** This procedure registers the TCL procedures defined in this file. */ int Sqlitetest6_Init(Tcl_Interp *interp){ #ifndef SQLITE_OMIT_DISKIO Tcl_CreateObjCommand(interp, "sqlite3_crash_enable", crashEnableCmd, 0, 0); Tcl_CreateObjCommand(interp, "sqlite3_crashparams", crashParamsObjCmd, 0, 0); Tcl_CreateObjCommand(interp, "sqlite3_simulate_device", devSymObjCmd, 0, 0); Tcl_CreateObjCommand(interp, "unregister_devsim", dsUnregisterObjCmd, 0, 0); Tcl_CreateObjCommand(interp, "register_jt_vfs", jtObjCmd, 0, 0); Tcl_CreateObjCommand(interp, "unregister_jt_vfs", jtUnregisterObjCmd, 0, 0); #endif return TCL_OK; } #endif /* SQLITE_TEST */ |
Changes to src/test_devsym.c.
︙ | |||
391 392 393 394 395 396 397 398 399 | 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 | + + + + + + + | } if( iSectorSize>=0 ){ g.iSectorSize = iSectorSize; }else{ g.iSectorSize = 512; } } void devsym_unregister(){ sqlite3_vfs_unregister(&devsym_vfs); g.pVfs = 0; g.iDeviceChar = 0; g.iSectorSize = 0; } #endif |
Changes to src/test_journal.c.
︙ | |||
156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 | 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 | + - + | static void jtDlError(sqlite3_vfs*, int nByte, char *zErrMsg); static void (*jtDlSym(sqlite3_vfs*,void*, const char *zSymbol))(void); static void jtDlClose(sqlite3_vfs*, void*); static int jtRandomness(sqlite3_vfs*, int nByte, char *zOut); static int jtSleep(sqlite3_vfs*, int microseconds); static int jtCurrentTime(sqlite3_vfs*, double*); static int jtCurrentTimeInt64(sqlite3_vfs*, sqlite3_int64*); static int jtGetLastError(sqlite3_vfs*, int, char*); static sqlite3_vfs jt_vfs = { 2, /* iVersion */ sizeof(jt_file), /* szOsFile */ JT_MAX_PATHNAME, /* mxPathname */ 0, /* pNext */ JT_VFS_NAME, /* zName */ 0, /* pAppData */ jtOpen, /* xOpen */ jtDelete, /* xDelete */ jtAccess, /* xAccess */ jtFullPathname, /* xFullPathname */ jtDlOpen, /* xDlOpen */ jtDlError, /* xDlError */ jtDlSym, /* xDlSym */ jtDlClose, /* xDlClose */ jtRandomness, /* xRandomness */ jtSleep, /* xSleep */ jtCurrentTime, /* xCurrentTime */ |
︙ | |||
281 282 283 284 285 286 287 | 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 | - + + - + - + | ** following properties: ** ** a) SQLITE_OPEN_MAIN_DB was specified when the file was opened. ** ** b) The file-name specified when the file was opened matches ** all but the final 8 characters of the journal file name. ** |
︙ | |||
513 514 515 516 517 518 519 | 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 | - + | int iAmt, sqlite_int64 iOfst ){ int rc; jt_file *p = (jt_file *)pFile; if( p->flags&SQLITE_OPEN_MAIN_JOURNAL ){ if( iOfst==0 ){ |
︙ | |||
558 559 560 561 562 563 564 | 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 | - + - + | assert( pgno<=p->nPage || p->nSync>0 ); assert( pgno>p->nPage || sqlite3BitvecTest(p->pWritable, pgno) ); } } rc = sqlite3OsWrite(p->pReal, zBuf, iAmt, iOfst); if( (p->flags&SQLITE_OPEN_MAIN_JOURNAL) && iAmt==12 ){ |
︙ | |||
600 601 602 603 604 605 606 | 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 | - + - - + | jt_file *pMain; /* The associated database file */ /* The journal file is being synced. At this point, we inspect the ** contents of the file up to this point and set each bit in the ** jt_file.pWritable bitvec of the main database file associated with ** this journal file. */ |
︙ | |||
726 727 728 729 730 731 732 | 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 | - + | ** ensure the file-system modifications are synced to disk before ** returning. */ static int jtDelete(sqlite3_vfs *pVfs, const char *zPath, int dirSync){ int nPath = (int)strlen(zPath); if( nPath>8 && 0==strcmp("-journal", &zPath[nPath-8]) ){ /* Deleting a journal file. The end of a transaction. */ |
︙ | |||
820 821 822 823 824 825 826 827 828 829 830 831 832 833 | 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 | + + + + | } /* ** Return the current time as a Julian Day number in *pTimeOut. */ static int jtCurrentTimeInt64(sqlite3_vfs *pVfs, sqlite3_int64 *pTimeOut){ return g.pVfs->xCurrentTimeInt64(g.pVfs, pTimeOut); } static int jtGetLastError(sqlite3_vfs *pVfs, int n, char *z){ return g.pVfs->xGetLastError(g.pVfs, n, z); } /************************************************************************** ** Start of public API. */ /* ** Configure the jt VFS as a wrapper around the VFS named by parameter |
︙ |
Changes to src/test_syscall.c.
︙ | |||
718 719 720 721 722 723 724 725 726 727 728 729 | 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 | + + + + + - - - + + + + | { "list", test_syscall_list }, { "defaultvfs", test_syscall_defaultvfs }, { "pagesize", test_syscall_pagesize }, { 0, 0 } }; int iCmd; int rc; sqlite3_vfs *pVfs = sqlite3_vfs_find(0); if( objc<2 ){ Tcl_WrongNumArgs(interp, 1, objv, "SUB-COMMAND ..."); return TCL_ERROR; } if( pVfs->iVersion<3 || pVfs->xSetSystemCall==0 ){ Tcl_AppendResult(interp, "VFS does not support xSetSystemCall", 0); rc = TCL_ERROR; }else{ |
︙ |
Changes to test/dbstatus2.test.
︙ | |||
82 83 84 85 86 87 88 | 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 | - + | execsql { INSERT INTO t1 VALUES(4, randomblob(600)) } db_write db } {0 4 0} do_test 2.3 { db_write db 1 } {0 4 0} do_test 2.4 { db_write db 0 } {0 0 0} do_test 2.5 { db_write db 1 } {0 0 0} |
︙ |
Changes to test/e_vacuum.test.
︙ | |||
172 173 174 175 176 177 178 | 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 | - + | execsql VACUUM execsql { PRAGMA page_size ; PRAGMA auto_vacuum } } {2048 0} # EVIDENCE-OF: R-48521-51450 When in write-ahead log mode, only the # auto_vacuum support property can be changed using VACUUM. # |
︙ |
Changes to test/exists.test.
︙ | |||
15 16 17 18 19 20 21 22 23 24 25 26 27 28 | 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 | + | set testdir [file dirname $argv0] source $testdir/tester.tcl source $testdir/lock_common.tcl foreach jm {rollback wal} { if {![wal_is_capable] && $jm=="wal"} continue set testprefix exists-$jm # This block of tests is targeted at CREATE XXX IF NOT EXISTS statements. # do_multiclient_test tn { |
︙ |
Changes to test/hook.test.
︙ | |||
700 701 702 703 704 705 706 | 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 | - + | do_execsql_test 7.5.2.0 { CREATE TABLE t8(a, b); INSERT INTO t8 VALUES('one', 'two'); INSERT INTO t8 VALUES('three', 'four'); ALTER TABLE t8 ADD COLUMN c DEFAULT 'xxx'; } |
︙ |
Changes to test/incrvacuum2.test.
︙ | |||
130 131 132 133 134 135 136 | 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 | - + | PRAGMA incremental_vacuum; COMMIT; } } {} integrity_check incrvacuum2-3.3 |
︙ |
Changes to test/journal2.test.
︙ | |||
200 201 202 203 204 205 206 | 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 | - + | #------------------------------------------------------------------------- # Test that it is possible to switch from journal_mode=truncate to # journal_mode=WAL on a SAFE_DELETE file-system. SQLite should close and # delete the journal file when committing the transaction that switches # the system to WAL mode. # |
︙ |
Changes to test/permutations.test.
︙ | |||
724 725 726 727 728 729 730 | 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 | - + | pragma journal_mode = 'memory' } -files [test_set $::allquicktests -exclude { # Exclude all tests that simulate IO errors. autovacuum_ioerr2.test cffault.test incrvacuum_ioerr.test ioerr.test ioerr.test ioerr2.test ioerr3.test ioerr4.test ioerr5.test vacuum3.test incrblob_err.test diskfull.test backup_ioerr.test e_fts3.test fts3cov.test fts3malloc.test fts3rnd.test |
︙ | |||
938 939 940 941 942 943 944 | 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 | - + + + | } -initialize { catch {db close} register_jt_vfs -default "" } -shutdown { unregister_jt_vfs } -files [test_set $::allquicktests -exclude { wal* incrvacuum.test ioerr.test corrupt4.test io.test crash8.test |
︙ | |||
1046 1047 1048 1049 1050 1051 1052 | 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 | - - + - - - - + + + | set ::G(perm:name) $name set ::G(perm:prefix) $options(-prefix) set ::G(perm:presql) $options(-presql) set ::G(isquick) 1 set ::G(perm:dbconfig) $options(-dbconfig) |
︙ |
Changes to test/pragma3.test.
︙ | |||
217 218 219 220 221 222 223 | 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 | - + | } # Make sure this also works in WAL mode # # This will not work with the in-memory journal permutation, as opening # [db2] switches the journal mode back to "memory" # |
︙ |
Changes to test/quota.test.
︙ | |||
523 524 525 526 527 528 529 530 | 523 524 525 526 527 528 529 530 531 532 | + + | catch { sqlite3_quota_shutdown } sqlite3_quota_initialize "" 1 } -body { sqlite3_quota_set * 4096 {} } catch { sqlite3_quota_shutdown } catch { db close } forcedelete test.db finish_test |
Changes to test/stat.test.
︙ | |||
33 34 35 36 37 38 39 | 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 | - + | register_dbstat_vtab db do_execsql_test stat-0.0 { PRAGMA auto_vacuum = OFF; CREATE VIRTUAL TABLE temp.stat USING dbstat; SELECT * FROM stat; } {} |
︙ |
Changes to test/sync.test.
︙ | |||
77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 | 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 | + + | INSERT INTO t2 VALUES(5,6); COMMIT; } cond_incr_sync_count 4 set sqlite_sync_count } 11 ifcapable pager_pragmas { if {[permutation]!="journaltest"} { do_test sync-1.4 { set sqlite_sync_count 0 execsql { PRAGMA main.synchronous=off; PRAGMA db2.synchronous=off; BEGIN; INSERT INTO t1 VALUES(5,6); INSERT INTO t2 VALUES(7,8); COMMIT; } set sqlite_sync_count } 0 } } finish_test |
Changes to test/tester.tcl.
︙ | |||
1939 1940 1941 1942 1943 1944 1945 1946 1947 1948 1949 1950 1951 1952 | 1939 1940 1941 1942 1943 1944 1945 1946 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 | + + + + + + | } proc wal_check_journal_mode {testname {db db}} { if { [wal_is_wal_mode] } { $db eval { SELECT * FROM sqlite_master } do_test $testname [list $db eval "PRAGMA main.journal_mode"] {wal} } } proc wal_is_capable {} { ifcapable !wal { return 0 } if {[permutation]=="journaltest"} { return 0 } return 1 } proc permutation {} { set perm "" catch {set perm $::G(perm:name)} set perm } proc presql {} { |
︙ |
Changes to test/tkt-2d1a5c67d.test.
︙ | |||
15 16 17 18 19 20 21 | 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 | - + + | # # set testdir [file dirname $argv0] source $testdir/tester.tcl set testprefix tkt-2d1a5c67d |
︙ |
Changes to test/tkt-313723c356.test.
︙ | |||
14 15 16 17 18 19 20 | 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 | - + | # fixed. # set testdir [file dirname $argv0] source $testdir/tester.tcl source $testdir/malloc_common.tcl |
︙ |
Changes to test/tkt-5d863f876e.test.
︙ | |||
14 15 16 17 18 19 20 | 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 | - + | # fixed. # set testdir [file dirname $argv0] source $testdir/tester.tcl source $testdir/lock_common.tcl set ::testprefix tkt-5d863f876e |
︙ |
Changes to test/tkt-9d68c883.test.
︙ | |||
46 47 48 49 50 51 52 53 | 46 47 48 49 50 51 52 53 54 55 | + + | sqlite3_memdebug_fail -1 catchsql { ROLLBACK } execsql { PRAGMA integrity_check } } {ok} } catch { db close } unregister_devsim finish_test |
Changes to test/zerodamage.test.
︙ | |||
85 86 87 88 89 90 91 | 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 | - + | sqlite3 db file:test.db?psow=FALSE -uri 1 db eval { UPDATE t1 SET y=randomblob(50) WHERE x=124; } concat [file_control_powersafe_overwrite db -1] [set ::max_journal_size] } {0 0 24704} |
︙ |