1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-07-30 19:03:16 +03:00

Fix the fuzzcheck program so that it can create new databases again.

FossilOrigin-Name: 021e8874a7d1bb94debae3ae04f83056a8573148ffc872cd76a186a2d22d0296
This commit is contained in:
drh
2017-03-20 20:42:21 +00:00
parent 74869e5e52
commit 16f0582c1b
3 changed files with 11 additions and 9 deletions

View File

@ -972,7 +972,7 @@ int main(int argc, char **argv){
/* Process each source database separately */
for(iSrcDb=0; iSrcDb<nSrcDb; iSrcDb++){
rc = sqlite3_open_v2(azSrcDb[iSrcDb], &db,
SQLITE_OPEN_READONLY, pDfltVfs->zName);
SQLITE_OPEN_READWRITE, pDfltVfs->zName);
if( rc ){
fatalError("cannot open source database %s - %s",
azSrcDb[iSrcDb], sqlite3_errmsg(db));
@ -1047,6 +1047,8 @@ int main(int argc, char **argv){
sqlite3_close(db);
return 0;
}
rc = sqlite3_exec(db, "PRAGMA query_only=1;", 0, 0, 0);
if( rc ) fatalError("cannot set database to query-only");
if( zExpDb!=0 || zExpSql!=0 ){
sqlite3_create_function(db, "writefile", 2, SQLITE_UTF8, 0,
writefileFunc, 0, 0);