From: drh Date: Sat, 17 Dec 2016 21:07:30 +0000 (+0000) Subject: Refinements to the new dbfuzz test program. X-Git-Tag: version-3.16.0~32 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=22d709dd911129e2e657d0f6e6bd132ea5f3b0a4;p=thirdparty%2Fsqlite.git Refinements to the new dbfuzz test program. FossilOrigin-Name: 50325abe79b6a79b09ec6a1cee7d80ca02337428 --- diff --git a/manifest b/manifest index 1dc3a4ab57..471db5a55d 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Enhance\sfuzzershell.c\sto\sread\sand\sexecute\sSQL\scommands\sin\sthe\sautoexec\stable\nof\sthe\sdatabase\sunder\stest.\s\sAdd\sthe\sdbfuzz.c\stest\sprogram\scombining\sselected\nfeatures\sof\sfuzzershell.c\sand\sfuzzcheck.c. -D 2016-12-17T20:27:22.394 +C Refinements\sto\sthe\snew\sdbfuzz\stest\sprogram. +D 2016-12-17T21:07:30.972 F Makefile.in 41bd4cad981487345c4a84081074bcdb876e4b2e F Makefile.linux-gcc 7bc79876b875010e8c8f9502eb935ca92aa3c434 F Makefile.msc b8ca53350ae545e3562403d5da2a69cec79308da @@ -628,7 +628,7 @@ F test/ctime.test ff6c38e822459d6ca743c34901caf57740b08b54 F test/cursorhint.test 7bc346788390475e77a345da2b92270d04d35856 F test/cursorhint2.test fa41f0d997e67db921d08c31e73111b32811201a F test/date.test a6a5a48b90907bca9fbcc79a30be5a715c1ab2fc -F test/dbfuzz.c 2bf7858028c0c437ccffc5795f791c495800cd9b +F test/dbfuzz.c 8cc2bdb818b4483a052f9f80f96be74cbd9a6e1d F test/dbstatus.test 73149851b3aff14fc6db478e58f9083a66422cf5 F test/dbstatus2.test e93ab03bfae6d62d4d935f20de928c19ca0ed0ab F test/default.test 0cb49b1c315a0d81c81d775e407f66906a2a604d @@ -1539,7 +1539,7 @@ F vsixtest/vsixtest.tcl 6a9a6ab600c25a91a7acc6293828957a386a8a93 F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0 -P 8dedd6ad44bd1d103dced9d1350188cb2327128d -R 467cdb2635ae3db86cb6ad0c3fe29c15 +P ef6e071a62cd79a0edbbef9f41ca9482540e5cb8 +R dc4a1399a03b50b6a494c9549eb51d65 U drh -Z 6af4ccd37cf6da1faf8a726dcd8a746b +Z 264edff2f6705a86fbfac5952dd5c460 diff --git a/manifest.uuid b/manifest.uuid index 258fb2afd4..7df7255bc5 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -ef6e071a62cd79a0edbbef9f41ca9482540e5cb8 \ No newline at end of file +50325abe79b6a79b09ec6a1cee7d80ca02337428 \ No newline at end of file diff --git a/test/dbfuzz.c b/test/dbfuzz.c index 0484b15eb3..2de97c35cb 100644 --- a/test/dbfuzz.c +++ b/test/dbfuzz.c @@ -20,6 +20,7 @@ ** are run against the database to ensure that SQLite can safely handle ** the fuzzed database. */ +#include #include #include #include @@ -541,30 +542,6 @@ static int integerValue(const char *zArg){ return (int)(isNeg? -v : v); } -/* -** This callback is invoked by sqlite3_exec() to return query results. -*/ -static int execCallback(void *NotUsed, int argc, char **argv, char **colv){ - int i; - static unsigned cnt = 0; - printf("ROW #%u:\n", ++cnt); - if( argv ){ - for(i=0; i0 && ISSPACE(z[n-1]) ) n--; + if( n==0 ) break; + if( pStmt==0 ){ + printf("TRACE: %.*s (error: %s)\n", n, z, sqlite3_errmsg(db)); + }else{ + printf("TRACE: %.*s\n", n, z); + } + } + zSql = zMore; + if( pStmt ){ + if( (runFlags & SQL_OUTPUT)==0 ){ + while( SQLITE_ROW==sqlite3_step(pStmt) ){} + }else{ + int nCol = -1; + int nRow; + for(nRow=0; SQLITE_ROW==sqlite3_step(pStmt); nRow++){ + int i; + if( nCol<0 ){ + nCol = sqlite3_column_count(pStmt); + } + for(i=0; i1 ){ printf("DATABASE-FILE: %s\n", azDb[i]); fflush(stdout); @@ -685,16 +738,7 @@ int main(int argc, char **argv){ } sqlite3_finalize(pStmt); StrAppend(&sql, "PRAGMA integrity_check;\n"); - if( traceFlag ){ - char *zErrMsg = 0; - rc = sqlite3_exec(db, StrStr(&sql), execCallback, 0, &zErrMsg); - if( zErrMsg ){ - printf("ERRMSG: %s\n", zErrMsg); - sqlite3_free(zErrMsg); - } - }else { - rc = sqlite3_exec(db, StrStr(&sql), execNoop, 0, 0); - } + runSql(db, StrStr(&sql), runFlags); sqlite3_close(db); reformatVfs(); StrFree(&sql);