/ Check-in [3a127ef9]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Enhance dbfuzz2 so that with the -v option it shows the return code and error message for any failing SQL statements.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256:3a127ef9f7feafe6ba8c75e4eb29e28aa61a30249082cc8767ada1ec0cc0b7f1
User & Date: drh 2019-02-04 19:45:26
Context
2019-02-04
19:50
Add the -memtrace option to dbfuzz2. check-in: 67fecbc7 user: drh tags: trunk
19:45
Enhance dbfuzz2 so that with the -v option it shows the return code and error message for any failing SQL statements. check-in: 3a127ef9 user: drh tags: trunk
19:12
Ensure that the sqlite3_exec() callback gets the correct number of columns for a query, even if the schema changes out from under it. check-in: a16ffb5a user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to test/dbfuzz2.c.

    78     78   */
    79     79   int LLVMFuzzerTestOneInput(const uint8_t *aData, size_t nByte){
    80     80     unsigned char *a;
    81     81     sqlite3 *db;
    82     82     int rc;
    83     83     int i;
    84     84     sqlite3_int64 x;
           85  +  char *zErr = 0;
    85     86   
    86     87     if( eVerbosity>=1 ){
    87     88       printf("************** nByte=%d ***************\n", (int)nByte);
    88     89       fflush(stdout);
    89     90     }
    90     91     if( sqlite3_initialize() ) return 0;
    91     92     rc = sqlite3_open(0, &db);
................................................................................
   102    103       sqlite3_exec(db, "PRAGMA vdbe_debug=ON", 0, 0, 0);
   103    104     }
   104    105     for(i=0; i<sizeof(azSql)/sizeof(azSql[0]); i++){
   105    106       if( eVerbosity>=1 ){
   106    107         printf("%s\n", azSql[i]);
   107    108         fflush(stdout);
   108    109       }
   109         -    sqlite3_exec(db, azSql[i], 0, 0, 0);
          110  +    zErr = 0;
          111  +    rc = sqlite3_exec(db, azSql[i], 0, 0, &zErr);
          112  +    if( rc && eVerbosity>=1 ){
          113  +      printf("-- rc=%d zErr=%s\n", rc, zErr);
          114  +    }
          115  +    sqlite3_free(zErr);
   110    116     }
   111    117     rc = sqlite3_close(db);
   112    118     if( rc!=SQLITE_OK ){
   113    119       fprintf(stdout, "sqlite3_close() returns %d\n", rc);
   114    120     }
   115    121     if( sqlite3_memory_used()!=0 ){
   116    122       int nAlloc = 0;