/ Check-in [a016144b]
Login

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

Overview
Comment:Merge changes from trunk, especially the activation of the cell-overwrite optimization for indexes and WITHOUT ROWID tables.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | apple-osx
Files: files | file ages | folders
SHA3-256:a016144b0e0c41b89157ea7349aad376f34888edf9558f8fd0d529516c5d18fd
User & Date: drh 2018-05-08 13:32:02
Context
2018-06-04
14:10
Merge changes from trunk. check-in: 95fbac39 user: drh tags: apple-osx
2018-05-08
13:32
Merge changes from trunk, especially the activation of the cell-overwrite optimization for indexes and WITHOUT ROWID tables. check-in: a016144b user: drh tags: apple-osx
13:03
Fix a harmless compiler warning in fuzzcheck. Add new OSSFuzz test cases to the test case library. check-in: d2619746 user: drh tags: trunk
2018-05-07
13:01
Merge enhancements from trunk, and especially the cell-overwrite optimization. check-in: cb3aa778 user: drh tags: apple-osx
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to Makefile.in.

   582    582   # Databases containing fuzzer test cases
   583    583   #
   584    584   FUZZDATA = \
   585    585     $(TOP)/test/fuzzdata1.db \
   586    586     $(TOP)/test/fuzzdata2.db \
   587    587     $(TOP)/test/fuzzdata3.db \
   588    588     $(TOP)/test/fuzzdata4.db \
   589         -  $(TOP)/test/fuzzdata5.db
          589  +  $(TOP)/test/fuzzdata5.db \
          590  +  $(TOP)/test/fuzzdata6.db
   590    591   
   591    592   # Standard options to testfixture
   592    593   #
   593    594   TESTOPTS = --verbose=file --output=test-out.txt
   594    595   
   595    596   # Extra compiler options for various shell tools
   596    597   #

Changes to Makefile.msc.

  1595   1595   # Databases containing fuzzer test cases
  1596   1596   #
  1597   1597   FUZZDATA = \
  1598   1598     $(TOP)\test\fuzzdata1.db \
  1599   1599     $(TOP)\test\fuzzdata2.db \
  1600   1600     $(TOP)\test\fuzzdata3.db \
  1601   1601     $(TOP)\test\fuzzdata4.db \
  1602         -  $(TOP)\test\fuzzdata5.db
         1602  +  $(TOP)\test\fuzzdata5.db \
         1603  +  $(TOP)\test\fuzzdata6.db
  1603   1604   # <</mark>>
  1604   1605   
  1605   1606   # Additional compiler options for the shell.  These are only effective
  1606   1607   # when the shell is not being dynamically linked.
  1607   1608   #
  1608   1609   !IF $(DYNAMIC_SHELL)==0 && $(FOR_WIN10)==0
  1609   1610   SHELL_COMPILE_OPTS = $(SHELL_COMPILE_OPTS) -DSQLITE_ENABLE_JSON1 -DSQLITE_ENABLE_FTS4 -DSQLITE_ENABLE_EXPLAIN_COMMENTS -DSQLITE_ENABLE_STMTVTAB

Changes to main.mk.

   485    485   # Databases containing fuzzer test cases
   486    486   #
   487    487   FUZZDATA = \
   488    488     $(TOP)/test/fuzzdata1.db \
   489    489     $(TOP)/test/fuzzdata2.db \
   490    490     $(TOP)/test/fuzzdata3.db \
   491    491     $(TOP)/test/fuzzdata4.db \
   492         -  $(TOP)/test/fuzzdata5.db
          492  +  $(TOP)/test/fuzzdata5.db \
          493  +  $(TOP)/test/fuzzdata6.db
   493    494   
   494    495   # Standard options to testfixture
   495    496   #
   496    497   TESTOPTS = --verbose=file --output=test-out.txt
   497    498   
   498    499   # Extra compiler options for various shell tools
   499    500   #

Changes to src/btree.c.

  8334   8334     if( pCur->pKeyInfo==0 ){
  8335   8335       assert( pX->pKey==0 );
  8336   8336       /* If this is an insert into a table b-tree, invalidate any incrblob 
  8337   8337       ** cursors open on the row being replaced */
  8338   8338       invalidateIncrblobCursors(p, pCur->pgnoRoot, pX->nKey, 0);
  8339   8339   
  8340   8340       /* If BTREE_SAVEPOSITION is set, the cursor must already be pointing 
  8341         -    ** to a row with the same key as the new entry being inserted.  */
  8342         -    assert( (flags & BTREE_SAVEPOSITION)==0 || 
  8343         -            ((pCur->curFlags&BTCF_ValidNKey)!=0 && pX->nKey==pCur->info.nKey) );
         8341  +    ** to a row with the same key as the new entry being inserted.
         8342  +    */
         8343  +#ifdef SQLITE_DEBUG
         8344  +    if( flags & BTREE_SAVEPOSITION ){
         8345  +      assert( pCur->curFlags & BTCF_ValidNKey );
         8346  +      assert( pX->nKey==pCur->info.nKey );
         8347  +      assert( pCur->info.nSize!=0 );
         8348  +      assert( loc==0 );
         8349  +    }
         8350  +#endif
  8344   8351   
  8345         -    /* If the cursor is currently on the last row and we are appending a
  8346         -    ** new row onto the end, set the "loc" to avoid an unnecessary
  8347         -    ** btreeMoveto() call */
         8352  +    /* On the other hand, BTREE_SAVEPOSITION==0 does not imply
         8353  +    ** that the cursor is not pointing to a row to be overwritten.
         8354  +    ** So do a complete check.
         8355  +    */
  8348   8356       if( (pCur->curFlags&BTCF_ValidNKey)!=0 && pX->nKey==pCur->info.nKey ){
  8349         -      /* The current is currently pointing to the entry that is to be
         8357  +      /* The cursor is pointing to the entry that is to be
  8350   8358         ** overwritten */
  8351   8359         assert( pX->nData>=0 && pX->nZero>=0 );
  8352   8360         if( pCur->info.nSize!=0
  8353   8361          && pCur->info.nPayload==(u32)pX->nData+pX->nZero
  8354   8362         ){
         8363  +        /* New entry is the same size as the old.  Do an overwrite */
  8355   8364           return btreeOverwriteCell(pCur, pX);
  8356   8365         }
  8357         -      loc = 0;
         8366  +      assert( loc==0 );
  8358   8367       }else if( loc==0 ){
         8368  +      /* The cursor is *not* pointing to the cell to be overwritten, nor
         8369  +      ** to an adjacent cell.  Move the cursor so that it is pointing either
         8370  +      ** to the cell to be overwritten or an adjacent cell.
         8371  +      */
  8359   8372         rc = sqlite3BtreeMovetoUnpacked(pCur, 0, pX->nKey, flags!=0, &loc);
  8360   8373         if( rc ) return rc;
  8361   8374       }
  8362         -  }else if( loc==0 && (flags & BTREE_SAVEPOSITION)==0 ){
  8363         -    if( pX->nMem ){
  8364         -      UnpackedRecord r;
  8365         -      r.pKeyInfo = pCur->pKeyInfo;
  8366         -      r.aMem = pX->aMem;
  8367         -      r.nField = pX->nMem;
  8368         -      r.default_rc = 0;
  8369         -      r.errCode = 0;
  8370         -      r.r1 = 0;
  8371         -      r.r2 = 0;
  8372         -      r.eqSeen = 0;
  8373         -      rc = sqlite3BtreeMovetoUnpacked(pCur, &r, 0, flags!=0, &loc);
  8374         -    }else{
  8375         -      rc = btreeMoveto(pCur, pX->pKey, pX->nKey, flags!=0, &loc);
  8376         -    }
  8377         -    if( rc ) return rc;
         8375  +  }else{
         8376  +    /* This is an index or a WITHOUT ROWID table */
         8377  +
         8378  +    /* If BTREE_SAVEPOSITION is set, the cursor must already be pointing 
         8379  +    ** to a row with the same key as the new entry being inserted.
         8380  +    */
         8381  +    assert( (flags & BTREE_SAVEPOSITION)==0 || loc==0 );
         8382  +
         8383  +    /* If the cursor is not already pointing either to the cell to be
         8384  +    ** overwritten, or if a new cell is being inserted, if the cursor is
         8385  +    ** not pointing to an immediately adjacent cell, then move the cursor
         8386  +    ** so that it does.
         8387  +    */
         8388  +    if( loc==0 && (flags & BTREE_SAVEPOSITION)==0 ){
         8389  +      if( pX->nMem ){
         8390  +        UnpackedRecord r;
         8391  +        r.pKeyInfo = pCur->pKeyInfo;
         8392  +        r.aMem = pX->aMem;
         8393  +        r.nField = pX->nMem;
         8394  +        r.default_rc = 0;
         8395  +        r.errCode = 0;
         8396  +        r.r1 = 0;
         8397  +        r.r2 = 0;
         8398  +        r.eqSeen = 0;
         8399  +        rc = sqlite3BtreeMovetoUnpacked(pCur, &r, 0, flags!=0, &loc);
         8400  +      }else{
         8401  +        rc = btreeMoveto(pCur, pX->pKey, pX->nKey, flags!=0, &loc);
         8402  +      }
         8403  +      if( rc ) return rc;
         8404  +    }
         8405  +
         8406  +    /* If the cursor is currently pointing to an entry to be overwritten
         8407  +    ** and the new content is the same as as the old, then use the
         8408  +    ** overwrite optimization.
         8409  +    */
         8410  +    if( loc==0 ){
         8411  +      getCellInfo(pCur);
         8412  +      if( pCur->info.nKey==pX->nKey ){
         8413  +        BtreePayload x2;
         8414  +        x2.pData = pX->pKey;
         8415  +        x2.nData = pX->nKey;
         8416  +        x2.nZero = 0;
         8417  +        return btreeOverwriteCell(pCur, &x2);
         8418  +      }
         8419  +    }
         8420  +
  8378   8421     }
  8379   8422     assert( pCur->eState==CURSOR_VALID || (pCur->eState==CURSOR_INVALID && loc) );
  8380   8423   
  8381   8424     pPage = pCur->pPage;
  8382   8425     assert( pPage->intKey || pX->nKey>=0 );
  8383   8426     assert( pPage->leaf || !pPage->intKey );
  8384   8427   

Changes to src/btree.h.

   255    255   #define BTREE_AUXDELETE    0x04  /* not the primary delete operation */
   256    256   #define BTREE_APPEND       0x08  /* Insert is likely an append */
   257    257   
   258    258   /* An instance of the BtreePayload object describes the content of a single
   259    259   ** entry in either an index or table btree.
   260    260   **
   261    261   ** Index btrees (used for indexes and also WITHOUT ROWID tables) contain
   262         -** an arbitrary key and no data.  These btrees have pKey,nKey set to their
   263         -** key and pData,nData,nZero set to zero.
          262  +** an arbitrary key and no data.  These btrees have pKey,nKey set to the
          263  +** key and the pData,nData,nZero fields are uninitialized.  The aMem,nMem
          264  +** fields give an array of Mem objects that are a decomposition of the key.
          265  +** The nMem field might be zero, indicating that no decomposition is available.
   264    266   **
   265    267   ** Table btrees (used for rowid tables) contain an integer rowid used as
   266    268   ** the key and passed in the nKey field.  The pKey field is zero.  
   267    269   ** pData,nData hold the content of the new entry.  nZero extra zero bytes
   268    270   ** are appended to the end of the content when constructing the entry.
          271  +** The aMem,nMem fields are uninitialized for table btrees.
          272  +**
          273  +** Field usage summary:
          274  +**
          275  +**               Table BTrees                   Index Btrees
          276  +**
          277  +**   pKey        always NULL                    encoded key
          278  +**   nKey        the ROWID                      length of pKey
          279  +**   pData       data                           not used
          280  +**   aMem        not used                       decomposed key value
          281  +**   nMem        not used                       entries in aMem
          282  +**   nData       length of pData                not used
          283  +**   nZero       extra zeros after pData        not used
   269    284   **
   270    285   ** This object is used to pass information into sqlite3BtreeInsert().  The
   271    286   ** same information used to be passed as five separate parameters.  But placing
   272    287   ** the information into this object helps to keep the interface more 
   273    288   ** organized and understandable, and it also helps the resulting code to
   274    289   ** run a little faster by using fewer registers for parameter passing.
   275    290   */
   276    291   struct BtreePayload {
   277    292     const void *pKey;       /* Key content for indexes.  NULL for tables */
   278    293     sqlite3_int64 nKey;     /* Size of pKey for indexes.  PRIMARY KEY for tabs */
   279         -  const void *pData;      /* Data for tables.  NULL for indexes */
          294  +  const void *pData;      /* Data for tables. */
   280    295     sqlite3_value *aMem;    /* First of nMem value in the unpacked pKey */
   281    296     u16 nMem;               /* Number of aMem[] value.  Might be zero */
   282    297     int nData;              /* Size of pData.  0 if none. */
   283    298     int nZero;              /* Extra zero data appended after pData,nData */
   284    299   };
   285    300   
   286    301   int sqlite3BtreeInsert(BtCursor*, const BtreePayload *pPayload,

Changes to test/fuzzcheck.c.

   716    716   */
   717    717   static void rebuild_database(sqlite3 *db){
   718    718     int rc;
   719    719     rc = sqlite3_exec(db, 
   720    720        "BEGIN;\n"
   721    721        "CREATE TEMP TABLE dbx AS SELECT DISTINCT dbcontent FROM db;\n"
   722    722        "DELETE FROM db;\n"
   723         -     "INSERT INTO db(dbid, dbcontent) SELECT NULL, dbcontent FROM dbx ORDER BY 2;\n"
          723  +     "INSERT INTO db(dbid, dbcontent) "
          724  +        " SELECT NULL, dbcontent FROM dbx ORDER BY 2;\n"
   724    725        "DROP TABLE dbx;\n"
   725    726        "CREATE TEMP TABLE sx AS SELECT DISTINCT sqltext FROM xsql;\n"
   726    727        "DELETE FROM xsql;\n"
   727         -     "INSERT INTO xsql(sqlid,sqltext) SELECT NULL, sqltext FROM sx ORDER BY 2;\n"
          728  +     "INSERT INTO xsql(sqlid,sqltext) "
          729  +        " SELECT NULL, sqltext FROM sx ORDER BY 2;\n"
   728    730        "DROP TABLE sx;\n"
   729    731        "COMMIT;\n"
   730    732        "PRAGMA page_size=1024;\n"
   731    733        "VACUUM;\n", 0, 0, 0);
   732    734     if( rc ) fatalError("cannot rebuild: %s", sqlite3_errmsg(db));
   733    735   }
   734    736   
................................................................................
   803    805   "  --dbid N             Use only the database where dbid=N\n"
   804    806   "  --export-db DIR      Write databases to files(s) in DIR. Works with --dbid\n"
   805    807   "  --export-sql DIR     Write SQL to file(s) in DIR. Also works with --sqlid\n"
   806    808   "  --help               Show this help text\n"
   807    809   "  -q|--quiet           Reduced output\n"
   808    810   "  --limit-mem N        Limit memory used by test SQLite instance to N bytes\n"
   809    811   "  --limit-vdbe         Panic if any test runs for more than 100,000 cycles\n"
   810         -"  --load-sql ARGS...   Load SQL scripts fro files into SOURCE-DB\n"
          812  +"  --load-sql ARGS...   Load SQL scripts fron files into SOURCE-DB\n"
   811    813   "  --load-db ARGS...    Load template databases from files into SOURCE_DB\n"
   812    814   "  -m TEXT              Add a description to the database\n"
   813    815   "  --native-vfs         Use the native VFS for initially empty database files\n"
   814    816   "  --native-malloc      Turn off MEMSYS3/5 and Lookaside\n"
   815    817   "  --oss-fuzz           Enable OSS-FUZZ testing\n"
   816    818   "  --prng-seed N        Seed value for the PRGN inside of SQLite\n"
   817    819   "  --rebuild            Rebuild and vacuum the database file\n"
................................................................................
   823    825   }
   824    826   
   825    827   int main(int argc, char **argv){
   826    828     sqlite3_int64 iBegin;        /* Start time of this program */
   827    829     int quietFlag = 0;           /* True if --quiet or -q */
   828    830     int verboseFlag = 0;         /* True if --verbose or -v */
   829    831     char *zInsSql = 0;           /* SQL statement for --load-db or --load-sql */
   830         -  int iFirstInsArg = 0;        /* First argv[] to use for --load-db or --load-sql */
          832  +  int iFirstInsArg = 0;        /* First argv[] for --load-db or --load-sql */
   831    833     sqlite3 *db = 0;             /* The open database connection */
   832    834     sqlite3_stmt *pStmt;         /* A prepared statement */
   833    835     int rc;                      /* Result code from SQLite interface calls */
   834    836     Blob *pSql;                  /* For looping over SQL scripts */
   835    837     Blob *pDb;                   /* For looping over template databases */
   836    838     int i;                       /* Loop index for the argv[] loop */
   837    839     int onlySqlid = -1;          /* --sqlid */
................................................................................
   843    845     int runFlags = 0;            /* Flags sent to runSql() */
   844    846     char *zMsg = 0;              /* Add this message */
   845    847     int nSrcDb = 0;              /* Number of source databases */
   846    848     char **azSrcDb = 0;          /* Array of source database names */
   847    849     int iSrcDb;                  /* Loop over all source databases */
   848    850     int nTest = 0;               /* Total number of tests performed */
   849    851     char *zDbName = "";          /* Appreviated name of a source database */
   850         -  const char *zFailCode = 0;   /* Value of the TEST_FAILURE environment variable */
          852  +  const char *zFailCode = 0;   /* Value of the TEST_FAILURE env variable */
   851    853     int cellSzCkFlag = 0;        /* --cell-size-check */
   852         -  int sqlFuzz = 0;             /* True for SQL fuzz testing. False for DB fuzz */
          854  +  int sqlFuzz = 0;             /* True for SQL fuzz. False for DB fuzz */
   853    855     int iTimeout = 120;          /* Default 120-second timeout */
   854    856     int nMem = 0;                /* Memory limit */
   855    857     int nMemThisDb = 0;          /* Memory limit set by the CONFIG table */
   856    858     char *zExpDb = 0;            /* Write Databases to files in this directory */
   857    859     char *zExpSql = 0;           /* Write SQL to files in this directory */
   858    860     void *pHeap = 0;             /* Heap for use by SQLite */
   859    861     int ossFuzz = 0;             /* enable OSS-FUZZ testing */
   860    862     int ossFuzzThisDb = 0;       /* ossFuzz value for this particular database */
   861    863     int nativeMalloc = 0;        /* Turn off MEMSYS3/5 and lookaside if true */
   862    864     sqlite3_vfs *pDfltVfs;       /* The default VFS */
          865  +  int openFlags4Data;          /* Flags for sqlite3_open_v2() */
   863    866   
   864    867     iBegin = timeOfDay();
   865    868   #ifdef __unix__
   866    869     signal(SIGALRM, timeoutHandler);
   867    870   #endif
   868    871     g.zArgv0 = argv[0];
          872  +  openFlags4Data = SQLITE_OPEN_READONLY;
   869    873     zFailCode = getenv("TEST_FAILURE");
   870    874     pDfltVfs = sqlite3_vfs_find(0);
   871    875     inmemVfsRegister(1);
   872    876     for(i=1; i<argc; i++){
   873    877       const char *z = argv[i];
   874    878       if( z[0]=='-' ){
   875    879         z++;
................................................................................
   902    906           nMem = integerValue(argv[++i]);
   903    907   #endif
   904    908         }else
   905    909         if( strcmp(z,"limit-vdbe")==0 ){
   906    910           vdbeLimitFlag = 1;
   907    911         }else
   908    912         if( strcmp(z,"load-sql")==0 ){
   909         -        zInsSql = "INSERT INTO xsql(sqltext) VALUES(CAST(readfile(?1) AS text))";
          913  +        zInsSql = "INSERT INTO xsql(sqltext)VALUES(CAST(readfile(?1) AS text))";
   910    914           iFirstInsArg = i+1;
          915  +        openFlags4Data = SQLITE_OPEN_READWRITE|SQLITE_OPEN_CREATE;
   911    916           break;
   912    917         }else
   913    918         if( strcmp(z,"load-db")==0 ){
   914    919           zInsSql = "INSERT INTO db(dbcontent) VALUES(readfile(?1))";
   915    920           iFirstInsArg = i+1;
          921  +        openFlags4Data = SQLITE_OPEN_READWRITE|SQLITE_OPEN_CREATE;
   916    922           break;
   917    923         }else
   918    924         if( strcmp(z,"m")==0 ){
   919    925           if( i>=argc-1 ) fatalError("missing arguments on %s", argv[i]);
   920    926           zMsg = argv[++i];
          927  +        openFlags4Data = SQLITE_OPEN_READWRITE|SQLITE_OPEN_CREATE;
   921    928         }else
   922    929         if( strcmp(z,"native-malloc")==0 ){
   923    930           nativeMalloc = 1;
   924    931         }else
   925    932         if( strcmp(z,"native-vfs")==0 ){
   926    933           nativeFlag = 1;
   927    934         }else
................................................................................
   934    941         }else
   935    942         if( strcmp(z,"quiet")==0 || strcmp(z,"q")==0 ){
   936    943           quietFlag = 1;
   937    944           verboseFlag = 0;
   938    945         }else
   939    946         if( strcmp(z,"rebuild")==0 ){
   940    947           rebuildFlag = 1;
          948  +        openFlags4Data = SQLITE_OPEN_READWRITE;
   941    949         }else
   942    950         if( strcmp(z,"result-trace")==0 ){
   943    951           runFlags |= SQL_OUTPUT;
   944    952         }else
   945    953         if( strcmp(z,"sqlid")==0 ){
   946    954           if( i>=argc-1 ) fatalError("missing arguments on %s", argv[i]);
   947    955           onlySqlid = integerValue(argv[++i]);
................................................................................
   979    987         fatalError("cannot import into more than one database");
   980    988       }
   981    989     }
   982    990   
   983    991     /* Process each source database separately */
   984    992     for(iSrcDb=0; iSrcDb<nSrcDb; iSrcDb++){
   985    993       rc = sqlite3_open_v2(azSrcDb[iSrcDb], &db,
   986         -                         SQLITE_OPEN_READWRITE, pDfltVfs->zName);
          994  +                         openFlags4Data, pDfltVfs->zName);
   987    995       if( rc ){
   988    996         fatalError("cannot open source database %s - %s",
   989    997         azSrcDb[iSrcDb], sqlite3_errmsg(db));
   990    998       }
   991    999       rc = sqlite3_exec(db,
   992   1000          "CREATE TABLE IF NOT EXISTS db(\n"
   993   1001          "  dbid INTEGER PRIMARY KEY, -- database id\n"
................................................................................
  1010   1018         if( rc ) fatalError("cannot change description: %s", sqlite3_errmsg(db));
  1011   1019       }
  1012   1020       ossFuzzThisDb = ossFuzz;
  1013   1021   
  1014   1022       /* If the CONFIG(name,value) table exists, read db-specific settings
  1015   1023       ** from that table */
  1016   1024       if( sqlite3_table_column_metadata(db,0,"config",0,0,0,0,0,0)==SQLITE_OK ){
  1017         -      rc = sqlite3_prepare_v2(db, "SELECT name, value FROM config", -1, &pStmt, 0);
         1025  +      rc = sqlite3_prepare_v2(db, "SELECT name, value FROM config",
         1026  +                                  -1, &pStmt, 0);
  1018   1027         if( rc ) fatalError("cannot prepare query of CONFIG table: %s",
  1019   1028                             sqlite3_errmsg(db));
  1020   1029         while( SQLITE_ROW==sqlite3_step(pStmt) ){
  1021   1030           const char *zName = (const char *)sqlite3_column_text(pStmt,0);
  1022   1031           if( zName==0 ) continue;
  1023   1032           if( strcmp(zName, "oss-fuzz")==0 ){
  1024   1033             ossFuzzThisDb = sqlite3_column_int(pStmt,1);
................................................................................
  1049   1058           sqlite3_bind_text(pStmt, 1, argv[i], -1, SQLITE_STATIC);
  1050   1059           sqlite3_step(pStmt);
  1051   1060           rc = sqlite3_reset(pStmt);
  1052   1061           if( rc ) fatalError("insert failed for %s", argv[i]);
  1053   1062         }
  1054   1063         sqlite3_finalize(pStmt);
  1055   1064         rc = sqlite3_exec(db, "COMMIT", 0, 0, 0);
  1056         -      if( rc ) fatalError("cannot commit the transaction: %s", sqlite3_errmsg(db));
         1065  +      if( rc ) fatalError("cannot commit the transaction: %s",
         1066  +                          sqlite3_errmsg(db));
  1057   1067         rebuild_database(db);
  1058   1068         sqlite3_close(db);
  1059   1069         return 0;
  1060   1070       }
  1061   1071       rc = sqlite3_exec(db, "PRAGMA query_only=1;", 0, 0, 0);
  1062   1072       if( rc ) fatalError("cannot set database to query-only");
  1063   1073       if( zExpDb!=0 || zExpSql!=0 ){
................................................................................
  1193   1203               prevAmt = amt;
  1194   1204             }
  1195   1205           }
  1196   1206           createVFile("main.db", pDb->sz, pDb->a);
  1197   1207           sqlite3_randomness(0,0);
  1198   1208           if( ossFuzzThisDb ){
  1199   1209   #ifndef SQLITE_OSS_FUZZ
  1200         -          fatalError("--oss-fuzz not supported: recompile with -DSQLITE_OSS_FUZZ");
         1210  +          fatalError("--oss-fuzz not supported: recompile"
         1211  +                     " with -DSQLITE_OSS_FUZZ");
  1201   1212   #else
  1202   1213             extern int LLVMFuzzerTestOneInput(const uint8_t*, size_t);
  1203   1214             LLVMFuzzerTestOneInput((const uint8_t*)pSql->a, (size_t)pSql->sz);
  1204   1215   #endif
  1205   1216           }else{
  1206   1217             openFlags = SQLITE_OPEN_CREATE | SQLITE_OPEN_READWRITE;
  1207   1218             if( nativeFlag && pDb->sz==0 ){
................................................................................
  1212   1223             if( rc ) fatalError("cannot open inmem database");
  1213   1224             sqlite3_limit(db, SQLITE_LIMIT_LENGTH, 100000000);
  1214   1225             sqlite3_limit(db, SQLITE_LIMIT_LIKE_PATTERN_LENGTH, 50);
  1215   1226             if( cellSzCkFlag ) runSql(db, "PRAGMA cell_size_check=ON", runFlags);
  1216   1227             setAlarm(iTimeout);
  1217   1228   #ifndef SQLITE_OMIT_PROGRESS_CALLBACK
  1218   1229             if( sqlFuzz || vdbeLimitFlag ){
  1219         -            sqlite3_progress_handler(db, 100000, progressHandler, &vdbeLimitFlag);
         1230  +            sqlite3_progress_handler(db, 100000, progressHandler,
         1231  +                                     &vdbeLimitFlag);
  1220   1232             }
  1221   1233   #endif
  1222   1234             do{
  1223   1235               runSql(db, (char*)pSql->a, runFlags);
  1224   1236             }while( timeoutTest );
  1225   1237             setAlarm(0);
  1226   1238             sqlite3_exec(db, "PRAGMA temp_store_directory=''", 0, 0, 0);

Changes to test/fuzzdata5.db.

cannot compute difference between binary files

Added test/fuzzdata6.db.

cannot compute difference between binary files