Index: test/fuzzcheck.c ================================================================== --- test/fuzzcheck.c +++ test/fuzzcheck.c @@ -804,20 +804,21 @@ " --cell-size-check Set the PRAGMA cell_size_check=ON\n" " --dbid N Use only the database where dbid=N\n" " --export-db DIR Write databases to files(s) in DIR. Works with --dbid\n" " --export-sql DIR Write SQL to file(s) in DIR. Also works with --sqlid\n" " --help Show this help text\n" -" -q|--quiet Reduced output\n" +" --info Show information about SOURCE-DB w/o running tests\n" " --limit-mem N Limit memory used by test SQLite instance to N bytes\n" " --limit-vdbe Panic if any test runs for more than 100,000 cycles\n" " --load-sql ARGS... Load SQL scripts fron files into SOURCE-DB\n" " --load-db ARGS... Load template databases from files into SOURCE_DB\n" " -m TEXT Add a description to the database\n" " --native-vfs Use the native VFS for initially empty database files\n" " --native-malloc Turn off MEMSYS3/5 and Lookaside\n" " --oss-fuzz Enable OSS-FUZZ testing\n" " --prng-seed N Seed value for the PRGN inside of SQLite\n" +" -q|--quiet Reduced output\n" " --rebuild Rebuild and vacuum the database file\n" " --result-trace Show the results of each SQL command\n" " --sqlid N Use only SQL where sqlid=N\n" " --timeout N Abort if any single test needs more than N seconds\n" " -v|--verbose Increased output. Repeat for more output.\n" @@ -839,10 +840,11 @@ int onlySqlid = -1; /* --sqlid */ int onlyDbid = -1; /* --dbid */ int nativeFlag = 0; /* --native-vfs */ int rebuildFlag = 0; /* --rebuild */ int vdbeLimitFlag = 0; /* --limit-vdbe */ + int infoFlag = 0; /* --info */ int timeoutTest = 0; /* undocumented --timeout-test flag */ int runFlags = 0; /* Flags sent to runSql() */ char *zMsg = 0; /* Add this message */ int nSrcDb = 0; /* Number of source databases */ char **azSrcDb = 0; /* Array of source database names */ @@ -894,10 +896,13 @@ zExpSql = argv[++i]; }else if( strcmp(z,"help")==0 ){ showHelp(); return 0; + }else + if( strcmp(z,"info")==0 ){ + infoFlag = 1; }else if( strcmp(z,"limit-mem")==0 ){ #if !defined(SQLITE_ENABLE_MEMSYS3) && !defined(SQLITE_ENABLE_MEMSYS5) fatalError("the %s option requires -DSQLITE_ENABLE_MEMSYS5 or _MEMSYS3", argv[i]); @@ -994,10 +999,46 @@ openFlags4Data, pDfltVfs->zName); if( rc ){ fatalError("cannot open source database %s - %s", azSrcDb[iSrcDb], sqlite3_errmsg(db)); } + + /* Print the description, if there is one */ + if( infoFlag ){ + int n; + zDbName = azSrcDb[iSrcDb]; + i = (int)strlen(zDbName) - 1; + while( i>0 && zDbName[i-1]!='/' && zDbName[i-1]!='\\' ){ i--; } + zDbName += i; + sqlite3_prepare_v2(db, "SELECT msg FROM readme", -1, &pStmt, 0); + if( pStmt && sqlite3_step(pStmt)==SQLITE_ROW ){ + printf("%s: %s", zDbName, sqlite3_column_text(pStmt,0)); + }else{ + printf("%s: (empty \"readme\")", zDbName); + } + sqlite3_finalize(pStmt); + sqlite3_prepare_v2(db, "SELECT count(*) FROM db", -1, &pStmt, 0); + if( pStmt + && sqlite3_step(pStmt)==SQLITE_ROW + && (n = sqlite3_column_int(pStmt,0))>0 + ){ + printf(" - %d DBs", n); + } + sqlite3_finalize(pStmt); + sqlite3_prepare_v2(db, "SELECT count(*) FROM xsql", -1, &pStmt, 0); + if( pStmt + && sqlite3_step(pStmt)==SQLITE_ROW + && (n = sqlite3_column_int(pStmt,0))>0 + ){ + printf(" - %d scripts", n); + } + sqlite3_finalize(pStmt); + printf("\n"); + sqlite3_close(db); + continue; + } + rc = sqlite3_exec(db, "CREATE TABLE IF NOT EXISTS db(\n" " dbid INTEGER PRIMARY KEY, -- database id\n" " dbcontent BLOB -- database disk file image\n" ");\n" Index: test/fuzzdata2.db ================================================================== --- test/fuzzdata2.db +++ test/fuzzdata2.db cannot compute difference between binary files