1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-08-01 06:27:03 +03:00

Enhance dbfuzz2 so that with the -v option it shows the return code and

error message for any failing SQL statements.

FossilOrigin-Name: 3a127ef9f7feafe6ba8c75e4eb29e28aa61a30249082cc8767ada1ec0cc0b7f1
This commit is contained in:
drh
2019-02-04 19:45:26 +00:00
parent f2305414cd
commit 88862d49a6
3 changed files with 14 additions and 8 deletions

View File

@ -82,6 +82,7 @@ int LLVMFuzzerTestOneInput(const uint8_t *aData, size_t nByte){
int rc;
int i;
sqlite3_int64 x;
char *zErr = 0;
if( eVerbosity>=1 ){
printf("************** nByte=%d ***************\n", (int)nByte);
@ -106,7 +107,12 @@ int LLVMFuzzerTestOneInput(const uint8_t *aData, size_t nByte){
printf("%s\n", azSql[i]);
fflush(stdout);
}
sqlite3_exec(db, azSql[i], 0, 0, 0);
zErr = 0;
rc = sqlite3_exec(db, azSql[i], 0, 0, &zErr);
if( rc && eVerbosity>=1 ){
printf("-- rc=%d zErr=%s\n", rc, zErr);
}
sqlite3_free(zErr);
}
rc = sqlite3_close(db);
if( rc!=SQLITE_OK ){