Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Changes In Branch prng-seed-test-control Excluding Merge-Ins
This is equivalent to a diff from faaaae4940 to 49aa344806
2019-08-03
| ||
01:40 | Add the SQLITE_TESTCTRL_PRNG_SEED which can control the PRNG seed either directly or through the schema cookie of a supplied database connection. (check-in: 2660e9292a user: drh tags: trunk) | |
01:39 | Give the SQLITE_TESTCTRL_PRNG_SEED two arguments. The second argument if not NULL is a pointer to a database connection which seeds the connection from its schema cookie. In this way, fuzzers can control the PRNG seed. (Closed-Leaf check-in: 49aa344806 user: drh tags: prng-seed-test-control) | |
2019-08-02
| ||
21:03 | Fixes to the PRNG_SEED pragma idea. (check-in: c71098409c user: drh tags: prng-seed-test-control) | |
20:45 | Add the SQLITE_TESTCTRL_PRNG_SEED test control. (check-in: 3ac5723164 user: drh tags: prng-seed-test-control) | |
19:40 | If a query like "SELECT min(a), b FROM t1" visits no rows where "a" is not null, extract a value for "b" from one of the rows where "a" is null. Fix for ticket [41866dc37]. (check-in: faaaae4940 user: dan tags: trunk) | |
18:43 | If a query like "SELECT min(a), b FROM t1" visits no rows where "a" is not null, extract a value for "b" from one of the rows where "a" is null. Possible fix for ticket [41866dc37]. (Closed-Leaf check-in: a7277ed062 user: dan tags: tkt-41866dc37) | |
2019-08-01
| ||
22:48 | The sqlite3_set_authorizer() interface should only expire prepared statements when it is setting a new authorizer, not when clearing the authorizer. And statements that are running when sqlite3_set_authorizer() is invoked should be allowed to continue running to completion. (check-in: 961e2f08c3 user: drh tags: trunk) | |
Changes to src/btree.c.
︙ | |||
6892 6893 6894 6895 6896 6897 6898 | 6892 6893 6894 6895 6896 6897 6898 6899 6900 6901 6902 6903 6904 6905 6906 | - + | u8 *pTmp = sqlite3PagerTempSpace(pPg->pBt->pPager); u8 *pData; int k; /* Current slot in pCArray->apEnd[] */ u8 *pSrcEnd; /* Current pCArray->apEnd[k] value */ assert( i<iEnd ); j = get2byte(&aData[hdr+5]); |
︙ |
Changes to src/global.c.
︙ | |||
256 257 258 259 260 261 262 263 264 265 266 267 268 269 | 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 | + | #ifndef SQLITE_UNTESTABLE 0, /* xTestCallback */ #endif 0, /* bLocaltimeFault */ 0, /* bInternalFunctions */ 0x7ffffffe, /* iOnceResetThreshold */ SQLITE_DEFAULT_SORTERREF_SIZE, /* szSorterRef */ 0, /* iPrngSeed */ }; /* ** Hash table for global functions - functions common to all ** database connections. After initialization, this table is ** read-only. */ |
︙ |
Changes to src/main.c.
︙ | |||
3820 3821 3822 3823 3824 3825 3826 | 3820 3821 3822 3823 3824 3825 3826 3827 3828 3829 3830 3831 3832 3833 3834 3835 3836 3837 3838 3839 3840 3841 3842 3843 3844 3845 3846 3847 3848 3849 3850 3851 3852 3853 3854 3855 3856 3857 3858 3859 3860 | + - - - - + + + + + + + + + + + + + + + + + + - + + + + + + + | ** this verb acts like PRNG_RESET. */ case SQLITE_TESTCTRL_PRNG_RESTORE: { sqlite3PrngRestoreState(); break; } /* sqlite3_test_control(SQLITE_TESTCTRL_PRNG_SEED, int x, sqlite3 *db); |
︙ |
Changes to src/os.c.
︙ | |||
254 255 256 257 258 259 260 | 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 | + + + + + + - + + + | return pVfs->xDlSym(pVfs, pHdle, zSym); } void sqlite3OsDlClose(sqlite3_vfs *pVfs, void *pHandle){ pVfs->xDlClose(pVfs, pHandle); } #endif /* SQLITE_OMIT_LOAD_EXTENSION */ int sqlite3OsRandomness(sqlite3_vfs *pVfs, int nByte, char *zBufOut){ if( sqlite3Config.iPrngSeed ){ memset(zBufOut, 0, nByte); if( ALWAYS(nByte>sizeof(unsigned)) ) nByte = sizeof(unsigned int); memcpy(zBufOut, &sqlite3Config.iPrngSeed, nByte); return SQLITE_OK; }else{ |
︙ |
Changes to src/shell.c.in.
︙ | |||
9146 9147 9148 9149 9150 9151 9152 | 9146 9147 9148 9149 9150 9151 9152 9153 9154 9155 9156 9157 9158 9159 9160 9161 9162 | - + | { "localtime_fault", SQLITE_TESTCTRL_LOCALTIME_FAULT,"BOOLEAN" }, { "never_corrupt", SQLITE_TESTCTRL_NEVER_CORRUPT, "BOOLEAN" }, { "optimizations", SQLITE_TESTCTRL_OPTIMIZATIONS, "DISABLE-MASK" }, #ifdef YYCOVERAGE { "parser_coverage", SQLITE_TESTCTRL_PARSER_COVERAGE, "" }, #endif { "pending_byte", SQLITE_TESTCTRL_PENDING_BYTE, "OFFSET " }, |
︙ | |||
9229 9230 9231 9232 9233 9234 9235 9236 9237 9238 9239 9240 9241 9242 | 9229 9230 9231 9232 9233 9234 9235 9236 9237 9238 9239 9240 9241 9242 9243 9244 9245 9246 9247 9248 9249 9250 9251 9252 9253 9254 9255 9256 9257 9258 9259 | + + + + + + + + + + + + + + + + + | case SQLITE_TESTCTRL_PENDING_BYTE: if( nArg==3 ){ unsigned int opt = (unsigned int)integerValue(azArg[2]); rc2 = sqlite3_test_control(testctrl, opt); isOk = 3; } break; /* sqlite3_test_control(int, int, sqlite3*) */ case SQLITE_TESTCTRL_PRNG_SEED: if( nArg==3 || nArg==4 ){ int i = (int)integerValue(azArg[2]); sqlite3 *db; if( nArg==3 ){ db = 0; }else{ db = p->db; /* Make sure the schema has been loaded */ sqlite3_table_column_metadata(db, 0, "x", 0, 0, 0, 0, 0, 0); } rc2 = sqlite3_test_control(testctrl, i, db); isOk = 3; } break; /* sqlite3_test_control(int, int) */ case SQLITE_TESTCTRL_ASSERT: case SQLITE_TESTCTRL_ALWAYS: case SQLITE_TESTCTRL_INTERNAL_FUNCTIONS: if( nArg==3 ){ int opt = booleanValue(azArg[2]); |
︙ |
Changes to src/sqlite.h.in.
︙ | |||
7331 7332 7333 7334 7335 7336 7337 | 7331 7332 7333 7334 7335 7336 7337 7338 7339 7340 7341 7342 7343 7344 7345 | - + | ** without notice. These values are for testing purposes only. ** Applications should not use any of these parameters or the ** [sqlite3_test_control()] interface. */ #define SQLITE_TESTCTRL_FIRST 5 #define SQLITE_TESTCTRL_PRNG_SAVE 5 #define SQLITE_TESTCTRL_PRNG_RESTORE 6 |
︙ | |||
7354 7355 7356 7357 7358 7359 7360 | 7354 7355 7356 7357 7358 7359 7360 7361 7362 7363 7364 7365 7366 7367 7368 7369 | + - + | #define SQLITE_TESTCTRL_VDBE_COVERAGE 21 #define SQLITE_TESTCTRL_BYTEORDER 22 #define SQLITE_TESTCTRL_ISINIT 23 #define SQLITE_TESTCTRL_SORTER_MMAP 24 #define SQLITE_TESTCTRL_IMPOSTER 25 #define SQLITE_TESTCTRL_PARSER_COVERAGE 26 #define SQLITE_TESTCTRL_RESULT_INTREAL 27 #define SQLITE_TESTCTRL_PRNG_SEED 28 |
︙ |
Changes to src/sqliteInt.h.
︙ | |||
3460 3461 3462 3463 3464 3465 3466 3467 3468 3469 3470 3471 3472 3473 | 3460 3461 3462 3463 3464 3465 3466 3467 3468 3469 3470 3471 3472 3473 3474 | + | #ifndef SQLITE_UNTESTABLE int (*xTestCallback)(int); /* Invoked by sqlite3FaultSim() */ #endif int bLocaltimeFault; /* True to fail localtime() calls */ int bInternalFunctions; /* Internal SQL functions are visible */ int iOnceResetThreshold; /* When to reset OP_Once counters */ u32 szSorterRef; /* Min size in bytes to use sorter-refs */ unsigned int iPrngSeed; /* Alternative fixed seed for the PRNG */ }; /* ** This macro is used inside of assert() statements to indicate that ** the assert is only valid on a well-formed database. Instead of: ** ** assert( X ); |
︙ |
Changes to src/test1.c.
︙ | |||
6369 6370 6371 6372 6373 6374 6375 | 6369 6370 6371 6372 6373 6374 6375 6376 6377 6378 6379 6380 6381 6382 6383 6384 6385 6386 6387 6388 6389 6390 6391 6392 6393 6394 6395 6396 6397 6398 6399 6400 6401 6402 6403 6404 6405 6406 6407 6408 6409 6410 6411 6412 6413 6414 6415 6416 6417 | + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + | */ static int SQLITE_TCLAPI reset_prng_state( ClientData clientData, /* Pointer to sqlite3_enable_XXX function */ Tcl_Interp *interp, /* The TCL interpreter that invoked this command */ int objc, /* Number of arguments */ Tcl_Obj *CONST objv[] /* Command arguments */ ){ sqlite3_randomness(0,0); return TCL_OK; } /* ** tclcmd: prng_seed INT ?DB? ** ** Set up the SQLITE_TESTCTRL_PRNG_SEED pragma with parameter INT and DB. ** INT is an integer. DB is a database connection, or a NULL pointer if ** omitted. ** ** When INT!=0 and DB!=0, set the PRNG seed to the value of the schema ** cookie for DB, or to INT if the schema cookie happens to be zero. ** ** When INT!=0 and DB==0, set the PRNG seed to just INT. ** ** If INT==0 and DB==0 then use the default procedure of calling the ** xRandomness method on the default VFS to get the PRNG seed. */ static int SQLITE_TCLAPI prng_seed( ClientData clientData, /* Pointer to sqlite3_enable_XXX function */ Tcl_Interp *interp, /* The TCL interpreter that invoked this command */ int objc, /* Number of arguments */ Tcl_Obj *CONST objv[] /* Command arguments */ ){ int i = 0; sqlite3 *db = 0; if( objc!=2 && objc!=3 ){ Tcl_WrongNumArgs(interp, 1, objv, "SEED ?DB?"); return TCL_ERROR; } if( Tcl_GetIntFromObj(interp,objv[0],&i) ) return TCL_ERROR; if( objc==3 && getDbPointer(interp, Tcl_GetString(objv[2]), &db) ){ return TCL_ERROR; } |
︙ | |||
7919 7920 7921 7922 7923 7924 7925 7926 7927 7928 7929 7930 7931 7932 | 7953 7954 7955 7956 7957 7958 7959 7960 7961 7962 7963 7964 7965 7966 7967 | + | { "sqlite3_extended_result_codes", test_extended_result_codes, 0}, { "sqlite3_limit", test_limit, 0}, { "dbconfig_maindbname_icecube", test_dbconfig_maindbname_icecube }, { "save_prng_state", save_prng_state, 0 }, { "restore_prng_state", restore_prng_state, 0 }, { "reset_prng_state", reset_prng_state, 0 }, { "prng_seed", prng_seed, 0 }, { "database_never_corrupt", database_never_corrupt, 0}, { "database_may_be_corrupt", database_may_be_corrupt, 0}, { "optimization_control", optimization_control,0}, #if SQLITE_OS_WIN { "lock_win32_file", win32_file_lock, 0 }, { "exists_win32_path", win32_exists_path, 0 }, { "find_win32_file", win32_find_file, 0 }, |
︙ |
Changes to test/dbfuzz2.c.
︙ | |||
207 208 209 210 211 212 213 214 215 216 217 218 219 220 | 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 | + + + | #endif if( bVdbeDebug ){ sqlite3_exec(db, "PRAGMA vdbe_debug=ON", 0, 0, 0); } if( mxCb>0 ){ sqlite3_progress_handler(db, 10, progress_handler, 0); } #ifdef SQLITE_TESTCTRL_PRNG_SEED sqlite3_test_control(SQLITE_TESTCTRL_PRNG_SEED, 1, db); #endif for(i=0; i<sizeof(azSql)/sizeof(azSql[0]); i++){ if( eVerbosity>=1 ){ printf("%s\n", azSql[i]); fflush(stdout); } zErr = 0; nCb = 0; |
︙ |
Changes to test/fuzzcheck.c.
︙ | |||
1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 | 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 | + + + | setAlarm(iTimeout); #ifndef SQLITE_OMIT_PROGRESS_CALLBACK if( sqlFuzz || vdbeLimitFlag ){ sqlite3_progress_handler(db, 100000, progressHandler, &vdbeLimitFlag); } #endif #ifdef SQLITE_TESTCTRL_PRNG_SEED sqlite3_test_control(SQLITE_TESTCTRL_PRNG_SEED, 1, db); #endif do{ runSql(db, (char*)pSql->a, runFlags); }while( timeoutTest ); setAlarm(0); sqlite3_exec(db, "PRAGMA temp_store_directory=''", 0, 0, 0); sqlite3_close(db); } |
︙ |