/ Check-in [706800ba]
Login

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

Overview
Comment:Fix harmless compiler warning in the 'sessionfuzz' tool.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 706800ba377e4a1f615ee6ab44530742f23e1d1be5b658608ca2fd352b363cb2
User & Date: mistachkin 2018-03-07 21:29:15
Original Comment: Fix harmless compiler warning.
Context
2018-03-07
21:39
Fix harmless compiler warnings in the 'dbdump' tool. check-in: 2b9bb266 user: mistachkin tags: trunk
21:29
Fix harmless compiler warning in the 'sessionfuzz' tool. check-in: 706800ba user: mistachkin tags: trunk
21:13
Enable compilation of 'sessionfuzz' tool using MSVC. check-in: c58de43b user: mistachkin tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to test/sessionfuzz.c.

   936    936           continue;
   937    937         }
   938    938         readFile(argv[i], &pChgset, &nChgset);
   939    939         if( nChgset >= 512 
   940    940          && memcmp(pChgset, "SQLite format 3", 16)==0 
   941    941         ){
   942    942           sqlite3 *db2;
   943         -        sqlite3_stmt *pStmt;
          943  +        sqlite3_stmt *pStmt2;
   944    944           int nCase = 0;
   945    945           /* This file is an SQL Archive containing many changesets */
   946    946           if( !bVerbose ){ printf("%s: ", fileTail(argv[i])); fflush(stdout); }
   947    947           sqlite3_open_v2(":memory:", &db2, 
   948    948                           SQLITE_OPEN_CREATE|SQLITE_OPEN_READWRITE, "memdb");
   949    949           sqlite3_deserialize(db2, 0, pChgset, nChgset, nChgset,
   950    950                 SQLITE_DESERIALIZE_READONLY | SQLITE_DESERIALIZE_FREEONCLOSE);
   951    951           sqlite3_create_function(db2, "sqlar_uncompress", 2, SQLITE_UTF8, 0,
   952    952                                    sqlarUncompressFunc, 0, 0);        
   953    953           rc = sqlite3_prepare_v2(db2, "SELECT name, sqlar_uncompress(data,sz)"
   954         -                                     "  FROM sqlar", -1, &pStmt, 0);
          954  +                                     "  FROM sqlar", -1, &pStmt2, 0);
   955    955           if( rc ){
   956    956             fprintf(stderr, "SQL error: %s\n", sqlite3_errmsg(db2));
   957    957             exit(1);
   958    958           }
   959         -        while( SQLITE_ROW==sqlite3_step(pStmt) ){
          959  +        while( SQLITE_ROW==sqlite3_step(pStmt2) ){
   960    960             if( bVerbose ){
   961         -            printf("%s/%s:", fileTail(argv[i]), sqlite3_column_text(pStmt,0));
          961  +            printf("%s/%s:", fileTail(argv[i]), sqlite3_column_text(pStmt2,0));
   962    962               fflush(stdout);
   963    963             }
   964    964             runSql(db, "BEGIN");
   965         -          pChgset = (unsigned char*)sqlite3_column_blob(pStmt, 1);
   966         -          nChgset = sqlite3_column_bytes(pStmt, 1);
          965  +          pChgset = (unsigned char*)sqlite3_column_blob(pStmt2, 1);
          966  +          nChgset = sqlite3_column_bytes(pStmt2, 1);
   967    967             rc = sqlite3changeset_apply(db, nChgset, pChgset, 0, conflictCall, 0);
   968    968             if( bVerbose ){
   969    969               printf(" Ok.  rc=%d\n", rc);
   970    970               fflush(stdout);
   971    971             }
   972    972             runSql(db, "ROLLBACK");
   973    973             nCase++;
   974    974           }
   975         -        sqlite3_finalize(pStmt);
          975  +        sqlite3_finalize(pStmt2);
   976    976           sqlite3_close(db2);
   977    977           if( bVerbose ) printf("%s: ", fileTail(argv[i]));
   978    978           printf(" %d cases, 0 crashes\n", nCase);
   979    979           fflush(stdout);
   980    980         }else{
   981    981           /* The named file is just an ordinary changeset */
   982    982           printf("%s:", fileTail(argv[i]));