/ Check-in [62829164]
Login

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

Overview
Comment:Merge the offical 3.27.0 release.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | apple-osx
Files: files | file ages | folders
SHA3-256: 628291641f6a9a825b2d7344036813cd50452a2b970d2cd035a3323275a9dab1
User & Date: drh 2019-02-07 18:49:41
Context
2019-02-07
19:28
Pull in the change that causes VACUUM to preserve rowid values. check-in: c9af2f71 user: drh tags: apple-osx
18:49
Merge the offical 3.27.0 release. check-in: 62829164 user: drh tags: apple-osx
17:02
Version 3.27.0 check-in: 97744701 user: drh tags: trunk, release, version-3.27.0
2019-01-29
19:17
Merge enhancements from trunk. check-in: 31efcc37 user: drh tags: apple-osx
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to Makefile.in.

  1344   1344   showwal$(TEXE):	$(TOP)/tool/showwal.c sqlite3.lo
  1345   1345   	$(LTLINK) -o $@ $(TOP)/tool/showwal.c sqlite3.lo $(TLIBS)
  1346   1346   
  1347   1347   showshm$(TEXE):	$(TOP)/tool/showshm.c
  1348   1348   	$(LTLINK) -o $@ $(TOP)/tool/showshm.c
  1349   1349   
  1350   1350   index_usage$(TEXE): $(TOP)/tool/index_usage.c sqlite3.lo
  1351         -	$(LTLINK) -o $@ $(TOP)/tool/index_usage.c sqlite3.lo $(TLIBS)
         1351  +	$(LTLINK) $(SHELL_OPT) -o $@ $(TOP)/tool/index_usage.c sqlite3.lo $(TLIBS)
  1352   1352   
  1353   1353   changeset$(TEXE):	$(TOP)/ext/session/changeset.c sqlite3.lo
  1354   1354   	$(LTLINK) -o $@ $(TOP)/ext/session/changeset.c sqlite3.lo $(TLIBS)
  1355   1355   
  1356   1356   changesetfuzz$(TEXE):	$(TOP)/ext/session/changesetfuzz.c sqlite3.lo
  1357   1357   	$(LTLINK) -o $@ $(TOP)/ext/session/changesetfuzz.c sqlite3.lo $(TLIBS)
  1358   1358   

Changes to ext/fts3/fts3_snippet.c.

   472    472     pPhrase->nToken = pExpr->pPhrase->nToken;
   473    473     rc = sqlite3Fts3EvalPhrasePoslist(p->pCsr, pExpr, p->iCol, &pCsr);
   474    474     assert( rc==SQLITE_OK || pCsr==0 );
   475    475     if( pCsr ){
   476    476       int iFirst = 0;
   477    477       pPhrase->pList = pCsr;
   478    478       fts3GetDeltaPosition(&pCsr, &iFirst);
   479         -    assert( iFirst>=0 );
   480         -    pPhrase->pHead = pCsr;
   481         -    pPhrase->pTail = pCsr;
   482         -    pPhrase->iHead = iFirst;
   483         -    pPhrase->iTail = iFirst;
          479  +    if( iFirst<0 ){
          480  +      rc = FTS_CORRUPT_VTAB;
          481  +    }else{
          482  +      pPhrase->pHead = pCsr;
          483  +      pPhrase->pTail = pCsr;
          484  +      pPhrase->iHead = iFirst;
          485  +      pPhrase->iTail = iFirst;
          486  +    }
   484    487     }else{
   485    488       assert( rc!=SQLITE_OK || (
   486    489          pPhrase->pList==0 && pPhrase->pHead==0 && pPhrase->pTail==0 
   487    490       ));
   488    491     }
   489    492   
   490    493     return rc;

Changes to ext/fts5/fts5_index.c.

  1648   1648   */
  1649   1649   static void fts5SegIterLoadTerm(Fts5Index *p, Fts5SegIter *pIter, int nKeep){
  1650   1650     u8 *a = pIter->pLeaf->p;        /* Buffer to read data from */
  1651   1651     int iOff = pIter->iLeafOffset;  /* Offset to read at */
  1652   1652     int nNew;                       /* Bytes of new data */
  1653   1653   
  1654   1654     iOff += fts5GetVarint32(&a[iOff], nNew);
  1655         -  if( iOff+nNew>pIter->pLeaf->szLeaf || nKeep>pIter->term.n ){
         1655  +  if( iOff+nNew>pIter->pLeaf->szLeaf || nKeep>pIter->term.n || nNew==0 ){
  1656   1656       p->rc = FTS5_CORRUPT;
  1657   1657       return;
  1658   1658     }
  1659   1659     pIter->term.n = nKeep;
  1660   1660     fts5BufferAppendBlob(&p->rc, &pIter->term, nNew, &a[iOff]);
  1661   1661     assert( pIter->term.n<=pIter->term.nSpace );
  1662   1662     iOff += nNew;
................................................................................
  2322   2322           }
  2323   2323         }
  2324   2324       }while( 1 );
  2325   2325     }
  2326   2326   
  2327   2327    search_success:
  2328   2328     pIter->iLeafOffset = iOff + nNew;
  2329         -  if( pIter->iLeafOffset>n ){
         2329  +  if( pIter->iLeafOffset>n || nNew<1 ){
  2330   2330       p->rc = FTS5_CORRUPT;
  2331   2331       return;
  2332   2332     }
  2333   2333     pIter->iTermLeafOffset = pIter->iLeafOffset;
  2334   2334     pIter->iTermLeafPgno = pIter->iLeafPgno;
  2335   2335   
  2336   2336     fts5BufferSet(&p->rc, &pIter->term, nKeep, pTerm);
................................................................................
  3100   3100   */
  3101   3101   static void fts5SegiterPoslist(
  3102   3102     Fts5Index *p,
  3103   3103     Fts5SegIter *pSeg,
  3104   3104     Fts5Colset *pColset,
  3105   3105     Fts5Buffer *pBuf
  3106   3106   ){
  3107         -  if( 0==fts5BufferGrow(&p->rc, pBuf, pSeg->nPos) ){
         3107  +  if( 0==fts5BufferGrow(&p->rc, pBuf, pSeg->nPos+FTS5_DATA_ZERO_PADDING) ){
         3108  +    memset(&pBuf->p[pBuf->n+pSeg->nPos], 0, FTS5_DATA_ZERO_PADDING);
  3108   3109       if( pColset==0 ){
  3109   3110         fts5ChunkIterate(p, pSeg, (void*)pBuf, fts5PoslistCallback);
  3110   3111       }else{
  3111   3112         if( p->pConfig->eDetail==FTS5_DETAIL_FULL ){
  3112   3113           PoslistCallbackCtx sCtx;
  3113   3114           sCtx.pBuf = pBuf;
  3114   3115           sCtx.pColset = pColset;
................................................................................
  4547   4548             iRowid += iDelta;
  4548   4549             
  4549   4550             if( writer.bFirstRowidInPage ){
  4550   4551               fts5PutU16(&pBuf->p[0], (u16)pBuf->n);   /* first rowid on page */
  4551   4552               pBuf->n += sqlite3Fts5PutVarint(&pBuf->p[pBuf->n], iRowid);
  4552   4553               writer.bFirstRowidInPage = 0;
  4553   4554               fts5WriteDlidxAppend(p, &writer, iRowid);
         4555  +            if( p->rc!=SQLITE_OK ) break;
  4554   4556             }else{
  4555   4557               pBuf->n += sqlite3Fts5PutVarint(&pBuf->p[pBuf->n], iDelta);
  4556   4558             }
  4557   4559             assert( pBuf->n<=pBuf->nSpace );
  4558   4560   
  4559   4561             if( eDetail==FTS5_DETAIL_NONE ){
  4560   4562               if( iOff<nDoclist && pDoclist[iOff]==0 ){
................................................................................
  4778   4780   static void fts5AppendPoslist(
  4779   4781     Fts5Index *p,
  4780   4782     i64 iDelta,
  4781   4783     Fts5Iter *pMulti,
  4782   4784     Fts5Buffer *pBuf
  4783   4785   ){
  4784   4786     int nData = pMulti->base.nData;
         4787  +  int nByte = nData + 9 + 9 + FTS5_DATA_ZERO_PADDING;
  4785   4788     assert( nData>0 );
  4786         -  if( p->rc==SQLITE_OK && 0==fts5BufferGrow(&p->rc, pBuf, nData+9+9) ){
         4789  +  if( p->rc==SQLITE_OK && 0==fts5BufferGrow(&p->rc, pBuf, nByte) ){
  4787   4790       fts5BufferSafeAppendVarint(pBuf, iDelta);
  4788   4791       fts5BufferSafeAppendVarint(pBuf, nData*2);
  4789   4792       fts5BufferSafeAppendBlob(pBuf, pMulti->base.pData, nData);
         4793  +    memset(&pBuf->p[pBuf->n], 0, FTS5_DATA_ZERO_PADDING);
  4790   4794     }
  4791   4795   }
  4792   4796   
  4793   4797   
  4794   4798   static void fts5DoclistIterNext(Fts5DoclistIter *pIter){
  4795   4799     u8 *p = pIter->aPoslist + pIter->nSize + pIter->nPoslist;
  4796   4800   
................................................................................
  4996   5000               if( iPos1<iPos2 ){
  4997   5001                 if( iPos1!=iPrev ){
  4998   5002                   sqlite3Fts5PoslistSafeAppend(&tmp, &iPrev, iPos1);
  4999   5003                 }
  5000   5004                 sqlite3Fts5PoslistNext64(a1, i1.nPoslist, &iOff1, &iPos1);
  5001   5005                 if( iPos1<0 ) break;
  5002   5006               }else{
  5003         -              assert( iPos2!=iPrev );
         5007  +              assert_nc( iPos2!=iPrev );
  5004   5008                 sqlite3Fts5PoslistSafeAppend(&tmp, &iPrev, iPos2);
  5005   5009                 sqlite3Fts5PoslistNext64(a2, i2.nPoslist, &iOff2, &iPos2);
  5006   5010                 if( iPos2<0 ) break;
  5007   5011               }
  5008   5012             }
  5009   5013           }
  5010   5014   
................................................................................
  6422   6426         goto decode_out;
  6423   6427       }
  6424   6428       fts5DecodePoslist(&rc, &s, &a[4], iOff-4);
  6425   6429   
  6426   6430       /* Decode any more doclist data that appears on the page before the
  6427   6431       ** first term. */
  6428   6432       nDoclist = (iTermOff ? iTermOff : szLeaf) - iOff;
         6433  +    if( nDoclist+iOff>n ){
         6434  +      rc = FTS5_CORRUPT;
         6435  +      goto decode_out;
         6436  +    }
  6429   6437       fts5DecodeDoclist(&rc, &s, &a[iOff], nDoclist);
  6430   6438   
  6431   6439       while( iPgidxOff<n && rc==SQLITE_OK ){
  6432   6440         int bFirst = (iPgidxOff==szLeaf);     /* True for first term on page */
  6433   6441         int nByte;                            /* Bytes of data */
  6434   6442         int iEnd;
  6435   6443         

Changes to ext/fts5/fts5_main.c.

   284    284         assert( iSavepoint>=0 );
   285    285         assert( iSavepoint<=p->ts.iSavepoint );
   286    286         p->ts.iSavepoint = iSavepoint-1;
   287    287         break;
   288    288   
   289    289       case FTS5_ROLLBACKTO:
   290    290         assert( p->ts.eState==1 );
   291         -      assert( iSavepoint>=0 );
          291  +      assert( iSavepoint>=-1 );
   292    292         assert( iSavepoint<=p->ts.iSavepoint );
   293    293         p->ts.iSavepoint = iSavepoint;
   294    294         break;
   295    295     }
   296    296   }
   297    297   #else
   298    298   # define fts5CheckTransactionState(x,y,z)

Changes to ext/fts5/fts5_vocab.c.

   480    480       if( sqlite3Fts5IterEof(pCsr->pIter) ){
   481    481         pCsr->bEof = 1;
   482    482       }else{
   483    483         const char *zTerm;
   484    484         int nTerm;
   485    485   
   486    486         zTerm = sqlite3Fts5IterTerm(pCsr->pIter, &nTerm);
          487  +      assert( nTerm>=0 );
   487    488         if( pCsr->nLeTerm>=0 ){
   488    489           int nCmp = MIN(nTerm, pCsr->nLeTerm);
   489    490           int bCmp = memcmp(pCsr->zLeTerm, zTerm, nCmp);
   490    491           if( bCmp<0 || (bCmp==0 && pCsr->nLeTerm<nTerm) ){
   491    492             pCsr->bEof = 1;
   492    493             return SQLITE_OK;
   493    494           }

Changes to ext/fts5/test/fts5ai.test.

    47     47       ROLLBACK TO one;
    48     48     COMMIT;
    49     49   }
    50     50   
    51     51   do_execsql_test 1.2 {
    52     52     INSERT INTO t1(t1) VALUES('integrity-check');
    53     53   }
           54  +
           55  +do_execsql_test 1.3 {
           56  +  SAVEPOINT one;
           57  +    INSERT INTO t1 VALUES('v w x');
           58  +  ROLLBACK TO one;
           59  +}
    54     60   }
    55     61   
    56     62   
    57     63   finish_test

Changes to ext/fts5/test/fts5corrupt3.test.

  2425   2425   |   4064: 69 74 79 2d 63 68 65 63 6b 09 02 02 1b 72 65 62   ity-check....reb
  2426   2426   |   4080: 75 69 6c 64 0a 01 02 1d 6f 70 74 69 6d 69 7a 65   uild....optimize
  2427   2427   | end crash-b87dfef02880fe.db
  2428   2428   }]} {}
  2429   2429   
  2430   2430   do_catchsql_test 24.1 {
  2431   2431     UPDATE t1 SET b=quote(zeroblob(200)) WHERE a MATCH 'thread*';
  2432         -} {0 {}}
         2432  +} {1 {database disk image is malformed}}
  2433   2433   
  2434   2434   do_catchsql_test 24.2 {
  2435   2435     INSERT INTO t1(t1) VALUES('integrity-check');
  2436   2436   } {1 {database disk image is malformed}}
  2437   2437   
  2438   2438   #--------------------------------------------------------------------------
  2439   2439   reset_db
................................................................................
  6419   6419   
  6420   6420   do_catchsql_test 47.1 {
  6421   6421     SELECT snippet(t1, -1, '.', '..', '[', 50), 
  6422   6422            highlight(t1, 2, '[', ']') FROM t1('g h') 
  6423   6423     WHERE rank MATCH 'bm25(1.0, 1.0)' ORDER BY rank;
  6424   6424   } {1 {database disk image is malformed}}
  6425   6425   
         6426  +#--------------------------------------------------------------------------
         6427  +reset_db
         6428  +do_test 48.0 {
         6429  +  sqlite3 db {}
         6430  +  db deserialize [decode_hexdb {
         6431  +| size 32768 pagesize 4096 filename crash-44a8305b4bd86f.db
         6432  +| page 1 offset 0
         6433  +|      0: 53 51 4c 69 74 65 20 66 6f 72 6d 61 74 20 33 00   SQLite format 3.
         6434  +|     16: 10 00 01 01 00 40 20 20 00 00 00 00 00 00 00 08   .....@  ........
         6435  +|     32: 00 00 00 02 00 00 00 01 00 00 00 09 00 00 00 04   ................
         6436  +|     48: 00 00 00 00 00 00 00 00 00 00 00 01 00 00 00 00   ................
         6437  +|     96: 00 00 00 00 0d 0f c7 00 07 0d 92 00 0f 8d 0f 36   ...............6
         6438  +|    112: 0e cb 0e 6b 0e 0e 0d b6 0d 92 0d 92 00 00 00 00   ...k............
         6439  +|   3472: 00 00 22 08 06 17 11 11 01 31 74 61 62 6c 65 74   .........1tablet
         6440  +|   3488: 32 74 32 08 43 52 45 41 54 45 20 54 41 42 4c 45   2t2.CREATE TABLE
         6441  +|   3504: 20 74 32 28 78 29 56 07 06 17 1f 1f 01 7d 74 61    t2(x)V.......ta
         6442  +|   3520: 62 6c 65 74 31 5f 63 6f 6e 66 69 67 74 31 5f 63   blet1_configt1_c
         6443  +|   3536: 6f 6e 66 69 67 07 43 52 45 41 54 45 20 54 41 42   onfig.CREATE TAB
         6444  +|   3552: 4c 45 20 27 74 31 5f 63 6f 6e 66 69 67 27 28 6b   LE 't1_config'(k
         6445  +|   3568: 20 50 52 49 4d 41 52 59 20 4b 45 59 2c 20 76 29    PRIMARY KEY, v)
         6446  +|   3584: 20 57 49 54 48 4f 55 54 20 52 4f 57 49 44 5b 06    WITHOUT ROWID[.
         6447  +|   3600: 07 17 21 21 01 81 01 74 61 62 6c 65 74 31 5f 64   ..!!...tablet1_d
         6448  +|   3616: 6f 63 73 69 7a 65 74 31 5f 64 6f 63 73 69 7a 65   ocsizet1_docsize
         6449  +|   3632: 06 43 52 45 41 54 45 20 54 41 42 4c 45 20 27 74   .CREATE TABLE 't
         6450  +|   3648: 31 5f 64 6f 63 73 69 7a 65 27 28 69 64 20 49 4e   1_docsize'(id IN
         6451  +|   3664: 54 45 47 45 52 20 50 52 49 4d 41 52 59 20 4b 45   TEGER PRIMARY KE
         6452  +|   3680: 59 2c 20 73 7a 20 42 4c 4f 42 29 5e 05 07 17 21   Y, sz BLOB)^...!
         6453  +|   3696: 21 01 81 07 74 61 62 6c 65 74 31 5f 63 6f 6e 74   !...tablet1_cont
         6454  +|   3712: 65 6e 74 74 31 5f 63 6f 6e 74 65 6e 74 05 43 52   entt1_content.CR
         6455  +|   3728: 45 41 54 45 20 54 41 42 4c 45 20 27 74 31 5f 63   EATE TABLE 't1_c
         6456  +|   3744: 6f 6e 74 65 6e 74 27 28 69 64 20 49 4e 54 45 47   ontent'(id INTEG
         6457  +|   3760: 45 52 20 50 52 49 4d 41 52 59 20 4b 45 59 2c 20   ER PRIMARY KEY, 
         6458  +|   3776: 63 30 2c 20 63 31 2c 20 63 32 29 69 04 07 17 19   c0, c1, c2)i....
         6459  +|   3792: 19 01 81 2d 74 61 62 6c 65 74 31 5f 69 64 78 74   ...-tablet1_idxt
         6460  +|   3808: 31 5f 69 64 78 04 43 52 45 41 54 45 20 54 41 42   1_idx.CREATE TAB
         6461  +|   3824: 4c 45 20 27 74 31 5f 69 64 78 27 28 73 65 67 69   LE 't1_idx'(segi
         6462  +|   3840: 64 2c 20 74 65 72 6d 2c 20 70 67 6e 6f 2c 20 50   d, term, pgno, P
         6463  +|   3856: 52 49 4d 41 52 59 20 4b 45 59 28 73 65 67 69 64   RIMARY KEY(segid
         6464  +|   3872: 2c 20 74 65 72 6d 29 29 20 57 49 54 48 4f 55 54   , term)) WITHOUT
         6465  +|   3888: 20 52 4f 57 49 44 55 03 07 17 1b 1b 01 81 01 74    ROWIDU........t
         6466  +|   3904: 61 62 6c 65 74 31 5f 64 61 74 61 74 31 5f 64 61   ablet1_datat1_da
         6467  +|   3920: 74 61 03 43 52 45 41 54 45 20 54 41 42 4c 45 20   ta.CREATE TABLE 
         6468  +|   3936: 27 74 31 5f 64 61 74 61 27 28 69 64 20 49 4e 54   't1_data'(id INT
         6469  +|   3952: 45 47 45 52 20 50 52 49 4d 41 52 59 20 4b 45 59   EGER PRIMARY KEY
         6470  +|   3968: 2c 20 62 6c 6f 63 6b 20 42 4c 4f 42 29 38 02 06   , block BLOB)8..
         6471  +|   3984: 17 11 11 08 5f 74 61 62 6c 65 74 31 74 31 43 52   ...._tablet1t1CR
         6472  +|   4000: 45 41 54 45 20 56 49 52 54 55 41 4c 20 54 41 42   EATE VIRTUAL TAB
         6473  +|   4016: 4c 45 20 74 31 20 55 53 49 4e 47 20 66 74 73 35   LE t1 USING fts5
         6474  +|   4032: 28 61 2c 62 2c 63 29 00 00 00 39 00 00 00 00 00   (a,b,c)...9.....
         6475  +| page 3 offset 8192
         6476  +|      0: 0d 00 00 00 03 0c 94 00 0f e6 0f ef 0c 94 00 00   ................
         6477  +|   3216: 00 00 00 00 86 4a 84 80 80 80 80 01 04 00 8d 18   .....J..........
         6478  +|   3232: 00 00 03 2b 02 30 30 01 02 06 01 02 06 01 02 06   ...+.00.........
         6479  +|   3248: 1f 02 03 01 02 03 01 02 03 01 08 32 30 31 36 30   ...........20160
         6480  +|   3264: 36 30 39 01 02 07 01 02 07 01 02 07 01 01 34 01   609...........4.
         6481  +|   3280: 02 05 01 02 05 01 02 05 01 01 35 01 02 04 01 02   ..........5.....
         6482  +|   3296: 04 01 02 04 02 07 30 30 30 30 30 30 30 1c 02 04   ......0000000...
         6483  +|   3312: 01 02 04 01 02 04 01 06 62 69 6e 62 72 79 03 06   ........binbry..
         6484  +|   3328: 01 02 02 03 06 01 02 02 03 06 01 02 01 03 16 01   ................
         6485  +|   3344: 02 02 03 06 01 02 02 03 06 01 02 02 03 06 01 02   ................
         6486  +|   3360: 02 03 06 01 02 02 03 06 01 02 02 03 06 01 02 02   ................
         6487  +|   3376: 03 04 71 02 02 03 06 01 02 02 01 08 63 6f 6d 70   ..q.........comp
         6488  +|   3392: 69 6c 65 72 01 02 02 01 02 02 01 02 02 01 06 64   iler...........d
         6489  +|   3408: 62 73 74 61 74 07 02 03 01 02 03 01 02 03 02 04   bstat...........
         6490  +|   3424: 65 62 75 67 04 02 02 01 02 02 01 02 02 01 06 65   ebug...........e
         6491  +|   3440: 6e 61 62 6c 65 07 02 02 01 02 02 01 02 02 01 02   nable...........
         6492  +|   3456: 02 01 02 02 01 02 02 01 02 02 01 02 02 01 03 02   ................
         6493  +|   3472: 01 02 02 01 02 02 01 02 02 01 02 02 01 02 02 01   ................
         6494  +|   3488: 02 02 01 02 02 01 02 02 01 02 02 01 02 02 01 02   ................
         6495  +|   3504: 02 01 02 02 02 08 78 74 65 6e 73 69 6f 6e 1f 02   ......xtension..
         6496  +|   3520: 04 01 02 04 01 02 04 01 04 66 74 73 34 0a 02 03   .........fts4...
         6497  +|   3536: 01 02 03 01 02 03 04 01 35 0d 02 03 01 02 03 01   ........5.......
         6498  +|   3552: 02 03 01 03 67 63 63 01 02 03 01 02 03 01 02 03   ....gcc.........
         6499  +|   3568: 02 06 65 6f 70 6f 6c 79 10 02 03 01 02 03 01 02   ..eopoly........
         6500  +|   3584: 03 01 05 6a 73 6f 6e 31 13 02 03 01 02 03 01 02   ...json1........
         6501  +|   3600: 03 01 04 6c 6f 61 64 1f 02 03 01 02 03 01 02 03   ...load.........
         6502  +|   3616: 01 03 6d 61 78 1c 02 02 01 02 02 01 02 02 02 05   ..max...........
         6503  +|   3632: 65 6d 6f 72 79 1c 02 03 01 02 03 01 02 03 04 04   emory...........
         6504  +|   3648: 73 79 73 35 16 02 03 01 02 03 01 02 03 01 06 6e   sys5...........n
         6505  +|   3664: 6f 63 61 73 65 02 06 01 02 02 03 06 01 02 02 03   ocase...........
         6506  +|   3680: 06 01 02 02 03 06 01 02 02 03 06 01 02 02 13 06   ................
         6507  +|   3696: 01 02 02 03 06 01 02 02 03 06 01 02 02 03 06 01   ................
         6508  +|   3712: 02 02 03 06 01 02 02 03 06 01 02 02 03 06 01 02   ................
         6509  +|   3728: 02 01 04 6f 6d 69 74 1f 02 02 01 02 02 01 02 02   ...omit.........
         6510  +|   3744: 01 05 72 74 72 65 65 19 02 03 01 02 03 01 02 03   ..rtree.........
         6511  +|   3760: 04 02 69 6d 01 06 01 02 02 03 06 01 02 02 03 06   ..im............
         6512  +|   3776: 01 02 02 03 06 01 02 02 03 06 01 02 02 03 06 01   ................
         6513  +|   3792: 02 02 03 06 01 02 02 03 06 01 02 02 03 06 01 02   ................
         6514  +|   3808: 02 03 06 01 02 02 03 06 01 02 02 03 06 01 02 02   ................
         6515  +|   3824: 01 0a 74 68 72 65 61 64 73 61 66 65 22 02 02 01   ..threadsafe....
         6516  +|   3840: 02 02 01 02 02 01 04 76 74 61 62 07 02 04 01 02   .......vtab.....
         6517  +|   3856: 04 01 02 04 01 01 78 01 06 01 01 02 01 06 01 01   ......x.........
         6518  +|   3872: 02 01 06 01 01 02 01 06 01 01 02 01 06 01 01 02   ................
         6519  +|   3888: 01 06 01 01 02 01 06 01 01 02 01 06 01 01 02 01   ................
         6520  +|   3904: 06 01 01 02 01 06 01 01 02 01 06 01 01 02 01 06   ................
         6521  +|   3920: 01 01 02 01 06 01 01 02 01 06 01 01 02 01 06 01   ................
         6522  +|   3936: 01 02 01 06 01 01 02 01 06 01 01 02 01 06 01 01   ................
         6523  +|   3952: 02 01 06 01 01 02 01 06 01 01 02 01 06 01 01 02   ................
         6524  +|   3968: 01 06 01 01 02 01 06 01 01 02 01 06 01 01 02 01   ................
         6525  +|   3984: 06 01 01 02 01 06 01 01 02 01 06 01 01 02 01 06   ................
         6526  +|   4000: 01 01 02 01 06 01 01 02 01 06 01 01 02 01 06 01   ................
         6527  +|   4016: 01 02 01 06 01 01 02 01 06 01 01 02 01 06 01 01   ................
         6528  +|   4032: 02 01 06 01 01 02 01 06 01 01 02 04 15 13 0c 0c   ................
         6529  +|   4048: 12 44 13 11 0f 47 13 0f 0c 0e 11 10 0f 0e 10 0f   .D...G..........
         6530  +|   4064: 44 0f 10 40 15 0f 07 01 03 00 14 24 5a 24 24 0f   D..@.......$Z$$.
         6531  +|   4080: 0a 03 00 24 00 00 00 00 01 01 01 00 01 01 01 01   ...$............
         6532  +| page 4 offset 12288
         6533  +|      0: 0a 00 00 00 01 0f fa 00 0f fa 00 00 00 00 00 00   ................
         6534  +|   4080: 00 00 00 00 00 00 00 00 00 00 05 04 09 0b 01 02   ................
         6535  +| page 5 offset 16384
         6536  +|      0: 0d 00 00 00 24 0c 0a 00 0f d8 0f af 0f 86 0f 74   ....$..........t
         6537  +|     16: 0f 61 0f 4e 0f 2f 0f 0f 0e ef 0e d7 0e be 0e a5   .a.N./..........
         6538  +|     32: 0e 8d 0e 74 0e 5b 0e 40 0e 24 0e 08 0d ef 0d d5   ...t.[.@.$......
         6539  +|     48: 0d bb 0d a0 0d 84 0d 68 0d 4f 0d 35 0d 1b 0c fb   .......h.O.5....
         6540  +|     64: 0c da 0c b9 0c 99 0c 78 0c 57 0c 3e 0c 24 0c 0a   .......x.W.>.$..
         6541  +|   3072: 00 00 00 00 00 00 00 00 00 00 18 24 05 00 25 0f   ...........$..%.
         6542  +|   3088: 19 54 48 52 45 41 44 53 41 46 45 3d 30 58 42 49   .THREADSAFE=0XBI
         6543  +|   3104: 4f 41 52 59 18 23 05 00 25 0f 19 54 48 52 45 41   OARY.#..%..THREA
         6544  +|   3120: 44 53 41 46 45 3d 30 58 4e 4f 43 41 53 45 17 22   DSAFE=0XNOCASE..
         6545  +|   3136: 05 00 25 0f 17 54 48 52 45 41 44 53 41 46 45 3d   ..%..THREADSAFE=
         6546  +|   3152: 30 58 52 54 52 49 4d 1f 21 05 00 33 0f 19 4f 4d   0XRTRIM.!..3..OM
         6547  +|   3168: 49 54 20 4c 4f 41 44 20 45 58 54 45 4e 53 49 4f   IT LOAD EXTENSIO
         6548  +|   3184: 4e 58 42 49 4e 41 52 59 1f 20 05 00 33 0f 19 4f   NXBINARY. ..3..O
         6549  +|   3200: 4d 49 54 20 4c 4f 41 44 20 45 58 54 45 4e 53 49   MIT LOAD EXTENSI
         6550  +|   3216: 4f 4e 58 4e 4f 43 41 53 45 1e 1f 05 00 33 0f 17   ONXNOCASE....3..
         6551  +|   3232: 4f 4d 49 54 20 4c 4f 41 44 20 45 58 54 45 4e 53   OMIT LOAD EXTENS
         6552  +|   3248: 49 4f 4e 58 52 54 52 49 4d 1f 1e 05 00 33 0f 19   IONXRTRIM....3..
         6553  +|   3264: 4d 41 58 20 4d 45 4d 4f 52 59 3d 35 30 30 30 30   MAX MEMORY=50000
         6554  +|   3280: 30 30 30 58 42 49 4e 41 52 59 1f 1d 05 00 33 0f   000XBINARY....3.
         6555  +|   3296: 19 4d 41 58 20 4d 45 4d 4f 52 59 3d 35 30 30 30   .MAX MEMORY=5000
         6556  +|   3312: 30 30 30 30 58 4e 4f 43 41 53 45 1e 1c 05 00 33   0000XNOCASE....3
         6557  +|   3328: 0f 17 4d 41 58 20 4d 45 4d 4f 52 59 3d 35 30 30   ..MAX MEMORY=500
         6558  +|   3344: 30 30 30 30 30 58 52 54 52 49 4d 18 1b 05 00 25   00000XRTRIM....%
         6559  +|   3360: 0f 19 45 4e 41 42 4c 45 20 52 54 52 45 45 58 42   ..ENABLE RTREEXB
         6560  +|   3376: 49 4e 41 52 59 18 1a 05 00 25 0f 19 45 4e 41 42   INARY....%..ENAB
         6561  +|   3392: 4c 45 20 52 54 52 46 45 58 4e 4f 43 41 53 45 17   LE RTRFEXNOCASE.
         6562  +|   3408: 19 05 00 25 0f 17 45 4e 41 42 4c 45 20 52 54 52   ...%..ENABLE RTR
         6563  +|   3424: 45 45 58 52 54 52 49 4d 1a 18 05 00 29 0f 19 45   EEXRTRIM....)..E
         6564  +|   3440: 4e 41 42 4c 45 20 4d 45 4d 53 59 53 35 58 42 49   NABLE MEMSYS5XBI
         6565  +|   3456: 4e 41 52 59 1a 17 05 00 29 0f 19 45 4e 41 42 4c   NARY....)..ENABL
         6566  +|   3472: 45 20 4d 45 4d 53 59 53 35 58 4e 4f 43 41 53 45   E MEMSYS5XNOCASE
         6567  +|   3488: 19 16 05 00 29 0f 17 45 4e 41 42 4c 45 20 4d 45   ....)..ENABLE ME
         6568  +|   3504: 4d 53 59 53 35 58 52 54 52 49 4d 18 15 05 00 25   MSYS5XRTRIM....%
         6569  +|   3520: 0f 19 45 4e 41 42 4c 45 20 4a 53 4f 4e 31 58 42   ..ENABLE JSON1XB
         6570  +|   3536: 49 4e 41 52 59 18 14 05 00 25 0f 19 45 4e 41 42   INARY....%..ENAB
         6571  +|   3552: 4c 45 20 4a 53 4f 4e 31 58 4e 4f 43 41 53 45 17   LE JSON1XNOCASE.
         6572  +|   3568: 13 05 00 25 0f 17 45 4e 41 42 4c 45 20 4a 53 4f   ...%..ENABLE JSO
         6573  +|   3584: 4e 31 58 52 54 52 49 4d 1a 12 05 00 29 0f 19 45   N1XRTRIM....)..E
         6574  +|   3600: 4e 41 42 4c 45 20 47 45 4f 50 4f 4c 59 57 42 49   NABLE GEOPOLYWBI
         6575  +|   3616: 4e 41 52 59 1a 11 05 00 29 0f 19 45 4e 41 42 4c   NARY....)..ENABL
         6576  +|   3632: 45 20 47 45 4f 50 4f 4c 59 58 4e 4f 42 41 53 45   E GEOPOLYXNOBASE
         6577  +|   3648: 19 10 05 00 29 0f 17 45 4e 41 42 4c 45 20 47 45   ....)..ENABLE GE
         6578  +|   3664: 4f 50 4f 4c 59 58 52 54 52 49 4d 17 0f 05 00 23   OPOLYXRTRIM....#
         6579  +|   3680: 0f 19 45 4e 41 42 4c 45 20 46 54 53 35 58 42 49   ..ENABLE FTS5XBI
         6580  +|   3696: 4e 41 52 59 17 0e 05 00 23 0f 19 45 4e 41 42 4c   NARY....#..ENABL
         6581  +|   3712: 45 20 46 54 53 35 58 4e 4f 43 41 53 45 16 0d 05   E FTS5XNOCASE...
         6582  +|   3728: 00 23 0f 17 45 4e 41 42 4c 45 20 46 54 53 35 58   .#..ENABLE FTS5X
         6583  +|   3744: 52 54 52 49 4d 17 0c 05 00 23 0f 19 45 4e 41 42   RTRIM....#..ENAB
         6584  +|   3760: 4c 45 20 46 54 53 34 58 42 49 4e 41 52 59 17 0b   LE FTS4XBINARY..
         6585  +|   3776: 05 00 23 0f 19 45 4e 41 42 4c 45 20 46 54 53 34   ..#..ENABLE FTS4
         6586  +|   3792: 58 4e 4f 43 41 53 45 16 0a 05 00 23 0f 17 45 4e   XNOCASE....#..EN
         6587  +|   3808: 41 42 4c 45 20 46 54 53 34 58 52 54 52 49 4d 1e   ABLE FTS4XRTRIM.
         6588  +|   3824: 09 05 00 31 0f 19 45 4e 41 42 4c 45 20 44 42 53   ...1..ENABLE DBS
         6589  +|   3840: 54 41 54 20 56 54 41 42 58 42 49 4e 41 52 59 1e   TAT VTABXBINARY.
         6590  +|   3856: 08 05 00 31 0f 19 45 4e 41 42 4c 45 20 44 42 53   ...1..ENABLE DBS
         6591  +|   3872: 54 41 54 20 56 54 41 42 58 4e 4f 43 41 53 45 1d   TAT VTABXNOCASE.
         6592  +|   3888: 07 05 00 31 0f 17 45 4e 41 42 4c 45 20 44 42 53   ...1..ENABLE DBS
         6593  +|   3904: 54 41 54 20 66 54 41 42 58 52 54 52 49 4d 11 06   TAT fTABXRTRIM..
         6594  +|   3920: 05 00 17 0f 19 44 45 42 55 47 58 42 49 4e 41 52   .....DEBUGXBINAR
         6595  +|   3936: 59 11 05 05 00 17 0f 19 44 45 42 55 47 58 4e 4f   Y.......DEBUGXNO
         6596  +|   3952: 43 41 53 45 10 04 05 00 17 0f 17 44 45 42 55 47   CASE.......DEBUG
         6597  +|   3968: 58 62 54 52 49 4d 27 03 05 00 43 0f 19 43 4f 4d   XbTRIM'...C..COM
         6598  +|   3984: 50 49 4c 45 52 3d 67 63 63 2d 35 2e 34 2e 30 20   PILER=gcc-5.4.0 
         6599  +|   4000: 32 30 31 36 30 36 30 39 52 02 49 4e 41 52 59 27   20160609R.INARY'
         6600  +|   4016: 02 05 00 43 0f 19 43 4f 4d 50 49 4c 45 52 3d 67   ...C..COMPILER=g
         6601  +|   4032: 63 63 2d 35 2e 34 2e 30 20 32 30 31 36 30 36 30   cc-5.4.0 2016060
         6602  +|   4048: 39 58 4e 4f 43 41 53 45 26 01 05 00 43 0f 17 43   9XNOCASE&...C..C
         6603  +|   4064: 4f 4d 50 49 4c 45 52 3d 67 63 63 2d 35 2e 34 2e   OMPILER=gcc-5.4.
         6604  +|   4080: 30 20 32 30 31 36 30 36 30 39 58 52 54 52 49 4d   0 20160609XRTRIM
         6605  +| page 6 offset 20480
         6606  +|      0: 0d 00 00 00 24 0e e0 00 0f f8 0f f0 0f e8 0f e0   ....$...........
         6607  +|     16: 0f d8 0f d0 0f c8 0f c0 0f b8 0f b0 0f a8 0f a0   ................
         6608  +|     32: 0f 98 0f 90 0f 88 0f 80 0f 78 0f 70 0f 68 0f 60   .........x.p.h.`
         6609  +|     48: 0f 58 0f 50 0f 48 0f 40 0f 38 0f 30 0f 28 0f 20   .X.P.H.@.8.0.(. 
         6610  +|     64: 0f 18 0f 10 0f 08 0f 00 0e f8 0e f0 0e e8 0e e0   ................
         6611  +|   3808: 06 24 03 00 12 02 01 01 06 23 03 00 12 02 01 01   .$.......#......
         6612  +|   3824: 06 22 03 00 12 02 01 01 06 21 03 00 12 03 01 01   .........!......
         6613  +|   3840: 06 20 03 00 12 03 01 01 06 1f 03 00 12 03 01 01   . ..............
         6614  +|   3856: 06 1e 03 00 12 03 01 01 06 1d 03 00 12 03 01 01   ................
         6615  +|   3872: 06 1c 03 00 12 03 01 01 06 1b 03 00 12 02 01 01   ................
         6616  +|   3888: 06 1a 03 00 12 02 01 01 06 19 03 00 12 02 01 01   ................
         6617  +|   3904: 06 18 03 00 12 02 01 01 06 17 03 00 12 02 01 01   ................
         6618  +|   3920: 06 16 03 00 12 02 01 01 06 15 03 00 12 02 01 01   ................
         6619  +|   3936: 06 14 03 00 12 02 01 01 06 13 03 00 12 02 01 01   ................
         6620  +|   3952: 06 12 03 00 12 02 01 01 06 11 03 00 12 02 01 01   ................
         6621  +|   3968: 06 10 03 00 12 02 01 01 06 0f 03 00 12 02 01 01   ................
         6622  +|   3984: 06 0e 03 00 12 02 01 01 06 0d 03 00 12 02 01 01   ................
         6623  +|   4000: 06 0c 03 00 12 02 01 01 06 0b 03 00 12 02 01 01   ................
         6624  +|   4016: 06 0a 03 00 12 02 01 01 06 09 03 00 12 03 01 01   ................
         6625  +|   4032: 06 08 03 00 12 03 01 01 06 07 03 00 12 03 01 01   ................
         6626  +|   4048: 06 06 03 00 12 01 01 01 06 05 03 00 12 01 01 01   ................
         6627  +|   4064: 06 04 03 00 12 01 01 01 06 03 03 00 12 06 01 01   ................
         6628  +|   4080: 06 02 03 00 12 06 01 01 06 01 03 00 12 06 01 01   ................
         6629  +| page 7 offset 24576
         6630  +|      0: 0a 00 00 00 01 0f f4 00 0f f4 00 00 00 00 00 00   ................
         6631  +|   4080: 00 00 00 00 0b 03 1b 01 76 65 72 73 69 6f 6e 04   ........version.
         6632  +| page 8 offset 28672
         6633  +|      0: 0d 00 00 00 03 0f d6 00 0f f4 0f e9 0f d6 00 00   ................
         6634  +|   4048: 00 00 00 00 00 00 11 03 02 2b 69 6e 74 65 67 72   .........+integr
         6635  +|   4064: 69 74 79 2d 63 68 65 63 6b 09 02 02 1b 72 65 62   ity-check....reb
         6636  +|   4080: 75 69 6c 64 0a 01 02 1d 6f 70 74 69 5d 69 71 a5   uild....opti]iq.
         6637  +| end crash-44a8305b4bd86f.db
         6638  +}]} {}
         6639  +
         6640  +do_catchsql_test 48.1 {
         6641  +  INSERT INTO t1(t1) VALUES('integrity-check');
         6642  +} {1 {database disk image is malformed}}
         6643  +
         6644  +#--------------------------------------------------------------------------
         6645  +reset_db
         6646  +do_test 49.0 {
         6647  +  sqlite3 db {}
         6648  +  db deserialize [decode_hexdb {
         6649  +| size 40960 pagesize 4096 filename crash-fd87385402ecf5.db
         6650  +| page 1 offset 0
         6651  +|      0: 53 51 4c 69 74 65 20 66 6f 72 6d 61 74 20 33 00   SQLite format 3.
         6652  +|     16: 10 00 01 01 00 40 20 20 00 00 00 00 00 00 00 0a   .....@  ........
         6653  +|     32: 00 00 00 00 00 00 00 00 00 00 00 0d 00 00 00 04   ................
         6654  +|     48: 00 00 00 00 00 00 00 00 00 00 00 01 00 00 00 00   ................
         6655  +|     96: 00 00 00 00 0d 00 00 00 0d 0b 6e 00 0f a3 0f 4c   ..........n....L
         6656  +|    112: 0e e1 0e 81 0e 24 0d cc 0d 72 0d 1b 0c b0 0c 50   .....$...r.....P
         6657  +|    128: 0b f8 0b b3 0b 6e 00 00 00 00 00 00 00 00 00 00   .....n..........
         6658  +|   2912: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 43 0d   ..............C.
         6659  +|   2928: 06 17 11 11 08 75 74 61 62 6c 65 74 34 74 34 43   .....utablet4t4C
         6660  +|   2944: 52 45 41 54 45 20 56 49 52 54 55 41 4c 20 54 41   REATE VIRTUAL TA
         6661  +|   2960: 42 4c 45 20 74 34 20 55 53 49 4e 47 20 66 74 73   BLE t4 USING fts
         6662  +|   2976: 35 76 6f 63 61 62 28 27 74 32 27 2c 20 27 72 6f   5vocab('t2', 'ro
         6663  +|   2992: 77 27 29 43 0c 06 17 11 11 08 75 74 61 62 6c 65   w')C......utable
         6664  +|   3008: 74 33 74 33 43 52 45 41 54 45 20 56 49 52 54 55   t3t3CREATE VIRTU
         6665  +|   3024: 41 4c 20 54 41 42 4c 45 20 74 33 20 55 53 49 4e   AL TABLE t3 USIN
         6666  +|   3040: 47 20 66 74 73 35 76 6f 63 61 62 28 27 74 31 27   G fts5vocab('t1'
         6667  +|   3056: 2c 20 27 72 6f 77 27 29 56 0b 06 17 1f 1f 01 7d   , 'row')V.......
         6668  +|   3072: 74 61 62 6c 65 74 32 5f 63 6f 6e 66 69 67 74 32   tablet2_configt2
         6669  +|   3088: 5f 63 6f 6e 66 69 67 0a 43 52 45 41 54 45 20 54   _config.CREATE T
         6670  +|   3104: 41 42 4c 45 20 27 74 32 5f 63 6f 6e 66 69 67 27   ABLE 't2_config'
         6671  +|   3120: 28 6b 20 50 52 49 4d 41 52 59 20 4b 45 59 2c 20   (k PRIMARY KEY, 
         6672  +|   3136: 76 29 20 57 49 54 48 4f 55 54 20 52 4f 57 49 44   v) WITHOUT ROWID
         6673  +|   3152: 5e 0a 07 17 21 21 01 81 07 74 61 62 6c 65 74 32   ^...!!...tablet2
         6674  +|   3168: 5f 63 6f 6e 74 65 6e 74 74 32 5f 63 6f 6e 74 65   _contentt2_conte
         6675  +|   3184: 6e 74 09 43 52 45 41 54 45 20 54 41 42 4c 45 20   nt.CREATE TABLE 
         6676  +|   3200: 27 74 32 5f 63 6f 6e 74 65 6e 74 27 28 69 64 20   't2_content'(id 
         6677  +|   3216: 49 4e 54 45 47 45 52 20 50 52 49 4d 41 52 59 20   INTEGER PRIMARY 
         6678  +|   3232: 4b 45 59 2c 20 63 30 2c 20 63 31 2c 20 63 32 29   KEY, c0, c1, c2)
         6679  +|   3248: 69 09 07 17 19 19 01 81 2d 74 61 62 6c 65 74 32   i.......-tablet2
         6680  +|   3264: 5f 69 64 78 74 32 5f 69 64 78 08 43 52 45 41 54   _idxt2_idx.CREAT
         6681  +|   3280: 45 20 54 41 42 4c 45 20 27 74 32 5f 69 64 78 27   E TABLE 't2_idx'
         6682  +|   3296: 28 73 65 67 69 64 2c 20 74 65 72 6d 2c 20 70 67   (segid, term, pg
         6683  +|   3312: 6e 6f 2c 20 50 52 49 4d 41 52 59 20 4b 45 59 28   no, PRIMARY KEY(
         6684  +|   3328: 73 65 67 69 64 2c 20 74 65 72 6d 29 29 20 57 49   segid, term)) WI
         6685  +|   3344: 54 48 4f 55 54 20 52 4f 57 49 44 55 08 07 17 1b   THOUT ROWIDU....
         6686  +|   3360: 1b 01 81 01 74 61 62 6c 65 74 32 5f 64 61 74 61   ....tablet2_data
         6687  +|   3376: 74 32 5f 64 61 74 61 07 43 52 45 41 54 45 20 54   t2_data.CREATE T
         6688  +|   3392: 41 42 4c 45 20 27 74 32 5f 64 61 74 61 27 28 69   ABLE 't2_data'(i
         6689  +|   3408: 64 20 49 4e 54 45 47 45 52 20 50 52 49 4d 41 52   d INTEGER PRIMAR
         6690  +|   3424: 59 20 4b 45 59 2c 20 62 6c 6f 63 6b 20 42 4c 4f   Y KEY, block BLO
         6691  +|   3440: 42 29 58 07 07 17 11 11 08 81 1d 74 61 62 6c 65   B)X........table
         6692  +|   3456: 74 32 74 32 43 52 45 41 54 45 20 56 49 52 54 55   t2t2CREATE VIRTU
         6693  +|   3472: 41 4c 20 54 41 42 4c 45 20 74 32 20 55 53 49 4e   AL TABLE t2 USIN
         6694  +|   3488: 47 20 66 74 73 35 28 27 61 27 2c 5b 62 5d 2c 22   G fts5('a',[b],.
         6695  +|   3504: 63 22 2c 64 65 74 61 69 6c 3d 6e 6f 6e 65 2c 63   c.,detail=none,c
         6696  +|   3520: 6f 6c 75 6d 6e 73 69 7a 65 3d 30 29 56 06 06 17   olumnsize=0)V...
         6697  +|   3536: 1f 1f 01 7d 74 61 62 6c 65 74 31 5f 63 6f 6e 66   ....tablet1_conf
         6698  +|   3552: 69 67 74 31 5f 63 6f 6e 66 69 67 06 43 52 45 41   igt1_config.CREA
         6699  +|   3568: 54 45 20 54 41 42 4c 45 20 27 74 31 5f 63 6f 6e   TE TABLE 't1_con
         6700  +|   3584: 66 69 67 27 28 6b 20 50 52 49 4d 41 52 59 20 4b   fig'(k PRIMARY K
         6701  +|   3600: 45 59 2c 20 76 29 20 57 49 54 48 4f 55 54 20 52   EY, v) WITHOUT R
         6702  +|   3616: 4f 57 49 44 5b 05 07 17 21 21 01 81 01 74 61 62   OWID[...!!...tab
         6703  +|   3632: 6c 65 74 31 5f 64 6f 63 73 69 7a 65 74 31 5f 64   let1_docsizet1_d
         6704  +|   3648: 6f 63 73 69 7a 65 05 43 52 45 41 54 45 20 54 41   ocsize.CREATE TA
         6705  +|   3664: 42 4c 45 20 27 74 31 5f 64 6f 63 73 69 7a 65 27   BLE 't1_docsize'
         6706  +|   3680: 28 69 64 20 49 4e 54 45 47 45 52 20 50 52 49 4d   (id INTEGER PRIM
         6707  +|   3696: 41 52 59 20 4b 45 59 2c 20 73 7a 20 42 4c 4f 42   ARY KEY, sz BLOB
         6708  +|   3712: 29 5e 04 07 17 21 21 01 81 07 74 61 62 6c 65 74   )^...!!...tablet
         6709  +|   3728: 31 5f 63 6f 6e 74 65 6e 74 74 31 5f 63 6f 6e 74   1_contentt1_cont
         6710  +|   3744: 65 6e 74 04 43 52 45 41 54 45 20 54 41 42 4c 45   ent.CREATE TABLE
         6711  +|   3760: 20 27 74 31 5f 63 6f 6e 74 65 6e 74 27 28 69 64    't1_content'(id
         6712  +|   3776: 20 49 4e 54 45 47 45 52 20 50 52 49 4d 41 52 59    INTEGER PRIMARY
         6713  +|   3792: 20 4b 45 59 2c 20 63 30 2c 20 63 31 2c 20 63 32    KEY, c0, c1, c2
         6714  +|   3808: 29 69 03 07 17 19 19 01 81 2d 74 61 62 6c 65 74   )i.......-tablet
         6715  +|   3824: 31 5f 69 64 78 74 31 5f 69 64 78 03 43 52 45 41   1_idxt1_idx.CREA
         6716  +|   3840: 54 45 20 54 41 42 4c 45 20 27 74 31 5f 69 64 78   TE TABLE 't1_idx
         6717  +|   3856: 27 28 73 65 67 69 64 2c 20 74 65 72 6d 2c 20 70   '(segid, term, p
         6718  +|   3872: 67 6e 6f 2c 20 50 52 49 4d 41 52 59 20 4b 45 59   gno, PRIMARY KEY
         6719  +|   3888: 28 73 65 67 69 64 2c 20 74 65 72 6d 29 29 20 57   (segid, term)) W
         6720  +|   3904: 49 54 48 4f 55 54 20 52 4f 57 49 44 55 02 07 17   ITHOUT ROWIDU...
         6721  +|   3920: 1b 1b 01 81 01 74 61 62 6c 65 74 31 5f 64 61 74   .....tablet1_dat
         6722  +|   3936: 61 74 31 5f 64 61 74 61 02 43 52 45 41 54 45 20   at1_data.CREATE 
         6723  +|   3952: 54 41 42 4c 45 20 27 74 31 5f 64 61 74 61 27 28   TABLE 't1_data'(
         6724  +|   3968: 69 64 20 49 4e 54 45 47 45 52 20 50 52 49 4d 41   id INTEGER PRIMA
         6725  +|   3984: 52 59 20 4b 45 59 2c 20 62 6c 6f 63 6b 20 42 4c   RY KEY, block BL
         6726  +|   4000: 4f 42 29 5b 01 07 17 11 11 08 81 23 74 61 62 6c   OB)[.......#tabl
         6727  +|   4016: 65 74 31 74 31 43 52 45 41 54 45 20 56 49 52 54   et1t1CREATE VIRT
         6728  +|   4032: 55 41 4c 20 54 41 42 4c 45 20 74 31 20 55 53 49   UAL TABLE t1 USI
         6729  +|   4048: 4e 47 20 66 74 73 35 28 61 2c 62 20 75 6e 69 6e   NG fts5(a,b unin
         6730  +|   4064: 64 65 78 65 64 2c 63 2c 74 6f 6b 65 6e 69 7a 65   dexed,c,tokenize
         6731  +|   4080: 3d 22 70 6f 72 74 65 72 20 61 73 63 69 69 22 29   =.porter ascii.)
         6732  +| page 2 offset 4096
         6733  +|      0: 0d 0f 68 00 05 0f 13 00 0f e6 0f 13 0f a8 0f 7c   ..h............|
         6734  +|     16: 0f 2a 00 00 00 00 00 00 00 00 00 00 00 00 00 00   .*..............
         6735  +|   3856: 00 00 00 15 0a 03 00 30 00 00 00 00 01 03 03 00   .......0........
         6736  +|   3872: 03 01 01 01 02 01 01 03 01 01 37 8c 80 80 80 80   ..........7.....
         6737  +|   3888: 01 03 00 74 00 20 68 20 69 0d 00 00 00 03 0f e8   ...t. h i.......
         6738  +|   3904: 00 0f f8 0f f0 0f e8 00 00 00 00 00 00 00 00 00   ................
         6739  +| page 5 offset 16384
         6740  +|   4064: 00 00 00 00 00 00 00 00 06 03 03 00 12 03 00 00   ................
         6741  +|   4080: 60 20 30 d6 20 30 00 30 60 10 30 01 20 30 00 30   ` 0. 0.0`.0. 0.0
         6742  +| page 6 offset 20480
         6743  +|      0: a0 00 00 00 10 ff 40 00 ff 00 00 00 00 00 00 00   ......@.........
         6744  +|   4080: 00 00 00 00 0b 03 1b 01 76 65 72 73 69 6f 6e 04   ........version.
         6745  +| page 7 offset 24576
         6746  +|      0: 0d 00 00 00 03 0f 9e 00 0f e6 0f ef 0f 9e 00 00   ................
         6747  +|   3984: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 41 84   ..............A.
         6748  +|   4000: 80 80 80 80 01 04 00 81 06 00 00 00 34 02 30 61   ............4.0a
         6749  +|   4016: 01 01 00 00 00 00 00 00 00 00 00 11 87 89 06 26   ...............&
         6750  +|   4032: 01 64 01 01 01 65 01 01 01 66 01 01 01 67 01 01   .d...e...f...g..
         6751  +|   4048: 01 01 01 68 01 01 01 01 01 69 01 01 01 04 06 06   ...h.....i......
         6752  +|   4064: 06 04 44 00 06 06 07 01 03 00 14 03 09 09 09 0f   ..D.............
         6753  +|   4080: 0a 03 00 24 00 00 00 00 01 01 01 00 01 01 01 01   ...$............
         6754  +| page 8 offset 28672
         6755  +|      0: 0a 00 00 00 01 0f fa 00 0f fa 00 00 00 00 00 00   ................
         6756  +|   4080: 00 00 00 00 00 00 00 00 00 00 05 04 09 0c 01 02   ................
         6757  +| page 9 offset 32768
         6758  +|      0: 0d 00 00 00 9d 0f be 00 0f ea 0f d4 0f be 00 00   ................
         6759  +|   4016: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 14 03   ................
         6760  +|   4032: 05 00 17 17 17 61 20 62 20 63 67 20 68 20 69 67   .....a b cg h ig
         6761  +|   4048: 20 68 20 69 14 02 05 00 17 17 17 67 20 68 20 69    h i.......g h i
         6762  +|   4064: 61 20 62 20 63 67 20 68 20 69 14 01 05 00 17 17   a b cg h i......
         6763  +|   4080: 17 61 20 62 20 63 64 20 65 20 66 67 20 68 20 69   .a b cd e fg h i
         6764  +| page 10 offset 36864
         6765  +|      0: 0a 00 00 00 01 0f f4 00 0f f4 00 00 00 00 00 00   ................
         6766  +|   4080: 00 00 00 00 0b 03 1b 01 76 65 72 73 69 6f 6e 04   ........version.
         6767  +| end crash-fd87385402ecf5.db
         6768  +}]} {}
         6769  +
         6770  +do_catchsql_test 49.1 {
         6771  +  SELECT term FROM t4 WHERE term LIKE 'oase';
         6772  +} {1 {database disk image is malformed}}
         6773  +
         6774  +#--------------------------------------------------------------------------
         6775  +reset_db
         6776  +do_test 50.0 {
         6777  +  sqlite3 db {}
         6778  +  db deserialize [decode_hexdb {
         6779  +| size 40960 pagesize 4096 filename crash-695bce8a3e107c.db
         6780  +| page 1 offset 0
         6781  +|      0: 53 51 4c 69 74 65 20 66 6f 72 6d 61 74 20 33 00   SQLite format 3.
         6782  +|     16: 10 00 01 01 00 40 20 20 00 00 00 00 00 00 00 0a   .....@  ........
         6783  +|     32: 00 00 00 00 00 00 00 00 00 00 00 0d 00 00 00 04   ................
         6784  +|     48: 00 00 00 00 00 00 00 00 00 00 00 01 00 00 00 00   ................
         6785  +|     96: 00 00 00 00 0d 00 00 00 0d 0b 6e 00 0f a3 0f 4c   ..........n....L
         6786  +|    112: 0e e1 0e 81 0e 24 0d cc 0d 72 0d 1b 0c b0 0c 50   .....$...r.....P
         6787  +|    128: 0b f8 0b b3 0b 6e 00 00 00 00 00 00 00 00 00 00   .....n..........
         6788  +|   2912: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 43 0d   ..............C.
         6789  +|   2928: 06 17 11 11 08 75 74 61 62 6c 65 74 34 74 34 43   .....utablet4t4C
         6790  +|   2944: 52 45 41 54 45 20 56 49 52 54 55 41 4c 20 54 41   REATE VIRTUAL TA
         6791  +|   2960: 42 4c 45 20 74 34 20 55 53 49 4e 47 20 66 74 73   BLE t4 USING fts
         6792  +|   2976: 35 76 6f 63 61 62 28 27 74 32 27 2c 20 27 72 6f   5vocab('t2', 'ro
         6793  +|   2992: 77 27 29 43 0c 06 17 11 11 08 75 74 61 62 6c 65   w')C......utable
         6794  +|   3008: 74 33 74 33 43 52 45 41 54 45 20 56 49 52 54 55   t3t3CREATE VIRTU
         6795  +|   3024: 41 4c 20 54 41 42 4c 45 20 74 33 20 55 53 49 4e   AL TABLE t3 USIN
         6796  +|   3040: 47 20 66 74 73 35 76 6f 63 61 62 28 27 74 31 27   G fts5vocab('t1'
         6797  +|   3056: 2c 20 27 72 6f 77 27 29 56 0b 06 17 1f 1f 01 7d   , 'row')V.......
         6798  +|   3072: 74 61 62 6c 65 74 32 5f 63 6f 6e 66 69 67 74 32   tablet2_configt2
         6799  +|   3088: 5f 63 6f 6e 66 69 67 0a 43 52 45 41 54 45 20 54   _config.CREATE T
         6800  +|   3104: 41 42 4c 45 20 27 74 32 5f 63 6f 6e 66 69 67 27   ABLE 't2_config'
         6801  +|   3120: 28 6b 20 50 52 49 4d 41 52 59 20 4b 45 59 2c 20   (k PRIMARY KEY, 
         6802  +|   3136: 76 29 20 57 49 54 48 4f 55 54 20 52 4f 57 49 44   v) WITHOUT ROWID
         6803  +|   3152: 5e 0a 07 17 21 21 01 81 07 74 61 62 6c 65 74 32   ^...!!...tablet2
         6804  +|   3168: 5f 63 6f 6e 74 65 6e 74 74 32 5f 63 6f 6e 74 65   _contentt2_conte
         6805  +|   3184: 6e 74 09 43 52 45 41 54 45 20 54 41 42 4c 45 20   nt.CREATE TABLE 
         6806  +|   3200: 27 74 32 5f 63 6f 6e 74 65 6e 74 27 28 69 64 20   't2_content'(id 
         6807  +|   3216: 49 4e 54 45 47 45 52 20 50 52 49 4d 41 52 59 20   INTEGER PRIMARY 
         6808  +|   3232: 4b 45 59 2c 20 63 30 2c 20 63 31 2c 20 63 32 29   KEY, c0, c1, c2)
         6809  +|   3248: 69 09 07 17 19 19 01 81 2d 74 61 62 6c 65 74 32   i.......-tablet2
         6810  +|   3264: 5f 69 64 78 74 32 5f 69 64 78 08 43 52 45 41 54   _idxt2_idx.CREAT
         6811  +|   3280: 45 20 54 41 42 4c 45 20 27 74 32 5f 69 64 78 27   E TABLE 't2_idx'
         6812  +|   3296: 28 73 65 67 69 64 2c 20 74 65 72 6d 2c 20 70 67   (segid, term, pg
         6813  +|   3312: 6e 6f 2c 20 50 52 49 4d 41 52 59 20 4b 45 59 28   no, PRIMARY KEY(
         6814  +|   3328: 73 65 67 69 64 2c 20 74 65 72 6d 29 29 20 57 49   segid, term)) WI
         6815  +|   3344: 54 48 4f 55 54 20 52 4f 57 49 44 55 08 07 17 1b   THOUT ROWIDU....
         6816  +|   3360: 1b 01 81 01 74 61 62 6c 65 74 32 5f 64 61 74 61   ....tablet2_data
         6817  +|   3376: 74 32 5f 64 61 74 61 07 43 52 45 41 54 45 20 54   t2_data.CREATE T
         6818  +|   3392: 41 42 4c 45 20 27 74 32 5f 64 61 74 61 27 28 69   ABLE 't2_data'(i
         6819  +|   3408: 64 20 49 4e 54 45 47 45 52 20 50 52 49 4d 41 52   d INTEGER PRIMAR
         6820  +|   3424: 59 20 4b 45 59 2c 20 62 6c 6f 63 6b 20 42 4c 4f   Y KEY, block BLO
         6821  +|   3440: 42 29 58 07 07 17 11 11 08 81 1d 74 61 62 6c 65   B)X........table
         6822  +|   3456: 74 32 74 32 43 52 45 41 54 45 20 56 49 52 54 55   t2t2CREATE VIRTU
         6823  +|   3472: 41 4c 20 54 41 42 4c 45 20 74 32 20 55 53 49 4e   AL TABLE t2 USIN
         6824  +|   3488: 47 20 66 74 73 35 28 27 61 27 2c 5b 62 5d 2c 22   G fts5('a',[b],.
         6825  +|   3504: 63 22 2c 64 65 74 61 69 6c 3d 6e 6f 6e 65 2c 63   c.,detail=none,c
         6826  +|   3520: 6f 6c 75 6d 6e 73 69 7a 65 3d 30 29 56 06 06 17   olumnsize=0)V...
         6827  +|   3536: 1f 1f 01 7d 74 61 62 6c 65 74 31 5f 63 6f 6e 66   ....tablet1_conf
         6828  +|   3552: 69 67 74 31 5f 63 6f 6e 66 69 67 06 43 52 45 41   igt1_config.CREA
         6829  +|   3568: 54 45 20 54 41 42 4c 45 20 27 74 31 5f 63 6f 6e   TE TABLE 't1_con
         6830  +|   3584: 66 69 67 27 28 6b 20 50 52 49 4d 41 52 59 20 4b   fig'(k PRIMARY K
         6831  +|   3600: 45 59 2c 20 76 29 20 57 49 54 48 4f 55 54 20 52   EY, v) WITHOUT R
         6832  +|   3616: 4f 57 49 44 5b 05 07 17 21 21 01 81 01 74 61 62   OWID[...!!...tab
         6833  +|   3632: 6c 65 74 31 5f 64 6f 63 73 69 7a 65 74 31 5f 64   let1_docsizet1_d
         6834  +|   3648: 6f 63 73 69 7a 65 05 43 52 45 41 54 45 20 54 41   ocsize.CREATE TA
         6835  +|   3664: 42 4c 45 20 27 74 31 5f 64 6f 63 73 69 7a 65 27   BLE 't1_docsize'
         6836  +|   3680: 28 69 64 20 49 4e 54 45 47 45 52 20 50 52 49 4d   (id INTEGER PRIM
         6837  +|   3696: 41 52 59 20 4b 45 59 2c 20 73 7a 20 42 4c 4f 42   ARY KEY, sz BLOB
         6838  +|   3712: 29 5e 04 07 17 21 21 01 81 07 74 61 62 6c 65 74   )^...!!...tablet
         6839  +|   3728: 31 5f 63 6f 6e 74 65 6e 74 74 31 5f 63 6f 6e 74   1_contentt1_cont
         6840  +|   3744: 65 6e 74 04 43 52 45 41 54 45 20 54 41 42 4c 45   ent.CREATE TABLE
         6841  +|   3760: 20 27 74 31 5f 63 6f 6e 74 65 6e 74 27 28 69 64    't1_content'(id
         6842  +|   3776: 20 49 4e 54 45 47 45 52 20 50 52 49 4d 41 52 59    INTEGER PRIMARY
         6843  +|   3792: 20 4b 45 59 2c 20 63 30 2c 20 63 31 2c 20 63 32    KEY, c0, c1, c2
         6844  +|   3808: 29 69 03 07 17 19 19 01 81 2d 74 61 62 6c 65 74   )i.......-tablet
         6845  +|   3824: 31 5f 69 64 78 74 31 5f 69 64 78 03 43 52 45 41   1_idxt1_idx.CREA
         6846  +|   3840: 54 45 20 54 41 42 4c 45 20 27 74 31 5f 69 64 78   TE TABLE 't1_idx
         6847  +|   3856: 27 28 73 65 67 69 64 2c 20 74 65 72 6d 2c 20 70   '(segid, term, p
         6848  +|   3872: 67 6e 6f 2c 20 50 52 49 4d 41 52 59 20 4b 45 59   gno, PRIMARY KEY
         6849  +|   3888: 28 73 65 67 69 64 2c 20 74 65 72 6d 29 29 20 57   (segid, term)) W
         6850  +|   3904: 49 54 48 4f 55 54 20 52 4f 57 49 44 55 02 07 17   ITHOUT ROWIDU...
         6851  +|   3920: 1b 1b 01 81 01 74 61 62 6c 65 74 31 5f 64 61 74   .....tablet1_dat
         6852  +|   3936: 61 74 31 5f 64 61 74 61 02 43 52 45 41 54 45 20   at1_data.CREATE 
         6853  +|   3952: 54 41 42 4c 45 20 27 74 31 5f 64 61 74 61 27 28   TABLE 't1_data'(
         6854  +|   3968: 69 64 20 49 4e 54 45 47 45 52 20 50 52 49 4d 41   id INTEGER PRIMA
         6855  +|   3984: 52 59 20 4b 45 59 2c 20 62 6c 6f 63 6b 20 42 4c   RY KEY, block BL
         6856  +|   4000: 4f 42 29 5b 01 07 17 11 11 08 81 23 74 61 62 6c   OB)[.......#tabl
         6857  +|   4016: 65 74 31 74 31 43 52 45 41 54 45 20 56 49 52 54   et1t1CREATE VIRT
         6858  +|   4032: 55 41 4c 20 54 41 42 4c 45 20 74 31 20 55 53 49   UAL TABLE t1 USI
         6859  +|   4048: 4e 47 20 66 74 73 35 28 61 2c 62 20 75 6e 69 6e   NG fts5(a,b unin
         6860  +|   4064: 64 65 78 65 64 2c 63 2c 74 6f 6b 65 6e 69 7a 65   dexed,c,tokenize
         6861  +|   4080: 3d 22 70 6f 72 74 65 72 20 61 73 63 69 69 22 29   =.porter ascii.)
         6862  +| page 2 offset 4096
         6863  +|      0: 0d 0f 68 00 05 0f 13 00 0f e6 0f 13 0f a8 0f 7c   ..h............|
         6864  +|     16: 0f 2a 00 00 00 00 00 00 00 00 00 00 00 00 00 00   .*..............
         6865  +|   3856: 00 00 00 15 0a 03 00 30 00 00 00 00 01 03 03 00   .......0........
         6866  +|   3872: 03 01 01 01 02 01 01 03 01 01 37 8c 80 80 80 80   ..........7.....
         6867  +|   3888: 01 03 00 74 00 20 68 20 69 0d 00 00 00 03 0f e8   ...t. h i.......
         6868  +|   3904: 00 0f f8 0f f0 0f e8 00 00 00 00 00 00 00 00 00   ................
         6869  +| page 5 offset 16384
         6870  +|   4064: 00 00 00 00 00 00 00 00 06 03 03 00 12 03 00 00   ................
         6871  +|   4080: 60 20 30 d6 20 30 00 30 60 10 30 01 20 30 00 30   ` 0. 0.0`.0. 0.0
         6872  +| page 6 offset 20480
         6873  +|      0: a0 00 00 00 10 ff 40 00 ff 00 00 00 00 00 00 00   ......@.........
         6874  +|   4080: 00 00 00 00 0b 03 1b 01 76 65 72 73 69 6f 6e 04   ........version.
         6875  +| page 7 offset 24576
         6876  +|      0: 0d 00 00 00 03 0f 9e 00 0f e6 0f ef 0f 9e 00 00   ................
         6877  +|   3984: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 41 84   ..............A.
         6878  +|   4000: 80 80 80 80 01 04 00 81 06 00 00 00 34 02 30 61   ............4.0a
         6879  +|   4016: 01 01 00 00 00 00 00 00 00 00 00 11 87 89 06 26   ...............&
         6880  +|   4032: 01 64 01 01 01 65 01 01 01 66 01 01 01 67 01 01   .d...e...f...g..
         6881  +|   4048: 01 01 01 68 01 01 01 01 01 69 01 01 01 04 06 06   ...h.....i......
         6882  +|   4064: 06 04 44 00 06 06 07 01 03 00 14 03 09 09 09 0f   ..D.............
         6883  +|   4080: 0a 03 00 24 00 00 00 00 01 01 01 00 01 01 01 01   ...$............
         6884  +| page 8 offset 28672
         6885  +|      0: 0a 00 00 00 01 0f fa 00 0f fa 00 00 00 00 00 00   ................
         6886  +|   4080: 00 00 00 00 00 00 00 00 00 00 05 04 09 0c 01 02   ................
         6887  +| page 9 offset 32768
         6888  +|      0: 0d 00 00 00 9d 0f be 00 0f ea 0f d4 0f be 00 00   ................
         6889  +|   4016: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 14 03   ................
         6890  +|   4032: 05 00 17 17 17 61 20 62 20 63 67 20 68 20 69 67   .....a b cg h ig
         6891  +|   4048: 20 68 20 69 14 02 05 00 17 17 17 67 20 68 20 69    h i.......g h i
         6892  +|   4064: 61 20 62 20 63 67 20 68 20 69 14 01 05 00 17 17   a b cg h i......
         6893  +|   4080: 17 61 20 62 20 63 64 20 65 20 66 67 20 68 20 69   .a b cd e fg h i
         6894  +| page 10 offset 36864
         6895  +|      0: 0a 00 00 00 01 0f f4 00 0f f4 00 00 00 00 00 00   ................
         6896  +|   4080: 00 00 00 00 0b 03 1b 01 76 65 72 73 69 6f 6e 04   ........version.
         6897  +| end crash-695bce8a3e107c.db
         6898  +}]} {}
         6899  +
         6900  +do_catchsql_test 50.1 {
         6901  +  SELECT term FROM t4 WHERE term LIKE '»as';
         6902  +} {1 {database disk image is malformed}}
         6903  +
         6904  +#-------------------------------------------------------------------------
         6905  +reset_db
         6906  +do_execsql_test 51.1 {
         6907  +BEGIN TRANSACTION;
         6908  +PRAGMA writable_schema=ON;
         6909  +CREATE VIRTUAL TABLE t1 USING fts5(a,b,c);
         6910  +CREATE TABLE IF NOT EXISTS 't1_data'(id INTEGER PRIMARY KEY, block BLOB);
         6911  +REPLACE INTO t1_data VALUES(1,X'2eb1182424');
         6912  +REPLACE INTO t1_data VALUES(10,X'000000000102080002010101020107');
         6913  +INSERT INTO t1_data VALUES(137438953473,X'0000032b0230300102060102060102061f0203010203010203010832303136303630390102070102070102070101340102050102050102050101350102040102040102040207303030303030301c023d010204010204010662696e6172790306010202030601020203060102020306010202030601020203060102020306010202030601020203060102020306010202030601020203060102020108636f6d70696c657201020201020201020201066462737461740702030102030102030204656275670402020102020102020107656e61626c6507020201020201020201020201020201020201020201020201020201020201020201020201020201020201020201020201020201020201020201020201020202087874656e73696f6e1f02040102040102040104667473340a02030102030102030401350d020301020301020301036763630102030102030102030206656f706f6c7910020301020301020301056a736f6e3113020301020301020301046c6f61641f020301020301020301036d61781c02020102020102020205656d6f72791c020301020301020304047379733516020301020301020301066e6f6361736502060102020306010202030601020213060102020306010202030601020203060102020306010202030601020203060102020306010202030601020201046f6d69741f0202010202010202010572747265651902030102030102030402696d010601020203060102020306010202030601020203060102020306010202030601020203060102020306010202030601020203060102020306010202010a7468726561647361666522020201020201020201047674616207020401020401020401017801060101020106010102010601010201060101020106010102010601010201060101020106010102010601010201060101020106010102010601010201060101020106010102010601010201060101020106010102010601010201060101020106010102ad060101020106010102010601010201060101020106010101010601010201060101020106010102010601010201060101020106010102010601010201060101020106010102010601010201060101020415130c0c124413110f47130efc0e11100f0e100f440f1040150f');
         6914  +INSERT INTO t1_data VALUES(274877906945,X'00000e96023030011a042319320d3b123d812b5a31120110446e581b66814a05010a4537814274010e8102815c810f3d0104846d01081581204401103741043c59416b44010a404655265301103f73811a11114213010a821235820f020135030484320201360104816a020162020484550302390301710a04824a020166030483690201670704837d0201690404822602016a0504825c02026b620504817502016f0904810d0303e79c88060482760201700a04826302017204048155020373c2be050481130201770204846202027962050482710202c2ba010482140203e58496070483330204e8b2b879010483710101310110545c0c814b0e3a6501082c815d5b011a2a0e2f0d765c3d686014061d0d0112810733112c2e82141101048313010e5c6f632e813e42010c811882370548010e19158146822f1f01104d364a708146135a010a237b0a55210201610904841703027678090481270201620304810002026374060484660202657a0704827602016601048351090483540301660704814b02016b03025f0304c582caba0204816602016c01025f0302cebc0904843e02016e0804821802016f0a04817503016f070483100201720304822c020484380201740404842e0102460201770104812f0204836c02027a6f040483110202cebc02048267040161020484650205d5bd62cebc0604845b0204f2a580880204842a0206f38184a179670502750204f696a3aa0a04814601013201063330390110812281378114600d010c03716c5e822d010e81226b542a814d010a72740f83000108813a1e0b010c5681046f812c010c07814a777328011664244219531b1a2f811e4a010c4d81557c7f1b0201300704810702013307048230010484050202367807048175020239710804832502016204026b0204814d020363306108048262020265650504817602026667070483150201690704832f0301360a04814d02016c08024702016d0304843e0303cfb2630204814002016e0804837503016203048416030370c2be0304821b02016f0604834b0201700504816b030175070210020273660604841c020676c2bac2b2640604830a02017704027d02017808048141010482700201790504811d0202c2ba0502470206ca8d73ecbab9010483340204f09e9ab504048367010133010c3e04814f82250114812e814b2e0411811305010c811337811e6e010c82085e2b0e5d010c61812054811c01148122451b0781050c813d010c17823762643e011e080c1720814a10364306143b0d33260112810f0c2a810c816b13010a8163810e470201370404811102056176c2aa36050481530202646e0904846202026a730404827402016b0a020c02036f616b0404830a0201750504820d02017605025e0201770a04820702027a73050482460202c2ba0604824a020483330203cba434040483200203cebc790304847e01013401124181442c1d091f81580108601d8336011081320a2b8125820001123b0b81158116811f070110078112817a817308010e6682410d810e2601122d0d6413378147351e01105081021d3525812d01128246510a622204054101105c1b620e81302b05020130020483480104822702013102027e020132030483270201350304844802023770030207020261710604823f0201640802570204830a020265770304831f020168070483210201690204825b02016f020481280704835402057037e18b8d0904810802017304048439030172020481440303c2bd6b0a02630201760202490804815e0201770304816e050483550201780704816902017a070483280207c2b2f093aabc780a0482240301b303024e0301bc0604837a0202cb800204834a0202cebc04048201040484410203d3ad770a04814f0202d5a508048371010135011630817e0f81040d2c041552010c813d3b7e8115010c40692182693a01121f810d810d0a32814701101d1d1f642281742e01068229240110811231810a387f4c01100f50810f8165810d0114811f26443152593c104a010e641e1a3357820e020132030481540201340204815402023778040207020163060481020204815b020164020483010201670a0481540304f0948f870904811a0201690704835502016d0604832203027b01022803017a0a025102016e020484260404816002026f690502680301720104834e02017208024f02021d020475e69c8e0504814c0202767602025f0302de870a04837b020178090483200104835003026a72090484400201790504837204022302017a0104836b0202c2aa0a0481070303bcc2b3090484370203c7866403027501013601087c158303011212814305813e7b0e090118141a1c49713a211e0c74630f010a59826d8113011203328166037781561a01101d7f1d2a1f822533010e820e070f7b40160110811f40292c813226010a2d20824a32010a81418158670201300304840a0201660404817d02016d0804826902016e080626817f0104820b02016f0404825a02017003023b020272750804840c0301760a04844d02017403025b020175080484200202766e060482360303c2ba6c030482220202c2aa0204810e0301b20204835703048421040484240301bc0802410202d2a1010482630204e1b18f3704048354010137010c08816337812f01101382211532424d39010881248123010e7724810267815f011081236029813e273301101b7b29812a5b813b01128150810324814b220b01060c8417010e165b6c81708117010a1782346f6c0201380804816803016b0604840102013908023f0201610204816c0201630302760201640304832604023e0204833902016502048203020266770804821a0201670a04830002026964080484500304f29e9eb70802250201700204811b0201710904832d0201730304826b05048403020174010481000205776a62c2b2050482630201790202260206c2b2eaaeb464050485020301b3080482480303bac7af0a0484550203c695650804822a0202ceb90a0481170202dbae05023f010138011819814a2703390a61090c6912011a21181304812523811b5f164e050114110f35128123423f810c010c817573817c03010e7182590c812b0401142503597e6e0e2f3a3759011252813a811a2b75091a010882162a31010e17450a81048279010858658208020231670a048205020361c2b906023b02016301048236020164050482520201650904833d0201670904811b0201690604825002026a7a0604837c02016e0204832002017002026d0302c789010481020201720504835e0201740604810002017502020a0702630302676306025f0303e4a0a70102640203786a75010484440201790104841402047ac2be72070481340207c2ba3766673576090482790301bd07048142010481600202c7b309027a0401740604823b0202d2bf0304830f0204e989a6300a02600204f4bd91b60702120101390106518369010e19254641823711010c258267288121010e817c810d2b17250110810a578133812f4c0110415681067b288121010e0881208119347101140b8131543c8100343d1101088203813e01100d742e3230820f3802013006048107020134080481440202356501021a02013808048147020162020482230201630304833c030162050483390206656cf093b5bd070484140202677303048502020769e3ad9669c2b90304847402016b0804836402016c0404841f02016d010481250904825202016e06025402016f0704842a0201700a04834a0201720a0483530201750304822e020676f097b18374030482140201780604833d0202c2b9010481550301be070483720204826f0202ca80060481630202d5a80504833f0101610114551047810e130a78660c011a364611206c0b13080705733d5501240f08070c090b0c20813d1471042e4351131e011204412d814f0913104201263036110d060b1f811a301b0f4e1a29092f181c012808071e221a2a81075b320503065a0f140c1a0a26011c07231d0e6f3715063b760c6b091501121111303e3a71566d6d010e0867814d816a0c01181e18240d41724d221b3f384b0201300204830b060483080302c2b30204837f0201310a026e020134050481560301730902690201360406827c0f0201370204825d06020a0201390904815b0304f3bfb2a70a04822c0201610404810e020262660604841a03017608025b02016309088112825f020164090482310201650a0484480302396f01025d02026774010482090302df9b06048321020168070661813303016f03048248020169030483610504814001048401010483460301300704824203016a0204824402016a0504813303021d03017209048412030277380804824502016c0104814c02036ec2ba0804835702016f0204811d030176020238020270360a04840d02017107048201030469ca99690602350201720304812d0104845e02017304022c02017409022b020175050484140302caaf0402410201760404831f020177010484180704845203026f6d04024b02017a030482660202c2aa0204810a0301b30a04817b0302bd76020483780302be6a0302440202c58207025e0202c69901027a0302ad77010483200206c993f099b183070484270203caa1660204841a0204f29788ac0804831d0204f4ba9f950504843c010162011c0e33810216341c2413042130780501184d373e53131f2f052907423e010c830e3781390e011c1320461f81041b811b041e15243d011e241b10816c310b130c3133033b0741011a11816d3139100c13140b395848011c580e411a06304306810a3138330d011a441707092c70140c1643813920010c73653581374f010c826c81210f0402013803024f07048172020161020481650204810c020162030483470301370404813602016307048379020483280201640304815501048176010481060201650104812a0104841f0201660504821f0201670302700201680804846403016b0a04831d0301700904845502016908025c02016a010483560904827602026b6306023402016c0404832602016d040484410204825702016e0504831603027831020482160302c2be0504827d02026f6a05048121020171030232020483220304845402023a0201720204845c0304846e03013607048224020174060484480201780704844303016f0604814f045807070a0707070707080709070709070808090a5c07080708080b07060a06080707070b0a0b0808070b0a0b0a55070b08080a0908080707060709070709070706080c060b07070c0a66070b08080609070607080c0909660b06070707080a0807070b0b0707080a0b07070d0607080c0908630707070b07070a070d060b0707090a07080b080a070809085f0707070c0706080706070809080f06080a5807070607060e070807080907070b070b060c0709090807690808070707070708070608070709070809070a0d0b07070809095b070707070707070c080d07070b06070707070c07080b0808811a0b08060706080a070a07080609070707080808071307070a0708070907060807090b06060707070b0707080708070707080c090a0a81080a0b07070b0f0b0706070707060b07070b07080808110b070707');
         6915  +INSERT INTO t1_data VALUES(274877906946,X'00000e880330627a020482240202c2aa0a04833f0301b30704844b0302b9650704824f0301ba0204845f0202c9820a0483640202d194060482300203e19cbd0904844b0203e691b4050483510205e78dadde9b0104821201016301142a6c033b8151085c094601140b813d49313f81110e1c011681163611221527257f5d38011c150f22811a0a3c12350631238117011c3e26420b402c1d81080c40150b2f01181c3143382640273d60132e070118663b1d162a1b0e2e8111393e0110821117310e52811c01141a2f49810181391f2b130112323c0305812a6f2e390201320204842702023334020481340201350202610201360304844603023362040484470203376a360a04826b02013808026203016f0704830d02013902025502016106088170827a0301320a04820403016c0404831502016204048327050484030201630a04814302016401048349020484760302430301640204845d02016504048249020367c2bd07020a0302cebc0902150201680a02500201690204846102016a06024c0301770504842b02016b0104830e0704811803023370040483580301710404845f02016c0504844f0204820d0204837f0302c2aa0104833702016d0104844c02016e0804834f03026c6a07025702046fecbd9a01023a020270330204830a0301740304837c020271350204811e0201720706833b310206736ef09289b70104832b020174070483290301320204827c02017608022802017806025b0302c2b30904835202027978080483040303c9b56f0904846a0202c2aa04048127050482120301b30504813a0301b901024204016a0704840c0202c5820704823c0202c999010482470202cebc0602400203db91670602730202dca7050482760203e1a3950304817e0203e786a702048273010164011a0612105b292b817c1211080d5a01147c1d420b35451c36811a011e0e168117081c0c2e051d474055192d011e02050a1c81180420250f815f300f21011c02316a37143321443a10042d54230112761428810e4750054101101805072b8215294e0116680f0f5381445a3e0b070901224e4a41210c361c281b101c43051325130f01185a1e19108106300f2e3f4538020130060481370202327305022002013405048168020335377a03021802013704027b02013804048260020161030882118101030263650904814d0201620604822502016303048419030135090483240201640602280301380404817e0201650404823c0304f097ac9f010482680201660a0267030566e2b6936f0104821c0201680704813302016b0604832002016c01026a0301610204843202016d0804845e03026d6d03023c020270730a04817f0304c2be797a0804832e020271710504835f02017203021b0201740204825a02017706027202017805048451010683572e03016e0a04814c0201790304811702017a080484450302c2b90204837b0202c2aa0604825b0303b273630104841c0301b9050485040301bc0a027b0303bd37680502670202c98b0204826b0203cfa1740504823a0203d199610202350203e3bf87040483570204f1baaba90504817301016501120b8104392d0d20180f011645213f292e4d0d082f8165011e0b400c07341b2329307f193338173a012055292409050c560a272a0f4403245718011a1c3a183f1c43264c3126060829012081208102043a044d0621650b180e150e011a066c030e513d7d265e1313130c0118171953040457347b114d191901261b1c060c26090d6f0d332a1519096e03101d1d012207342f1f2c7e2517251d0f310d2a17081e02013005020a02013308048247020135030483660201380704841b030132030482180201610102600604825f0304c2bdc2ba02023a02016209021f0201630604813002056663cebc610604841e0201670504816a0104842703037177310604833f03027872080482350201680604825e02016a040483320104840d02016b0304813f02026c6408020602016d070481590104837d03016c08020d02016e060484630301780404815c02016f0104826b0804825e02017008027b0302c2aa0504847c0201710404836d0201730402510302cebc08048338020375c7bf05048344020177010482660304822303026479070481630204786ec2ba0204814f0202796a0a04834f02017a01048407030484660604810603026561020483180204c2b278390504813d0301b304024f04026536010483110302b9330604813e0301be0304840b040484560202c4a702022d0206c6a5f7ada9990402350202c79f090481180202caa60502140204cebcc2bd080483320202db900a0481250205f4b5aa9079040484360204f7b985bd0204835e01016601128101285c096981190e01121f813f0d431a8135530114698102813228492f190a011260161881328101812601188155780d813257050c0b04060114161681340772811b5e25011c4505810e13290b253a0c0c0a1a4b011a3714133e1235812b136b062c0b011a6b591356810c3c240906250b1001148127810d413e0e81090d020231680504822c0302c2bc0204830c0201360104840c0303656a740902110302d1950504824f0201370902130201390a0482530303e0a9ae0904844c0201610804810d0201620a04810c03023039030481330302356902048268020163060483470201650504822d02016706048200030483560302713509025002026a79010484410804825902016c0504822002016e07020d0304843a02016f0204842d0201710304837604048361030482430201720904840f020173020482520804810b02017406068425320201760202420201780804845d02037979650704814802017a080481110301780804812c0202c2bd070484600202cebc0508813082410102770401610202250202ddb40302310205f19e9a937a030482410101670118365558195a0a062d0581260a011881068143330844041f0a1851011a2025141e1081204f550e077521011a193b1f58351912265681220821011812070528472f4e2f407f204a01124d1e1f811b810d7b4d01180f1d3481034a35580a12811f011c2303340d1470150778070c812331011620411939703c032915143f01104281116a3d323c6a0201350604842902013703023f0201390a04816e0201610604826402016202023f0201630a04843302016409048258020165020482620404814702016602061b833f0201670404827d03026369020227020169040483490301670604847602016a0604845d0404840902016c04024601088150822b010482350204830a0301690304844902016d0202710704820002016f03048509020482380304836603026e74010483580201700504817a020171020481080204826a0201720304837b0202410302160302c2b3080484550201730904816e020174040248010484280304834e020275730404836e020176060484720104815c02017709026a020178060275040483790201790504821501026c030170080483770304cfb269710704815102017a0204813303016f090483160202c2aa050481400301ba0804810b0401630804830d0301be0604844d0202c8a30a02110203cba0640204816a0202cebf060482420204e487856e030481080204ec97bd6d080484080205f09eb3a0770502260208f687999931ed878703048424010168011a12460e090c036e151b812e065501161708411982151738471f35011a2d1c0678340c1f04425c21200c010c2a087f255d4a011a0d0b6c33814a212c3a0a401b1e011c501f2381010a0481201c0c6012280118150b5228520e0a036c1c8123011a15810a060408030a81563f381601185b1b06212a143f332a60160e011a221b1e62411d2048090e0b0f5502033072350804826a020131020482530201320304823b0201330104814502033677380204813102026174020483540304dbbf6f620404835d0201620504846a0104831803017103048323020164060483740201660a02410201690102130104821402016a0504823f02016c0404832e02016d09022602026e640a04822702016f070482000301750402670201710304813106020d0202726304048220020173060484530201750504831e020483400302c2bd0704843a020177020483470203786371030483740201790904810002017a0302300202c2b9080483280301bc010481700303bd33720304825e0205c99973c2bd040483160203d5a6330a04842b0204e7b3b3300904813c0205f099a68f72090209010169011c21101d4b2d0e0e066b4253074c140118070a0910447556030833541d01163733816837402b3909122501183c5b1139102e2d430c662334011e27050f21621230323503332b6a0332011e1e07031843202e6e3c2850094d410c01163955220b16812d24521212011681250b0a3505460481176f011a2c09266b162968051c0a1481170116022e1e820c352037263a070201310104825d0602110303696869020484070201320204826e0201610304832203016f040232020162050642843f03048336020484540301370804833c03026c6105027a0203636165090483120201640502770304833e03017107022f0301780702470201650a04811e020167080238020168040481160102230404826b030170040483000201690304836f0302766c0304811402016b0504812e02026c6108027702016d0308827d81530604837302026e790904842602016f06048208020170060481680302320201710204812902017307048255020274320104822a02017506026803016e0a04821303017207025f0302c2b90504834a020177020483130201780604836b0402210301320604847302017a010483130202c2aa0804823c0301b9030482600301ba0104845304016c0504837e0202c3b8080484600204cf9d6379020483660202d3860704812e0203e3a4be0402560203e58784010481210204f09e95ac0102580204f5aea5890a023301016a01123428131a1f6c81445601141e227c1a7b5f1918810301182318812e17455605460d811c011a28820221311a6e12093f050a0c0120082c0b0f1362074457460c3b070d5132011c2143052a20133d160a358117591f01103136813b136e6247011c100e4c28060d16815a320a3e11070124462c03582e262d45110804113326040808070807080809090b81050708060708090607060907070b070e07070807060706070b08070f0807070709080708080c070706060808090c07060708080708080909811307070708060709080707070607070a060b070706070707080a080607060c070707080809070608080908090a812406070707070a0906070b0b0908070b07070b0607070b0608070608090b080a080f080a0608080b070b08070a080b0a810408080708080607090707080807070b070c070a070f070b080607090707080d06070b810b070607070607070b08070707070b14070a0f08070b0d08070e080b060a0a070a0707080707070709080a0a0a0e810f0907070709080a0b0707060a0707060807060a08070b08070907060807090b090a0a81140a09070706100707090a060607060e07070807070d08070a07070806070608070a070708070707080a0808090909');
         6916  +INSERT INTO t1_data VALUES(274877906947,X'00080e7f073c23110a1a18392f66090524183704276d6703306a320404824e030164080483520305c2bd7ac2bc0604815a0201360704833202016106021f020482400201630304822a0708817e8204030173040483500201640404824803016d0804824a03017709023002016606048367020268680a04815802016902088339811804027f0302656e0704834e0303d5a5370604816702036a3366090484470303c2ba660904826e02016b0904837c02016c07021403026c610604835802016d0204816802016e0104831202016f0104822f020270720602060201710704822202017206048174020273690204824602017409020c020175090482140201760a0482720301660404824403016a090484290201790404845703025d0203c2bc33040484620301bd0304824c020484540202c78607022403019a010482380202ca87070484390202d39d030485050203e184940404831b0203e6a881060483480203e8b18c0a04816d0203ee8d850104814801016b0110467257393c81272c011a053e815d3b190517064524521f011c3823590a8115372004313b1f3216011a5a20780b102d0804426916112c011a182f810781082d12137026161501221a180516811611051c131207811515173501180320112581062e05621c1407011c2d0e0617811522062208065a21520114582841621e6c203f1e2001161647411a272533815b1c2602013009048309020232630104835a0301720104817f0201330604836f0302ddb5080482560202347a07048102020135020483460104827b02043678ca800a04835f0201370404814b0104846002016103048246010482220301700204833f0201620404824d060481150201650304824f02016606088110834c0201670604821d0303c2be66010481790201680404843b030176050482270201690a04830e02016e0904844202016f040481010301630304822f020270640204822f03016e0704845802027177090482710206736ec2b2796a0104832e0306dab1d485377004048304020174050481700201750a0212020378627604048164030173080483190201790704833d0204823a02017a0506820e67030178070484530202c2b2060481500104823f020483030301b3020484310301bc04027e0402caaf0a026a0301be040482590204842e0202540202c79f0804824d0202cfa30804815a0204f29a92970204823301016c01140f63351a0a653b650d22011c09117a3e1538123537046a15043101141310082f49052f772b0c011c11121781583c2a5010133228241301287f3e0a2b1244080503060a100f413b4f0d070e2a01103e4e1f04814e7b1601183d0404052877111f230f811d01123a100f053e5c076910011a031732102381243d1b1727507301180e5d273e810803812e0f192a02013301048271070481330204821d020134080263020135060481280201610104830a0201640604826d020165060483050201670204841c0504841c0304841b0201680a04845602016a0104811c01024f030481080204813102016b0204837008024502016d0404836c04068207780301670704842302016f0404821203016d040484490301720404837e0201700104821d03048407030165050483050201720a04811602017307023502017407020503016f080484240302c2b90504821b020175090484090201770a088119822503026d6905048300020178030482680604812a0201790104830c0204833a0303d9a06806022002017a060482600203c2aa33030481560301b904020a0301bd0504820f0202d0b90904817c0202d3820202200202daa9080482030203de966e02024b0202df9d080484350204f098b0a20604845e01016d01220304456608322258060a031d4c38340f090112310c070e4238626e6601124a318109030513812f0118240d561e533742188113101b01160b24444b224d44814d4806011c05774e483410330d23541b28090401141f29062581131e221b6d011e81053a037a03320b0e4c24360d2310011a0e321d3c141825111d54637a1c0114093d3c2e58571a35293a0201350104840a03017701048330020136060217020138030483370201610a0482650201620504815e0201630704827701048201020164080483690201660804846703016904048113020167070483080201680504837d05022c0302cdb10a04815f0201690104833a0404824302026a360a04823b02016b0a04813502016d0504831a0204833803021a02026e360404825e02016f080484140201720304844b0404816603056ff09d899b0304823f020275390204816e0301780a04824202017604088308812703027902027770050482040201790104827e040482750204812902017a060483030304c2bdc2b30104836f0203c2aa62040484040301b903021c0302bd6b090484300301be0704814d0202c99402025603049a65656b090484020202ca92090482060203d19a730504844a0203d49f690804836e0202dfa8020482710204f09180860704822901016e011a0c0b8104243647521f43231f36011a2e1b33432c3d0b414905054d17011010573a6c0a816c1801160e063582340a5239050b06011a4481063d1b67250f2044200839012044591d1857291214135814101a1b361d011225067e8147111a4a4301166b13362e17195f3812186f01141c465b032b290406373301182a152a2281300f8107054e3f02023274080481770305c2bacf8168020481450201340604832f0201350704842e02013605020e0201380404841d0201610404810d020483750201620304812b020484230301610804834503026c6a0304816d0201630102380305613577337405048359020165040482720201660904826202066736f094b0af0a0482250201680104811f02016b0304847202016c0404822403016f0904822c0302c2b301025002016d0504817b01023f02016e020483090802040303e7bda10804832d02036f6b740404811402017005048419020484220202716506026303026b760904830a020172080482430304706c73620504825f02017308048413020174080481070201760104827f0204836e020477e7b89a0104840e02017a030483700206c2aa35657065050482740301b30804842b04046cc2be78090481040301b903020d0301bc010484260904813f0203c7a5620302330203c99f36050481010301a30704815b0202ca8b090483250202cdbb0604820a0202cebc0102170401380304842b0207eca2a6f29c87950904824001016f01221d17052b58101241060e3a201f1021633a0114816919811c142443100801280426080e2620042a812c531a490e121707131710011273432e493347811a340112195f671f46721c325e0118380c052b812822478107600b0116021c21821b2019263433040126021b05351b2a286b05181f071b5628111a330a012014533e073d0c0e5469141d1e2734050901220318051b44412803632e0642370e0a3a2b020131070481770201320a04812f0202346e04022b020136030483590304f09a81b60404834702016105048210020162030205030167010268020163010481540604820202048300020264310902420201650804834b02016703048247030365c6b602048205030573f098b890030481450201690204832802016a0a04826703016c0104825e02016b0604815e03016c03048334030677c2aa74c2bc09023d02016c0304823903027777060484540303df866c0104815b02016d0204811f0303796f7704020302016e0204814d07024a02016f0902680201700604840a0104831a0204835a020172070484440201730a023703026b660604830e030278790304815b0201750904822402017704025b020178030482350307f4b2a3896a343407026b0201790902720302633409020402017a020484590302dea004025f0202c2b20204816b050481200202de900402160204ee85a5770204822c0101700114143a0d391a60812d4e09011a2f313104201c372c3a3411321b011a268140144226334145050d1c4d01164e081f20671f088107237901186b123c1f6d07261e2b732e210116511116342a3d32376e083001106882257a0a17141101163039192b0c05812d735f3b01262a3e0841030b17181411051e0a18530e272b6d01182f322b260e24581d5381050f02013104048353020132050482370301690204843e02013302020d0201340104841f0201350a048139020137050482770201380204833a02016105025a0504832f0201620304836d020163050484100304832003016c030481290201640304837e020482490304822b010482290201660a04827002046964dc960204833102016c0704814502016d010482000201700104817e02037176760904821f020473eb91a708048152020174090482770201750404831e01063a825d03017a0904826a020276730a0254020177080260030277630104815c020178070481220202020301720804841202017a0204834c0202c2aa040484010301ba080482580202c6a3020481320203cdbf690502790202ce90070483140301bc030481470205d1a371cebc060481590203d2976a0404830c0203dfba6e0604814b01017101163732393b8120422f054b0e010e030b211d815d1c01165641757c080d81311d090e0112816581542d2313054301224e07121706516606080e39102d231c4b39010a2d81402d5e011a132527428114080d6e1111721c011a814a1a341538251023100d1c4c011e22182622623712411e38162a182d3b01142b67611981470f1f1f250201310a04824e0202336207048217020238730204815a0303cf886d06025a02033962620404833803016f0a04814e020161060483140302726d050483450301790904810c02036376690504811c02016403024d020165010483280802550301650904827f0304ebb8b561070482340201670302670301660804810e020168040482340201690704844d0302616404020f02016a030481060301700704827802016b070481240104814b0302c2bd0504816102016c0604837f03017a0404837902036dc2b90804810002016e0904821602016f0304812c03016401024b02017103048233060483600303e5848e04023a020172040481050305f3978aa06c070481151708070b070a0d0707070607080c080909090706080707070707070806070707070a090b070708080909090981140708070708080b0a0b0b070b070907090707070707070807080c0c070609070b0807100706070e08080a81110f06070707070f07120a0c070707070b0707060607080709080b0b080709060708070808080a810f0707060707070b070707070a080b08070e08070b0b08070c080f070a09060807070a080909080a810b080b070706070b0b0708060b07070c07070707070a0a09090b0708070a07070b0a070c070a060b080907080807070d8123070707070a0706060f070707090b07070707070b07080907080a060f070608080706070c060707070c070a810f07070706070707070a070b0713070a070707090a070c070706080a07070807080808070b0909810607080808090707080709060a070a060707070707070b080707090707060b0807');
         6917  +INSERT INTO t1_data VALUES(274877906948,X'00000e8a0330717304048359030134050481100203756371070482190201760704817b0301770804821d0201770204844d0201780204836c0404826103017504026a0202c2aa020482420301b305022c040267390602570301b9080481540301bc0102290206c99cf6b5aa80080481430202cebc02026e02048120010172011a1c2f15158108048125463f251d010811811539011412423105812181171549011847284a30234e5b33042632120118351e8113817d0f2b220d111901264f104a211004061d0a2a0b35121a0a2118341f011c81160a1b030d2a0610243e445f0c011c6f0c1e3b1768141e322717500b140110537f810169811625011a492847203e210f532c16480627020135020481780302caae0104811a020261330904846c0201620804812d0201630404814a0201650704837503017301048276020168050213020169010484540604842b0302796f0504833302016a0304831b02016b0604701302016d0604815302016e070483630204815202027071020481520201710104835b02037266700704843002027362040481490201740904817d020175020481040304f59e9c9407048218020176060484060204776dc2aa020483070201780504812503016601048159020279790704840502027a730904826c030178030482740202c2aa04023d010483540301bd06026b0203cab877010483290202cdbf060482410202cebc04025c0401690204827f04016c0904840e0202cf880104835d0203dfbe6c01025b0204f0aeb7b2030481680205f1a7b5bb390504826a010173011a22810d12415003071f81181839011a3220221511546d810012052b57011a0c4274300d154e81111f041e10011e293f4213051b2276560817312811170120092136122418370e4e782b3912080f3201262b3b340f222b0c09142a0822116a135c1c130c0114320c4e385a0d0415075f01163543340f06362381133c0c012224180981742048191d110e180e180d310f011a20632450281f043027114b034e0203316a61030482160201360104826e0201380a0484570201610104844d0504814a0201620904820f020164010481630304810403027761040258020165080481550302c9b70204827a0204677367690102660201680104831b020169020483760301720a04814502016a04020c02016b04023405023c030269630504840502016c08048463020170030482670202716d080482000201720304835c03016507024d020174030482520504821503016505048207020175040208030137060481710201760a04833d0201780404832302027a6f080481200202c2ba0204812c0301bd0404821e0205c3a66865730702540202c7890804816f0205cebcc7af730504815c0202d2930202540202db89020481160203e8b8a00304825d0205f0958db331070481620305989b8569780a04813d0204f69299a5020210010174011a7b3829100a4e511f1a281c17140114812626032c372634234c01140a520e815a810815200501123e4f3531042d57615b011a041f3e64070f1f1913274a20770114811d0f5d743e0634161c01162c2782130c1b810520280d01164a513110480b402b810d13011e522d08042c1146137012201e810512011a290903182c05301e5d811944290201390a04836d0301610104836e02016208027803036cc2bc07048261020263640a0481480301730704813602016408022b020165050484310301720702260301780402500203666d73070484470201670104825b02016a040481590304836702016c0304835601025e02016d060484110301340204813702016f04021802017006068336280201710304813507025902017201026508022903016d0604812f0201740304827e03016a010482440201750404834b02017604021a010484150504836a02057773c2b2380602520201780204823e0302cebc080484040303d2956403048171020179020484240204813c0202c2b303048307020484410301be0204816f030484250203c798680104843d03019c030482570204e19ea86a020482350302a0950a0482280204e5a4bc780304810e0101750126090a35030a03220a1731630f31252f0c4b1e31011e39200e3715282a03103b56090f6b1501121d4916246e6d460d6501162609380406361e816d203f011a22166008124f58202e182025150114390f3a25713f0e3f715c011a5a11191123466025710c313312011e3c191326811c1444055f1f5109051201143b106f1181000d068155012043381381020d81080d0603171824260a0201300404844a02013207024203026b390204833803066eeebabb35660604842102013308020302023f02013503048243020436716b66040481440201380a04843d020261690704836002016203048209030484670201630a04841d020264790104822b0201650502340302c2bd060484300201670202620201680704810d020169010484430104843402026b67040481540306eea3ad77c2aa0a04836702016c020258040482270104830a02016d0404824102036e716a0604843e02016f0104832a04020c0204836803036530650a04817402017005025b0301630604843d020171070275020273720404827002017504048133010484120301370102270201760104814f03026203016d0904844802017701048375080481220301660202330301700a04827f020378c2b2030484710202796806023c0301730704813d02017a0404815f0104817202048407010483390202c2b204026802048254040266640204831e0301b3090482230302b963060482010401750a0483290306ba35f2999dac09020f0203ca926e090483350203cdb4780302350202cebc0a020f0204d7a7696d010483100206f097bc996d71040481480101760114185b2258291610821c0e01160272173107154f5b813722011a81020c200e1826250d39811f07011a7911152a2a45131504422c81070120050d3f5b23342e3e4139032a3813042d0116592d1c15630c0c0a814649011c1a362f5c4a35511f0804033e372b01102981262a352e8205010e0b4b6282388106011e26810a2d125f361a12170d1721311e0201300204832b0201320104811b050483790201350204832202016404024c0202657a090483710202666307022703016c07048362030277750604842f0201670304843d0104844c0203686f7a07027202016a0102430204847502046ce0a2b20704810302016d0204827b02026e330804826c02016f0104835502017102027606026c020172060483490202736505048371020174030484130302387602025d02017502048345020376346b0904825c0201770904814b0303c2bd720804812b020178040483600201790804816402017a08026e0202c2b90704811c0301bd0504821e0204cdbcc7a108021a0202cfb8080481490204f09f96a50204842101017701180207232d37812d0c045c4a0a011a06163b3408171c52213a26592201206d08581605811a171e0c0a1347104914011282181324082b73320f01122f6e811d2c3d410a44011e551414206a092f133f333d150a3e0f011e235b170e37060627471b13373b3e27011a0e1e816b270c10102d53381045011a060e1e254d044932651234691e011a158138300a04810c0a8121071802013003027707048214020131080481370201320a04835502013304048271020538ceb369650802310201390a0481440202616c0502570302c7a104026c0201620804811c02016301048168020241020164040481560104820b020165080484460102400202686c060232020269670604827302016a0108810c826e0704824e02026b6c0604816902016c0304831c02016d0304811903016407022b02016e01022e0604845a030237780702040301710804815102016f0104842903017a0704826902017003048445020482080202713002024e0201720804822003016202022302017303048111010482790204812d03067479c39f66700a0210020174020229020175090484430301690604820402017606020202017a01021b0104843a0202c2b90604842b0301bd030484570202c69b0504815d0202c8a30a02240202ceb8090484690301bc0404832f0202df85020481230101780116812b0a16810e4b045a3b2a01205b1305811134092f62072343100f0f05011e5734152612030b4c4134123009361601121781653207780a6a0d01164a25210824138107738139011481341f088158060c8133010e5920193a4c2331011a0510358101231a1b3609702732011a2f07631610033436810256174c011a1342040a58110721378139101602033067750802720201320604834303017109048244020133090481700203366f79010483520201390404810902016301048411050483420201640a048432020265310704832b02026774040481000302d5b2010259020369756c0504832902016c07048365030233700904824102016d010482670404834c0504830c02016e0104831604048120030169090481750303eba6990104835f02016f0604834c030379c2ba0a0481560201700404815e06048256020174040482370201760a04820d0201770604811c02017a0404812e06020b0202c2b9030481660301bd0a04816c0301be030483620206c99b6d7777750304835b0206ceb0646b66610402490202d8bf030482250206e8bfbc626964080482510204f09c9a9e0404830f010179010e2081335661371c01220e4e2718124f0d0649812b0b0a063b040b011402741d1235810805211a011409161d732b8106325f6a01182e330325068107703728302b011e3723081c0d0a3f810c183e061b067f0106834a12011a044030185a1e810704220a0541011245602b0e421441817801144b03811a1a29614e224b02013003048139020132050485050304f09caba6010482230201350104822708048413020138020483430201610402230201620902440108812181070301300304815e020263710404831002016403048226010483660604823c020165010484510201670104816407048418030334c2b20a0481120201690404814c02016a010481500904810f02036b75610304836402016d01027902016f0304817b03056f6373cebc0a0483010201700104817d020171050482680104843b0302383203048128040807090707070b0608060707060c0b810e07080807070707060b080707070b0807090807070a070a07070808070b06090807070708080a0b81230907070b070b0707080907070706090807070807060b07060707070808070a080b0708090b0b09810a0707060908070607060609070b0a070706080a09070707070e0a0708090b0c0b09070a080a811a0706080c09070a07080b0708060806070b080c0e07090e09060706080b060a070b0607090707130b080708070b0908070a0c810d070b0706080707080b080a0a070807090708070707090709070706080709080a81170a0707070a070707070a0b0a07080d080707060a070707070b0707060f0b060707060a08070807080708810d0807070709070b070808070907080f0b070907090b0707070a0807070c0b080c0a810107070a0b07060c07080f070b09070b0906070b070b');
         6918  +INSERT INTO t1_data VALUES(274877906949,X'00000e5c033079720404826c0404833002021b03026f6b020482100201740904842e010484150303c2b36f0204840e0201760704826b02017708048273020578f48ba5b50a0481400201790904845902017a050483280304c2bac2bd0404841e0203c2aa680904843a0301bc070481100301be0304820304016a050481630202ca8103027b0202cb860604840d0204ceb56e370204832e0302bc740202520202cf8d07027e0205d8ae39c2aa0104813c0204e887b3770404816a0204f1bfb0970204832f01017a0118101e282f07045961813a193e011e69162f0d2b051c060f084460063053011e06810c20330d0733815c220515220c011210290a7e07810c3a18011a1f2f064a19155212472781047c010a123e45825501166c6062182718167131092f0112331b812c0b6e81470b01184f3a230d45261e271c36111701140a8128456b291248391a0201300104840d0204812502013401048318020137070483070201380904823b03016704026402013907023403016e060481380201610204812f0404824504045243020162050481150104824003016a0804827a020163070484590204817903017a02048209020164020484200203653077030482610302737601048424020166070481730201670304841e0504840e03016b0504825302016901048235010484400404841002016a010483680404845f02046bc2b97407023302026c7a0704812d02027161070209030378cebc0a021f020172040483750404815f0201730304813c030131020482040201740704824d0302793901027502017604048423020177040620813103048313020179030484540204833c04022503017a0904826302017a050483530203c2b2660404840f0307ba6272f397bd92010483070301be020482760202c6b9050482410203c9a3650604812c0202cbae020482180202d38c0704812f0204f096adb7070483490204f6a69c8b030484390102c2aa010c815e81147969010c811c827f0417010e81077a4c03815f010a2e8100820c010a810d148140010c0a7481201a13010c0b831525323d010a8206358129010c21637a33812701083c8340390301300504820a0304326939770404841c03016107048334030165030484150302696c0704810103016c0704812a03027178090481620301730504830e0301750504846303017802021c0301790304836803017a0604834e040135030482650302cdbf010483330304ceb23169070484090303e4849a0504817d0201b201088219744601082210832c010629846001121c8137182211816232010a81668122690108817281080110816a433581102f3e010e7481001b3481190106814e1b010e3646823a810e070301310504840b030161010481720301660604822f0301680804821003016a0704844803016b0104845b03016c0504823403026f700802340301710804826004026d3106024a03017509068458070301770a04836c04016b01021f0301790a0482790302c2b20a02270401b3040482130303ceae6e010484330302df9e040482100201b3010881656e750106820b50010e81434a27048153010a812b068122010843810c0401048211010a50817d812e010c811a8163810801061e832c010c811f81418101030163030481210301640504831102048104030482440301680a048202040271300404841303066b6576cebc6a0104843603026f7a08026d0303756a7808023e030176040483610301770704814403027973020484360302c2b906020c0401bc010484490401bd0804835c0302d38c0304846f0304eaae96750a0484020201b9010c3b824018322d010e0468315a5c817901067d583401060b810e010865118169010c0e07826b813a01066f8265010c3b8239633852010e61161e7030821b01068241210301350804843d0301620302480301690402610403e7a1910704812103016d080269030673c2bac2b36c090483070301760504821d02048454030278350702620302c2ba010483320304ca897a750804813b0401b5070482350303cebc6d050483120302d199020483020402ad660604840c0302d2a1010482550302daa30202340201ba01026d01085119826a010c2f5e82008110010882028221010481090108821b812d01068128460208810b8264010c810971812d440301310304820e0301320504825e05048221030333756d010482720301340502700301640604813d03016607020c0301690204823a03016b0104812203016c0704842103016d0304835f03016e0a04813c03016f0304834d030173060482660401710604810f0301740104843c0303d48174040482690201bc010482690108813c83290114090f816045242e148111010a810616822701048456010e2c81167a638115010a3a3b83204001067a8367010c8114127a2265010a824f7f5c230301300604833e0302616f020483560301640104827d090481280301650502150301660804841a03016804048221030169030481120301720104827803017606023d04016e020481700302c2aa0904836c0401ba090484100201bd01088240224f010843813674020a81185068620106822a44010e14154a8101825e010c19814a1b826c010c81221f81651b010a815a4d812c01082d7281160301300804843c030231300304836703013509048353030365c2bc0304814d0302667504027a0301670604831503016c09025d03016d03048178030172020483620301730104816b0402c2b30404823203017401027204016a08048451030175090237040177090481690301770302190301780a04823d03027a350a0481260302c2aa060481620401b3090481090304f098a1a30a04825d0201be010a0d730b816f010c821d81236c2b010c6f8208358119010681236801087d4e831e0108823c8235010667794b010683165e010e05812e3d3c820d010c81148123817403043531c2ba0204824c03083875c2bceba7957a03020803016302020804036dcebc0304814e0301640304843704033379790504823203016b08023603016d070481090304825804013707027a03016f080484530301710a04842203017809025e0304c2aa6135010481460401b90a04836b0401bc0704814f0306c6ab66e3afb9080482660103c39f350304821f0201b0050481110301680602030201b8040481310604810403016c0a024803017108024b0201be06048323030482650301300504812d0304f48990ae060482740103c491680a0483700301760a0481290201a7010484090202b177020482380201b3030482280102c5800602090301360104826a02018202048173040483780301370104814102018b090482730201930504810f0102c680020483790404830c020183020228020185030484400704820b02028d7a0a04821c0201920404835e02019507048437010484070301760204836102019a020214080483100303d795680504820602019e030481050201a30404820a05048436030177070484290201a50704843b0201a8060482690304816f03027735020483630202ab79050484430201b6060481050201b904024003016d070481130201bd090484350201bf06048361030163020481580102c781040484560201830604833a020286650404842a0301750a04821a020189070483370303e0b9b30904836602018c0104816c04020602021d030171050484570201960a04842d03016b0204821903016c04021e03016e0204845002019a0a04844402019d0704835103013103021702039f77750704827e0201a1090483340201a301022b0404831d0304616363750502520302cfb2040483720201a50a0481530202ad760902310201af0104811d0908816281390301640404843c0201b3080483240201bb030483480201bd040484290304840a0203bf646a0404843f03017a040482450102c89d05020f0201a1090483550201a3060483550201ab0904813203017a04024a0201ad030482210201b10204824302025d0303656577030483600202b46e010482240201b6090484410204bce39f9d020484570102c9870604813202018b0804843603017a06027102018d080481130204840c02018f0104836309026202029164020484430201930504816d0201970304843402039c6c73070483700201a0070483470201a203048262030364d7960a0484010201a80304832a060484390202a96a080481170303c69532090481440201ac040214020481180202ae770604832c0201b0090482300201b40804845a0201b5070482110302716f010482160201ba0504837b0201bb02048149030165050483250201bc07088105833002067f824d0302d19f0402330201bd04024d03017a0904814f0102ca800a048321020181040481580201820604821e020383693707048417020287630704840002018a0904834c0104835c02018b06022f02018c0704814702018d0704810a0104831a020490e7b38308048423020191020482510201920304832f030135030483710201950304833207026802019902026b02019b0904832a02019d09024c02019f0802210201a4010484080202a5710a0481680203a777670804831e0301790902100201ae0402700104834e0201af040484650202b673080484190201b705048221010483520201b808048465030167010484400104cb81cab90104834802018602048317020689777568cf920804842602018b0404817b020191050484200202a0720304833e0201a3040625827f0201a4030485080102cdb1070881408205020483700201b30404840e0202b735080482640201b80504815a0201b90a0482370206bb31cebc6c730304842f030133070483010103ce80370304826d0201900202770201ae0504844e0201b1050484080201b20904815f0201b3040483430201b40702600201b50804823b0201b90304846e0302c9a1070483300201ba0404844d0104847e0201bb050482780201bc010882378223010e811105814d8134010a8142823f2d0106811c52010a6e1814816b02088168824b010a438137812d011019060c6b812f811c010a81314e811b03033366660404825503013502048263030238620904820703016303048120040f080b0907070b07070a0907070707080a07070b0a0a81060b0707070606070f0b070b07070908070b070f0b090807080b07070707070c0e0707090d07080908080a0a50070a0707080708070706070707080a094d07070707070707070707080706070707090844070f07080c0708070708070707080a4707060609060c0b07080a07090808080737070b09060706070707070707070707094807080b0607070707060708074107080709070706070707080607060706070808070a460a0d06090709060b060707060a07070c0907060b06060b070a090707080707070b0707070c060b08070b070a09070b07070b08080706070707070807080707090d070707060707070609070a090807070d0707070b09070707070706070a0908070a0807060b0a080707090707090b08090a08070707080707070e07060708070709080b06070b0a0707070a06070606070809060a07080b07070a070c07070808070e070807070c07090607070707060707080b0743090708');
         6919  +INSERT INTO t1_data VALUES(274877906950,X'00040e1807020e0830cebc66f09f97b60604840703016b06021003016c0804835103016d0a0484050301710602560301730304822d030275770904834e0301770204824d0302797707022e0302c2b2070482640402bc6d0a025e0303c3a6370602530305cebc7768690a04823f0201be0504816f0301780a0482780201bf0a04833a0305f09e919a790a0483440103cf80340604827e0201810404823e0201830304843a0504837f0301780704834c02018407048139020186030881038372030178010231020187010481100201880204835b0204845a0104825a0201890204825c0604831802018a0704841502028c340304845e02018e0602180301390204833c0203936e770104820f0201940704823702039765630304847b020199080484110301710704821402029b650704827102019d0304845802019f0504845c0303e7ba880502690202a163090484160201a3060483020301680102470201a90a0482480201ab0104837f030482570201af050482190201b20a0481020201b30504842903026f64040483650203b873780704826d0201bb0704831c030177020481410102d0b0070482560202b17a050484460201b2040483400201b40402390202b671020484220202b777090483510201ba030481750202bb6301021e0202bc620a0484080201bd0204815d0201be060482470201bf040483340102d1800904825002028470050482290202876f06022202048872c5820104826202028b680504845d02018c0a027302018d0a0205020197090483210202986b0a02780201a3030481580201a70604835e020483670201a901048379060483780201ad0a04816b0201af010482310201b1080482020201b3060484610202b5640804814c03026e690304847c0201bb080482710201bd020482020201bf06048435010482590107d28b37c2ba61640104831702018d0704810b020393c5890204836e0201950602070305f6a5989a74040484450201970104813702029f790a04843f0202a57407027f0201a90504835b0202ab750502490202b9760a04827d0301780304826e0202bb6f060481780203bd7130050483630103d3866f09023602028a6c0604825302018c0304845302028e650404833a02028f6f0104821302039d356d090484320201a5020481130404813f0201ab0704835b0201b90a0482380201bd0904833c0201bf060484450302307604027f0102d491050483300201930a024603036bd291070483060201970704826702079b72c2b3356f730904844f02019d010482610201a10404814d0202a36b0502250203a5c7b3080483780201ab02023d0103d5a1640102260201a206026a0301660804813c0201a5030481180201a7050483360201a9040483510201aa060482020201ab0504811e0201bb090481680202bd740702160202be700304846d0102d6840a027d02068534f0988d910a0483730102d78f0404832804048462020390766601027802019202027405024b0201940a04834d020298770904815702039a6c6b0304846802049c73616e080483420201b0010481050202b565050481290206b67376c2aa640a0483280201b80704830e0102d89d0202150802720201a60602480202b073090481480201ba0204836f0102d9a50202670201b40a04822a030337c2b20a04820f0102da800604831c0201840604842802038636380804811e020188090484190201920504815402019a0304830c0201a301023d0201a6040481460201a8020484100201af0104842a0204825f0201b50304827c0201bb0804830f0105dbb878c2bc0502580107dc97e69eaf6764020259020299610104812902029d680502110202a0690a0483270203a56372030483540202a96a0204842c0205acf094abac0704821c0102dd92020483410203946d790304814f020395d7ac090228020296300404830302039b397809020a02029c770504833d0202a2700504821a0201ab010483400202b0760a04813a0201b2040483130203b3c7a10104833d0204b4e8a5a40604816f0201b90604830d0201ba090483630102de800904810a020281740a02380201880704826802018f030481670201900202790203916e710404833502019206048418020399ddba080481240202a3630a02250202b86e070481670204830d0201b90604811f0201bc070481530102df820102390201830304830102038e367901024f02039134620a0482080201920104814b020198030484790202a06b060481240201ba0802090201be08022f03023670010482170202bf6f01022d0103e0a1960304831d0302bb75060483700202a2900804817c0202a49e050485010202a6b2040482030202aa80040481720202abb30304843c0301ba0204833b0203aca677010481120206ae9f613566730504841e0202afa001020a0302a979080484060202b1a1010483730203b2a46a070482460301ba020484580203b39b610804834a0202b6a60304813b0202bfae0404837c0103e185930304845f02038889780a04826802028a85070484620301b90304826c020298a3070483270203af8962050484620202b5b7070481170202b8970602190202bd8f0a0482620103e2848f04021b0203afa861020484010301b70704824a0103e3828f05048214020284a50304812f0202909e0904824d020292b907026302049ba0336604020602029c8e0204840d0202ad860202750302a16a0802180202ae880602040202b480010483150202b7b1090483780202bdbf070482050103e480ab06020f0202889605024f020293b9030483310204968fdc93080483110202a295010484150202a69a0804844d0202a78e0a02080202aa9b0a04825f0203b2b8670402720203b5b764060482550204babacf87070481270202bd9b010481780206be9a6878696805021e0103e58bba0304821202049eab6a630a04827702029faf08024d0202a2b50a02400202a3af0704827c0203a4bd6f0504840c0202ad9d030485010202b1be040483780202b5b9060484500103e689b10404844602028abc0704811902038e98690802320203968b35090482680203979971010483060202b6a4030484050301be0a04833e0103e780a601048171020282be0304824d020286b105021b02028f960a048266020291be0804831c020299900204815502029ea70702400202a0ba040481410204a69e3870030481220202a9800602310202afb8020482170203b1af6d0802140203b5a06a0702740104e88c9a6c06048426020295bc05048326020296af0304846b02059cad72d4aa060484780205baa97364680404837b0103e983840104843902029a8a010481490203a1ac770504812c0301ba050483410202af8c0302620202b1af0302500103ea8fa60a023e020297b50904812e020298a90704825702039ea76b0304847f0202a59e080481460202a68e080482590204a9b1c6a8010481350203b38d75040482750203b89e6f0a0484030103eb828f0704824e020384837109048178020397b6690104821a02039e9e330704837f0203a68b73030484440203b980320804822c0103ec8fa80204814302039588760a04826902029bb80a024e0203afb6630802710203b4a268060483000103ed8cb50104811602029982060481550104ee8085760304834502028a870904845702028f8b04027602039da470030483040202a1a20504813c0202a8ae0504837f0202af9d0402570205b1b773d8b4080482120202bd880904832c0202be930104827b0104ef88ae680704835d0205a8ab63c2be06022e0203aaa16c080481090204adb779660804823f0202b8ae080484220203bb9165030481340106f08798b1636a0604824f0203908ea80404826203029f880402530303b4ad740a04833302039184b6090484650302acb3080483340302b1b703048272020a9281a23578f098b1893001048210030291a50404816803029d8f070483200302afa5080484440302b49f020481010303bd833603026a020393839a07024c0304a3ad6e300504842d0303abb16d0502660302adae0904830e02039481a406048164030386a16c070483530302b2a8050484320302bfb9080483170204958eb8720304832b0302b1ba090481200302babe05048209020496888b6708048358030293b4050483400304b4927a6f050483770204978b93320104810a03048fb9c7890704822803029ba702022a0302a39d060484490302a4be0a0484530302adaa0a026b0302af92040483700302b9bc0404821b02049884b56404048352030486b1716f0904827a030296b80904811d03049d9e797a060483390302a5a00a04844a0303b5856d0a04822e0302bcbd040483310303bd91740704845102039983a20a04816503039d8a330a02140303b9826b0404814e02069a8b8438687403026b0302a599010481740302a6ac0704840f0303b6896d0404831a0302b785010484370302bfac08027d02059b86b770610404845203028fbd020483550303a0be75090483620302a295040482390302b6970404813002039c97bb0a04841103059d8976c2be0604824e0302afbc05023c02039d87b40504825903028daf03048172030292be040482310302a0ab0502290303b2a16b03025d02039e929d050483040302a69f060484150302aa8607025502049f9f8b66020483160302a3be060481120203a8afad0904835e0204acb1af640204845b0204b282a47a040481610203baa68a010482490204bb9f8366060483130203bfa48f0704817c0104f18191920802220204828cad360a0482730203859c9a050481670204888eb23408025f020492ba9c3202026502049bb0bf7008021f02039f94a60104835c0203a6b496030482760203a98c960504824e0203acb7b8030483240203afa0b703023d0206b3a38c683972060483340203bbaaad0902070105f282848f790804833a020384b79f0a048170020590a98c616a0804843b02049a92be730904822f02039da18b080482530203a28f8f06048309070d06070706070807070807080b0707070b09070b07070906070f0b07080607090709070708070708080706070b070707080907070808070608080707080707070808070a0806060707070b0b07070707080807070b0d0709060b0708070707080708090808070808090b0707070707080609070d07070709060806070707070707070708070c0c08090708090a07080c070a0608070707090807090707070607070b07070a0c08070809080b08090808080808070807090a07070807070706090709070c070707070809070708060608070908080808080807090c07080809070908080909080708090807080809070908080709080707070808080807080a0808070808090a080b090a070708090808080908080909080709080708080807080a070808080a08080b0b0908090707070808080908080a0909090909090909090907080909080a0807090808070b08080a0a090a08090c090709090808100808080808080a0808090908080a08080a080a0a0a0708080708080a0a080a080908090908090b08080908070b08090808090b0709080807080908070a08090a0a090a09090a0909090909090909080c080b090b0a09');
         6920  +INSERT INTO t1_data VALUES(274877906951,X'000002020630f2abab907a060481130204b381af77040481790203bea6a6070484250108f380b5a33633737701048229020383be9f0404837102048495bf73070481060204938c9a6e0904823502039eb39201022302049fbb9f6c0a0481500204a3909e620404837d0204a9ac9a75020483110203bd8c850a048111030293ad0a048247030294b9040483550203bea4ac0702220105f483b5ab66030482440302bda306048141020584b2bb643804048142020586b1a8677a0204831d0205878c916c770804821f02038da1bf0704824302038f81bd0304825102039e91b20302420203b29b9403021f0203b3a1b10704825a0203b5afb4040481210204b98da0780a02060104f582b1b00404811002038f9fbc010482200302b8a406048419020394b7b80404834c02039bb5b005022b0203aa88b9060481390203aba48f0604842a0205af969438680602360203b88d8903026c0104f68386ad0904846702049aae8f79030483520203a8989a0604836c0203b18cb4070482260203b9a98d050483730203bebc870104824c0104f78283840804816703028db20302600303a8b46106020b020389b2a80104835002048e809339010481190205929193d0b409048253020393aebc0204816202059787b96f690704817202079b949dc78934620404817f02039db28b020483750205a288a7c7a3080482780203a5948d0204811a040b0a090e090a0a080a0a0a090808080b080b0b0b090908080909090a0908090809090a080a0a090909090a0708090a0b090b0d090b');
         6921  +CREATE TABLE IF NOT EXISTS 't1_idx'(segid, term, pgno, PRIMARY KEY(segid, term)) WITHOUT ROWID;
         6922  +INSERT INTO t1_idx VALUES(2,X'',2);
         6923  +INSERT INTO t1_idx VALUES(2,X'30627a',4);
         6924  +INSERT INTO t1_idx VALUES(2,X'306a32',6);
         6925  +INSERT INTO t1_idx VALUES(2,X'307173',8);
         6926  +INSERT INTO t1_idx VALUES(2,X'307972',10);
         6927  +INSERT INTO t1_idx VALUES(2,X'30cebc66',12);
         6928  +INSERT INTO t1_idx VALUES(2,X'30f2ab',14);
         6929  +CREATE TABLE IF NOT EXISTS 't1_content'(id INTEGER PRIMARY KEY, c0, c1,Öc2);
         6930  +INSERT INTO t1_content VALUES(1,'COMPILER=gcc-5.4.0 20160609','X','RTRIM');
         6931  +INSERT INTO t1_content VALUES(2,'COMPILER=gcc-5.4.0 20160609','X','NOCASE');
         6932  +INSERT INTO t1_content VALUES(3,'COMPILER=gcc-5.4.0 20160609','X','BINARY');
         6933  +INSERT INTO t1_content VALUES(4,'DEBUG','X','RTRIM');
         6934  +INSERT INTO t1_content VALUES(5,'DEBUG','X','NOCASE');
         6935  +INSERT INTO t1_content VALUES(6,'DEBUG','X','BINARY');
         6936  +INSERT INTO t1_content VALUES(7,'ENABLE DBSTAT VTAB','X','RTRIM');
         6937  +INSERT INTO t1_content VALUES(8,'ENABLE DBSTAT VTAB','X','NOCASE');
         6938  +INSERT INTO t1_content VALUES(9,'ENABLE DBSTAT VTAB','X','BINARY');
         6939  +INSERT INTO t1_content VALUES(10,'ENABLE FTS4','X','RTRIM');
         6940  +INSERT INTO t1_content VALUES(11,'ENABLE FTS4','X','NOCASE');
         6941  +INSERT INTO t1_content VALUES(12,'ENABLE FUS4','X','BINARY');
         6942  +INSERT INTO t1_content VALUES(0,NULL,NULL,NULL);
         6943  +INSERT INTO t1_content VALUES(33,'OMIT LOAD EXTENSION','X','BINARY');
         6944  +INSERT INTO t1_content VALUES(32,'OMIT LOAD EXTENSION','X','NOCASE');
         6945  +INSERT INTO t1_content VALUES(31,'OMYT LOAD EXTENSION','X','RTRIM');
         6946  +INSERT INTO t1_content VALUES(30,'MAX MEMORY=50000000','W','BINARY');
         6947  +INSERT INTO t1_content VALUES(29,'MAX MEMORY=50000000','X','NOCASE');
         6948  +INSERT INTO t1_content VALUES(28,'MAX MEMORY=50000000','X','RTRIM');
         6949  +INSERT INTO t1_content VALUES(27,'ENABLE RTREE','X','BINARY');
         6950  +INSERT INTO t1_content VALUES(26,'ENABLE RTREE','Y','NOCASE');
         6951  +INSERT INTO t1_content VALUES(25,'ENABLE RTREE','X','RTRIM');
         6952  +INSERT INTO t1_content VALUES(24,'ENABLE MEMSYS5','X','BINARY');
         6953  +INSERT INTO t1_content VALUES(23,'ENABLE MEMSYS5','X','NOCASE');
         6954  +INSERT INTO t1_content VALUES(22,'ENABLE MEMSYS5','X','RTRIM');
         6955  +INSERT INTO t1_content VALUES(21,'ENABLE JSON1','X','BINARY');
         6956  +INSERT INTO t1_content VALUES(20,'ENABLE JSON1','X','NOCASE');
         6957  +INSERT INTO t1_content VALUES(18,'ENABLE GEOPOLY','X','BINARY');
         6958  +INSERT INTO t1_content VALUES(17,'EOABLE GEOPOLY','X','NOCQSE');
         6959  +INSERT INTO t1_content VALUES(16,'ENABLE GEOPOLY','X','RTRIM');
         6960  +INSERT INTO t1_content VALUES(15,'ENABLE FTS5','X','BINARY');
         6961  +INSERT INTO t1_content VALUES(14,'ENABLE FTS5','X','NOCASE');
         6962  +CREATE TABLE IF NOT EXISTS 't1_docsize'(id INTEGER PRIMARY KEY, sz BLOB);
         6963  +CREATE TABLE IF NOT EXISTS 't1_config'(k PRIMARY KEY, v) WITHOUT ROWID;
         6964  +CREATE TABLE t2(x);
         6965  +INSERT INTO t2 VALUES('optimize');
         6966  +INSERT INTO t2 VALUES('rebuild');
         6967  +INSERT INTO t2 VALUES('integrity-check');
         6968  +PRAGMA writable_schema=OFF;
         6969  +COMMIT;
         6970  +} {}
         6971  +
         6972  +do_catchsql_test 51.1 {
         6973  +  SELECT max(rowid)==0 FROM t1('e*');
         6974  +} {0 0}
         6975  +
         6976  +#--------------------------------------------------------------------------
         6977  +reset_db
         6978  +do_test 52.0 {
         6979  +  sqlite3 db {}
         6980  +  db deserialize [decode_hexdb {
         6981  +| size 40960 pagesize 4096 filename crash-2b92f77ddfe191.db
         6982  +| page 1 offset 0
         6983  +|      0: 53 51 4c 69 74 65 20 66 6f 72 6d 61 74 20 33 00   SQLite format 3.
         6984  +|     16: 10 00 01 01 00 40 20 20 00 00 00 00 00 00 00 0a   .....@  ........
         6985  +|     32: 00 00 00 00 00 00 00 00 00 00 00 0d 00 00 00 04   ................
         6986  +|     48: 00 00 00 00 00 00 00 00 00 00 00 01 00 00 00 00   ................
         6987  +|     96: 00 00 00 00 0d 00 00 00 0d 0b 6e 00 0f a3 0f 4c   ..........n....L
         6988  +|    112: 0e e1 0e 81 0e 24 0d cc 0d 72 0d 1b 0c b0 0c 50   .....$...r.....P
         6989  +|    128: 0b f8 0b b3 0b 6e 00 00 00 00 00 00 00 00 00 00   .....n..........
         6990  +|   2912: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 43 0d   ..............C.
         6991  +|   2928: 06 17 11 11 08 75 74 61 62 6c 65 74 34 74 34 43   .....utablet4t4C
         6992  +|   2944: 52 45 41 54 45 20 56 49 52 54 55 41 4c 20 54 41   REATE VIRTUAL TA
         6993  +|   2960: 42 4c 45 20 74 34 20 55 53 49 4e 47 20 66 74 73   BLE t4 USING fts
         6994  +|   2976: 35 76 6f 63 61 62 28 27 74 32 27 2c 20 27 72 6f   5vocab('t2', 'ro
         6995  +|   2992: 77 27 29 43 0c 06 17 11 11 08 75 74 61 62 6c 65   w')C......utable
         6996  +|   3008: 74 33 74 33 43 52 45 41 54 45 20 56 49 52 54 55   t3t3CREATE VIRTU
         6997  +|   3024: 41 4c 20 54 41 42 4c 45 20 74 33 20 55 53 49 4e   AL TABLE t3 USIN
         6998  +|   3040: 47 20 66 74 73 35 76 6f 63 61 62 28 27 74 31 27   G fts5vocab('t1'
         6999  +|   3056: 2c 20 27 72 6f 77 27 29 56 0b 06 17 1f 1f 01 7d   , 'row')V.......
         7000  +|   3072: 74 61 62 6c 75 74 32 5f 63 6f 6e 66 69 67 74 32   tablut2_configt2
         7001  +|   3088: 5f 63 6f 6e 66 69 67 0a 43 52 45 41 54 45 20 54   _config.CREATE T
         7002  +|   3104: 41 42 4c 45 20 27 74 32 5f 63 6f 6e 66 69 67 27   ABLE 't2_config'
         7003  +|   3120: 28 6b 20 50 52 49 4d 41 52 59 20 4b 45 59 2c 20   (k PRIMARY KEY, 
         7004  +|   3136: 76 29 20 57 49 54 48 4f 55 54 20 52 4f 57 49 44   v) WITHOUT ROWID
         7005  +|   3152: 5e 0a 07 17 21 21 01 81 07 74 61 62 6c 65 74 32   ^...!!...tablet2
         7006  +|   3168: 5f 63 6f 6e 74 65 6e 74 74 32 5f 63 6f 6e 74 65   _contentt2_conte
         7007  +|   3184: 6e 74 09 43 52 45 41 54 45 20 54 41 42 4c 45 20   nt.CREATE TABLE 
         7008  +|   3200: 27 74 32 5f 63 6f 6e 74 65 6e 74 27 28 69 64 20   't2_content'(id 
         7009  +|   3216: 49 4e 54 45 47 45 52 20 50 52 49 4d 41 52 59 20   INTEGER PRIMARY 
         7010  +|   3232: 4b 45 59 2c 20 63 30 2c 20 63 31 2c 20 63 32 29   KEY, c0, c1, c2)
         7011  +|   3248: 69 09 07 17 19 19 01 81 2d 74 61 62 6c 65 74 32   i.......-tablet2
         7012  +|   3264: 5f 69 64 78 74 32 5f 69 64 78 08 43 52 45 41 54   _idxt2_idx.CREAT
         7013  +|   3280: 45 20 54 41 42 4c 45 20 27 74 32 5f 69 64 78 27   E TABLE 't2_idx'
         7014  +|   3296: 28 73 65 67 69 64 2c 20 74 65 72 6d 2c 20 70 67   (segid, term, pg
         7015  +|   3312: 6e 6f 2c 20 50 52 49 4d 41 52 59 20 4b 45 59 28   no, PRIMARY KEY(
         7016  +|   3328: 73 65 67 69 64 2c 20 74 65 72 6d 29 29 20 57 49   segid, term)) WI
         7017  +|   3344: 54 48 4f 55 54 20 52 4f 57 49 44 55 08 07 17 1b   THOUT ROWIDU....
         7018  +|   3360: 1b 01 81 01 74 61 62 6c 65 74 32 5f 64 61 74 61   ....tablet2_data
         7019  +|   3376: 74 32 5f 64 61 74 61 07 43 52 45 41 54 45 20 54   t2_data.CREATE T
         7020  +|   3392: 41 42 4c 45 20 27 74 32 5f 64 61 74 61 27 28 69   ABLE 't2_data'(i
         7021  +|   3408: 64 20 49 4e 54 45 47 45 52 20 50 52 49 4d 41 52   d INTEGER PRIMAR
         7022  +|   3424: 59 20 4b 45 59 2c 20 62 6c 6f 63 6b 20 42 4c 4f   Y KEY, block BLO
         7023  +|   3440: 42 29 58 07 07 17 11 11 08 81 1d 74 61 62 6c 65   B)X........table
         7024  +|   3456: 74 32 74 32 43 52 45 41 54 45 20 56 49 52 54 55   t2t2CREATE VIRTU
         7025  +|   3472: 41 4c 20 54 41 42 4c 45 20 74 32 20 55 53 49 4e   AL TABLE t2 USIN
         7026  +|   3488: 47 20 66 74 73 35 28 27 61 27 2c 5b 62 5d 2c 22   G fts5('a',[b],.
         7027  +|   3504: 63 22 2c 64 65 74 61 69 6c 3d 6e 6f 6e 65 2c 63   c.,detail=none,c
         7028  +|   3520: 6f 6c 75 6d 6e 73 69 7a 65 3d 30 29 56 06 06 17   olumnsize=0)V...
         7029  +|   3536: 1f 1f 01 7d 74 61 62 6c 65 74 31 5f 63 6f 6e 66   ....tablet1_conf
         7030  +|   3552: 69 67 74 31 5f 63 6f 6e 66 69 67 06 43 52 45 41   igt1_config.CREA
         7031  +|   3568: 54 45 20 54 41 42 4c 45 20 27 74 31 5f 63 6f 6e   TE TABLE 't1_con
         7032  +|   3584: 66 69 67 27 28 6b 20 50 52 49 4d 41 52 59 20 4b   fig'(k PRIMARY K
         7033  +|   3600: 45 59 2c 20 76 29 20 57 49 54 48 4f 55 54 20 52   EY, v) WITHOUT R
         7034  +|   3616: 4f 57 49 44 5b 05 07 17 21 21 01 81 01 74 61 62   OWID[...!!...tab
         7035  +|   3632: 6c 65 74 31 5f 64 6f 63 73 69 7a 65 74 31 5f 64   let1_docsizet1_d
         7036  +|   3648: e8 63 73 69 7a 65 05 43 52 45 41 54 45 20 54 41   .csize.CREATE TA
         7037  +|   3664: 42 4c 45 20 27 74 31 5f 64 6f 63 73 69 7a 65 27   BLE 't1_docsize'
         7038  +|   3680: 28 69 64 20 49 4e 54 45 47 45 52 20 50 52 49 4d   (id INTEGER PRIM
         7039  +|   3696: 41 52 59 20 4b 45 59 2c 20 73 7a 20 42 4c 4f 42   ARY KEY, sz BLOB
         7040  +|   3712: 29 5e 04 07 17 21 21 01 81 07 74 61 62 6c 65 74   )^...!!...tablet
         7041  +|   3728: 31 5f 63 6f 6e 74 65 6f 74 74 31 5f 63 6f 6e 74   1_conteott1_cont
         7042  +|   3744: 65 6e 74 04 43 52 45 41 54 45 20 54 41 42 4c 45   ent.CREATE TABLE
         7043  +|   3760: 20 27 74 31 5f 63 6f 6e 74 65 6e 74 27 28 69 64    't1_content'(id
         7044  +|   3776: 20 49 4e 54 45 47 45 52 20 50 52 49 4d 41 52 59    INTEGER PRIMARY
         7045  +|   3792: 20 4b 45 59 2c 20 63 30 2c 20 63 31 2c 20 63 32    KEY, c0, c1, c2
         7046  +|   3808: 29 69 03 07 17 19 19 01 81 2d 74 61 62 6c 65 74   )i.......-tablet
         7047  +|   3824: 31 5f 69 64 78 74 31 5f 69 64 78 03 43 52 45 41   1_idxt1_idx.CREA
         7048  +|   3840: 54 45 20 54 41 42 4c 45 20 27 74 31 5f 69 64 78   TE TABLE 't1_idx
         7049  +|   3856: 27 28 73 65 67 69 64 2c 20 74 65 72 6d 2c 20 70   '(segid, term, p
         7050  +|   3872: 67 6e 6f 2c 20 50 52 49 4d 41 52 59 20 4b 45 59   gno, PRIMARY KEY
         7051  +|   3888: 28 73 65 67 69 64 2c 20 74 65 72 6d 29 29 20 57   (segid, term)) W
         7052  +|   3904: 49 54 48 4f 55 54 20 52 4f 57 49 44 55 02 07 17   ITHOUT ROWIDU...
         7053  +|   3920: 1b 1b 01 81 01 74 61 62 6c 65 74 31 5f 64 61 74   .....tablet1_dat
         7054  +|   3936: 61 74 31 5f 64 61 74 61 02 43 52 45 41 54 45 20   at1_data.CREATE 
         7055  +|   3952: 54 41 42 4c 45 20 27 74 31 5f 64 61 74 61 27 28   TABLE 't1_data'(
         7056  +|   3968: 69 64 20 49 4e 54 45 47 45 52 20 50 52 49 4d 41   id INTEGER PRIMA
         7057  +|   3984: 52 59 20 4b 45 59 2c 20 62 6c 6f 63 6b 20 42 4c   RY KEY, block BL
         7058  +|   4000: 4f 42 29 5b 01 07 17 11 11 08 81 23 74 61 62 6c   OB)[.......#tabl
         7059  +|   4016: 65 74 31 74 31 43 52 45 41 54 45 20 56 49 52 54   et1t1CREATE VIRT
         7060  +|   4032: 55 41 4c 20 54 41 42 4c 45 20 74 31 20 55 53 49   UAL TABLE t1 USI
         7061  +|   4048: 4e 47 20 66 74 73 35 28 61 2c 62 20 75 6e 69 6e   NG fts5(a,b unin
         7062  +|   4064: 64 65 78 65 64 2c 63 2c 74 6f 6b 65 6e 69 7a 65   dexed,c,tokenize
         7063  +|   4080: 3d 22 70 6f 72 74 65 72 20 61 73 63 69 69 22 29   =.porter ascii.)
         7064  +| page 2 offset 4096
         7065  +|      0: 0d 0f 68 00 05 0f 13 00 0f e6 0f 13 0f a8 0f 7c   ..h............|
         7066  +|     16: 0f 2a 00 00 00 00 00 00 00 00 00 00 00 00 00 00   .*..............
         7067  +|   3856: 00 00 00 15 0a 03 00 30 00 00 00 00 01 03 03 00   .......0........
         7068  +|   3872: 03 01 01 01 02 01 01 03 01 01 37 8c 80 80 80 80   ..........7.....
         7069  +|   3888: 01 03 00 74 00 00 00 2e 02 30 61 03 02 02 01 01   ...t.....0a.....
         7070  +|   3904: 62 03 02 03 01 01 63 03 02 04 01 01 67 03 08 c1   b.....c.....g...
         7071  +|   3920: 02 02 01 01 68 03 06 01 02 03 01 01 69 03 06 01   ....h.......i...
         7072  +|   3936: 02 04 04 06 06 06 08 08 0f ef 00 14 2a 00 00 00   ............*...
         7073  +|   3952: 00 01 02 02 00 02 01 01 01 02 01 01 25 88 80 80   ............%...
         7074  +|   3968: 80 80 01 03 00 50 00 00 00 1f 02 30 67 02 08 02   .....P.....0g...
         7075  +|   3984: 01 02 02 01 01 68 02 08 03 01 02 03 01 01 69 02   .....h........i.
         7076  +|   4000: 08 04 01 02 04 04 09 09 37 84 80 80 80 80 01 03   ........7.......
         7077  +|   4016: 00 74 00 14 00 2e 02 30 61 01 02 02 01 01 62 01   .t.....0a.....b.
         7078  +|   4032: 02 03 01 01 63 01 02 04 01 01 67 01 06 01 02 02   ....c.....g.....
         7079  +|   4048: 01 01 68 01 06 01 02 03 01 01 69 01 06 01 02 03   ..h.......i.....
         7080  +|   4064: f4 06 06 06 08 08 07 01 03 00 14 03 09 00 09 00   ................
         7081  +|   4080: 00 00 11 24 00 00 00 00 01 01 01 00 01 00 01 01   ...$............
         7082  +| page 3 offset 8192
         7083  +|      0: 0a 00 00 00 03 0f ec 00 0f fa 0f f3 0f ec 00 00   ................
         7084  +|   4064: 00 00 00 00 00 00 00 00 00 00 00 00 06 04 01 0c   ................
         7085  +|   4080: 01 03 02 06 04 01 0c 01 02 02 05 04 09 0c 01 02   ................
         7086  +| page 4 offset 12288
         7087  +|      0: 0d 00 00 00 03 0f be 00 0f ea 0f d4 0f be 00 00   ................
         7088  +|     16: 00 00 00 00 01 00 00 00 00 00 00 00 00 00 00 00   ................
         7089  +|   4016: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 14 03   ................
         7090  +|   4032: 05 00 17 17 17 61 20 62 20 63 67 20 68 20 69 67   .....a b cg h ig
         7091  +|   4048: 20 68 20 69 14 02 05 00 17 17 17 67 20 68 20 69    h i.......g h i
         7092  +|   4064: 61 20 62 20 63 67 20 68 20 69 14 01 05 00 17 17   a b cg h i......
         7093  +|   4080: 17 61 20 62 20 63 64 20 65 20 66 67 20 68 20 69   .a b cd e fg h i
         7094  +| page 5 offset 16384
         7095  +|      0: 0d 00 00 00 03 0f e8 00 0f f8 0f f0 0f e8 00 00   ................
         7096  +|   4064: 00 00 00 00 00 00 00 00 06 03 03 00 12 03 00 03   ................
         7097  +|   4080: 06 02 03 00 12 03 00 03 06 01 04 00 12 03 00 03   ................
         7098  +| page 6 offset 20480
         7099  +|      0: 0a 00 00 00 01 0f f4 00 0f f4 00 00 00 00 00 00   ................
         7100  +|   4080: 00 00 00 00 0b 03 1b 01 76 65 72 73 69 6f 6e 04   ........version.
         7101  +| page 7 offset 24576
         7102  +|      0: 0d 00 00 00 03 0f 9e 00 0f e6 0f ef 0f 9e 00 00   ................
         7103  +|   3968: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 41 84   ..............A.
         7104  +|   3984: 80 80 80 80 01 04 00 81 06 00 00 00 34 02 30 61   ............4.0a
         7105  +|   4000: 01 01 01 01 01 62 01 01 01 01 01 63 01 01 01 01   .....b.....c....
         7106  +|   4016: 01 64 01 01 01 65 01 01 01 66 01 01 01 67 01 01   .d...e...f...g..
         7107  +|   4032: 01 01 01 68 01 01 01 01 01 69 01 01 01 04 06 06   ...h.....i......
         7108  +|   4048: 06 04 04 04 06 06 07 01 03 00 14 03 09 09 09 0f   ................
         7109  +|   4064: 0a 03 00 24 00 00 00 00 01 01 01 00 01 01 01 01   ...$............
         7110  +|   4080: 0a 00 00 00 01 0f fa 00 0f fa 00 00 00 00 00 00   ................
         7111  +| page 8 offset 28672
         7112  +|   4080: 00 00 00 00 00 00 00 00 00 00 05 04 09 0c 01 02   ................
         7113  +| page 9 offset 32768
         7114  +|      0: 0d 00 00 00 03 0f be 00 0f ea 0f d4 0f be 00 00   ................
         7115  +|   4016: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 14 03   ................
         7116  +|   4032: 05 00 17 17 17 61 20 62 20 63 67 20 68 20 69 67   .....a b cg h ig
         7117  +|   4048: 20 68 20 69 14 02 05 00 17 17 17 67 20 68 20 69    h i.......g h i
         7118  +|   4064: 61 20 62 20 63 67 20 68 20 69 14 01 05 00 17 17   a b cg h i......
         7119  +|   4080: 17 61 20 62 20 63 64 20 65 20 66 67 20 68 20 69   .a b cd e fg h i
         7120  +| page 10 offset 36864
         7121  +|      0: 0a 00 00 00 01 0f f4 00 0f f4 00 00 00 00 00 00   ................
         7122  +|   4080: 00 00 00 00 0b 03 1b 01 76 65 72 73 69 6f 6e 04   ........version.
         7123  +| end crash-2b92f77ddfe191.db
         7124  +}]} {}
         7125  +
         7126  +do_catchsql_test 52.1 {
         7127  +  SELECT fts5_decode(id, block) FROM t1_data;
         7128  +} {1 {database disk image is malformed}}
         7129  +
         7130  +#-------------------------------------------------------------------------
         7131  +reset_db
         7132  +do_test 53.0 {
         7133  +  sqlite3 db {}
         7134  +  db deserialize [decode_hexdb {
         7135  +| size 24576 pagesize 4096 filename crash-dbe9b7614da103.db
         7136  +| page 1 offset 0
         7137  +|      0: 53 51 4c 69 74 65 20 66 6f 72 6d 61 74 20 33 00   SQLite format 3.
         7138  +|     16: 10 00 01 01 00 40 20 20 00 00 00 00 00 00 00 06   .....@  ........
         7139  +|     32: 00 00 00 00 00 00 00 00 00 00 00 06 00 00 00 04   ................
         7140  +|     96: 00 00 00 00 0d 00 00 00 06 0e 0f 00 0f aa 0f 53   ...............S
         7141  +|    112: 0e e8 0e 8b 0e 33 0e 0f 00 00 00 00 00 00 00 00   .....3..........
         7142  +|   3584: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 22   ................
         7143  +|   3600: 06 06 17 11 11 01 31 74 61 62 6c 65 62 62 62 62   ......1tablebbbb
         7144  +|   3616: 06 43 52 45 41 54 45 20 54 41 42 4c 45 20 62 62   .CREATE TABLE bb
         7145  +|   3632: 28 61 29 56 05 06 17 1f 1f 01 7d 74 61 62 6c 65   (a)V.......table
         7146  +|   3648: 74 31 5f 63 6f 6e 66 69 67 74 31 5f 63 6f 6e 66   t1_configt1_conf
         7147  +|   3664: 69 67 05 43 52 45 41 54 45 20 54 41 42 4c 45 20   ig.CREATE TABLE 
         7148  +|   3680: 27 74 31 5f 63 6f 6e 66 69 67 27 28 6b 20 50 52   't1_config'(k PR
         7149  +|   3696: 49 4d 41 52 59 20 4b 45 59 2c 20 76 29 20 57 49   IMARY KEY, v) WI
         7150  +|   3712: 54 48 4f 55 54 20 52 4f 57 49 44 5b 04 07 17 21   THOUT ROWID[...!
         7151  +|   3728: 21 01 81 01 74 61 62 6c 65 74 31 5f 64 6f 63 73   !...tablet1_docs
         7152  +|   3744: 69 7a 65 74 31 5f 64 6f 63 73 69 7a 65 04 43 52   izet1_docsize.CR
         7153  +|   3760: 45 41 54 45 20 54 41 42 4c 45 20 27 74 31 5f 64   EATE TABLE 't1_d
         7154  +|   3776: 6f 63 73 69 7a 65 27 28 69 64 20 49 4e 54 45 47   ocsize'(id INTEG
         7155  +|   3792: 45 52 20 50 52 49 4d 41 52 59 20 4b 45 59 2c 20   ER PRIMARY KEY, 
         7156  +|   3808: 73 7a 20 42 4c 4f 42 29 69 03 07 17 19 19 01 81   sz BLOB)i.......
         7157  +|   3824: 2d 74 61 62 6c 65 74 31 5f 69 64 78 74 31 5f 69   -tablet1_idxt1_i
         7158  +|   3840: 64 78 03 43 52 45 41 54 45 20 54 41 42 4c 45 20   dx.CREATE TABLE 
         7159  +|   3856: 27 74 31 5f 69 64 78 27 28 73 65 67 69 64 2c 20   't1_idx'(segid, 
         7160  +|   3872: 74 65 72 6d 2c 20 70 67 6e 6f 2c 20 50 52 49 4d   term, pgno, PRIM
         7161  +|   3888: 41 52 59 20 4b 45 59 28 73 65 67 69 64 2c 20 74   ARY KEY(segid, t
         7162  +|   3904: 65 72 6d 29 29 20 57 49 54 48 4f 55 54 20 52 4f   erm)) WITHOUT RO
         7163  +|   3920: 57 49 44 55 02 07 17 1b 1b 01 81 01 74 61 62 6b   WIDU........tabk
         7164  +|   3936: 65 74 31 5f 64 61 74 61 74 31 5f 64 61 74 61 02   et1_datat1_data.
         7165  +|   3952: 43 52 45 41 54 45 20 54 41 42 4c 45 20 27 74 31   CREATE TABLE 't1
         7166  +|   3968: 5f 64 61 74 61 27 28 69 64 20 49 4e 54 45 47 45   _data'(id INTEGE
         7167  +|   3984: 52 20 50 52 49 4d 41 52 59 20 4b 45 59 2c 20 62   R PRIMARY KEY, b
         7168  +|   4000: 6c 6f 63 6b 20 42 4c 4f 42 29 54 01 07 17 10 11   lock BLOB)T.....
         7169  +|   4016: 08 81 15 74 61 62 6c 65 74 31 74 31 43 52 45 41   ...tablet1t1CREA
         7170  +|   4032: 54 45 20 56 49 52 54 55 41 4c 20 54 41 42 4c 45   TE VIRTUAL TABLE
         7171  +|   4048: 20 74 31 20 55 53 49 4e 47 20 66 74 73 35 28 61    t1 USING fts5(a
         7172  +|   4064: 2c 62 2c 70 72 65 66 69 78 3d 22 31 2c 32 2c 33   ,b,prefix=.1,2,3
         7173  +|   4080: 2c 34 22 2c 20 63 6f 6e 74 65 6e 74 3d 22 22 29   ,4., content=..)
         7174  +| page 2 offset 4096
         7175  +|      0: 0d 0b 6a 00 37 09 4c 02 0f e7 09 4c 0f c6 0f a4   ..j.7.L....L....
         7176  +|     16: 0f 88 0f 6d 0f 4b 0f 2c 0f 0e 0e ec 0e cd 0e 2a   ...m.K.,.......*
         7177  +|     32: 0e 8e 0e 6c 0e 4b 0e 29 0e 08 0d e6 0d c4 0d b5   ...l.K.)........
         7178  +|     48: 0d 97 0d 76 0d 54 0e 31 0d 15 0c f3 0c d3 0c b5   ...v.T.1........
         7179  +|     64: 0c 95 0c 73 0c 54 0c 32 0c 10 0b ee 0b cc 0b b0   ...s.T.2........
         7180  +|     80: 0b 8d 0b 7e 0b 48 0b 2e 0b 0b 0a ef 0a cc 0a ad   ...~.H..........
         7181  +|     96: 0a 8c 0a 6d 0a 4d 0a 2b 0a 0c 09 ec 09 ca 09 a8   ...m.M.+........
         7182  +|    112: 09 86 09 63 0f f1 00 00 00 00 00 00 00 00 00 00   ...c............
         7183  +|   2368: 00 00 00 00 00 00 00 00 00 00 00 00 15 0a 03 00   ................
         7184  +|   2384: 30 00 00 00 01 01 03 35 00 03 01 01 12 02 01 12   0......5........
         7185  +|   2400: 03 01 11 1c 8c 80 80 80 80 10 03 00 3e 00 00 00   ............>...
         7186  +|   2416: 17 01 05 05 34 74 61 62 6c 03 02 03 01 04 77 68   ....4tabl.....wh
         7187  +|   2432: 65 72 03 02 06 09 1b 8c 80 80 80 80 0f 03 00 3c   er.............<
         7188  +|   2448: 00 00 00 16 05 34 66 74 73 34 03 02 02 01 04 6e   .....4fts4.....n
         7189  +|   2464: 75 6d 62 03 06 01 04 09 1b 8c 80 80 80 80 0e 03   umb.............
         7190  +|   2480: 00 3c 00 00 00 16 04 33 74 68 65 03 06 01 01 04   .<.....3the.....
         7191  +|   2496: 01 03 77 68 65 03 02 04 04 0a 1b 8c 80 80 80 80   ..whe...........
         7192  +|   2512: 0d 03 00 3c 00 00 00 16 04 33 6e 75 6d 03 06 01   ...<.....3num...
         7193  +|   2528: 01 05 01 03 74 61 62 03 02 03 04 0a 19 8c 80 80   ....tab.........
         7194  +|   2544: 80 80 0c 03 00 38 00 00 00 14 03 32 77 68 03 02   .....8.....2wh..
         7195  +|   2560: 04 00 04 33 66 74 73 03 02 02 04 07 18 8c 80 80   ...3fts.........
         7196  +|   2576: 80 80 0b 03 00 36 00 00 00 13 03 32 74 61 03 02   .....6.....2ta..
         7197  +|   2592: 03 02 01 68 03 06 01 01 04 04 07 1b 8c 80 80 80   ...h............
         7198  +|   2608: 80 0a 03 00 3c 00 00 00 16 03 32 6e 75 03 06 01   ....<.....2nu...
         7199  +|   2624: 01 05 01 02 6f 66 03 06 01 01 06 04 09 19 8c 80   ....of..........
         7200  +|   2640: 80 80 80 09 03 00 38 00 00 00 14 03 32 66 74 03   ......8.....2ft.
         7201  +|   2656: 02 02 01 02 69 73 03 06 01 01 03 04 07 18 8c 80   ....is..........
         7202  +|   2672: 80 80 80 08 03 00 36 00 00 00 13 02 31 74 03 08   ......6.....1t..
         7203  +|   2688: 03 01 01 04 01 01 77 03 02 04 04 09 1a 8c 80 80   ......w.........
         7204  +|   2704: 80 80 07 03 00 3a 00 00 00 15 02 31 6e 03 08 01   .....:.....1n...
         7205  +|   2720: 01 02 05 01 01 6f 03 06 01 01 06 04 09 18 8c 80   .....o..........
         7206  +|   2736: 80 80 80 06 03 00 36 00 00 00 13 04 02 31 66 03   ......6......1f.
         7207  +|   2752: 02 02 01 01 69 03 06 01 01 03 05 06 1c 8c 80 80   ....i...........
         7208  +|   2768: 80 80 05 03 00 3e 00 00 00 17 04 30 74 68 65 03   .....>.....0the.
         7209  +|   2784: 06 01 01 04 01 05 77 68 65 72 65 03 02 04 0a 15   ......where.....
         7210  +|   2800: 8c 80 80 80 80 04 03 00 30 00 00 00 11 01 01 06   ........0.......
         7211  +|   2816: 06 30 74 61 62 6c 65 03 02 03 07 1c 8c 80 80 80   .0table.........
         7212  +|   2832: 80 03 03 00 3e 00 00 00 17 07 30 6e 75 6d 62 65   ....>.....0numbe
         7213  +|   2848: 72 03 06 01 01 05 01 02 6f 66 03 06 04 0d 13 8c   r.......of......
         7214  +|   2864: 80 80 80 80 02 03 00 2c 00 00 00 0f 01 01 03 02   .......,........
         7215  +|   2880: 30 6e 03 06 01 01 02 07 1b 8c 80 80 80 80 01 03   0n..............
         7216  +|   2896: 00 3c 00 00 00 16 08 30 66 74 73 34 61 75 78 03   .<.....0fts4aux.
         7217  +|   2912: 02 02 01 02 69 73 03 06 04 0c 00 00 00 14 2a 00   ....is........*.
         7218  +|   2928: 00 00 01 01 02 24 00 02 01 01 12 02 01 12 08 88   .....$..........
         7219  +|   2944: 80 80 80 80 12 03 00 16 00 00 00 05 02 1c 88 80   ................
         7220  +|   2960: 80 80 80 11 03 00 3e 00 00 00 17 05 34 72 6f 77   ......>.....4row
         7221  +|   2976: 73 02 06 01 01 05 01 04 74 68 65 72 02 02 04 0b   s.......ther....
         7222  +|   2992: 15 88 80 80 80 80 10 03 00 30 00 00 00 11 02 01   .........0......
         7223  +|   3008: 01 07 05 34 62 65 74 77 02 02 04 08 1b 88 80 80   ...4betw........
         7224  +|   3024: 80 80 0f 03 00 3c 00 00 00 16 04 04 33 72 6f 77   .....<......3row
         7225  +|   3040: 02 06 01 01 05 01 03 74 68 65 02 08 05 0a 1b 88   .......the......
         7226  +|   3056: 80 80 80 80 0e 03 00 3c 00 00 00 16 01 01 02 04   .......<........
         7227  +|   3072: 33 61 72 65 02 02 03 01 03 62 65 74 02 02 07 08   3are.....bet....
         7228  +|   3088: 1b 88 80 80 80 80 0d 03 00 3c 00 00 00 16 03 32   .........<.....2
         7229  +|   3104: 74 68 02 08 02 01 01 07 00 04 33 61 6e 64 02 06   th........3and..
         7230  +|   3120: 04 0a 1b 89 80 80 80 80 0c 03 00 3c 00 00 00 16   ...........<....
         7231  +|   3136: 03 32 69 6e 02 06 01 01 06 01 02 72 6f 02 06 01   .2in.......ro...
         7232  +|   3152: 01 05 04 09 18 88 80 80 80 80 0b 03 00 36 00 00   .............6..
         7233  +|   3168: 00 13 02 03 32 61 72 02 02 03 01 02 62 65 02 02   ....2ar.....be..
         7234  +|   3184: 04 05 07 1b 88 80 80 80 80 0a 03 00 3c 00 00 00   ............<...
         7235  +|   3200: 16 02 31 74 02 08 02 01 01 07 00 03 32 61 6e 02   ..1t........2an.
         7236  +|   3216: 06 01 01 04 09 19 88 80 80 80 80 09 03 00 38 00   ..............8.
         7237  +|   3232: 00 00 14 02 31 6e 02 06 01 01 03 01 01 72 02 06   ....1n.......r..
         7238  +|   3248: 01 01 05 04 08 17 88 80 80 80 80 08 03 00 34 00   ..............4.
         7239  +|   3264: 00 00 12 02 31 62 02 02 04 01 01 69 02 06 01 01   ....1b.....i....
         7240  +|   3280: 06 04 06 19 88 80 80 80 80 07 03 00 38 00 00 00   ............8...
         7241  +|   3296: 14 04 02 31 32 02 02 05 01 01 61 02 08 03 01 01   ...12.....a.....
         7242  +|   3312: 02 05 06 1b 88 80 80 80 80 06 03 00 3c 00 00 00   ............<...
         7243  +|   3328: 16 06 30 74 68 65 72 65 02 02 02 00 02 31 31 02   ..0there.....11.
         7244  +|   3344: 06 01 01 04 0a 15 88 80 80 80 80 05 03 00 30 00   ..............0.
         7245  +|   3360: 00 00 11 01 01 05 04 30 74 68 65 02 06 01 01 07   .......0the.....
         7246  +|   3376: 07 1c 88 80 80 80 80 04 03 00 3e 00 00 00 17 01   ..........>.....
         7247  +|   3392: 01 06 02 30 6e 02 06 01 01 03 01 04 72 6f 77 73   ...0n.......rows
         7248  +|   3408: 02 06 07 08 1b 88 80 80 80 80 03 03 00 3c 00 00   .............<..
         7249  +|   3424: 00 16 08 30 62 65 74 77 65 65 6e 02 02 04 01 02   ...0between.....
         7250  +|   3440: 69 6e 02 06 04 0c 1a 88 80 80 80 80 02 03 00 3a   in.............:
         7251  +|   3456: 00 00 00 15 04 30 61 6e 64 02 06 01 01 02 02 02   .....0and.......
         7252  +|   3472: 72 65 02 02 03 04 0a 16 88 80 80 80 80 01 03 00   re..............
         7253  +|   3488: 34 00 00 00 12 02 30 31 02 06 01 01 04 01 01 32   4.....01.......2
         7254  +|   3504: 02 02 05 04 08 08 84 80 80 80 80 12 03 00 16 00   ................
         7255  +|   3520: 00 00 05 04 1b 84 80 80 80 80 11 03 00 3c 00 00   .............<..
         7256  +|   3536: 00 16 05 34 74 61 62 6c 01 06 01 01 05 02 03 65   ...4tabl.......e
         7257  +|   3552: 72 6d 01 02 04 0b 1b 84 80 80 80 80 10 03 00 3c   rm.............<
         7258  +|   3568: 00 00 00 16 05 34 65 61 63 68 01 02 03 01 04 70   .....4each.....p
         7259  +|   3584: 72 65 73 01 02 05 04 09 1a 84 80 80 80 80 0f 03   res.............
         7260  +|   3600: 00 3a 00 00 00 15 04 33 74 65 72 01 02 04 02 02   .:.....3ter.....
         7261  +|   3616: 68 65 01 06 01 01 03 04 08 1b 84 80 80 80 80 0e   he..............
         7262  +|   3632: 03 00 3c 00 00 00 16 04 33 70 72 65 01 02 05 01   ..<.....3pre....
         7263  +|   3648: 03 74 61 62 01 06 01 01 05 04 08 1a 84 80 80 80   .tab............
         7264  +|   3664: 80 0d 03 00 3a 00 00 00 15 04 33 66 6f 72 01 02   ....:.....3for..
         7265  +|   3680: 02 02 02 74 73 01 06 01 01 04 04 08 1b 84 80 80   ...ts...........
         7266  +|   3696: 80 80 0c 03 00 3c 00 00 00 16 03 32 74 68 01 06   .....<.....2th..
         7267  +|   3712: 01 01 03 00 04 33 65 61 63 01 02 03 04 09 18 84   .....3eac.......
         7268  +|   3728: 80 80 80 80 0b 03 00 36 00 00 00 13 03 32 74 61   .......6.....2ta
         7269  +|   3744: 01 06 01 01 05 02 01 65 01 02 04 04 09 19 84 70   .......e.......p
         7270  +|   3760: 80 80 80 0a 03 00 38 00 00 00 14 03 32 69 6e 01   ......8.....2in.
         7271  +|   3776: 06 01 01 02 01 02 70 72 01 02 05 04 09 18 84 80   ......pr........
         7272  +|   3792: 80 80 80 09 03 00 36 00 00 00 13 03 32 66 6f 01   ......6.....2fo.
         7273  +|   3808: 02 02 02 01 74 01 06 01 01 04 04 07 1b 84 80 80   ....t...........
         7274  +|   3824: 80 80 08 03 00 3c 00 00 00 16 02 31 74 01 0a 04   .....<.....1t...
         7275  +|   3840: 01 01 03 04 00 03 32 65 61 01 02 03 04 0a 17 84   ......2ea.......
         7276  +|   3856: 80 80 80 80 07 03 00 34 00 00 00 12 02 31 69 01   .......4.....1i.
         7277  +|   3872: 06 01 01 02 01 01 70 01 02 05 04 08 18 84 80 80   ......p.........
         7278  +|   3888: 80 80 06 03 00 36 00 00 00 03 02 31 65 01 02 03   .....6.....1e...
         7279  +|   3904: 01 01 66 02 08 02 01 01 04 04 06 1b 84 80 80 80   ..f.............
         7280  +|   3920: 80 05 03 00 3c 00 00 00 16 05 30 74 65 72 6d 01   ....<.....0term.
         7281  +|   3936: 02 04 02 02 68 65 01 06 01 01 03 04 09 14 84 80   ....he..........
         7282  +|   3952: 80 80 80 04 03 00 2e 00 00 00 10 06 30 74 61 62   ............0tab
         7283  +|   3968: 6c 65 01 06 01 01 05 04 15 84 80 80 80 80 03 03   le..............
         7284  +|   3984: 00 30 00 00 00 11 02 08 30 70 72 65 73 65 6e 74   .0......0present
         7285  +|   4000: 01 02 05 05 1b 84 80 80 80 80 02 03 00 3c 00 00   .............<..
         7286  +|   4016: 00 16 04 30 66 74 73 01 06 01 01 04 01 02 69 6e   ...0fts.......in
         7287  +|   4032: 01 06 01 01 04 0a 1a 84 80 80 80 80 01 03 00 3a   ...............:
         7288  +|   4048: 00 00 00 15 05 30 65 61 63 68 01 02 03 01 03 66   .....0each.....f
         7289  +|   4064: 6f 72 01 02 02 04 09 06 01 03 00 12 03 0b 0f 00   or..............
         7290  +|   4080: 00 08 8c 80 80 80 80 11 03 00 16 00 00 00 05 04   ................
         7291  +| page 3 offset 8192
         7292  +|      0: 0a 00 00 00 32 0e 4f 00 0f fa 0f f1 0f e9 0f e1   ....2.O.........
         7293  +|     16: 0f d8 0f d1 0f c9 0f c1 0f b9 0f b1 0f a9 0f a0   ................
         7294  +|     32: 0f 98 0f 90 0f 87 0f 80 0f 78 0f 71 0f 68 0f 5f   .........x.q.h._
         7295  +|     48: 0f 56 0f 4d 0f 41 0f 38 0f 2f 0f 26 0f 1d 0f 13   .V.M.A.8./.&....
         7296  +|     64: 0f 0a 0f 01 0e f7 0e ee 0e e6 0e dd 0e d6 0e cd   ................
         7297  +|     80: 0e c3 0e ba 0e b0 0e a8 0e 9f 0e 86 0e 8e 0e 85   ................
         7298  +|     96: 0e 7c 0e 73 0e 6a 0e 60 0e 58 0e 4f 00 00 00 00   .|.s.j.`.X.O....
         7299  +|   3648: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 08   ................
         7300  +|   3664: 04 01 10 01 03 34 74 20 07 04 01 0e 01 03 34 1e   .....4t ......4.
         7301  +|   3680: 09 04 01 12 01 03 33 74 68 1c 08 04 01 10 01 03   ......3th.......
         7302  +|   3696: 33 6e 1a 08 04 01 10 01 03 32 77 18 08 04 01 10   3n.......2w.....
         7303  +|   3712: 01 03 32 74 16 08 04 01 10 01 03 32 6e 14 07 04   ..2t.......2n...
         7304  +|   3728: 01 0e 01 03 32 12 08 04 01 10 01 03 31 74 10 07   ....2.......1t..
         7305  +|   3744: f4 01 10 01 03 31 6e 0e 07 04 01 0e 01 03 31 0c   .....1n.......1.
         7306  +|   3760: 09 04 01 12 01 03 30 74 68 0a 08 04 01 10 01 03   ......0th.......
         7307  +|   3776: 30 74 08 09 04 01 12 01 03 30 6e 75 06 08 04 01   0t.......0nu....
         7308  +|   3792: 10 01 03 30 6e 04 06 04 01 0c 01 03 02 08 04 01   ...0n...........
         7309  +|   3808: 10 01 02 34 72 22 07 04 01 0e 01 02 34 20 08 04   ...4r.......4 ..
         7310  +|   3824: 01 10 01 02 33 72 1e 09 04 01 12 01 02 33 61 72   ....3r.......3ar
         7311  +|   3840: 1c 08 04 01 10 01 02 32 74 1a 08 04 01 10 01 02   .......2t.......
         7312  +|   3856: 32 69 18 09 04 01 12 01 02 32 61 72 16 08 04 01   2i.......2ar....
         7313  +|   3872: 10 01 02 31 74 14 08 04 01 10 01 02 31 6e 12 08   ...1t.......1n..
         7314  +|   3888: 04 01 10 01 02 31 62 10 08 04 01 10 01 02 31 32   .....1b.......12
         7315  +|   3904: 0e 0b 04 01 16 01 02 30 74 68 65 72 0c 08 04 01   .......0ther....
         7316  +|   3920: 10 01 02 30 74 0a 08 04 01 10 01 02 30 6e 08 08   ...0t.......0n..
         7317  +|   3936: 04 01 10 01 02 30 62 06 08 04 01 10 01 02 30 61   .....0b.......0a
         7318  +|   3952: 04 06 04 01 0c 01 02 02 07 04 09 10 01 34 74 22   .............4t.
         7319  +|   3968: 06 04 09 0e 01 34 20 08 04 09 12 01 33 74 65 1e   .....4 .....3te.
         7320  +|   3984: 07 04 09 10 01 33 70 1c 07 04 09 10 01 33 66 1a   .....3p......3f.
         7321  +|   4000: 08 04 09 12 01 32 74 68 18 07 04 09 10 01 32 74   .....2th......2t
         7322  +|   4016: 16 07 04 09 0f 01 32 69 14 07 04 09 10 01 32 66   ......2i......2f
         7323  +|   4032: 12 07 04 09 00 01 31 74 10 07 04 09 10 01 31 69   ......1t......1i
         7324  +|   4048: 0e 06 04 09 0e 01 31 0c 08 04 09 12 01 33 44 65   ......1......3De
         7325  +|   4064: 0a 07 04 09 10 01 30 74 08 07 04 09 10 01 30 75   ......0t......0u
         7326  +|   4080: 26 08 04 09 12 01 30 66 74 04 05 04 09 0c 01 02   &.....0ft.......
         7327  +| page 4 offset 12288
         7328  +|      0: 0d 00 00 00 03 0f eb 00 0f f9 0f f2 0f eb 00 00   ................
         7329  +|   4064: 00 00 00 00 00 00 00 00 00 00 00 05 03 03 00 10   ................
         7330  +|   4080: 03 05 05 02 03 00 10 04 06 05 01 03 00 10 04 04   ................
         7331  +| page 5 offset 16384
         7332  +|      0: 0a 00 00 00 02 0f eb 00 0f eb 0f f4 00 00 00 00   ................
         7333  +|   4064: 00 00 00 00 00 00 00 00 00 00 00 08 03 15 01 70   ...............p
         7334  +|   4080: 67 73 7a 08 0b 03 1b 01 76 65 72 73 69 6f 6e 04   gsz.....version.
         7335  +| page 6 offset 20480
         7336  +|      0: 0d 00 00 00 03 0f f2 00 0f 00 00 00 00 00 00 00   ................
         7337  +|   4080: 00 00 03 03 02 01 03 03 02 02 01 02 02 01 0c e9   ................
         7338  +| end crash-dbe9b7614da103.db
         7339  +}]} {}
         7340  +
         7341  +do_catchsql_test 53.1 {
         7342  +  WITH RECURSIVE c(x) AS (VALUES(1) UNION ALL SELECT x<>1 FROM c WHERE x<10)
         7343  +    INSERT INTO t1(a) SELECT randomblob(3000) FROM c;
         7344  +} {1 {database disk image is malformed}}
         7345  +
         7346  +#-------------------------------------------------------------------------
         7347  +reset_db
         7348  +do_test 54.0 {
         7349  +  sqlite3 db {}
         7350  +  db deserialize [decode_hexdb {
         7351  +| size 24576 pagesize 4096 filename crash-03a1855566d9ae.db
         7352  +| page 1 offset 0
         7353  +|      0: 53 51 4c 69 74 65 20 66 6f 72 6d 61 74 20 33 00   SQLite format 3.
         7354  +|     16: 10 00 01 01 00 40 20 20 00 00 00 00 00 00 00 06   .....@  ........
         7355  +|     32: 00 00 00 00 00 00 00 00 00 00 00 06 00 00 00 04   ................
         7356  +|     48: 00 00 00 00 00 00 00 00 00 00 00 01 00 00 00 00   ................
         7357  +|     96: 00 00 00 00 0d 00 00 00 06 0e 0f 00 0f aa 0f 53   ...............S
         7358  +|    112: 0e e8 0e 8b 0e 33 0e 0f 00 00 00 00 00 00 00 00   .....3..........
         7359  +|   3584: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 22   ................
         7360  +|   3600: 06 06 17 11 11 01 31 74 61 62 6c 65 62 62 62 62   ......1tablebbbb
         7361  +|   3616: 06 43 52 45 41 54 45 20 54 41 42 4c 45 20 62 62   .CREATE TABLE bb
         7362  +|   3632: 28 61 29 56 05 06 17 1f 1f 01 7d 74 61 62 6c 65   (a)V.......table
         7363  +|   3648: 74 31 5f 63 2a 6e 66 69 67 74 31 5f 63 6f 6e 66   t1_c*nfigt1_conf
         7364  +|   3664: 69 67 05 43 52 45 41 54 45 20 54 41 42 4c 45 20   ig.CREATE TABLE 
         7365  +|   3680: 27 74 31 5f 63 6f 6e 66 69 67 27 28 6b 20 50 52   't1_config'(k PR
         7366  +|   3696: 49 4d 41 52 59 20 4b 45 59 2c 20 76 29 20 57 49   IMARY KEY, v) WI
         7367  +|   3712: 54 48 4f 55 54 20 52 4f 57 49 44 5b 04 07 17 21   THOUT ROWID[...!
         7368  +|   3728: 21 01 81 01 74 61 62 6c 65 74 31 5f 64 6f 73 73   !...tablet1_doss
         7369  +|   3744: 69 7a 65 74 31 5f 64 6f 63 73 69 7a 65 04 43 52   izet1_docsize.CR
         7370  +|   3760: 45 41 54 45 20 54 41 42 4c 45 20 27 74 31 5f 64   EATE TABLE 't1_d
         7371  +|   3776: 6f 63 73 69 7a 65 27 28 69 64 20 49 4e 54 45 47   ocsize'(id INTEG
         7372  +|   3792: 45 52 20 50 52 49 4d 41 52 59 20 4b 45 59 2c 20   ER PRIMARY KEY, 
         7373  +|   3808: 73 7a 20 42 4c 4f 42 29 69 03 07 17 19 19 01 81   sz BLOB)i.......
         7374  +|   3824: 2d 74 61 62 6c 65 74 31 5f 69 64 78 74 31 5f 69   -tablet1_idxt1_i
         7375  +|   3840: 64 78 03 43 52 45 41 54 45 20 54 41 42 4c 45 20   dx.CREATE TABLE 
         7376  +|   3856: 27 74 31 5f 69 64 78 27 28 73 65 67 69 64 2c 20   't1_idx'(segid, 
         7377  +|   3872: 74 65 72 6d 2c 20 70 67 6e 6f 2c 20 50 52 49 4d   term, pgno, PRIM
         7378  +|   3888: 41 52 59 20 4b 45 59 28 73 65 67 69 64 2c 20 74   ARY KEY(segid, t
         7379  +|   3904: 65 72 6d 29 29 20 57 49 54 48 4f 55 54 20 52 4f   erm)) WITHOUT RO
         7380  +|   3920: 57 49 44 55 02 07 17 1b 1b 01 81 01 74 61 62 6c   WIDU........tabl
         7381  +|   3936: 65 74 31 5f 64 61 74 61 74 31 5f 64 61 74 61 02   et1_datat1_data.
         7382  +|   3952: 43 52 45 41 54 45 20 54 41 42 4c 45 20 27 74 31   CREATE TABLE 't1
         7383  +|   3968: 5f 64 61 74 61 27 28 69 64 20 49 4e 54 45 47 45   _data'(id INTEGE
         7384  +|   3984: 52 20 50 52 49 4d 41 52 59 20 4b 45 59 2c 20 62   R PRIMARY KEY, b
         7385  +|   4000: 6c 6f 63 6b 20 42 4c 4f 42 29 54 01 07 17 11 11   lock BLOB)T.....
         7386  +|   4016: 08 81 15 74 61 62 6c 65 74 31 74 31 43 52 45 41   ...tablet1t1CREA
         7387  +|   4032: 54 45 20 56 49 52 54 55 41 4c 20 54 41 42 4c 45   TE VIRTUAL TABLE
         7388  +|   4048: 20 74 31 20 55 53 49 4e 47 20 66 74 73 35 28 61    t1 USING fts5(a
         7389  +|   4064: 2c 62 2c 70 72 65 66 69 78 3d 22 32 2c 32 2c 33   ,b,prefix=.2,2,3
         7390  +|   4080: 2c 34 22 2c 20 63 6f 6e 74 65 6e 74 3d 22 22 29   ,4., content=..)
         7391  +| page 2 offset 4096
         7392  +|      0: 0d 0b 6a 00 37 09 4c 02 0f e7 09 4c 0f c6 0f a4   ..j.7.L....L....
         7393  +|     16: 0f 88 0f 6d 0f 4b 0f 2c 0f 0e 0e ec 0e cd 0e ad   ...m.K.,........
         7394  +|     32: 0e 8e 0e 6c 0e 4b 0e 29 0e 08 0d e6 0d c4 0d b5   ...l.K.)........
         7395  +|     48: 0d 97 0d 76 0d 54 0d 31 0d 15 0c f3 0c d3 0c b5   ...v.T.1........
         7396  +|     64: 0c 95 0c 73 0c 54 0c 32 0c 10 0b ee 0b cd 0b b0   ...s.T.2........
         7397  +|     80: 0b 8d 0b 7e 0b 48 0b 2e 0b 0b 0a ef 0a cc 0a ad   ...~.H..........
         7398  +|     96: 0a 8c 0a 6d 0a 4d 0a 2b 0a 0c 09 ec 09 ca 09 a8   ...m.M.+........
         7399  +|    112: 09 86 09 63 0f f1 00 00 00 00 00 00 00 00 00 00   ...c............
         7400  +|   2368: 00 00 00 00 00 00 00 00 00 00 00 00 15 0a 03 00   ................
         7401  +|   2384: 30 00 00 00 01 01 03 35 00 03 01 01 12 02 01 12   0......5........
         7402  +|   2400: 03 01 11 1c 8c 80 80 80 80 10 03 00 3e 00 00 00   ............>...
         7403  +|   2416: 17 01 05 05 34 74 61 62 6c 03 02 03 01 04 77 68   ....4tabl.....wh
         7404  +|   2432: 65 72 03 02 06 09 1b 8c 80 80 80 80 0f 03 00 3c   er.............<
         7405  +|   2448: 00 00 00 16 05 34 66 74 73 34 03 02 02 01 04 6e   .....4fts4.....n
         7406  +|   2464: 75 6d 62 03 06 01 04 09 1b 8c 80 80 80 80 0e 03   umb.............
         7407  +|   2480: 00 3c 00 00 00 16 04 33 74 68 65 03 06 01 01 04   .<.....3the.....
         7408  +|   2496: 01 03 77 68 65 03 02 04 04 0a 1b 8c 80 80 80 80   ..whe...........
         7409  +|   2512: 0d 03 00 3c 00 00 00 16 04 33 6e 75 6d 03 06 01   ...<.....3num...
         7410  +|   2528: 01 05 01 03 74 61 62 05 62 03 04 0a 19 8c 80 80   ....tab.b.......
         7411  +|   2544: 80 80 0c 03 00 38 00 00 00 14 03 39 a7 68 03 02   .....8.....9.h..
         7412  +|   2560: 04 10 04 33 66 74 73 03 02 02 04 07 18 8c 80 80   ...3fts.........
         7413  +|   2576: 80 80 0b 03 00 36 00 00 00 13 03 32 74 61 03 02   .....6.....2ta..
         7414  +|   2592: 03 02 01 68 03 06 01 01 04 04 07 1b 8c 80 80 80   ...h............
         7415  +|   2608: 80 0a 03 00 3c 00 00 00 16 03 32 6e 75 03 06 01   ....<.....2nu...
         7416  +|   2624: 01 05 01 02 6f 66 03 06 01 01 06 04 09 19 8c 80   ....of..........
         7417  +|   2640: 80 80 80 09 03 00 38 00 00 00 14 03 32 66 74 03   ......8.....2ft.
         7418  +|   2656: 02 02 01 02 69 73 03 06 01 01 03 04 07 18 8c 80   ....is..........
         7419  +|   2672: 80 80 80 08 03 00 36 00 00 00 13 02 31 74 03 08   ......6.....1t..
         7420  +|   2688: 03 01 01 04 01 01 77 03 02 04 04 09 1a 8c 80 80   ......w.........
         7421  +|   2704: 80 80 07 03 00 3a ff 00 00 15 02 31 6e 03 08 01   .....:.....1n...
         7422  +|   2720: 01 02 05 01 01 6f 03 06 01 01 06 04 09 18 8c 80   .....o..........
         7423  +|   2736: 80 80 80 06 03 00 36 00 00 00 13 04 02 31 66 03   ......6......1f.
         7424  +|   2752: 02 02 01 01 69 03 06 01 01 03 05 06 1c 8c 80 80   ....i...........
         7425  +|   2768: 80 80 05 03 00 3e 00 00 00 17 04 30 74 68 65 03   .....>.....0the.
         7426  +|   2784: 06 01 01 04 01 05 77 68 65 72 65 03 02 04 0a 15   ......where.....
         7427  +|   2800: 8c 80 80 80 80 04 03 00 30 00 00 00 11 01 01 06   ........0.......
         7428  +|   2816: 06 30 74 61 62 6c cc 03 02 03 07 1c 8c 80 80 80   .0tabl..........
         7429  +|   2832: 80 03 03 00 3e 00 00 00 17 07 30 6e 75 6d 62 65   ....>.....0numbe
         7430  +|   2848: 72 03 06 01 01 05 01 02 6f 66 03 06 04 0d 13 8c   r.......of......
         7431  +|   2864: 80 80 80 80 02 03 00 2c 00 00 00 0f 01 01 03 02   .......,........
         7432  +|   2880: 30 6e 03 06 01 01 02 07 1b 8c 80 80 80 80 01 03   0n..............
         7433  +|   2896: 00 3c 00 00 00 16 08 30 66 74 73 34 61 75 78 03   .<.....0fts4aux.
         7434  +|   2912: 02 02 01 02 69 73 03 06 04 0c 00 00 00 14 2a 00   ....is........*.
         7435  +|   2928: 00 00 01 01 02 24 00 02 01 01 12 02 01 12 08 88   .....$..........
         7436  +|   2944: 80 80 80 80 12 03 00 16 00 00 00 05 02 1c 88 80   ................
         7437  +|   2960: 80 80 80 11 03 00 3e 00 00 00 17 05 34 72 6f 77   ......>.....4row
         7438  +|   2976: 73 02 06 01 01 05 01 04 74 68 65 72 02 02 04 0b   s.......ther....
         7439  +|   2992: 15 88 80 80 80 80 10 03 00 30 00 00 00 11 02 01   .........0......
         7440  +|   3008: 01 07 05 34 62 65 74 77 02 02 04 08 1b 88 80 80   ...4betw........
         7441  +|   3024: 80 80 0f 03 00 3c 00 00 00 16 04 04 33 72 6f 77   .....<......3row
         7442  +|   3040: 02 06 01 01 05 01 03 74 68 65 02 08 05 0a 1b 88   .......the......
         7443  +|   3056: 80 80 80 80 0e 03 05 0c 00 00 00 16 01 01 02 04   ................
         7444  +|   3072: 33 61 72 65 02 02 03 01 03 62 65 74 02 02 07 08   3are.....bet....
         7445  +|   3088: 1b 88 80 80 80 80 0d 03 00 3c 00 00 00 16 03 32   .........<.....2
         7446  +|   3104: 84 68 02 08 02 01 01 07 00 04 33 61 6e 64 02 06   .h........3and..
         7447  +|   3120: 04 0a 1b 88 80 80 80 80 0c 03 00 3c 00 00 00 16   ...........<....
         7448  +|   3136: 03 32 69 6e 02 06 01 01 06 01 02 72 6f 02 06 01   .2in.......ro...
         7449  +|   3152: 01 05 04 09 18 88 80 80 80 80 0b 03 00 36 00 00   .............6..
         7450  +|   3168: 00 13 02 03 32 61 72 02 02 03 01 02 62 65 02 02   ....2ar.....be..
         7451  +|   3184: 04 05 07 1b 88 80 80 80 80 0a 03 00 3c 00 00 00   ............<...
         7452  +|   3200: 16 02 31 74 02 08 02 01 01 07 00 03 32 61 6e 02   ..1t........2an.
         7453  +|   3216: 06 01 01 04 09 19 88 80 80 80 80 09 03 00 38 00   ..............8.
         7454  +|   3232: 00 00 14 02 31 6e 02 06 01 01 03 01 01 72 02 06   ....1n.......r..
         7455  +|   3248: 01 01 05 04 08 17 88 80 80 80 80 08 03 00 34 00   ..............4.
         7456  +|   3264: 00 00 12 02 31 62 02 02 04 01 01 69 02 06 01 01   ....1b.....i....
         7457  +|   3280: 06 04 06 19 88 80 80 80 80 07 03 00 38 00 00 00   ............8...
         7458  +|   3296: 14 04 02 31 32 02 02 05 01 01 61 02 08 03 01 01   ...12.....a.....
         7459  +|   3312: 02 05 06 1b 88 80 80 80 80 06 03 00 3c 00 00 00   ............<...
         7460  +|   3328: 16 06 30 74 68 65 72 65 02 12 02 00 02 31 31 02   ..0there.....11.
         7461  +|   3344: 06 11 01 04 0a 15 88 80 80 80 80 05 03 00 30 00   ..............0.
         7462  +|   3360: 00 00 11 01 01 05 04 30 74 68 65 02 06 01 01 07   .......0the.....
         7463  +|   3376: 07 1c 88 80 80 80 80 04 03 00 3e 00 00 00 17 01   ..........>.....
         7464  +|   3392: 01 06 02 30 6e 02 06 01 01 03 01 04 72 6f 77 73   ...0n.......rows
         7465  +|   3408: 02 06 07 08 1b 88 80 80 80 80 03 03 00 3c 00 00   .............<..
         7466  +|   3424: 00 16 08 30 62 65 74 77 65 65 6e 02 02 04 01 02   ...0between.....
         7467  +|   3440: 69 6e 02 06 04 0c 1a 88 80 80 80 80 02 03 00 3a   in.............:
         7468  +|   3456: 08 f0 00 15 04 30 61 6e 64 02 06 01 01 02 02 02   .....0and.......
         7469  +|   3472: 72 65 02 02 03 04 0a 17 88 80 80 80 80 01 03 00   re..............
         7470  +|   3488: 34 00 00 00 12 02 30 31 02 06 01 01 04 01 01 32   4.....01.......2
         7471  +|   3504: 02 02 06 04 08 08 84 80 80 80 80 12 03 00 16 00   ................
         7472  +|   3520: 00 00 05 04 1b 84 80 80 80 80 11 03 00 3c 00 00   .............<..
         7473  +|   3536: 00 16 05 34 74 61 62 6c 01 06 01 01 05 02 03 65   ...4tabl.......e
         7474  +|   3552: 72 6d 01 02 04 0b 1b 84 80 80 80 80 10 03 00 3c   rm.............<
         7475  +|   3568: 00 00 00 16 05 34 65 61 63 68 01 02 03 01 04 70   .....4each.....p
         7476  +|   3584: 72 65 73 01 02 05 04 09 1a 84 80 80 80 80 0f 03   res.............
         7477  +|   3600: 00 3a 00 00 00 15 04 33 74 65 72 01 02 04 02 02   .:.....3ter.....
         7478  +|   3616: 68 65 01 06 01 01 03 04 08 1b 84 80 80 80 80 0e   he..............
         7479  +|   3632: 03 00 3c 00 00 00 16 04 33 70 72 65 01 02 05 01   ..<.....3pre....
         7480  +|   3648: 03 74 61 62 01 06 01 01 05 04 08 1a 84 80 80 80   .tab............
         7481  +|   3664: 80 0d 03 00 3a 00 00 00 15 04 33 66 6f 72 01 02   ....:.....3for..
         7482  +|   3680: 02 02 02 74 73 01 06 01 01 04 04 08 1b 84 80 80   ...ts...........
         7483  +|   3696: 80 80 0c 03 00 3c 00 00 00 16 03 32 74 68 01 06   .....<.....2th..
         7484  +|   3712: 01 01 03 00 04 33 65 61 63 01 02 03 04 09 18 84   .....3eac.......
         7485  +|   3728: 80 80 80 80 0b 03 00 36 00 00 00 13 03 32 74 61   .......6.....2ta
         7486  +|   3744: 01 06 01 01 05 02 01 65 00 02 04 04 09 19 84 80   .......e........
         7487  +|   3760: 80 80 80 0a 03 00 38 00 00 00 14 03 32 69 6e 01   ......8.....2in.
         7488  +|   3776: 06 01 01 02 01 02 70 72 01 02 05 04 09 18 84 80   ......pr........
         7489  +|   3792: 80 80 80 09 03 00 36 00 00 00 13 03 32 66 6f 01   ......6.....2fo.
         7490  +|   3808: 02 02 02 01 74 01 06 01 01 04 04 07 1b 84 80 80   ....t...........
         7491  +|   3824: 80 80 08 03 00 3c 00 00 00 16 02 31 74 01 0a 04   .....<.....1t...
         7492  +|   3840: 01 01 03 04 00 03 32 65 61 01 02 03 04 0a 17 84   ......2ea.......
         7493  +|   3856: 80 80 80 80 07 03 00 34 00 00 00 12 02 31 69 01   .......4.....1i.
         7494  +|   3872: 06 01 01 02 de 01 70 01 02 05 04 08 18 84 80 80   ......p.........
         7495  +|   3888: 80 80 06 03 00 36 00 00 00 13 02 31 65 01 02 03   .....6.....1e...
         7496  +|   3904: 01 01 66 01 08 02 01 01 04 04 06 1b 84 80 80 80   ..f.............
         7497  +|   3920: 80 05 03 00 3c 00 00 00 16 05 30 74 65 72 6d 01   ....<.....0term.
         7498  +|   3936: 02 04 02 02 68 65 01 06 01 01 03 04 09 14 84 80   ....he..........
         7499  +|   3952: 80 80 80 04 03 00 2e 00 00 00 10 06 30 74 61 62   ............0tab
         7500  +|   3968: 6c 65 01 06 01 01 05 04 15 84 80 80 80 80 03 03   le..............
         7501  +|   3984: 00 30 00 00 00 11 02 08 30 70 72 65 73 65 6e 74   .0......0present
         7502  +|   4000: 01 02 05 05 1b 84 80 80 80 80 02 03 00 3c 00 00   .............<..
         7503  +|   4016: 00 16 04 30 66 74 73 01 06 01 01 04 01 02 69 6e   ...0fts.......in
         7504  +|   4032: 01 06 01 01 04 0a 1a 84 80 80 80 80 01 03 00 3a   ...............:
         7505  +|   4048: 00 00 00 15 05 30 65 61 63 68 00 f2 03 01 03 66   .....0each.....f
         7506  +|   4064: 6f 72 01 02 02 04 09 06 01 03 00 12 03 0b 0f 00   or..............
         7507  +|   4080: 00 08 8c 80 80 80 80 11 03 00 16 00 00 00 05 04   ................
         7508  +| page 3 offset 8192
         7509  +|      0: 0a 00 00 00 32 0e 4f 00 0f fa 0f f1 0f e9 0f e1   ....2.O.........
         7510  +|     16: 0f d8 0f d1 0f c9 0f c1 0f b9 0f b1 0f a9 0f a0   ................
         7511  +|     32: 0f 98 0f 90 0f 87 0f 80 0f 78 0f 71 0f 68 0f 5f   .........x.q.h._
         7512  +|     48: 0f 56 0f 4d 0f 41 0f 38 0f 2f 0f 26 0f 1d 0f 13   .V.M.A.8./.&....
         7513  +|     64: 0f 0a 0f 01 0e f7 0e ee 0e e6 0e dd 0e d6 0e cd   ................
         7514  +|     80: 0e c3 0e ba 0e b0 0e a8 0e 9f 0e 96 0e 8e 0e 85   ................
         7515  +|     96: 0e 7c 0e 73 0e 6a 0e 60 0e 58 0e 4f 00 00 00 00   .|.s.j.`.X.O....
         7516  +|   3648: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 08   ................
         7517  +|   3664: 04 01 10 01 03 34 74 20 07 04 01 0e 01 03 34 1e   .....4t ......4.
         7518  +|   3680: 09 04 01 12 01 03 33 74 68 1c 08 04 01 10 01 03   ......3th.......
         7519  +|   3696: 33 6e 1a 08 04 01 10 01 03 32 77 18 08 04 01 10   3n.......2w.....
         7520  +|   3712: 01 03 32 74 16 08 04 01 10 01 03 32 6e 14 07 04   ..2t.......2n...
         7521  +|   3728: 01 0e 01 03 32 12 08 04 01 10 01 03 31 74 10 08   ....2.......1t..
         7522  +|   3744: 04 01 10 01 03 31 6e 0e 07 04 01 0e 01 03 31 0c   .....1n.......1.
         7523  +|   3760: 09 04 01 12 01 03 30 74 68 0a 08 04 01 10 01 03   ......0th.......
         7524  +|   3776: 30 74 08 09 04 01 12 01 03 30 6e 75 06 08 04 01   0t.......0nu....
         7525  +|   3792: 10 01 03 30 6e 04 06 04 01 0c 01 05 52 08 04 01   ...0n.......R...
         7526  +|   3808: 10 01 02 34 72 22 07 04 01 0e 01 02 34 20 08 04   ...4r.......4 ..
         7527  +|   3824: 01 10 01 02 33 72 1e 09 04 01 12 01 02 33 61 72   ....3r.......3ar
         7528  +|   3840: 1c 08 04 01 10 01 02 32 74 1a 08 04 01 10 b3 02   .......2t.......
         7529  +|   3856: 32 69 18 09 04 01 12 01 02 32 61 72 16 08 04 01   2i.......2ar....
         7530  +|   3872: 10 01 02 31 74 14 08 04 01 10 01 02 31 6e 12 08   ...1t.......1n..
         7531  +|   3888: 04 01 10 01 02 31 62 10 08 04 01 10 01 02 31 32   .....1b.......12
         7532  +|   3904: 0e 0b 04 01 16 01 02 30 74 68 65 72 0c 08 04 01   .......0ther....
         7533  +|   3920: 10 01 02 30 74 0a 08 04 01 10 01 02 30 6e 08 08   ...0t.......0n..
         7534  +|   3936: 04 01 10 01 02 30 62 06 08 04 01 10 01 02 30 61   .....0b.......0a
         7535  +|   3952: 04 06 04 01 0c 01 02 02 07 04 09 10 01 34 74 22   .............4t.
         7536  +|   3968: 06 04 09 0e 01 34 20 08 04 09 12 01 33 74 65 1e   .....4 .....3te.
         7537  +|   3984: 07 04 09 10 01 33 70 1c 07 f4 09 11 01 33 66 1a   .....3p......3f.
         7538  +|   4000: 08 04 09 12 01 32 74 68 18 07 04 09 10 01 32 e4   .....2th......2.
         7539  +|   4016: 16 07 04 09 10 01 32 69 14 07 04 09 10 01 32 66   ......2i......2f
         7540  +|   4032: 12 07 04 09 10 01 31 74 10 07 04 09 10 01 31 69   ......1t......1i
         7541  +|   4048: 0e 06 04 09 0e 01 31 0c 08 04 09 12 01 30 74 65   ......1......0te
         7542  +|   4064: 0a 07 04 09 10 01 30 74 08 07 04 09 10 01 30 70   ......0t......0p
         7543  +|   4080: 06 08 04 09 12 01 30 66 74 04 05 04 09 0c 01 02   ......0ft.......
         7544  +| page 4 offset 12288
         7545  +|      0: 0d 00 00 00 03 0f eb 00 0f f9 0f f2 0f eb 00 00   ................
         7546  +|   4064: 00 00 00 00 00 00 00 00 00 00 00 05 03 03 00 10   ................
         7547  +|   4080: 03 05 05 02 03 00 10 04 06 05 01 03 00 10 04 04   ................
         7548  +| page 5 offset 16384
         7549  +|      0: 0a 00 00 00 02 0f eb 00 0f eb 0f f4 00 00 00 00   ................
         7550  +|   4064: 00 00 00 00 00 00 00 00 00 00 00 08 03 15 01 70   ...............p
         7551  +|   4080: 67 73 7a 18 0b 03 1b 01 76 65 72 73 69 6f 6e 04   gsz.....version.
         7552  +| page 6 offset 20480
         7553  +|      0: 0d 00 00 00 03 0f f2 00 0f fc 0f f7 0f f2 00 00   ................
         7554  +|   4080: 00 00 23 03 02 01 03 03 02 02 01 02 02 00 f2 09   ..#.............
         7555  +| end crash-03a1855566d9ae.db
         7556  +}]} {}
         7557  +
         7558  +do_catchsql_test 54.1 {
         7559  +  SELECT rowid==-1 FROM t1('t*');
         7560  +} {0 {0 0 0}}
         7561  +
         7562  +#-------------------------------------------------------------------------
         7563  +reset_db
         7564  +do_test 55.0 {
         7565  +  sqlite3 db {}
         7566  +  db deserialize [decode_hexdb {
         7567  +| size 32768 pagesize 4096 filename crash-b366b5ac0d3887.db
         7568  +| page 1 offset 0
         7569  +|      0: 53 51 4c 69 74 65 20 66 6f 72 6d 61 74 20 33 00   SQLite format 3.
         7570  +|     16: 10 00 01 01 00 40 20 20 00 00 00 00 00 00 00 08   .....@  ........
         7571  +|     32: 00 00 00 02 00 00 00 05 90 00 00 09 00 00 00 04   ................
         7572  +|     96: 00 00 00 00 0d 0f c7 00 07 0d 92 00 0f 8d 0f 36   ...............6
         7573  +|    112: 0e cb 0e 6b 0e 0e 0d b6 0d 92 0d 92 00 00 00 00   ...k............
         7574  +|   3472: 00 00 22 08 06 17 11 11 01 31 74 61 62 6c 65 74   .........1tablet
         7575  +|   3488: 32 74 32 08 43 52 45 41 54 45 20 54 41 42 4c 45   2t2.CREATE TABLE
         7576  +|   3504: 20 74 32 28 78 29 56 07 06 17 1f 1f 01 7d 74 61    t2(x)V.......ta
         7577  +|   3520: 62 6c 65 74 31 5f 63 6f 6e 66 69 67 74 31 5f 63   blet1_configt1_c
         7578  +|   3536: 6f 6e 66 69 67 07 43 52 45 41 54 45 20 54 41 42   onfig.CREATE TAB
         7579  +|   3552: 4c 45 20 27 74 31 5f 63 6f 6e 66 69 67 27 28 6b   LE 't1_config'(k
         7580  +|   3568: 20 50 52 49 4d 41 52 59 20 4b 45 59 2c 20 76 29    PRIMARY KEY, v)
         7581  +|   3584: 20 57 49 54 48 4f 55 54 20 52 4f 57 49 44 5b 06    WITHOUT ROWID[.
         7582  +|   3600: 07 17 21 21 01 81 01 74 61 62 6c 65 74 31 5f 64   ..!!...tablet1_d
         7583  +|   3616: 6f 63 73 69 7a 65 74 31 5f 64 6f 63 73 69 7a 65   ocsizet1_docsize
         7584  +|   3632: 06 43 52 45 41 54 45 20 54 41 42 4c 45 20 27 74   .CREATE TABLE 't
         7585  +|   3648: 31 5f 64 6f 63 73 69 7a 65 27 28 69 64 20 49 4e   1_docsize'(id IN
         7586  +|   3664: 54 45 47 45 52 20 50 52 49 4d 41 52 59 20 4b 45   TEGER PRIMARY KE
         7587  +|   3680: 59 2c 20 73 7a 20 43 4c 4f 42 29 5e 05 07 17 21   Y, sz CLOB)^...!
         7588  +|   3696: 21 01 81 07 74 61 62 6c 65 74 31 5f 63 6f 6e 74   !...tablet1_cont
         7589  +|   3712: 65 6e 74 74 31 5f 63 6f 6e 74 65 6e 74 05 43 52   entt1_content.CR
         7590  +|   3728: 45 41 54 45 20 54 41 42 4c 45 20 27 74 31 5f 63   EATE TABLE 't1_c
         7591  +|   3744: 6f 6e 74 65 6e 74 27 28 69 64 20 49 4e 54 45 47   ontent'(id INTEG
         7592  +|   3760: 45 52 20 50 52 49 4d 41 52 59 20 4b 45 59 2c 20   ER PRIMARY KEY, 
         7593  +|   3776: 63 30 2c 20 63 31 2c 20 63 32 29 69 04 07 17 19   c0, c1, c2)i....
         7594  +|   3792: 19 01 81 2d 74 61 62 6c 65 74 32 5f 69 64 78 74   ...-tablet2_idxt
         7595  +|   3808: 31 5f 69 64 78 04 43 52 45 41 54 45 20 54 41 42   1_idx.CREATE TAB
         7596  +|   3824: 4c 45 20 27 74 31 5f 69 64 78 27 28 73 65 67 69   LE 't1_idx'(segi
         7597  +|   3840: 64 2c 20 74 65 72 6d 2c 20 70 67 6e 6f 2c 20 50   d, term, pgno, P
         7598  +|   3856: 52 49 4d 41 52 59 20 4b 45 59 28 73 65 67 69 64   RIMARY KEY(segid
         7599  +|   3872: 2c 20 74 65 72 6d 29 29 20 57 49 54 48 4f 55 54   , term)) WITHOUT
         7600  +|   3888: 20 52 4f 57 49 44 55 03 07 17 1b 1b 01 81 01 74    ROWIDU........t
         7601  +|   3904: 61 62 6c 65 74 31 5f 64 61 74 61 74 31 5f 64 61   ablet1_datat1_da
         7602  +|   3920: 74 61 03 43 52 45 41 54 45 20 54 41 42 4c 45 20   ta.CREATE TABLE 
         7603  +|   3936: 27 74 31 5f 64 61 74 61 27 28 69 64 20 49 4e 54   't1_data'(id INT
         7604  +|   3952: 45 47 45 52 20 50 52 49 4d 42 52 59 20 4b 45 59   EGER PRIMBRY KEY
         7605  +|   3968: 2c 20 62 6c 6f 63 6b 20 42 4c 4f 42 29 38 02 06   , block BLOB)8..
         7606  +|   3984: 17 11 11 08 5f 74 61 62 6c 65 74 31 74 31 43 52   ...._tablet1t1CR
         7607  +|   4000: 45 41 54 45 20 56 49 52 54 55 41 4c 20 54 41 42   EATE VIRTUAL TAB
         7608  +|   4016: 4c 45 20 74 31 20 55 53 49 4e 47 20 66 74 73 35   LE t1 USING fts5
         7609  +|   4032: 28 61 2c 62 2c 63 29 00 00 00 39 00 00 00 00 00   (a,b,c)...9.....
         7610  +| page 3 offset 8192
         7611  +|      0: 0d 00 00 00 03 0c 94 00 0f e6 0f ef 0c 94 00 00   ................
         7612  +|   3216: 00 00 00 00 86 4a 84 80 80 80 80 01 04 00 8d 18   .....J..........
         7613  +|   3232: 00 00 03 2b 02 30 30 01 02 06 01 02 06 01 02 06   ...+.00.........
         7614  +|   3248: 1f 02 03 01 02 03 01 02 03 01 08 32 30 31 36 30   ...........20160
         7615  +|   3264: 36 30 39 01 02 07 01 02 07 01 02 07 01 01 34 01   609...........4.
         7616  +|   3280: 02 05 01 02 05 01 02 05 01 01 35 01 02 04 01 02   ..........5.....
         7617  +|   3296: 04 01 02 04 02 07 30 30 30 30 30 30 30 1c 02 04   ......0000000...
         7618  +|   3312: 01 02 04 01 02 04 01 06 62 69 6e 61 72 79 03 06   ........binary..
         7619  +|   3328: 01 02 02 03 06 01 02 02 03 06 01 02 02 03 06 01   ................
         7620  +|   3344: 02 02 03 06 01 02 02 03 06 01 02 02 03 06 01 02   ................
         7621  +|   3360: 02 03 06 01 02 02 03 06 01 02 02 03 06 01 02 02   ................
         7622  +|   3376: 03 06 01 02 02 03 06 01 02 02 01 08 63 6f 6d 70   ............comp
         7623  +|   3392: 69 6c 65 72 01 02 02 01 02 02 f1 02 02 01 06 64   iler...........d
         7624  +|   3408: 62 73 74 61 74 07 02 03 01 02 03 01 02 03 02 04   bstat...........
         7625  +|   3424: 65 62 75 67 04 02 02 01 02 02 01 02 02 01 06 65   ebug...........e
         7626  +|   3440: 6e 61 62 6c 65 07 02 02 01 02 02 01 02 02 01 02   nable...........
         7627  +|   3456: 02 01 02 02 01 02 02 01 02 02 01 02 02 01 02 02   ................
         7628  +|   3472: 01 02 02 01 02 02 01 02 02 01 02 02 01 02 02 01   ................
         7629  +|   3488: 02 02 01 02 02 01 02 02 01 02 02 01 02 02 01 02   ................
         7630  +|   3504: 02 01 02 02 02 08 78 74 65 6e 73 69 6f 6e 1f 02   ......xtension..
         7631  +|   3520: 04 01 02 04 01 02 04 01 04 66 74 73 34 0a 02 03   .........fts4...
         7632  +|   3536: 01 02 03 01 02 03 04 01 35 0d 02 03 01 02 03 01   ........5.......
         7633  +|   3552: 02 03 01 03 67 63 63 01 02 03 01 02 03 01 02 03   ....gcc.........
         7634  +|   3568: 02 06 65 6f 70 6f 6c 79 10 02 03 01 02 03 01 02   ..eopoly........
         7635  +|   3584: 03 01 05 6a 73 6f 6e 31 13 02 03 01 02 03 01 02   ...json1........
         7636  +|   3600: 03 01 04 6c 6f 61 64 1f 02 03 01 02 03 01 02 03   ...load.........
         7637  +|   3616: 01 03 6d 61 78 1c 02 02 01 02 02 01 02 02 02 05   ..max...........
         7638  +|   3632: 65 6d 6f 72 79 1c 02 03 01 02 03 01 02 03 04 04   emory...........
         7639  +|   3648: 73 79 73 35 16 02 03 01 02 03 01 02 03 01 06 6e   sys5...........n
         7640  +|   3664: 6f 63 61 73 65 02 06 01 02 02 03 06 01 02 02 03   ocase...........
         7641  +|   3680: 06 01 02 02 03 06 01 02 02 03 06 01 02 02 03 06   ................
         7642  +|   3696: 01 02 02 03 06 01 02 02 03 06 01 02 02 03 06 01   ................
         7643  +|   3712: 02 02 03 06 01 02 02 03 06 01 02 02 03 06 01 02   ................
         7644  +|   3728: 02 01 04 6f 6d 69 74 1f 02 02 01 02 02 01 02 02   ...omit.........
         7645  +|   3744: 01 05 72 74 72 65 65 19 02 03 01 02 03 01 02 03   ..rtree.........
         7646  +|   3760: 04 02 69 6d 01 06 01 02 02 03 06 01 02 02 03 06   ..im............
         7647  +|   3776: 01 02 02 03 06 01 02 02 03 06 01 02 02 03 06 01   ................
         7648  +|   3792: 02 02 03 06 01 02 02 03 06 01 02 02 03 06 01 02   ................
         7649  +|   3808: 02 03 06 01 02 02 03 06 01 02 02 03 06 01 02 02   ................
         7650  +|   3824: 01 0a 74 68 72 65 61 64 73 61 66 65 22 02 02 01   ..threadsafe....
         7651  +|   3840: 02 02 01 02 02 01 04 76 74 61 62 07 02 04 01 02   .......vtab.....
         7652  +|   3856: 04 01 02 04 01 01 78 01 06 01 01 02 01 06 01 01   ......x.........
         7653  +|   3872: 02 01 06 01 01 02 01 06 01 01 02 01 06 01 01 02   ................
         7654  +|   3888: 01 06 01 01 02 01 06 01 01 02 01 06 01 01 02 01   ................
         7655  +|   3904: 06 01 01 02 01 06 01 01 02 01 06 01 01 02 01 06   ................
         7656  +|   3920: 01 01 02 01 06 01 01 02 01 06 01 01 02 01 06 01   ................
         7657  +|   3936: 01 02 01 06 01 01 02 01 06 01 01 02 01 06 01 01   ................
         7658  +|   3952: 02 01 06 01 01 02 01 06 01 01 02 08 d6 01 01 02   ................
         7659  +|   3968: 01 06 01 01 02 01 06 01 01 02 01 06 01 01 02 01   ................
         7660  +|   3984: 06 01 01 02 01 06 01 01 02 01 06 01 01 02 01 06   ................
         7661  +|   4000: 01 01 02 01 06 01 01 02 01 06 01 01 02 01 06 01   ................
         7662  +|   4016: 01 02 01 06 01 01 02 01 06 01 01 02 01 06 01 01   ................
         7663  +|   4032: 02 01 06 01 01 02 01 06 01 01 02 04 15 13 0c 0c   ................
         7664  +|   4048: 12 44 13 11 0f 47 13 0f 0c 0e 11 10 0f 0e 10 0f   .D...G..........
         7665  +|   4064: 44 0f 10 40 15 0f 07 01 03 00 14 24 5a 24 24 0f   D..@.......$Z$$.
         7666  +|   4080: 0a 03 00 24 00 00 00 00 01 01 01 00 01 01 01 01   ...$............
         7667  +| page 4 offset 12288
         7668  +|      0: 0a 00 00 00 01 0f fa 00 0f fa 00 00 00 00 00 00   ................
         7669  +|   4080: 00 00 00 00 00 00 00 00 00 00 05 04 09 0c 01 02   ................
         7670  +| page 5 offset 16384
         7671  +|      0: 0d 00 00 00 24 0c 0a 00 0f d8 0f af 0f 86 0f 74   ....$..........t
         7672  +|     16: 0f 61 0f 4e 0f 2f 0f 0f 0e ef 0e d7 0e be 0e a5   .a.N./..........
         7673  +|     32: 0e 8d 0e 74 0e 5b 0e 40 0e 24 0e 08 0d ef 0d d5   ...t.[.@.$......
         7674  +|     48: 0d bb 0d a0 0d 84 0d 68 0d 4f 0d 35 0d 1b 0c fb   .......h.O.5....
         7675  +|     64: 0c da 0c b9 0c 99 0c 78 0c 57 0c 3e 00 00 00 00   .......x.W.>....
         7676  +|   3072: 00 00 00 00 00 00 00 00 00 00 18 24 05 00 25 0f   ...........$..%.
         7677  +|   3088: 19 54 48 52 45 41 44 53 41 46 45 3d 30 58 42 49   .THREADSAFE=0XBI
         7678  +|   3104: 4e 41 52 59 18 23 05 00 25 0f 19 54 48 52 45 41   NARY.#..%..THREA
         7679  +|   3120: 44 53 41 46 45 3d 30 58 4e 4f 43 41 53 45 17 22   DSAFE=0XNOCASE..
         7680  +|   3136: 05 00 25 0f 17 54 48 52 45 41 44 53 41 46 45 3d   ..%..THREADSAFE=
         7681  +|   3152: 30 58 52 54 52 49 4d 1f 20 f5 00 33 0f 19 4f 4d   0XRTRIM. ..3..OM
         7682  +|   3168: 49 54 20 4c 4f 41 44 20 45 58 54 45 4e 53 49 4f   IT LOAD EXTENSIO
         7683  +|   3184: 4e 58 42 49 4e 41 52 59 1f 20 05 00 33 0f 19 4f   NXBINARY. ..3..O
         7684  +|   3200: 4d 49 54 20 4c 4f 41 44 20 45 58 54 45 4e 53 49   MIT LOAD EXTENSI
         7685  +|   3216: 4f 4e 58 4e 4f 43 41 53 45 1e 1f 05 00 33 0f 17   ONXNOCASE....3..
         7686  +|   3232: 4f 4d 49 54 20 4c 4f 41 44 20 45 58 54 45 4e 53   OMIT LOAD EXTENS
         7687  +|   3248: 49 4f 4e 58 52 54 52 49 4d 1f 1e 05 00 33 0f 19   IONXRTRIM....3..
         7688  +|   3264: 4c 41 58 20 4d 45 4d 4f 52 59 3d 35 30 30 30 30   LAX MEMORY=50000
         7689  +|   3280: 30 30 30 58 42 49 4e 41 52 59 1f 1d 05 00 33 0f   000XBINARY....3.
         7690  +|   3296: 19 4d 41 58 20 4d 45 4d 4f 52 59 3d 35 30 30 30   .MAX MEMORY=5000
         7691  +|   3312: 30 30 30 30 58 4e 4f 43 41 53 45 1e 1c 05 00 33   0000XNOCASE....3
         7692  +|   3328: 0f 17 4d 41 58 20 4d 45 4d 4f 52 59 3d 35 30 30   ..MAX MEMORY=500
         7693  +|   3344: 30 30 30 30 30 58 52 54 52 49 4d 18 1b 05 00 25   00000XRTRIM....%
         7694  +|   3360: 0f 19 45 4e 41 42 4c 45 20 52 54 52 45 45 58 42   ..ENABLE RTREEXB
         7695  +|   3376: 49 4e 41 52 59 18 1a 05 00 25 0f 19 45 4e 41 42   INARY....%..ENAB
         7696  +|   3392: 4c 45 20 52 54 52 45 45 58 4e 4f 43 41 53 45 17   LE RTREEXNOCASE.
         7697  +|   3408: 19 05 00 25 0f 17 45 4e 41 42 4c 45 20 52 54 52   ...%..ENABLE RTR
         7698  +|   3424: 45 45 58 52 54 52 49 4d 1a 18 05 00 29 0f 19 45   EEXRTRIM....)..E
         7699  +|   3440: 4e 41 42 4c 45 20 4d 45 4d 53 59 53 35 58 42 49   NABLE MEMSYS5XBI
         7700  +|   3456: 4e 41 52 59 1a 17 05 00 29 0f 19 45 4e 41 42 4c   NARY....)..ENABL
         7701  +|   3472: 45 20 4d 45 4d 53 59 53 35 58 4e 4f 43 41 53 45   E MEMSYS5XNOCASE
         7702  +|   3488: 19 16 05 00 29 0f 17 45 4e 41 42 4c 45 20 4d 45   ....)..ENABLE ME
         7703  +|   3504: 4d 53 59 53 35 58 52 54 52 49 4d 18 15 05 00 25   MSYS5XRTRIM....%
         7704  +|   3520: 0f 19 45 4e 41 42 4c 45 20 4a 53 4f 4e 31 58 42   ..ENABLE JSON1XB
         7705  +|   3536: 49 4e 41 52 59 18 14 05 00 25 0f 30 45 4e 41 42   INARY....%.0ENAB
         7706  +|   3552: 4c 45 20 4a 53 4f 4e 31 58 4e 4f 43 41 53 45 17   LE JSON1XNOCASE.
         7707  +|   3568: 13 05 00 25 0f 17 45 4e 41 42 4c 45 20 4a 53 4f   ...%..ENABLE JSO
         7708  +|   3584: 4e 31 58 52 54 52 49 4d 1a 12 05 00 29 0f 19 45   N1XRTRIM....)..E
         7709  +|   3600: 4e 41 42 4c 45 20 47 45 4f 50 4f 4c 59 58 42 49   NABLE GEOPOLYXBI
         7710  +|   3616: 4e 41 52 59 1a 11 05 00 29 0f 19 45 4e 41 42 4c   NARY....)..ENABL
         7711  +|   3632: 45 20 47 45 4f 50 4f 4c 59 58 4e 4f 43 41 53 45   E GEOPOLYXNOCASE
         7712  +|   3648: 19 10 05 00 29 0f 17 45 4e 41 42 4c 45 20 47 45   ....)..ENABLE GE
         7713  +|   3664: 4f 50 4f 4c 59 58 52 54 52 49 4d 17 0f 05 00 23   OPOLYXRTRIM....#
         7714  +|   3680: 0f 19 45 4e 41 42 4c 45 20 46 54 53 35 58 42 49   ..ENABLE FTS5XBI
         7715  +|   3696: 4e 41 52 59 17 0e 05 00 23 0f 19 45 4e 41 42 4c   NARY....#..ENABL
         7716  +|   3712: 45 20 46 54 53 35 58 4e 4f 43 41 53 45 16 0d 05   E FTS5XNOCASE...
         7717  +|   3728: 00 23 0f 17 45 4f 41 42 4c 45 20 46 54 53 35 58   .#..EOABLE FTS5X
         7718  +|   3744: 52 54 52 49 4d 17 0c 05 00 23 0f 19 45 4e 41 42   RTRIM....#..ENAB
         7719  +|   3760: 4c 45 20 46 54 53 34 58 42 49 4e 41 52 59 17 0b   LE FTS4XBINARY..
         7720  +|   3776: 05 00 23 0f 19 45 4e 41 42 4c 45 20 46 54 53 34   ..#..ENABLE FTS4
         7721  +|   3792: 58 4e 4f 43 41 53 45 16 0a 05 00 23 0f 17 45 4e   XNOCASE....#..EN
         7722  +|   3808: 41 42 4c 45 20 46 54 53 34 58 52 54 52 49 4d 1e   ABLE FTS4XRTRIM.
         7723  +|   3824: 09 05 00 31 0f 19 45 4e 41 42 4c 45 20 44 42 53   ...1..ENABLE DBS
         7724  +|   3840: 54 41 54 20 56 54 31 42 58 42 49 4e 41 52 59 1e   TAT VT1BXBINARY.
         7725  +|   3856: 08 05 00 31 0f 19 45 4e 41 42 4c 45 20 44 42 53   ...1..ENABLE DBS
         7726  +|   3872: 54 41 54 20 56 54 41 42 58 4e 4f 43 41 53 45 1d   TAT VTABXNOCASE.
         7727  +|   3888: 07 05 00 31 0f 17 45 4e 41 42 4c 45 20 44 42 53   ...1..ENABLE DBS
         7728  +|   3904: 54 41 54 20 56 54 41 42 58 52 54 52 49 4d 11 06   TAT VTABXRTRIM..
         7729  +|   3920: 05 00 17 0f 19 44 45 42 55 47 58 42 49 4e 41 52   .....DEBUGXBINAR
         7730  +|   3936: 59 11 15 05 00 17 0f 19 44 45 42 55 47 58 4e 4f   Y.......DEBUGXNO
         7731  +|   3952: 43 41 53 45 10 04 05 00 17 0f 17 44 45 42 55 47   CASE.......DEBUG
         7732  +|   3968: 58 42 54 52 49 4d 27 03 05 00 43 0f 19 43 4f 4d   XBTRIM'...C..COM
         7733  +|   3984: 50 49 4c 45 52 3d 67 63 63 2d 35 2e 34 2e 30 20   PILER=gcc-5.4.0 
         7734  +|   4000: 32 30 31 36 30 36 30 39 58 42 49 4e 41 52 59 27   20160609XBINARY'
         7735  +|   4016: 02 05 00 43 0f 19 43 4f 4d 50 49 4c 45 52 3d 67   ...C..COMPILER=g
         7736  +|   4032: 63 63 2d 35 2e 34 2e 30 20 32 30 31 36 30 36 30   cc-5.4.0 2016060
         7737  +|   4048: 39 58 4e 4f 43 41 53 45 26 01 05 00 43 0f 17 43   9XNOCASE&...C..C
         7738  +|   4064: 4f 4d 50 49 4c 45 52 3d 67 63 63 2d 35 2e 34 2e   OMPILER=gcc-5.4.
         7739  +|   4080: 30 20 32 30 31 36 30 36 30 39 58 52 54 52 49 4d   0 20160609XRTRIM
         7740  +| page 6 offset 20480
         7741  +|      0: 0d 00 00 00 24 0e e0 00 0f f8 0f f0 0f e8 0f e0   ....$...........
         7742  +|     16: 0f d8 0f d0 0f c8 0f c0 0f b8 0f b0 0f a8 0f a0   ................
         7743  +|     32: 0f 98 0f 90 0f 88 0f 80 0f 78 0f 70 1f 68 0f 60   .........x.p.h.`
         7744  +|     48: 0f 58 0f 50 0f 48 0f 40 0f 38 0f 30 0f 28 0f 20   .X.P.H.@.8.0.(. 
         7745  +|     64: 0f 18 0f 10 0f 08 0f 00 0e f8 0e f0 0e e8 0e e0   ................
         7746  +|   3808: 07 24 03 00 12 02 01 01 06 23 03 00 12 02 01 01   .$.......#......
         7747  +|   3824: 06 22 03 00 12 02 01 01 06 21 03 00 12 03 01 01   .........!......
         7748  +|   3840: 06 20 03 00 12 03 01 01 06 1f 03 00 12 03 01 01   . ..............
         7749  +|   3856: 06 1e 03 00 12 03 01 01 06 1d 03 00 12 03 01 01   ................
         7750  +|   3872: 06 1c 03 00 12 03 01 01 06 1b 03 00 12 02 01 01   ................
         7751  +|   3888: 06 1a 03 00 12 02 01 01 06 19 03 00 12 02 01 01   ................
         7752  +|   3904: 06 18 03 00 12 02 01 01 06 17 03 00 12 02 01 01   ................
         7753  +|   3920: 06 16 03 00 12 02 01 01 06 15 03 00 12 02 01 01   ................
         7754  +|   3936: 06 14 03 00 12 02 01 01 06 13 03 00 12 02 01 01   ................
         7755  +|   3952: 06 12 03 00 12 02 01 01 06 11 03 00 12 02 01 01   ................
         7756  +|   3968: 06 10 03 00 12 02 01 01 06 0f 03 00 12 02 01 01   ................
         7757  +|   3984: 06 0e 03 00 12 02 01 01 06 0d 03 00 12 02 01 01   ................
         7758  +|   4000: 06 0c 03 00 12 02 01 01 06 0b 03 00 12 02 01 01   ................
         7759  +|   4016: 06 0a 03 00 12 02 01 01 05 09 03 00 12 03 01 01   ................
         7760  +|   4032: 06 08 03 00 12 03 01 01 01 17 03 00 12 03 01 01   ................
         7761  +|   4048: 06 06 03 00 12 01 01 01 06 05 03 00 12 01 01 01   ................
         7762  +|   4064: 06 04 03 00 12 01 01 01 06 03 02 f0 12 06 01 01   ................
         7763  +|   4080: 06 02 03 00 13 06 01 01 06 01 03 00 12 06 01 01   ................
         7764  +| page 7 offset 24576
         7765  +|      0: 0a 00 00 00 01 0f f4 00 0f f4 00 00 00 00 00 00   ................
         7766  +|   4080: 00 00 00 00 0b 03 1b 01 76 65 72 73 69 6f 6e 04   ........version.
         7767  +| page 8 offset 28672
         7768  +|      0: 0d 00 00 00 03 0f d6 00 0f f4 0f e9 0f d6 00 00   ................
         7769  +|   4048: 00 00 00 00 00 00 11 03 02 2b 69 6e 74 65 77 72   .........+intewr
         7770  +|   4064: 69 74 79 2d 63 68 65 63 6b 09 02 02 1b 72 65 62   ity-check....reb
         7771  +|   4080: 75 69 6c 64 0a 01 02 1d 6f 70 74 69 6d 69 7a 65   uild....optimize
         7772  +| end crash-b366b5ac0d3887.db
         7773  +}]} {}
         7774  +
         7775  +do_execsql_test 55.1 {
         7776  +  SAVEPOINT one;
         7777  +  DELETE FROM t1 WHERE a MATCH 'ts';
         7778  +}
         7779  +
         7780  +do_execsql_test 55.2 {
         7781  +  ROLLBACK TO one;
         7782  +}
  6426   7783   
  6427   7784   sqlite3_fts5_may_be_corrupt 0
  6428   7785   finish_test
  6429   7786   

Changes to ext/misc/memtrace.c.

    73     73   static sqlite3_mem_methods ersaztMethods = {
    74     74     memtraceMalloc,
    75     75     memtraceFree,
    76     76     memtraceRealloc,
    77     77     memtraceSize,
    78     78     memtraceRoundup,
    79     79     memtraceInit,
    80         -  memtraceShutdown
           80  +  memtraceShutdown,
           81  +  0
    81     82   };
    82     83   
    83     84   /* Begin tracing memory allocations to out. */
    84     85   int sqlite3MemTraceActivate(FILE *out){
    85     86     int rc = SQLITE_OK;
    86     87     if( memtraceBase.xMalloc==0 ){
    87     88       rc = sqlite3_config(SQLITE_CONFIG_GETMALLOC, &memtraceBase);

Changes to ext/misc/prefixes.c.

    15     15   **      prefixes('abcdefg')
    16     16   **
    17     17   ** The function has a single (non-HIDDEN) column named prefix that takes
    18     18   ** on all prefixes of the string in its argument, including an empty string
    19     19   ** and the input string itself.  The order of prefixes is from longest
    20     20   ** to shortest.
    21     21   */
           22  +#if !defined(SQLITE_CORE) || !defined(SQLITE_OMIT_VIRTUALTABLE)
    22     23   #if !defined(SQLITEINT_H)
    23     24   #include "sqlite3ext.h"
    24     25   #endif
    25     26   SQLITE_EXTENSION_INIT1
    26     27   #include <string.h>
    27     28   #include <assert.h>
    28     29   
................................................................................
   311    312     if( rc==SQLITE_OK ){
   312    313       rc = sqlite3_create_function(
   313    314           db, "prefix_length", 2, SQLITE_UTF8, 0, prefixLengthFunc, 0, 0
   314    315       );
   315    316     }
   316    317     return rc;
   317    318   }
          319  +#endif /* !defined(SQLITE_CORE) || !defined(SQLITE_OMIT_VIRTUALTABLE) */

Changes to main.mk.

  1022   1022   	$(TCC) -DSQLITE_THREADSAFE=0 -DSQLITE_OMIT_LOAD_EXTENSION -o showwal$(EXE) \
  1023   1023   		$(TOP)/tool/showwal.c sqlite3.o $(THREADLIB)
  1024   1024   
  1025   1025   showshm$(EXE):	$(TOP)/tool/showshm.c
  1026   1026   	$(TCC) -o showshm$(EXE) $(TOP)/tool/showshm.c
  1027   1027   
  1028   1028   index_usage$(EXE): $(TOP)/tool/index_usage.c sqlite3.o
  1029         -	$(TCC) -DSQLITE_THREADSAFE=0 -DSQLITE_OMIT_DEPRECATED -o index_usage$(EXE) \
         1029  +	$(TCC) -DSQLITE_THREADSAFE=0 -DSQLITE_OMIT_DEPRECATED $(SHELL_OPTS) -o index_usage$(EXE) \
  1030   1030   		$(TOP)/tool/index_usage.c sqlite3.o $(THREADLIB)
  1031   1031   
  1032   1032   changeset$(EXE):	$(TOP)/ext/session/changeset.c sqlite3.o
  1033   1033   	$(TCC) -DSQLITE_THREADSAFE=0 -DSQLITE_OMIT_LOAD_EXTENSION -o changeset$(EXE) \
  1034   1034   		$(TOP)/ext/session/changeset.c sqlite3.o $(THREADLIB)
  1035   1035   
  1036   1036   changesetfuzz$(EXE):	$(TOP)/ext/session/changesetfuzz.c sqlite3.o

Changes to src/attach.c.

   151    151         sqlite3_result_error(context, zErr, -1);
   152    152         sqlite3_free(zErr);
   153    153         return;
   154    154       }
   155    155       assert( pVfs );
   156    156       flags |= SQLITE_OPEN_MAIN_DB;
   157    157       rc = sqlite3BtreeOpen(pVfs, zPath, db, &pNew->pBt, 0, flags);
   158         -    sqlite3_free( zPath );
   159    158       db->nDb++;
          159  +    pNew->zDbSName = sqlite3DbStrDup(db, zName);
   160    160     }
   161    161     db->noSharedCache = 0;
   162    162     if( rc==SQLITE_CONSTRAINT ){
   163    163       rc = SQLITE_ERROR;
   164    164       zErrDyn = sqlite3MPrintf(db, "database is already attached");
   165    165     }else if( rc==SQLITE_OK ){
   166    166       Pager *pPager;
................................................................................
   180    180   #ifndef SQLITE_OMIT_PAGER_PRAGMAS
   181    181       sqlite3BtreeSetPagerFlags(pNew->pBt,
   182    182                         PAGER_SYNCHRONOUS_FULL | (db->flags & PAGER_FLAGS_MASK));
   183    183   #endif
   184    184       sqlite3BtreeLeave(pNew->pBt);
   185    185     }
   186    186     pNew->safety_level = SQLITE_DEFAULT_SYNCHRONOUS+1;
   187         -  if( !REOPEN_AS_MEMDB(db) ) pNew->zDbSName = sqlite3DbStrDup(db, zName);
   188    187     if( rc==SQLITE_OK && pNew->zDbSName==0 ){
   189    188       rc = SQLITE_NOMEM_BKPT;
   190    189     }
   191    190   
   192    191   
   193    192   #ifdef SQLITE_HAS_CODEC
   194    193     if( rc==SQLITE_OK ){
................................................................................
   208    207         case SQLITE_BLOB:
   209    208           nKey = sqlite3_value_bytes(argv[2]);
   210    209           zKey = (char *)sqlite3_value_blob(argv[2]);
   211    210           rc = sqlite3CodecAttach(db, db->nDb-1, zKey, nKey);
   212    211           break;
   213    212   
   214    213         case SQLITE_NULL:
   215         -        /* No key specified.  Use the key from the main database */
   216         -        sqlite3CodecGetKey(db, 0, (void**)&zKey, &nKey);
   217         -        if( nKey || sqlite3BtreeGetOptimalReserve(db->aDb[0].pBt)>0 ){
   218         -          rc = sqlite3CodecAttach(db, db->nDb-1, zKey, nKey);
          214  +        /* No key specified.  Use the key from URI filename, or if none,
          215  +        ** use the key from the main database. */
          216  +        if( sqlite3CodecQueryParameters(db, zName, zPath)==0 ){
          217  +          sqlite3CodecGetKey(db, 0, (void**)&zKey, &nKey);
          218  +          if( nKey || sqlite3BtreeGetOptimalReserve(db->aDb[0].pBt)>0 ){
          219  +            rc = sqlite3CodecAttach(db, db->nDb-1, zKey, nKey);
          220  +          }
   219    221           }
   220    222           break;
   221    223       }
   222    224     }
   223    225   #endif
          226  +  sqlite3_free( zPath );
   224    227   
   225    228     /* If the file was opened successfully, read the schema for the new database.
   226    229     ** If this fails, or if opening the file failed, then close the file and 
   227    230     ** remove the entry from the db->aDb[] array. i.e. put everything back the
   228    231     ** way we found it.
   229    232     */
   230    233     if( rc==SQLITE_OK ){

Changes to src/btree.c.

  4520   4520   */
  4521   4521   u32 sqlite3BtreePayloadSize(BtCursor *pCur){
  4522   4522     assert( cursorHoldsMutex(pCur) );
  4523   4523     assert( pCur->eState==CURSOR_VALID );
  4524   4524     getCellInfo(pCur);
  4525   4525     return pCur->info.nPayload;
  4526   4526   }
         4527  +
         4528  +/*
         4529  +** Return an upper bound on the size of any record for the table
         4530  +** that the cursor is pointing into.
         4531  +**
         4532  +** This is an optimization.  Everything will still work if this
         4533  +** routine always returns 2147483647 (which is the largest record
         4534  +** that SQLite can handle) or more.  But returning a smaller value might
         4535  +** prevent large memory allocations when trying to interpret a
         4536  +** corrupt datrabase.
         4537  +**
         4538  +** The current implementation merely returns the size of the underlying
         4539  +** database file.
         4540  +*/
         4541  +sqlite3_int64 sqlite3BtreeMaxRecordSize(BtCursor *pCur){
         4542  +  assert( cursorHoldsMutex(pCur) );
         4543  +  assert( pCur->eState==CURSOR_VALID );
         4544  +  return pCur->pBt->pageSize * (sqlite3_int64)pCur->pBt->nPage;
         4545  +}
  4527   4546   
  4528   4547   /*
  4529   4548   ** Given the page number of an overflow page in the database (parameter
  4530   4549   ** ovfl), this function finds the page number of the next page in the 
  4531   4550   ** linked list of overflow pages. If possible, it uses the auto-vacuum
  4532   4551   ** pointer-map data instead of reading the content of page ovfl to do so. 
  4533   4552   **
................................................................................
  6730   6749   **             -----------
  6731   6750   **            /     |     \
  6732   6751   **           /      |      \
  6733   6752   **  ---------   ---------   ---------
  6734   6753   **  |Child-1|   |Child-2|   |Child-3|
  6735   6754   **  ---------   ---------   ---------
  6736   6755   **
  6737         -** The order of cells is in the array is:
         6756  +** The order of cells is in the array is for an index btree is:
  6738   6757   **
  6739   6758   **       1.  All cells from Child-1 in order
  6740   6759   **       2.  The first divider cell from Parent
  6741   6760   **       3.  All cells from Child-2 in order
  6742   6761   **       4.  The second divider cell from Parent
  6743   6762   **       5.  All cells from Child-3 in order
  6744   6763   **
  6745         -** The apEnd[] array holds pointer to the end of page for Child-1, the
  6746         -** Parent, Child-2, the Parent (again), and Child-3.  The ixNx[] array
  6747         -** holds the number of cells contained in each of these 5 stages, and
  6748         -** all stages to the left.  Hence:
         6764  +** For a table-btree (with rowids) the items 2 and 4 are empty because
         6765  +** content exists only in leaves and there are no divider cells.
         6766  +**
         6767  +** For an index btree, the apEnd[] array holds pointer to the end of page
         6768  +** for Child-1, the Parent, Child-2, the Parent (again), and Child-3,
         6769  +** respectively. The ixNx[] array holds the number of cells contained in
         6770  +** each of these 5 stages, and all stages to the left.  Hence:
         6771  +**
  6749   6772   **    ixNx[0] = Number of cells in Child-1.
  6750   6773   **    ixNx[1] = Number of cells in Child-1 plus 1 for first divider.
  6751   6774   **    ixNx[2] = Number of cells in Child-1 and Child-2 + 1 for 1st divider.
  6752   6775   **    ixNx[3] = Number of cells in Child-1 and Child-2 + both divider cells
  6753   6776   **    ixNx[4] = Total number of cells.
         6777  +**
         6778  +** For a table-btree, the concept is similar, except only apEnd[0]..apEnd[2]
         6779  +** are used and they point to the leaf pages only, and the ixNx value are:
         6780  +**
         6781  +**    ixNx[0] = Number of cells in Child-1.
         6782  +**    ixNx[1] = Number of cells in Child-1 and Child-2 + 1 for 1st divider.
         6783  +**    ixNx[2] = Number of cells in Child-1 and Child-2 + both divider cells
  6754   6784   */
  6755   6785   typedef struct CellArray CellArray;
  6756   6786   struct CellArray {
  6757   6787     int nCell;              /* Number of cells in apCell[] */
  6758   6788     MemPage *pRef;          /* Reference page */
  6759   6789     u8 **apCell;            /* All cells begin balanced */
  6760   6790     u16 *szCell;            /* Local size of all cells in apCell[] */
................................................................................
  7660   7690     **    szNew[i]: Spaced used on the i-th sibling page.
  7661   7691     **   cntNew[i]: Index in b.apCell[] and b.szCell[] for the first cell to
  7662   7692     **              the right of the i-th sibling page.
  7663   7693     ** usableSpace: Number of bytes of space available on each sibling.
  7664   7694     ** 
  7665   7695     */
  7666   7696     usableSpace = pBt->usableSize - 12 + leafCorrection;
  7667         -  for(i=0; i<nOld; i++){
         7697  +  for(i=k=0; i<nOld; i++, k++){
  7668   7698       MemPage *p = apOld[i];
  7669         -    b.apEnd[i*2] = p->aDataEnd;
  7670         -    b.apEnd[i*2+1] = pParent->aDataEnd;
  7671         -    b.ixNx[i*2] = cntOld[i];
  7672         -    b.ixNx[i*2+1] = cntOld[i]+1;
         7699  +    b.apEnd[k] = p->aDataEnd;
         7700  +    b.ixNx[k] = cntOld[i];
         7701  +    if( !leafData ){
         7702  +      k++;
         7703  +      b.apEnd[k] = pParent->aDataEnd;
         7704  +      b.ixNx[k] = cntOld[i]+1;
         7705  +    }
  7673   7706       szNew[i] = usableSpace - p->nFree;
  7674   7707       for(j=0; j<p->nOverflow; j++){
  7675   7708         szNew[i] += 2 + p->xCellSize(p, p->apOvfl[j]);
  7676   7709       }
  7677   7710       cntNew[i] = cntOld[i];
  7678   7711     }
  7679   7712     k = nOld;

Changes to src/btree.h.

   311    311   i64 sqlite3BtreeIntegerKey(BtCursor*);
   312    312   #ifdef SQLITE_ENABLE_OFFSET_SQL_FUNC
   313    313   i64 sqlite3BtreeOffset(BtCursor*);
   314    314   #endif
   315    315   int sqlite3BtreePayload(BtCursor*, u32 offset, u32 amt, void*);
   316    316   const void *sqlite3BtreePayloadFetch(BtCursor*, u32 *pAmt);
   317    317   u32 sqlite3BtreePayloadSize(BtCursor*);
          318  +sqlite3_int64 sqlite3BtreeMaxRecordSize(BtCursor*);
   318    319   
   319    320   char *sqlite3BtreeIntegrityCheck(Btree*, int *aRoot, int nRoot, int, int*);
   320    321   struct Pager *sqlite3BtreePager(Btree*);
   321    322   i64 sqlite3BtreeRowCountEst(BtCursor*);
   322    323   
   323    324   #ifndef SQLITE_OMIT_INCRBLOB
   324    325   int sqlite3BtreePayloadChecked(BtCursor*, u32 offset, u32 amt, void*);

Changes to src/build.c.

  3483   3483       ** in-memory database structures. 
  3484   3484       */
  3485   3485       assert( pParse->nErr==0 );
  3486   3486       if( db->init.busy ){
  3487   3487         Index *p;
  3488   3488         assert( !IN_SPECIAL_PARSE );
  3489   3489         assert( sqlite3SchemaMutexHeld(db, 0, pIndex->pSchema) );
         3490  +      if( pTblName!=0 ){
         3491  +        pIndex->tnum = db->init.newTnum;
         3492  +        if( sqlite3IndexHasDuplicateRootPage(pIndex) ){
         3493  +          sqlite3ErrorMsg(pParse, "invalid rootpage");
         3494  +          pParse->rc = SQLITE_CORRUPT_BKPT;
         3495  +          goto exit_create_index;
         3496  +        }
         3497  +      }
  3490   3498         p = sqlite3HashInsert(&pIndex->pSchema->idxHash, 
  3491   3499             pIndex->zName, pIndex);
  3492   3500         if( p ){
  3493   3501           assert( p==pIndex );  /* Malloc must have failed */
  3494   3502           sqlite3OomFault(db);
  3495   3503           goto exit_create_index;
  3496   3504         }
  3497   3505         db->mDbFlags |= DBFLAG_SchemaChange;
  3498         -      if( pTblName!=0 ){
  3499         -        pIndex->tnum = db->init.newTnum;
  3500         -      }
  3501   3506       }
  3502   3507   
  3503   3508       /* If this is the initial CREATE INDEX statement (or CREATE TABLE if the
  3504   3509       ** index is an implied index for a UNIQUE or PRIMARY KEY constraint) then
  3505   3510       ** emit code to allocate the index rootpage on disk and make an entry for
  3506   3511       ** the index in the sqlite_master table and populate the index with
  3507   3512       ** content.  But, do not do this if we are simply reading the sqlite_master
................................................................................
  3869   3874     assert( pSrc!=0 );
  3870   3875     assert( iStart<=pSrc->nSrc );
  3871   3876   
  3872   3877     /* Allocate additional space if needed */
  3873   3878     if( (u32)pSrc->nSrc+nExtra>pSrc->nAlloc ){
  3874   3879       SrcList *pNew;
  3875   3880       int nAlloc = pSrc->nSrc*2+nExtra;
  3876         -    int nGot;
  3877   3881       sqlite3 *db = pParse->db;
  3878   3882   
  3879   3883       if( pSrc->nSrc+nExtra>=SQLITE_MAX_SRCLIST ){
  3880   3884         sqlite3ErrorMsg(pParse, "too many FROM clause terms, max: %d",
  3881   3885                         SQLITE_MAX_SRCLIST);
  3882   3886         return 0;
  3883   3887       }
................................................................................
  3885   3889       pNew = sqlite3DbRealloc(db, pSrc,
  3886   3890                  sizeof(*pSrc) + (nAlloc-1)*sizeof(pSrc->a[0]) );
  3887   3891       if( pNew==0 ){
  3888   3892         assert( db->mallocFailed );
  3889   3893         return 0;
  3890   3894       }
  3891   3895       pSrc = pNew;
  3892         -    nGot = (sqlite3DbMallocSize(db, pNew) - sizeof(*pSrc))/sizeof(pSrc->a[0])+1;
  3893         -    pSrc->nAlloc = nGot;
         3896  +    pSrc->nAlloc = nAlloc;
  3894   3897     }
  3895   3898   
  3896   3899     /* Move existing slots that come after the newly inserted slots
  3897   3900     ** out of the way */
  3898   3901     for(i=pSrc->nSrc-1; i>=iStart; i--){
  3899   3902       pSrc->a[i+nExtra] = pSrc->a[i];
  3900   3903     }

Changes to src/expr.c.

  1359   1359     return p==pWalker->u.pSelect ? WRC_Continue : WRC_Prune;
  1360   1360   }
  1361   1361   static void gatherSelectWindows(Select *p){
  1362   1362     Walker w;
  1363   1363     w.xExprCallback = gatherSelectWindowsCallback;
  1364   1364     w.xSelectCallback = gatherSelectWindowsSelectCallback;
  1365   1365     w.xSelectCallback2 = 0;
         1366  +  w.pParse = 0;
  1366   1367     w.u.pSelect = p;
  1367   1368     sqlite3WalkSelect(&w, p);
  1368   1369   }
  1369   1370   #endif
  1370   1371   
  1371   1372   
  1372   1373   /*
................................................................................
  4981   4982     testcase( pExpr->op==TK_AGG_COLUMN );
  4982   4983     testcase( pExpr->op==TK_AGG_FUNCTION );
  4983   4984     if( ExprHasProperty(pExpr, EP_FromJoin) ) return WRC_Prune;
  4984   4985     switch( pExpr->op ){
  4985   4986       case TK_ISNOT:
  4986   4987       case TK_NOT:
  4987   4988       case TK_ISNULL:
         4989  +    case TK_NOTNULL:
  4988   4990       case TK_IS:
  4989   4991       case TK_OR:
  4990   4992       case TK_CASE:
  4991   4993       case TK_IN:
  4992   4994       case TK_FUNCTION:
  4993   4995         testcase( pExpr->op==TK_ISNOT );
  4994   4996         testcase( pExpr->op==TK_NOT );
  4995   4997         testcase( pExpr->op==TK_ISNULL );
         4998  +      testcase( pExpr->op==TK_NOTNULL );
  4996   4999         testcase( pExpr->op==TK_IS );
  4997   5000         testcase( pExpr->op==TK_OR );
  4998   5001         testcase( pExpr->op==TK_CASE );
  4999   5002         testcase( pExpr->op==TK_IN );
  5000   5003         testcase( pExpr->op==TK_FUNCTION );
  5001   5004         return WRC_Prune;
  5002   5005       case TK_COLUMN:

Changes to src/global.c.

   185    185   ** sqlite3_db_config(db, SQLITE_DBCONFIG_LOOKASIDE);
   186    186   */
   187    187   #ifndef SQLITE_DEFAULT_LOOKASIDE
   188    188   # define SQLITE_DEFAULT_LOOKASIDE 1200,100
   189    189   #endif
   190    190   
   191    191   
          192  +/* The default maximum size of an in-memory database created using
          193  +** sqlite3_deserialize()
          194  +*/
          195  +#ifndef SQLITE_MEMDB_DEFAULT_MAXSIZE
          196  +# define SQLITE_MEMDB_DEFAULT_MAXSIZE 1073741824
          197  +#endif
          198  +
   192    199   /*
   193    200   ** The following singleton contains the global configuration for
   194    201   ** the SQLite library.
   195    202   */
   196    203   SQLITE_WSD struct Sqlite3Config sqlite3Config = {
   197    204      SQLITE_DEFAULT_MEMSTATUS,  /* bMemstat */
   198    205      1,                         /* bCoreMutex */
................................................................................
   232    239      0,                         /* xSqllog */
   233    240      0,                         /* pSqllogArg */
   234    241   #endif
   235    242   #ifdef SQLITE_VDBE_COVERAGE
   236    243      0,                         /* xVdbeBranch */
   237    244      0,                         /* pVbeBranchArg */
   238    245   #endif
          246  +#ifdef SQLITE_ENABLE_DESERIALIZE
          247  +   SQLITE_MEMDB_DEFAULT_MAXSIZE,   /* mxMemdbSize */
          248  +#endif
   239    249   #ifndef SQLITE_UNTESTABLE
   240    250      0,                         /* xTestCallback */
   241    251   #endif
   242    252      0,                         /* bLocaltimeFault */
   243    253      0,                         /* bInternalFunctions */
   244    254      0x7ffffffe,                /* iOnceResetThreshold */
   245         -   SQLITE_DEFAULT_SORTERREF_SIZE   /* szSorterRef */
          255  +   SQLITE_DEFAULT_SORTERREF_SIZE,   /* szSorterRef */
   246    256   };
   247    257   
   248    258   /*
   249    259   ** Hash table for global functions - functions common to all
   250    260   ** database connections.  After initialization, this table is
   251    261   ** read-only.
   252    262   */

Changes to src/legacy.c.

    47     47     if( zSql==0 ) zSql = "";
    48     48   #ifdef SQLITE_ENABLE_SQLRR
    49     49     SRRecExec(db, zSql);
    50     50   #endif  
    51     51     sqlite3_mutex_enter(db->mutex);
    52     52     sqlite3Error(db, SQLITE_OK);
    53     53     while( rc==SQLITE_OK && zSql[0] ){
    54         -    int nCol;
           54  +    int nCol = 0;
    55     55       char **azVals = 0;
    56     56   
    57     57       pStmt = 0;
    58     58       rc = sqlite3_prepare_v2(db, zSql, -1, &pStmt, &zLeftover);
    59     59       assert( rc==SQLITE_OK || pStmt==0 );
    60     60       if( rc!=SQLITE_OK ){
    61     61         continue;
    62     62       }
    63     63       if( !pStmt ){
    64     64         /* this happens for a comment or white-space */
    65     65         zSql = zLeftover;
    66     66         continue;
    67     67       }
    68         -
    69     68       callbackIsInit = 0;
    70         -    nCol = sqlite3_column_count(pStmt);
    71     69   
    72     70       while( 1 ){
    73     71         int i;
    74     72         rc = sqlite3_step(pStmt);
    75     73   
    76     74         /* Invoke the callback function if required */
    77     75         if( xCallback && (SQLITE_ROW==rc || 
    78     76             (SQLITE_DONE==rc && !callbackIsInit
    79     77                              && db->flags&SQLITE_NullCallback)) ){
    80     78           if( !callbackIsInit ){
           79  +          nCol = sqlite3_column_count(pStmt);
    81     80             azCols = sqlite3DbMallocRaw(db, (2*nCol+1)*sizeof(const char*));
    82     81             if( azCols==0 ){
    83     82               goto exec_out;
    84     83             }
    85     84             for(i=0; i<nCol; i++){
    86     85               azCols[i] = (char *)sqlite3_column_name(pStmt, i);
    87     86               /* sqlite3VdbeSetColName() installs column names as UTF8

Changes to src/main.c.

   652    652           iVal = SQLITE_DEFAULT_SORTERREF_SIZE;
   653    653         }
   654    654         sqlite3GlobalConfig.szSorterRef = (u32)iVal;
   655    655         break;
   656    656       }
   657    657   #endif /* SQLITE_ENABLE_SORTER_REFERENCES */
   658    658   
          659  +#ifdef SQLITE_ENABLE_DESERIALIZE
          660  +    case SQLITE_CONFIG_MEMDB_MAXSIZE: {
          661  +      sqlite3GlobalConfig.mxMemdbSize = va_arg(ap, sqlite3_int64);
          662  +      break;
          663  +    }
          664  +#endif /* SQLITE_ENABLE_DESERIALIZE */
          665  +
   659    666       default: {
   660    667         rc = SQLITE_ERROR;
   661    668         break;
   662    669       }
   663    670     }
   664    671     va_end(ap);
   665    672     return rc;
................................................................................
  3029   3036         _open_asl_log();
  3030   3037         sqlite3_trace(db, _sqlite_auto_trace_syslog, db);
  3031   3038       }
  3032   3039     }
  3033   3040   }
  3034   3041   #endif
  3035   3042   
         3043  +#if defined(SQLITE_HAS_CODEC)
         3044  +/*
         3045  +** Process URI filename query parameters relevant to the SQLite Encryption
         3046  +** Extension.  Return true if any of the relevant query parameters are
         3047  +** seen and return false if not.
         3048  +*/
         3049  +int sqlite3CodecQueryParameters(
         3050  +  sqlite3 *db,           /* Database connection */
         3051  +  const char *zDb,       /* Which schema is being created/attached */
         3052  +  const char *zUri       /* URI filename */
         3053  +){
         3054  +  const char *zKey;
         3055  +  if( (zKey = sqlite3_uri_parameter(zUri, "hexkey"))!=0 && zKey[0] ){
         3056  +    u8 iByte;
         3057  +    int i;
         3058  +    char zDecoded[40];
         3059  +    for(i=0, iByte=0; i<sizeof(zDecoded)*2 && sqlite3Isxdigit(zKey[i]); i++){
         3060  +      iByte = (iByte<<4) + sqlite3HexToInt(zKey[i]);
         3061  +      if( (i&1)!=0 ) zDecoded[i/2] = iByte;
         3062  +    }
         3063  +    sqlite3_key_v2(db, zDb, zDecoded, i/2);
         3064  +    return 1;
         3065  +  }else if( (zKey = sqlite3_uri_parameter(zUri, "key"))!=0 ){
         3066  +    sqlite3_key_v2(db, zDb, zKey, sqlite3Strlen30(zKey));
         3067  +    return 1;
         3068  +  }else if( (zKey = sqlite3_uri_parameter(zUri, "textkey"))!=0 ){
         3069  +    sqlite3_key_v2(db, zDb, zKey, -1);
         3070  +    return 1;
         3071  +  }else{
         3072  +    return 0;
         3073  +  }
         3074  +}
         3075  +#endif
         3076  +
  3036   3077   /*
  3037   3078   ** This routine does the work of opening a database on behalf of
  3038   3079   ** sqlite3_open() and sqlite3_open16(). The database filename "zFilename"  
  3039   3080   ** is UTF-8 encoded.
  3040   3081   */
  3041   3082   static int openDatabase(
  3042   3083     const char *zFilename, /* Database filename UTF-8 encoded */
................................................................................
  3396   3437     if( sqlite3GlobalConfig.xSqllog ){
  3397   3438       /* Opening a db handle. Fourth parameter is passed 0. */
  3398   3439       void *pArg = sqlite3GlobalConfig.pSqllogArg;
  3399   3440       sqlite3GlobalConfig.xSqllog(pArg, db, zFilename, 0);
  3400   3441     }
  3401   3442   #endif
  3402   3443   #if defined(SQLITE_HAS_CODEC)
  3403         -  if( rc==SQLITE_OK ){
  3404         -    const char *zKey;
  3405         -    if( (zKey = sqlite3_uri_parameter(zOpen, "hexkey"))!=0 && zKey[0] ){
  3406         -      u8 iByte;
  3407         -      int i;
  3408         -      char zDecoded[40];
  3409         -      for(i=0, iByte=0; i<sizeof(zDecoded)*2 && sqlite3Isxdigit(zKey[i]); i++){
  3410         -        iByte = (iByte<<4) + sqlite3HexToInt(zKey[i]);
  3411         -        if( (i&1)!=0 ) zDecoded[i/2] = iByte;
  3412         -      }
  3413         -      sqlite3_key_v2(db, 0, zDecoded, i/2);
  3414         -    }else if( (zKey = sqlite3_uri_parameter(zOpen, "key"))!=0 ){
  3415         -      sqlite3_key_v2(db, 0, zKey, sqlite3Strlen30(zKey));
  3416         -    }
  3417         -  }
         3444  +  if( rc==SQLITE_OK ) sqlite3CodecQueryParameters(db, 0, zOpen);
  3418   3445   #endif
  3419   3446     sqlite3_free(zOpen);
  3420   3447     return rc & 0xff;
  3421   3448   }
         3449  +
  3422   3450   
  3423   3451   /*
  3424   3452   ** Open a new database handle.
  3425   3453   */
  3426   3454   int sqlite3_open(
  3427   3455     const char *zFilename, 
  3428   3456     sqlite3 **ppDb 

Changes to src/memdb.c.

    38     38     sqlite3_int64 szMax;            /* Maximum allowed size of the file */
    39     39     unsigned char *aData;           /* content of the file */
    40     40     int nMmap;                      /* Number of memory mapped pages */
    41     41     unsigned mFlags;                /* Flags */
    42     42     int eLock;                      /* Most recent lock against this file */
    43     43   };
    44     44   
    45         -/* The default maximum size of an in-memory database */
    46         -#ifndef SQLITE_MEMDB_DEFAULT_MAXSIZE
    47         -# define SQLITE_MEMDB_DEFAULT_MAXSIZE 1073741824
    48         -#endif
    49         -
    50     45   /*
    51     46   ** Methods for MemFile
    52     47   */
    53     48   static int memdbClose(sqlite3_file*);
    54     49   static int memdbRead(sqlite3_file*, void*, int iAmt, sqlite3_int64 iOfst);
    55     50   static int memdbWrite(sqlite3_file*,const void*,int iAmt, sqlite3_int64 iOfst);
    56     51   static int memdbTruncate(sqlite3_file*, sqlite3_int64 size);
................................................................................
   307    302     sqlite3_file *pFile,
   308    303     sqlite3_int64 iOfst,
   309    304     int iAmt,
   310    305     void **pp
   311    306   ){
   312    307     MemFile *p = (MemFile *)pFile;
   313    308     if( iOfst+iAmt>p->sz ){
   314         -    assert( CORRUPT_DB );
   315    309       *pp = 0;
   316    310     }else{
   317    311       p->nMmap++;
   318    312       *pp = (void*)(p->aData + iOfst);
   319    313     }
   320    314     return SQLITE_OK;
   321    315   }
................................................................................
   342    336       return ORIGVFS(pVfs)->xOpen(ORIGVFS(pVfs), zName, pFile, flags, pOutFlags);
   343    337     }
   344    338     memset(p, 0, sizeof(*p));
   345    339     p->mFlags = SQLITE_DESERIALIZE_RESIZEABLE | SQLITE_DESERIALIZE_FREEONCLOSE;
   346    340     assert( pOutFlags!=0 );  /* True because flags==SQLITE_OPEN_MAIN_DB */
   347    341     *pOutFlags = flags | SQLITE_OPEN_MEMORY;
   348    342     p->base.pMethods = &memdb_io_methods;
   349         -  p->szMax = SQLITE_MEMDB_DEFAULT_MAXSIZE;
          343  +  p->szMax = sqlite3GlobalConfig.mxMemdbSize;
   350    344     return SQLITE_OK;
   351    345   }
   352    346   
   353    347   #if 0 /* Only used to delete rollback journals, master journals, and WAL
   354    348         ** files, none of which exist in memdb.  So this routine is never used */
   355    349   /*
   356    350   ** Delete the file located at zPath. If the dirSync argument is true,
................................................................................
   594    588     if( p==0 ){
   595    589       rc = SQLITE_ERROR;
   596    590     }else{
   597    591       p->aData = pData;
   598    592       p->sz = szDb;
   599    593       p->szAlloc = szBuf;
   600    594       p->szMax = szBuf;
   601         -    if( p->szMax<SQLITE_MEMDB_DEFAULT_MAXSIZE ){
   602         -      p->szMax = SQLITE_MEMDB_DEFAULT_MAXSIZE;
          595  +    if( p->szMax<sqlite3GlobalConfig.mxMemdbSize ){
          596  +      p->szMax = sqlite3GlobalConfig.mxMemdbSize;
   603    597       }
   604    598       p->mFlags = mFlags;
   605    599       rc = SQLITE_OK;
   606    600     }
   607    601   
   608    602   end_deserialize:
   609    603     sqlite3_finalize(pStmt);

Changes to src/parse.y.

   822    822   
   823    823   /////////////////////////// The DELETE statement /////////////////////////////
   824    824   //
   825    825   %ifdef SQLITE_ENABLE_UPDATE_DELETE_LIMIT
   826    826   cmd ::= with DELETE FROM xfullname(X) indexed_opt(I) where_opt(W) 
   827    827           orderby_opt(O) limit_opt(L). {
   828    828     sqlite3SrcListIndexedBy(pParse, X, &I);
          829  +#ifndef SQLITE_ENABLE_UPDATE_DELETE_LIMIT
          830  +  sqlite3ExprListDelete(pParse->db, O); O = 0;
          831  +  sqlite3ExprDelete(pParse->db, L); L = 0;
          832  +#endif
   829    833     sqlite3DeleteFrom(pParse,X,W,O,L);
   830    834   }
   831    835   %endif
   832    836   %ifndef SQLITE_ENABLE_UPDATE_DELETE_LIMIT
   833    837   cmd ::= with DELETE FROM xfullname(X) indexed_opt(I) where_opt(W). {
   834    838     sqlite3SrcListIndexedBy(pParse, X, &I);
   835    839     sqlite3DeleteFrom(pParse,X,W,0,0);

Changes to src/pcache1.c.

    88     88   typedef struct PGroup PGroup;
    89     89   
    90     90   /*
    91     91   ** Each cache entry is represented by an instance of the following 
    92     92   ** structure. Unless SQLITE_PCACHE_SEPARATE_HEADER is defined, a buffer of
    93     93   ** PgHdr1.pCache->szPage bytes is allocated directly before this structure 
    94     94   ** in memory.
           95  +**
           96  +** Note: Variables isBulkLocal and isAnchor were once type "u8". That works,
           97  +** but causes a 2-byte gap in the structure for most architectures (since 
           98  +** pointers must be either 4 or 8-byte aligned). As this structure is located
           99  +** in memory directly after the associated page data, if the database is
          100  +** corrupt, code at the b-tree layer may overread the page buffer and 
          101  +** read part of this structure before the corruption is detected. This
          102  +** can cause a valgrind error if the unitialized gap is accessed. Using u16
          103  +** ensures there is no such gap, and therefore no bytes of unitialized memory
          104  +** in the structure.
    95    105   */
    96    106   struct PgHdr1 {
    97    107     sqlite3_pcache_page page;      /* Base class. Must be first. pBuf & pExtra */
    98    108     unsigned int iKey;             /* Key value (page number) */
    99         -  u8 isBulkLocal;                /* This page from bulk local storage */
   100         -  u8 isAnchor;                   /* This is the PGroup.lru element */
          109  +  u16 isBulkLocal;               /* This page from bulk local storage */
          110  +  u16 isAnchor;                  /* This is the PGroup.lru element */
   101    111     PgHdr1 *pNext;                 /* Next in hash table chain */
   102    112     PCache1 *pCache;               /* Cache that currently owns this page */
   103    113     PgHdr1 *pLruNext;              /* Next in LRU list of unpinned pages */
   104    114     PgHdr1 *pLruPrev;              /* Previous in LRU list of unpinned pages */
   105    115                                    /* NB: pLruPrev is only valid if pLruNext!=0 */
   106    116   };
   107    117   
................................................................................
   299    309       do{
   300    310         PgHdr1 *pX = (PgHdr1*)&zBulk[pCache->szPage];
   301    311         pX->page.pBuf = zBulk;
   302    312         pX->page.pExtra = &pX[1];
   303    313         pX->isBulkLocal = 1;
   304    314         pX->isAnchor = 0;
   305    315         pX->pNext = pCache->pFree;
          316  +      pX->pLruPrev = 0;           /* Initializing this saves a valgrind error */
   306    317         pCache->pFree = pX;
   307    318         zBulk += pCache->szAlloc;
   308    319       }while( --nBulk );
   309    320     }
   310    321     return pCache->pFree!=0;
   311    322   }
   312    323   

Changes to src/pragma.c.

  1417   1417         sqlite3VdbeJumpHere(v, addrTop);
  1418   1418       }
  1419   1419     }
  1420   1420     break;
  1421   1421   #endif /* !defined(SQLITE_OMIT_TRIGGER) */
  1422   1422   #endif /* !defined(SQLITE_OMIT_FOREIGN_KEY) */
  1423   1423   
  1424         -#ifndef NDEBUG
  1425         -  case PragTyp_PARSER_TRACE: {
  1426         -    if( zRight ){
  1427         -      if( sqlite3GetBoolean(zRight, 0) ){
  1428         -        sqlite3ParserTrace(stdout, "parser: ");
  1429         -      }else{
  1430         -        sqlite3ParserTrace(0, 0);
  1431         -      }
  1432         -    }
  1433         -  }
  1434         -  break;
  1435         -#endif
  1436         -
  1437   1424     /* Reinstall the LIKE and GLOB functions.  The variant of LIKE
  1438   1425     ** used will be case sensitive or not depending on the RHS.
  1439   1426     */
  1440   1427     case PragTyp_CASE_SENSITIVE_LIKE: {
  1441   1428       if( zRight ){
  1442   1429         sqlite3RegisterLikeFunctions(db, sqlite3GetBoolean(zRight, 0));
  1443   1430       }

Changes to src/pragma.h.

    45     45   #define PragTyp_THREADS                       37
    46     46   #define PragTyp_WAL_AUTOCHECKPOINT            38
    47     47   #define PragTyp_WAL_CHECKPOINT                39
    48     48   #define PragTyp_ACTIVATE_EXTENSIONS           40
    49     49   #define PragTyp_HEXKEY                        41
    50     50   #define PragTyp_KEY                           42
    51     51   #define PragTyp_LOCK_STATUS                   43
    52         -#define PragTyp_PARSER_TRACE                  44
    53         -#define PragTyp_STATS                         45
           52  +#define PragTyp_STATS                         44
    54     53   
    55     54   /* Property flags associated with various pragma. */
    56     55   #define PragFlg_NeedSchema 0x01 /* Force schema load before running */
    57     56   #define PragFlg_NoColumns  0x02 /* OP_ResultRow called with zero columns */
    58     57   #define PragFlg_NoColumns1 0x04 /* zero columns if RHS argument is present */
    59     58   #define PragFlg_ReadOnly   0x08 /* Read-only HEADER_VALUE */
    60     59   #define PragFlg_Result0    0x10 /* Acts as query when no argument */
................................................................................
   207    206    {/* zName:     */ "compile_options",
   208    207     /* ePragTyp:  */ PragTyp_COMPILE_OPTIONS,
   209    208     /* ePragFlg:  */ PragFlg_Result0,
   210    209     /* ColNames:  */ 0, 0,
   211    210     /* iArg:      */ 0 },
   212    211   #endif
   213    212   #if !defined(SQLITE_OMIT_FLAG_PRAGMAS)
   214         -#if !defined(SQLITE_OMIT_DEPRECATED)
   215    213    {/* zName:     */ "count_changes",
   216    214     /* ePragTyp:  */ PragTyp_FLAG,
   217    215     /* ePragFlg:  */ PragFlg_Result0|PragFlg_NoColumns1,
   218    216     /* ColNames:  */ 0, 0,
   219    217     /* iArg:      */ SQLITE_CountRows },
   220    218   #endif
   221         -#endif
   222    219   #if !defined(SQLITE_OMIT_PAGER_PRAGMAS) && SQLITE_OS_WIN
   223         -#if !defined(SQLITE_OMIT_DEPRECATED)
   224    220    {/* zName:     */ "data_store_directory",
   225    221     /* ePragTyp:  */ PragTyp_DATA_STORE_DIRECTORY,
   226    222     /* ePragFlg:  */ PragFlg_NoColumns1,
   227    223     /* ColNames:  */ 0, 0,
   228    224     /* iArg:      */ 0 },
   229         -#endif
   230    225   #endif
   231    226   #if !defined(SQLITE_OMIT_SCHEMA_VERSION_PRAGMAS)
   232    227    {/* zName:     */ "data_version",
   233    228     /* ePragTyp:  */ PragTyp_HEADER_VALUE,
   234    229     /* ePragFlg:  */ PragFlg_ReadOnly|PragFlg_Result0,
   235    230     /* ColNames:  */ 0, 0,
   236    231     /* iArg:      */ BTREE_DATA_VERSION },
................................................................................
   238    233   #if !defined(SQLITE_OMIT_SCHEMA_PRAGMAS)
   239    234    {/* zName:     */ "database_list",
   240    235     /* ePragTyp:  */ PragTyp_DATABASE_LIST,
   241    236     /* ePragFlg:  */ PragFlg_NeedSchema|PragFlg_Result0,
   242    237     /* ColNames:  */ 35, 3,
   243    238     /* iArg:      */ 0 },
   244    239   #endif
   245         -#if !defined(SQLITE_OMIT_PAGER_PRAGMAS)
   246         -#if !defined(SQLITE_OMIT_DEPRECATED)
          240  +#if !defined(SQLITE_OMIT_PAGER_PRAGMAS) && !defined(SQLITE_OMIT_DEPRECATED)
   247    241    {/* zName:     */ "default_cache_size",
   248    242     /* ePragTyp:  */ PragTyp_DEFAULT_CACHE_SIZE,
   249    243     /* ePragFlg:  */ PragFlg_NeedSchema|PragFlg_Result0|PragFlg_SchemaReq|PragFlg_NoColumns1,
   250    244     /* ColNames:  */ 45, 1,
   251    245     /* iArg:      */ 0 },
   252         -#endif
   253    246   #endif
   254    247   #if !defined(SQLITE_OMIT_FLAG_PRAGMAS)
   255    248   #if !defined(SQLITE_OMIT_FOREIGN_KEY) && !defined(SQLITE_OMIT_TRIGGER)
   256    249    {/* zName:     */ "defer_foreign_keys",
   257    250     /* ePragTyp:  */ PragTyp_FLAG,
   258    251     /* ePragFlg:  */ PragFlg_Result0|PragFlg_NoColumns1,
   259    252     /* ColNames:  */ 0, 0,
   260    253     /* iArg:      */ SQLITE_DeferFKs },
   261    254   #endif
   262    255   #endif
   263    256   #if !defined(SQLITE_OMIT_FLAG_PRAGMAS)
   264         -#if !defined(SQLITE_OMIT_DEPRECATED)
   265    257    {/* zName:     */ "empty_result_callbacks",
   266    258     /* ePragTyp:  */ PragTyp_FLAG,
   267    259     /* ePragFlg:  */ PragFlg_Result0|PragFlg_NoColumns1,
   268    260     /* ColNames:  */ 0, 0,
   269    261     /* iArg:      */ SQLITE_NullCallback },
   270         -#endif
   271    262   #endif
   272    263   #if !defined(SQLITE_OMIT_UTF16)
   273    264    {/* zName:     */ "encoding",
   274    265     /* ePragTyp:  */ PragTyp_ENCODING,
   275    266     /* ePragFlg:  */ PragFlg_Result0|PragFlg_NoColumns1,
   276    267     /* ColNames:  */ 0, 0,
   277    268     /* iArg:      */ 0 },
................................................................................
   303    294    {/* zName:     */ "freelist_count",
   304    295     /* ePragTyp:  */ PragTyp_HEADER_VALUE,
   305    296     /* ePragFlg:  */ PragFlg_ReadOnly|PragFlg_Result0,
   306    297     /* ColNames:  */ 0, 0,
   307    298     /* iArg:      */ BTREE_FREE_PAGE_COUNT },
   308    299   #endif
   309    300   #if !defined(SQLITE_OMIT_FLAG_PRAGMAS)
   310         -#if !defined(SQLITE_OMIT_DEPRECATED)
   311    301    {/* zName:     */ "full_column_names",
   312    302     /* ePragTyp:  */ PragTyp_FLAG,
   313    303     /* ePragFlg:  */ PragFlg_Result0|PragFlg_NoColumns1,
   314    304     /* ColNames:  */ 0, 0,
   315    305     /* iArg:      */ SQLITE_FullColNames },
   316         -#endif
   317         -#endif
   318         -#if !defined(SQLITE_OMIT_FLAG_PRAGMAS)
   319    306    {/* zName:     */ "fullfsync",
   320    307     /* ePragTyp:  */ PragTyp_FLAG,
   321    308     /* ePragFlg:  */ PragFlg_Result0|PragFlg_NoColumns1,
   322    309     /* ColNames:  */ 0, 0,
   323    310     /* iArg:      */ SQLITE_FullFSync },
   324    311   #endif
   325    312   #if !defined(SQLITE_OMIT_SCHEMA_PRAGMAS)
................................................................................
   469    456     /* iArg:      */ 0 },
   470    457    {/* zName:     */ "page_size",
   471    458     /* ePragTyp:  */ PragTyp_PAGE_SIZE,
   472    459     /* ePragFlg:  */ PragFlg_Result0|PragFlg_SchemaReq|PragFlg_NoColumns1,
   473    460     /* ColNames:  */ 0, 0,
   474    461     /* iArg:      */ 0 },
   475    462   #endif
   476         -#if defined(SQLITE_DEBUG) && !defined(SQLITE_OMIT_PARSER_TRACE)
          463  +#if !defined(SQLITE_OMIT_FLAG_PRAGMAS)
          464  +#if defined(SQLITE_DEBUG)
   477    465    {/* zName:     */ "parser_trace",
   478         -  /* ePragTyp:  */ PragTyp_PARSER_TRACE,
   479         -  /* ePragFlg:  */ 0,
          466  +  /* ePragTyp:  */ PragTyp_FLAG,
          467  +  /* ePragFlg:  */ PragFlg_Result0|PragFlg_NoColumns1,
   480    468     /* ColNames:  */ 0, 0,
   481         -  /* iArg:      */ 0 },
          469  +  /* iArg:      */ SQLITE_ParserTrace },
          470  +#endif
   482    471   #endif
   483    472   #if defined(SQLITE_INTROSPECTION_PRAGMAS)
   484    473    {/* zName:     */ "pragma_list",
   485    474     /* ePragTyp:  */ PragTyp_PRAGMA_LIST,
   486    475     /* ePragFlg:  */ PragFlg_Result0,
   487    476     /* ColNames:  */ 9, 1,
   488    477     /* iArg:      */ 0 },
................................................................................
   538    527    {/* zName:     */ "secure_delete",
   539    528     /* ePragTyp:  */ PragTyp_SECURE_DELETE,
   540    529     /* ePragFlg:  */ PragFlg_Result0,
   541    530     /* ColNames:  */ 0, 0,
   542    531     /* iArg:      */ 0 },
   543    532   #endif
   544    533   #if !defined(SQLITE_OMIT_FLAG_PRAGMAS)
   545         -#if !defined(SQLITE_OMIT_DEPRECATED)
   546    534    {/* zName:     */ "short_column_names",
   547    535     /* ePragTyp:  */ PragTyp_FLAG,
   548    536     /* ePragFlg:  */ PragFlg_Result0|PragFlg_NoColumns1,
   549    537     /* ColNames:  */ 0, 0,
   550    538     /* iArg:      */ SQLITE_ShortColNames },
   551         -#endif
   552    539   #endif
   553    540    {/* zName:     */ "shrink_memory",
   554    541     /* ePragTyp:  */ PragTyp_SHRINK_MEMORY,
   555    542     /* ePragFlg:  */ PragFlg_NoColumns,
   556    543     /* ColNames:  */ 0, 0,
   557    544     /* iArg:      */ 0 },
   558    545    {/* zName:     */ "soft_heap_limit",
................................................................................
   597    584   #endif
   598    585   #if !defined(SQLITE_OMIT_PAGER_PRAGMAS)
   599    586    {/* zName:     */ "temp_store",
   600    587     /* ePragTyp:  */ PragTyp_TEMP_STORE,
   601    588     /* ePragFlg:  */ PragFlg_Result0|PragFlg_NoColumns1,
   602    589     /* ColNames:  */ 0, 0,
   603    590     /* iArg:      */ 0 },
   604         -#endif
   605         -#if !defined(SQLITE_OMIT_PAGER_PRAGMAS)
   606         -#if !defined(SQLITE_OMIT_DEPRECATED)
   607    591    {/* zName:     */ "temp_store_directory",
   608    592     /* ePragTyp:  */ PragTyp_TEMP_STORE_DIRECTORY,
   609    593     /* ePragFlg:  */ PragFlg_NoColumns1,
   610    594     /* ColNames:  */ 0, 0,
   611    595     /* iArg:      */ 0 },
   612         -#endif
   613    596   #endif
   614    597   #if defined(SQLITE_HAS_CODEC)
   615    598    {/* zName:     */ "textkey",
   616    599     /* ePragTyp:  */ PragTyp_KEY,
   617    600     /* ePragFlg:  */ 0,
   618    601     /* ColNames:  */ 0, 0,
   619    602     /* iArg:      */ 4 },

Changes to src/prepare.c.

    42     42       if( zObj==0 ) zObj = "?";
    43     43       z = sqlite3MPrintf(db, "malformed database schema (%s)", zObj);
    44     44       if( zExtra && zExtra[0] ) z = sqlite3MPrintf(db, "%z - %s", z, zExtra);
    45     45       *pData->pzErrMsg = z;
    46     46       pData->rc = SQLITE_CORRUPT_BKPT;
    47     47     }
    48     48   }
           49  +
           50  +/*
           51  +** Check to see if any sibling index (another index on the same table)
           52  +** of pIndex has the same root page number, and if it does, return true.
           53  +** This would indicate a corrupt schema.
           54  +*/
           55  +int sqlite3IndexHasDuplicateRootPage(Index *pIndex){
           56  +  Index *p;
           57  +  for(p=pIndex->pTable->pIndex; p; p=p->pNext){
           58  +    if( p->tnum==pIndex->tnum && p!=pIndex ) return 1;
           59  +  }
           60  +  return 0;
           61  +}
    49     62   
    50     63   /*
    51     64   ** This is the callback routine for the code that initializes the
    52     65   ** database.  See sqlite3Init() below for additional information.
    53     66   ** This routine is also called from the OP_ParseSchema opcode of the VDBE.
    54     67   **
    55     68   ** Each callback contains the following information:
................................................................................
   121    134       ** to do here is record the root page number for that index.
   122    135       */
   123    136       Index *pIndex;
   124    137       pIndex = sqlite3FindIndex(db, argv[0], db->aDb[iDb].zDbSName);
   125    138       if( pIndex==0
   126    139        || sqlite3GetInt32(argv[1],&pIndex->tnum)==0
   127    140        || pIndex->tnum<2
          141  +     || sqlite3IndexHasDuplicateRootPage(pIndex)
   128    142       ){
   129    143         corruptSchema(pData, argv[0], pIndex?"invalid rootpage":"orphan index");
   130    144       }
   131    145     }
   132    146     return 0;
   133    147   }
   134    148   

Changes to src/printf.c.

   151    151     return sqlite3_value_double(p->apArg[p->nUsed++]);
   152    152   }
   153    153   static char *getTextArg(PrintfArguments *p){
   154    154     if( p->nArg<=p->nUsed ) return 0;
   155    155     return (char*)sqlite3_value_text(p->apArg[p->nUsed++]);
   156    156   }
   157    157   
          158  +/*
          159  +** Allocate memory for a temporary buffer needed for printf rendering.
          160  +**
          161  +** If the requested size of the temp buffer is larger than the size
          162  +** of the output buffer in pAccum, then cause an SQLITE_TOOBIG error.
          163  +** Do the size check before the memory allocation to prevent rogue
          164  +** SQL from requesting large allocations using the precision or width
          165  +** field of the printf() function.
          166  +*/
          167  +static char *printfTempBuf(sqlite3_str *pAccum, sqlite3_int64 n){
          168  +  char *z;
          169  +  if( n>pAccum->nAlloc && n>pAccum->mxAlloc ){
          170  +    setStrAccumError(pAccum, SQLITE_TOOBIG);
          171  +    return 0;
          172  +  }
          173  +  z = sqlite3DbMallocRaw(pAccum->db, n);
          174  +  if( z==0 ){
          175  +    setStrAccumError(pAccum, SQLITE_NOMEM);
          176  +  }
          177  +  return z;
          178  +}
   158    179   
   159    180   /*
   160    181   ** On machines with a small stack size, you can redefine the
   161    182   ** SQLITE_PRINT_BUF_SIZE to be something smaller, if desired.
   162    183   */
   163    184   #ifndef SQLITE_PRINT_BUF_SIZE
   164    185   # define SQLITE_PRINT_BUF_SIZE 70
................................................................................
   233    254         sqlite3_str_append(pAccum, "%", 1);
   234    255         break;
   235    256       }
   236    257       /* Find out what flags are present */
   237    258       flag_leftjustify = flag_prefix = cThousand =
   238    259        flag_alternateform = flag_altform2 = flag_zeropad = 0;
   239    260       done = 0;
          261  +    width = 0;
          262  +    flag_long = 0;
          263  +    precision = -1;
   240    264       do{
   241    265         switch( c ){
   242    266           case '-':   flag_leftjustify = 1;     break;
   243    267           case '+':   flag_prefix = '+';        break;
   244    268           case ' ':   flag_prefix = ' ';        break;
   245    269           case '#':   flag_alternateform = 1;   break;
   246    270           case '!':   flag_altform2 = 1;        break;
   247    271           case '0':   flag_zeropad = 1;         break;
   248    272           case ',':   cThousand = ',';          break;
   249    273           default:    done = 1;                 break;
          274  +        case 'l': {
          275  +          flag_long = 1;
          276  +          c = *++fmt;
          277  +          if( c=='l' ){
          278  +            c = *++fmt;
          279  +            flag_long = 2;
          280  +          }
          281  +          done = 1;
          282  +          break;
          283  +        }
          284  +        case '1': case '2': case '3': case '4': case '5':
          285  +        case '6': case '7': case '8': case '9': {
          286  +          unsigned wx = c - '0';
          287  +          while( (c = *++fmt)>='0' && c<='9' ){
          288  +            wx = wx*10 + c - '0';
          289  +          }
          290  +          testcase( wx>0x7fffffff );
          291  +          width = wx & 0x7fffffff;
          292  +#ifdef SQLITE_PRINTF_PRECISION_LIMIT
          293  +          if( width>SQLITE_PRINTF_PRECISION_LIMIT ){
          294  +            width = SQLITE_PRINTF_PRECISION_LIMIT;
          295  +          }
          296  +#endif
          297  +          if( c!='.' && c!='l' ){
          298  +            done = 1;
          299  +          }else{
          300  +            fmt--;
          301  +          }
          302  +          break;
          303  +        }
          304  +        case '*': {
          305  +          if( bArgList ){
          306  +            width = (int)getIntArg(pArgList);
          307  +          }else{
          308  +            width = va_arg(ap,int);
          309  +          }
          310  +          if( width<0 ){
          311  +            flag_leftjustify = 1;
          312  +            width = width >= -2147483647 ? -width : 0;
          313  +          }
          314  +#ifdef SQLITE_PRINTF_PRECISION_LIMIT
          315  +          if( width>SQLITE_PRINTF_PRECISION_LIMIT ){
          316  +            width = SQLITE_PRINTF_PRECISION_LIMIT;
          317  +          }
          318  +#endif
          319  +          if( (c = fmt[1])!='.' && c!='l' ){
          320  +            c = *++fmt;
          321  +            done = 1;
          322  +          }
          323  +          break;
          324  +        }
          325  +        case '.': {
          326  +          c = *++fmt;
          327  +          if( c=='*' ){
          328  +            if( bArgList ){
          329  +              precision = (int)getIntArg(pArgList);
          330  +            }else{
          331  +              precision = va_arg(ap,int);
          332  +            }
          333  +            if( precision<0 ){
          334  +              precision = precision >= -2147483647 ? -precision : -1;
          335  +            }
          336  +            c = *++fmt;
          337  +          }else{
          338  +            unsigned px = 0;
          339  +            while( c>='0' && c<='9' ){
          340  +              px = px*10 + c - '0';
          341  +              c = *++fmt;
          342  +            }
          343  +            testcase( px>0x7fffffff );
          344  +            precision = px & 0x7fffffff;
          345  +          }
          346  +#ifdef SQLITE_PRINTF_PRECISION_LIMIT
          347  +          if( precision>SQLITE_PRINTF_PRECISION_LIMIT ){
          348  +            precision = SQLITE_PRINTF_PRECISION_LIMIT;
          349  +          }
          350  +#endif
          351  +          if( c=='l' ){
          352  +            --fmt;
          353  +          }else{
          354  +            done = 1;
          355  +          }
          356  +          break;
          357  +        }
   250    358         }
   251    359       }while( !done && (c=(*++fmt))!=0 );
   252         -    /* Get the field width */
   253         -    if( c=='*' ){
   254         -      if( bArgList ){
   255         -        width = (int)getIntArg(pArgList);
   256         -      }else{
   257         -        width = va_arg(ap,int);
   258         -      }
   259         -      if( width<0 ){
   260         -        flag_leftjustify = 1;
   261         -        width = width >= -2147483647 ? -width : 0;
   262         -      }
   263         -      c = *++fmt;
   264         -    }else{
   265         -      unsigned wx = 0;
   266         -      while( c>='0' && c<='9' ){
   267         -        wx = wx*10 + c - '0';
   268         -        c = *++fmt;
   269         -      }
   270         -      testcase( wx>0x7fffffff );
   271         -      width = wx & 0x7fffffff;
   272         -    }
   273         -    assert( width>=0 );
   274         -#ifdef SQLITE_PRINTF_PRECISION_LIMIT
   275         -    if( width>SQLITE_PRINTF_PRECISION_LIMIT ){
   276         -      width = SQLITE_PRINTF_PRECISION_LIMIT;
   277         -    }
   278         -#endif
   279    360   
   280         -    /* Get the precision */
   281         -    if( c=='.' ){
   282         -      c = *++fmt;
   283         -      if( c=='*' ){
   284         -        if( bArgList ){
   285         -          precision = (int)getIntArg(pArgList);
   286         -        }else{
   287         -          precision = va_arg(ap,int);
   288         -        }
   289         -        c = *++fmt;
   290         -        if( precision<0 ){
   291         -          precision = precision >= -2147483647 ? -precision : -1;
   292         -        }
   293         -      }else{
   294         -        unsigned px = 0;
   295         -        while( c>='0' && c<='9' ){
   296         -          px = px*10 + c - '0';
   297         -          c = *++fmt;
   298         -        }
   299         -        testcase( px>0x7fffffff );
   300         -        precision = px & 0x7fffffff;
   301         -      }
   302         -    }else{
   303         -      precision = -1;
   304         -    }
   305         -    assert( precision>=(-1) );
   306         -#ifdef SQLITE_PRINTF_PRECISION_LIMIT
   307         -    if( precision>SQLITE_PRINTF_PRECISION_LIMIT ){
   308         -      precision = SQLITE_PRINTF_PRECISION_LIMIT;
   309         -    }
   310         -#endif
   311         -
   312         -
   313         -    /* Get the conversion type modifier */
   314         -    if( c=='l' ){
   315         -      flag_long = 1;
   316         -      c = *++fmt;
   317         -      if( c=='l' ){
   318         -        flag_long = 2;
   319         -        c = *++fmt;
   320         -      }
   321         -    }else{
   322         -      flag_long = 0;
   323         -    }
   324    361       /* Fetch the info entry for the field */
   325    362       infop = &fmtinfo[0];
   326    363       xtype = etINVALID;
   327    364       for(idx=0; idx<ArraySize(fmtinfo); idx++){
   328    365         if( c==fmtinfo[idx].fmttype ){
   329    366           infop = &fmtinfo[idx];
   330    367           xtype = infop->type;
................................................................................
   401    438           if( flag_zeropad && precision<width-(prefix!=0) ){
   402    439             precision = width-(prefix!=0);
   403    440           }
   404    441           if( precision<etBUFSIZE-10-etBUFSIZE/3 ){
   405    442             nOut = etBUFSIZE;
   406    443             zOut = buf;
   407    444           }else{
   408         -          u64 n = (u64)precision + 10 + precision/3;
   409         -          zOut = zExtra = sqlite3Malloc( n );
   410         -          if( zOut==0 ){
   411         -            setStrAccumError(pAccum, SQLITE_NOMEM);
   412         -            return;
   413         -          }
          445  +          u64 n;
          446  +          n = (u64)precision + 10;
          447  +          if( cThousand ) n += precision/3;
          448  +          zOut = zExtra = printfTempBuf(pAccum, n);
          449  +          if( zOut==0 ) return;
   414    450             nOut = (int)n;
   415    451           }
   416    452           bufpt = &zOut[nOut-1];
   417    453           if( xtype==etORDINAL ){
   418    454             static const char zOrd[] = "thstndrd";
   419    455             int x = (int)(longvalue % 10);
   420    456             if( x>=4 || (longvalue/10)%10==1 ){
................................................................................
   525    561             flag_rtz = flag_altform2;
   526    562           }
   527    563           if( xtype==etEXP ){
   528    564             e2 = 0;
   529    565           }else{
   530    566             e2 = exp;
   531    567           }
   532         -        if( MAX(e2,0)+(i64)precision+(i64)width > etBUFSIZE - 15 ){
   533         -          bufpt = zExtra 
   534         -              = sqlite3Malloc( MAX(e2,0)+(i64)precision+(i64)width+15 );
   535         -          if( bufpt==0 ){
   536         -            setStrAccumError(pAccum, SQLITE_NOMEM);
   537         -            return;
          568  +        {
          569  +          i64 szBufNeeded;           /* Size of a temporary buffer needed */
          570  +          szBufNeeded = MAX(e2,0)+(i64)precision+(i64)width+15;
          571  +          if( szBufNeeded > etBUFSIZE ){
          572  +            bufpt = zExtra = printfTempBuf(pAccum, szBufNeeded);
          573  +            if( bufpt==0 ) return;
   538    574             }
   539    575           }
   540    576           zOut = bufpt;
   541    577           nsd = 16 + flag_altform2*10;
   542    578           flag_dp = (precision>0 ?1:0) | flag_alternateform | flag_altform2;
   543    579           /* The sign in front of the number */
   544    580           if( prefix ){
................................................................................
   754    790             if( flag_altform2 && (ch&0xc0)==0xc0 ){
   755    791               while( (escarg[i+1]&0xc0)==0x80 ){ i++; }
   756    792             }
   757    793           }
   758    794           needQuote = !isnull && xtype==etSQLESCAPE2;
   759    795           n += i + 3;
   760    796           if( n>etBUFSIZE ){
   761         -          bufpt = zExtra = sqlite3Malloc( n );
   762         -          if( bufpt==0 ){
   763         -            setStrAccumError(pAccum, SQLITE_NOMEM);
   764         -            return;
   765         -          }
          797  +          bufpt = zExtra = printfTempBuf(pAccum, n);
          798  +          if( bufpt==0 ) return;
   766    799           }else{
   767    800             bufpt = buf;
   768    801           }
   769    802           j = 0;
   770    803           if( needQuote ) bufpt[j++] = q;
   771    804           k = i;
   772    805           for(i=0; i<k; i++){

Changes to src/select.c.

  5739   5739        && (pTabList->nSrc==1
  5740   5740            || (pTabList->a[1].fg.jointype&(JT_LEFT|JT_CROSS))!=0)
  5741   5741       ){
  5742   5742         continue;
  5743   5743       }
  5744   5744   
  5745   5745       if( flattenSubquery(pParse, p, i, isAgg) ){
         5746  +      if( pParse->nErr ) goto select_end;
  5746   5747         /* This subquery can be absorbed into its parent. */
  5747   5748         i = -1;
  5748   5749       }
  5749   5750       pTabList = p->pSrc;
  5750   5751       if( db->mallocFailed ) goto select_end;
  5751   5752       if( !IgnorableOrderby(pDest) ){
  5752   5753         sSort.pOrderBy = p->pOrderBy;

Changes to src/shell.c.in.

  1024   1024     int mode;              /* An output mode setting */
  1025   1025     int modePrior;         /* Saved mode */
  1026   1026     int cMode;             /* temporary output mode for the current query */
  1027   1027     int normalMode;        /* Output mode before ".explain on" */
  1028   1028     int writableSchema;    /* True if PRAGMA writable_schema=ON */
  1029   1029     int showHeader;        /* True to show column names in List or Column mode */
  1030   1030     int nCheck;            /* Number of ".check" commands run */
         1031  +  unsigned nProgress;    /* Number of progress callbacks encountered */
         1032  +  unsigned mxProgress;   /* Maximum progress callbacks before failing */
         1033  +  unsigned flgProgress;  /* Flags for the progress callback */
  1031   1034     unsigned shellFlgs;    /* Various flags */
  1032   1035     sqlite3_int64 szMax;   /* --maxsize argument to .open */
  1033   1036     char *zDestTable;      /* Name of destination table when MODE_Insert */
  1034   1037     char *zTempFile;       /* Temporary file that might need deleting */
  1035   1038     char zTestcase[30];    /* Name of current test case */
  1036   1039     char colSeparator[20]; /* Column separator character for several modes */
  1037   1040     char rowSeparator[20]; /* Row separator character for MODE_Ascii */
................................................................................
  1078   1081   
  1079   1082   /* Allowed values for ShellState.eTraceType
  1080   1083   */
  1081   1084   #define SHELL_TRACE_PLAIN      0      /* Show input SQL text */
  1082   1085   #define SHELL_TRACE_EXPANDED   1      /* Show expanded SQL text */
  1083   1086   #define SHELL_TRACE_NORMALIZED 2      /* Show normalized SQL text */
  1084   1087   
         1088  +/* Bits in the ShellState.flgProgress variable */
         1089  +#define SHELL_PROGRESS_QUIET 0x01  /* Omit announcing every progress callback */
         1090  +#define SHELL_PROGRESS_RESET 0x02  /* Reset the count when the progres
         1091  +                                   ** callback limit is reached, and for each
         1092  +                                   ** top-level SQL statement */
         1093  +#define SHELL_PROGRESS_ONCE  0x04  /* Cancel the --limit after firing once */
         1094  +
  1085   1095   /*
  1086   1096   ** These are the allowed shellFlgs values
  1087   1097   */
  1088   1098   #define SHFLG_Pagecache      0x00000001 /* The --pagecache option is used */
  1089   1099   #define SHFLG_Lookaside      0x00000002 /* Lookaside memory is used */
  1090   1100   #define SHFLG_Backslash      0x00000004 /* The --backslash option is used */
  1091   1101   #define SHFLG_PreserveRowid  0x00000008 /* .dump preserves rowid values */
................................................................................
  1778   1788       }
  1779   1789       p->sGraph.zPrefix[0] = 0;
  1780   1790       eqp_render_level(p, 0);
  1781   1791       eqp_reset(p);
  1782   1792     }
  1783   1793   }
  1784   1794   
         1795  +#ifndef SQLITE_OMIT_PROGRESS_CALLBACK
         1796  +/*
         1797  +** Progress handler callback.
         1798  +*/
         1799  +static int progress_handler(void *pClientData) {
         1800  +  ShellState *p = (ShellState*)pClientData;
         1801  +  p->nProgress++;
         1802  +  if( p->nProgress>=p->mxProgress && p->mxProgress>0 ){
         1803  +    raw_printf(p->out, "Progress limit reached (%u)\n", p->nProgress);
         1804  +    if( p->flgProgress & SHELL_PROGRESS_RESET ) p->nProgress = 0;
         1805  +    if( p->flgProgress & SHELL_PROGRESS_ONCE ) p->mxProgress = 0;
         1806  +    return 1;
         1807  +  }
         1808  +  if( (p->flgProgress & SHELL_PROGRESS_QUIET)==0 ){
         1809  +    raw_printf(p->out, "Progress %u\n", p->nProgress);
         1810  +  }
         1811  +  return 0;
         1812  +}
         1813  +#endif /* SQLITE_OMIT_PROGRESS_CALLBACK */
         1814  +
  1785   1815   /*
  1786   1816   ** This is the callback routine that the shell
  1787   1817   ** invokes for each row of a query result.
  1788   1818   */
  1789   1819   static int shell_callback(
  1790   1820     void *pArg,
  1791   1821     int nArg,        /* Number of result columns */
................................................................................
  3464   3494   #endif
  3465   3495     "        --new           Initialize FILE to an empty database",
  3466   3496     "        --readonly      Open FILE readonly",
  3467   3497     "        --zip           FILE is a ZIP archive",
  3468   3498     ".output ?FILE?           Send output to FILE or stdout if FILE is omitted",
  3469   3499     "     If FILE begins with '|' then open it as a pipe.",
  3470   3500     ".print STRING...         Print literal STRING",
         3501  +#ifndef SQLITE_OMIT_PROGRESS_CALLBACK
         3502  +  ".progress N              Invoke progress handler after every N opcodes",
         3503  +  "   --limit N                 Interrupt after N progress callbacks",
         3504  +  "   --once                    Do no more than one progress interrupt",
         3505  +  "   --quiet|-q                No output except at interrupts",
         3506  +  "   --reset                   Reset the count for each input and interrupt",
         3507  +#endif
  3471   3508     ".prompt MAIN CONTINUE    Replace the standard prompts",
  3472   3509     ".quit                    Exit this program",
  3473   3510     ".read FILE               Read input from FILE",
  3474   3511     ".restore ?DB? FILE       Restore content of DB (default \"main\") from FILE",
  3475   3512     ".save FILE               Write in-memory database into FILE",
  3476   3513     ".scanstats on|off        Turn sqlite3_stmt_scanstatus() metrics on or off",
  3477   3514     ".schema ?PATTERN?        Show the CREATE statements matching PATTERN",
................................................................................
  6996   7033       for(i=1; i<nArg; i++){
  6997   7034         if( i>1 ) raw_printf(p->out, " ");
  6998   7035         utf8_printf(p->out, "%s", azArg[i]);
  6999   7036       }
  7000   7037       raw_printf(p->out, "\n");
  7001   7038     }else
  7002   7039   
         7040  +#ifndef SQLITE_OMIT_PROGRESS_CALLBACK
         7041  +  if( c=='p' && n>=3 && strncmp(azArg[0], "progress", n)==0 ){
         7042  +    int i;
         7043  +    int nn = 0;
         7044  +    p->flgProgress = 0;
         7045  +    p->mxProgress = 0;
         7046  +    p->nProgress = 0;
         7047  +    for(i=1; i<nArg; i++){
         7048  +      const char *z = azArg[i];
         7049  +      if( z[0]=='-' ){
         7050  +        z++;
         7051  +        if( z[0]=='-' ) z++;
         7052  +        if( strcmp(z,"quiet")==0 || strcmp(z,"q")==0 ){
         7053  +          p->flgProgress |= SHELL_PROGRESS_QUIET;
         7054  +          continue;
         7055  +        }
         7056  +        if( strcmp(z,"reset")==0 ){
         7057  +          p->flgProgress |= SHELL_PROGRESS_RESET;
         7058  +          continue;
         7059  +        }
         7060  +        if( strcmp(z,"once")==0 ){
         7061  +          p->flgProgress |= SHELL_PROGRESS_ONCE;
         7062  +          continue;
         7063  +        }
         7064  +        if( strcmp(z,"limit")==0 ){
         7065  +          if( i+1>=nArg ){
         7066  +            utf8_printf(stderr, "Error: missing argument on --limit\n");
         7067  +            rc = 1;
         7068  +            goto meta_command_exit;
         7069  +          }else{
         7070  +            p->mxProgress = (int)integerValue(azArg[++i]);
         7071  +          }
         7072  +          continue;
         7073  +        }
         7074  +        utf8_printf(stderr, "Error: unknown option: \"%s\"\n", azArg[i]);
         7075  +        rc = 1;
         7076  +        goto meta_command_exit;
         7077  +      }else{
         7078  +        nn = (int)integerValue(z);
         7079  +      }
         7080  +    }
         7081  +    open_db(p, 0);
         7082  +    sqlite3_progress_handler(p->db, nn, progress_handler, p);
         7083  +  }else
         7084  +#endif /* SQLITE_OMIT_PROGRESS_CALLBACK */
         7085  +
  7003   7086     if( c=='p' && strncmp(azArg[0], "prompt", n)==0 ){
  7004   7087       if( nArg >= 2) {
  7005   7088         strncpy(mainPrompt,azArg[1],(int)ArraySize(mainPrompt)-1);
  7006   7089       }
  7007   7090       if( nArg >= 3) {
  7008   7091         strncpy(continuePrompt,azArg[2],(int)ArraySize(continuePrompt)-1);
  7009   7092       }
................................................................................
  8331   8414   */
  8332   8415   static int runOneSqlLine(ShellState *p, char *zSql, FILE *in, int startline){
  8333   8416     int rc;
  8334   8417     char *zErrMsg = 0;
  8335   8418   
  8336   8419     open_db(p, 0);
  8337   8420     if( ShellHasFlag(p,SHFLG_Backslash) ) resolve_backslashes(zSql);
         8421  +  if( p->flgProgress & SHELL_PROGRESS_RESET ) p->nProgress = 0;
  8338   8422     BEGIN_TIMER;
  8339   8423     rc = shell_exec(p, zSql, &zErrMsg);
  8340   8424     END_TIMER;
  8341   8425     if( rc || zErrMsg ){
  8342   8426       char zPrefix[100];
  8343   8427       if( in!=0 || !stdin_is_interactive ){
  8344   8428         sqlite3_snprintf(sizeof(zPrefix), zPrefix,
................................................................................
  8593   8677     "   -interactive         force interactive I/O\n"
  8594   8678     "   -line                set output mode to 'line'\n"
  8595   8679     "   -list                set output mode to 'list'\n"
  8596   8680     "   -lookaside SIZE N    use N entries of SZ bytes for lookaside memory\n"
  8597   8681   #if defined(SQLITE_ENABLE_DESERIALIZE)
  8598   8682     "   -maxsize N           maximum size for a --deserialize database\n"
  8599   8683   #endif
         8684  +  "   -memtrace            trace all memory allocations and deallocations\n"
  8600   8685     "   -mmap N              default mmap size set to N\n"
  8601   8686   #ifdef SQLITE_ENABLE_MULTIPLEX
  8602   8687     "   -multiplex           enable the multiplexor VFS\n"
  8603   8688   #endif
  8604   8689     "   -newline SEP         set output row separator. Default: '\\n'\n"
  8605   8690     "   -nullvalue TEXT      set text string for NULL values. Default ''\n"
  8606   8691     "   -pagecache SIZE N    use N slots of SZ bytes each for page cache memory\n"

Changes to src/sqlite.h.in.

  1979   1979   ** than the configured sorter-reference size threshold - then a reference
  1980   1980   ** is stored in each sorted record and the required column values loaded
  1981   1981   ** from the database as records are returned in sorted order. The default
  1982   1982   ** value for this option is to never use this optimization. Specifying a 
  1983   1983   ** negative value for this option restores the default behaviour.
  1984   1984   ** This option is only available if SQLite is compiled with the
  1985   1985   ** [SQLITE_ENABLE_SORTER_REFERENCES] compile-time option.
         1986  +**
         1987  +** [[SQLITE_CONFIG_MEMDB_MAXSIZE]]
         1988  +** <dt>SQLITE_CONFIG_MEMDB_MAXSIZE
         1989  +** <dd>The SQLITE_CONFIG_MEMDB_MAXSIZE option accepts a single parameter
         1990  +** [sqlite3_int64] parameter which is the default maximum size for an in-memory
         1991  +** database created using [sqlite3_deserialize()].  This default maximum
         1992  +** size can be adjusted up or down for individual databases using the
         1993  +** [SQLITE_FCNTL_SIZE_LIMIT] [sqlite3_file_control|file-control].  If this
         1994  +** configuration setting is never used, then the default maximum is determined
         1995  +** by the [SQLITE_MEMDB_DEFAULT_MAXSIZE] compile-time option.  If that
         1996  +** compile-time option is not set, then the default maximum is 1073741824.
  1986   1997   ** </dl>
  1987   1998   */
  1988   1999   #define SQLITE_CONFIG_SINGLETHREAD  1  /* nil */
  1989   2000   #define SQLITE_CONFIG_MULTITHREAD   2  /* nil */
  1990   2001   #define SQLITE_CONFIG_SERIALIZED    3  /* nil */
  1991   2002   #define SQLITE_CONFIG_MALLOC        4  /* sqlite3_mem_methods* */
  1992   2003   #define SQLITE_CONFIG_GETMALLOC     5  /* sqlite3_mem_methods* */
................................................................................
  2009   2020   #define SQLITE_CONFIG_MMAP_SIZE    22  /* sqlite3_int64, sqlite3_int64 */
  2010   2021   #define SQLITE_CONFIG_WIN32_HEAPSIZE      23  /* int nByte */
  2011   2022   #define SQLITE_CONFIG_PCACHE_HDRSZ        24  /* int *psz */
  2012   2023   #define SQLITE_CONFIG_PMASZ               25  /* unsigned int szPma */
  2013   2024   #define SQLITE_CONFIG_STMTJRNL_SPILL      26  /* int nByte */
  2014   2025   #define SQLITE_CONFIG_SMALL_MALLOC        27  /* boolean */
  2015   2026   #define SQLITE_CONFIG_SORTERREF_SIZE      28  /* int nByte */
         2027  +#define SQLITE_CONFIG_MEMDB_MAXSIZE       29  /* sqlite3_int64 */
  2016   2028   
  2017   2029   /*
  2018   2030   ** CAPI3REF: Database Connection Configuration Options
  2019   2031   **
  2020   2032   ** These constants are the available integer configuration options that
  2021   2033   ** can be passed as the second argument to the [sqlite3_db_config()] interface.
  2022   2034   **
................................................................................
  3414   3426   ** zero is returned.
  3415   3427   ** 
  3416   3428   ** If F is a NULL pointer, then sqlite3_uri_parameter(F,P) returns NULL and
  3417   3429   ** sqlite3_uri_boolean(F,P,B) returns B.  If F is not a NULL pointer and
  3418   3430   ** is not a database file pathname pointer that SQLite passed into the xOpen
  3419   3431   ** VFS method, then the behavior of this routine is undefined and probably
  3420   3432   ** undesirable.
         3433  +**
         3434  +** See the [URI filename] documentation for additional information.
  3421   3435   */
  3422   3436   const char *sqlite3_uri_parameter(const char *zFilename, const char *zParam);
  3423   3437   int sqlite3_uri_boolean(const char *zFile, const char *zParam, int bDefault);
  3424   3438   sqlite3_int64 sqlite3_uri_int64(const char*, const char*, sqlite3_int64);
  3425   3439   
  3426   3440   
  3427   3441   /*

Changes to src/sqliteInt.h.

  1567   1567   #define HI(X)  ((u64)(X)<<32)
  1568   1568   #ifdef SQLITE_DEBUG
  1569   1569   #define SQLITE_SqlTrace       HI(0x0001)  /* Debug print SQL as it executes */
  1570   1570   #define SQLITE_VdbeListing    HI(0x0002)  /* Debug listings of VDBE progs */
  1571   1571   #define SQLITE_VdbeTrace      HI(0x0004)  /* True to trace VDBE execution */
  1572   1572   #define SQLITE_VdbeAddopTrace HI(0x0008)  /* Trace sqlite3VdbeAddOp() calls */
  1573   1573   #define SQLITE_VdbeEQP        HI(0x0010)  /* Debug EXPLAIN QUERY PLAN */
         1574  +#define SQLITE_ParserTrace    HI(0x0020)  /* PRAGMA parser_trace=ON */
  1574   1575   #endif
  1575   1576   
  1576   1577   /*
  1577   1578   ** Allowed values for sqlite3.mDbFlags
  1578   1579   */
  1579   1580   #define DBFLAG_SchemaChange   0x0001  /* Uncommitted Hash table changes */
  1580   1581   #define DBFLAG_PreferBuiltin  0x0002  /* Preference to built-in funcs */
................................................................................
  3439   3440   #ifdef SQLITE_VDBE_COVERAGE
  3440   3441     /* The following callback (if not NULL) is invoked on every VDBE branch
  3441   3442     ** operation.  Set the callback using SQLITE_TESTCTRL_VDBE_COVERAGE.
  3442   3443     */
  3443   3444     void (*xVdbeBranch)(void*,unsigned iSrcLine,u8 eThis,u8 eMx);  /* Callback */
  3444   3445     void *pVdbeBranchArg;                                     /* 1st argument */
  3445   3446   #endif
         3447  +#ifdef SQLITE_ENABLE_DESERIALIZE
         3448  +  sqlite3_int64 mxMemdbSize;        /* Default max memdb size */
         3449  +#endif
  3446   3450   #ifndef SQLITE_UNTESTABLE
  3447   3451     int (*xTestCallback)(int);        /* Invoked by sqlite3FaultSim() */
  3448   3452   #endif
  3449   3453     int bLocaltimeFault;              /* True to fail localtime() calls */
  3450   3454     int bInternalFunctions;           /* Internal SQL functions are visible */
  3451   3455     int iOnceResetThreshold;          /* When to reset OP_Once counters */
  3452   3456     u32 szSorterRef;                  /* Min size in bytes to use sorter-refs */
................................................................................
  3856   3860   ExprList *sqlite3ExprListAppend(Parse*,ExprList*,Expr*);
  3857   3861   ExprList *sqlite3ExprListAppendVector(Parse*,ExprList*,IdList*,Expr*);
  3858   3862   void sqlite3ExprListSetSortOrder(ExprList*,int);
  3859   3863   void sqlite3ExprListSetName(Parse*,ExprList*,Token*,int);
  3860   3864   void sqlite3ExprListSetSpan(Parse*,ExprList*,const char*,const char*);
  3861   3865   void sqlite3ExprListDelete(sqlite3*, ExprList*);
  3862   3866   u32 sqlite3ExprListFlags(const ExprList*);
         3867  +int sqlite3IndexHasDuplicateRootPage(Index*);
  3863   3868   int sqlite3Init(sqlite3*, char**);
  3864   3869   int sqlite3InitCallback(void*, int, char**, char**);
  3865   3870   int sqlite3InitOne(sqlite3*, int, char**, u32);
  3866   3871   void sqlite3Pragma(Parse*,Token*,Token*,Token*,int);
  3867   3872   #ifndef SQLITE_OMIT_VIRTUALTABLE
  3868   3873   Module *sqlite3PragmaVtabRegister(sqlite3*,const char *zName);
  3869   3874   #endif
................................................................................
  3889   3894   void sqlite3AddPrimaryKey(Parse*, ExprList*, int, int, int);
  3890   3895   void sqlite3AddCheckConstraint(Parse*, Expr*);
  3891   3896   void sqlite3AddDefaultValue(Parse*,Expr*,const char*,const char*);
  3892   3897   void sqlite3AddCollateType(Parse*, Token*);
  3893   3898   void sqlite3EndTable(Parse*,Token*,Token*,u8,Select*);
  3894   3899   int sqlite3ParseUri(const char*,const char*,unsigned int*,
  3895   3900                       sqlite3_vfs**,char**,char **);
         3901  +#ifdef SQLITE_HAS_CODEC
         3902  +  int sqlite3CodecQueryParameters(sqlite3*,const char*,const char*);
         3903  +#else
         3904  +# define sqlite3CodecQueryParameters(A,B,C) 0
         3905  +#endif
  3896   3906   Btree *sqlite3DbNameToBtree(sqlite3*,const char*);
  3897   3907   
  3898   3908   #ifdef SQLITE_UNTESTABLE
  3899   3909   # define sqlite3FaultSim(X) SQLITE_OK
  3900   3910   #else
  3901   3911     int sqlite3FaultSim(int);
  3902   3912   #endif

Changes to src/test1.c.

  7328   7328     extern int sqlite3_eval_init(sqlite3*,char**,const sqlite3_api_routines*);
  7329   7329     extern int sqlite3_explain_init(sqlite3*,char**,const sqlite3_api_routines*);
  7330   7330     extern int sqlite3_fileio_init(sqlite3*,char**,const sqlite3_api_routines*);
  7331   7331     extern int sqlite3_fuzzer_init(sqlite3*,char**,const sqlite3_api_routines*);
  7332   7332     extern int sqlite3_ieee_init(sqlite3*,char**,const sqlite3_api_routines*);
  7333   7333     extern int sqlite3_nextchar_init(sqlite3*,char**,const sqlite3_api_routines*);
  7334   7334     extern int sqlite3_percentile_init(sqlite3*,char**,const sqlite3_api_routines*);
         7335  +#ifndef SQLITE_OMIT_VIRTUALTABLE
  7335   7336     extern int sqlite3_prefixes_init(sqlite3*,char**,const sqlite3_api_routines*);
         7337  +#endif
  7336   7338     extern int sqlite3_regexp_init(sqlite3*,char**,const sqlite3_api_routines*);
  7337   7339     extern int sqlite3_remember_init(sqlite3*,char**,const sqlite3_api_routines*);
  7338   7340     extern int sqlite3_series_init(sqlite3*,char**,const sqlite3_api_routines*);
  7339   7341     extern int sqlite3_spellfix_init(sqlite3*,char**,const sqlite3_api_routines*);
  7340   7342     extern int sqlite3_totype_init(sqlite3*,char**,const sqlite3_api_routines*);
  7341   7343     extern int sqlite3_wholenumber_init(sqlite3*,char**,const sqlite3_api_routines*);
  7342   7344     extern int sqlite3_unionvtab_init(sqlite3*,char**,const sqlite3_api_routines*);
................................................................................
  7354   7356       { "eval",                  sqlite3_eval_init                 },
  7355   7357       { "explain",               sqlite3_explain_init              },
  7356   7358       { "fileio",                sqlite3_fileio_init               },
  7357   7359       { "fuzzer",                sqlite3_fuzzer_init               },
  7358   7360       { "ieee754",               sqlite3_ieee_init                 },
  7359   7361       { "nextchar",              sqlite3_nextchar_init             },
  7360   7362       { "percentile",            sqlite3_percentile_init           },
         7363  +#ifndef SQLITE_OMIT_VIRTUALTABLE
  7361   7364       { "prefixes",              sqlite3_prefixes_init             },
         7365  +#endif
  7362   7366       { "regexp",                sqlite3_regexp_init               },
  7363   7367       { "remember",              sqlite3_remember_init             },
  7364   7368       { "series",                sqlite3_series_init               },
  7365   7369       { "spellfix",              sqlite3_spellfix_init             },
  7366   7370       { "totype",                sqlite3_totype_init               },
  7367   7371       { "unionvtab",             sqlite3_unionvtab_init            },
  7368   7372       { "wholenumber",           sqlite3_wholenumber_init          },

Changes to src/test_journal.c.

   556    556       }else{
   557    557         u32 pgno = (u32)(iOfst/p->nPagesize + 1);
   558    558         assert( (iAmt==1||iAmt==(int)p->nPagesize) &&
   559    559                 ((iOfst+iAmt)%p->nPagesize)==0 );
   560    560         /* The following assert() statements may fail if this layer is used
   561    561         ** with a connection in "PRAGMA synchronous=off" mode. If they
   562    562         ** fail with sync=normal or sync=full, this may indicate problem.  */
   563         -      assert( pgno<=p->nPage || p->nSync>0 );
          563  +      assert( p->nPage==0 || pgno<=p->nPage || p->nSync>0 );
   564    564         assert( pgno>p->nPage || sqlite3BitvecTest(p->pWritable, pgno) );
   565    565       }
   566    566     }
   567    567   
   568    568     rc = sqlite3OsWrite(p->pReal, zBuf, iAmt, iOfst);
   569    569     if( (p->flags&SQLITE_OPEN_MAIN_JOURNAL) && iAmt==12 ){
   570    570       jt_file *pMain = locateDatabaseHandle(p->zName, 0);

Changes to src/tokenize.c.

   568    568     mxSqlLen = db->aLimit[SQLITE_LIMIT_SQL_LENGTH];
   569    569     if( db->nVdbeActive==0 ){
   570    570       db->u1.isInterrupted = 0;
   571    571     }
   572    572     pParse->rc = SQLITE_OK;
   573    573     pParse->zTail = zSql;
   574    574     assert( pzErrMsg!=0 );
   575         -  /* sqlite3ParserTrace(stdout, "parser: "); */
          575  +#ifdef SQLITE_DEBUG
          576  +  if( db->flags & SQLITE_ParserTrace ){
          577  +    printf("parser: [[[%s]]]\n", zSql);
          578  +    sqlite3ParserTrace(stdout, "parser: ");
          579  +  }else{
          580  +    sqlite3ParserTrace(0, 0);
          581  +  }
          582  +#endif
   576    583   #ifdef sqlite3Parser_ENGINEALWAYSONSTACK
   577    584     pEngine = &sEngine;
   578    585     sqlite3ParserInit(pEngine, pParse);
   579    586   #else
   580    587     pEngine = sqlite3ParserAlloc(sqlite3Malloc, pParse);
   581    588     if( pEngine==0 ){
   582    589       sqlite3OomFault(db);
................................................................................
   736    743     Vdbe *pVdbe,       /* VM being reprepared */
   737    744     const char *zSql   /* The original SQL string */
   738    745   ){
   739    746     sqlite3 *db;       /* The database connection */
   740    747     int i;             /* Next unread byte of zSql[] */
   741    748     int n;             /* length of current token */
   742    749     int tokenType;     /* type of current token */
   743         -  int prevType;      /* Previous non-whitespace token */
          750  +  int prevType = 0;  /* Previous non-whitespace token */
   744    751     int nParen;        /* Number of nested levels of parentheses */
   745    752     int iStartIN;      /* Start of RHS of IN operator in z[] */
   746    753     int nParenAtIN;    /* Value of nParent at start of RHS of IN operator */
   747    754     int j;             /* Bytes of normalized SQL generated so far */
   748    755     sqlite3_str *pStr; /* The normalized SQL string under construction */
   749    756   
   750    757     db = sqlite3VdbeDb(pVdbe);

Changes to src/vdbemem.c.

  1120   1120     BtCursor *pCur,   /* Cursor pointing at record to retrieve. */
  1121   1121     u32 offset,       /* Offset from the start of data to return bytes from. */
  1122   1122     u32 amt,          /* Number of bytes to return. */
  1123   1123     Mem *pMem         /* OUT: Return data in this Mem structure. */
  1124   1124   ){
  1125   1125     int rc;
  1126   1126     pMem->flags = MEM_Null;
         1127  +  if( sqlite3BtreeMaxRecordSize(pCur)<offset+amt ){
         1128  +    return SQLITE_CORRUPT_BKPT;
         1129  +  }
  1127   1130     if( SQLITE_OK==(rc = sqlite3VdbeMemClearAndResize(pMem, amt+1)) ){
  1128   1131       rc = sqlite3BtreePayload(pCur, offset, amt, pMem->z);
  1129   1132       if( rc==SQLITE_OK ){
  1130   1133         pMem->z[amt] = 0;   /* Overrun area used when reading malformed records */
  1131   1134         pMem->flags = MEM_Blob;
  1132   1135         pMem->n = (int)amt;
  1133   1136       }else{

Changes to src/vtab.c.

   997    997     if( db->aVTrans ){
   998    998       int i;
   999    999       for(i=0; rc==SQLITE_OK && i<db->nVTrans; i++){
  1000   1000         VTable *pVTab = db->aVTrans[i];
  1001   1001         const sqlite3_module *pMod = pVTab->pMod->pModule;
  1002   1002         if( pVTab->pVtab && pMod->iVersion>=2 ){
  1003   1003           int (*xMethod)(sqlite3_vtab *, int);
         1004  +        sqlite3VtabLock(pVTab);
  1004   1005           switch( op ){
  1005   1006             case SAVEPOINT_BEGIN:
  1006   1007               xMethod = pMod->xSavepoint;
  1007   1008               pVTab->iSavepoint = iSavepoint+1;
  1008   1009               break;
  1009   1010             case SAVEPOINT_ROLLBACK:
  1010   1011               xMethod = pMod->xRollbackTo;
................................................................................
  1012   1013             default:
  1013   1014               xMethod = pMod->xRelease;
  1014   1015               break;
  1015   1016           }
  1016   1017           if( xMethod && pVTab->iSavepoint>iSavepoint ){
  1017   1018             rc = xMethod(pVTab->pVtab, iSavepoint);
  1018   1019           }
         1020  +        sqlite3VtabUnlock(pVTab);
  1019   1021         }
  1020   1022       }
  1021   1023     }
  1022   1024     return rc;
  1023   1025   }
  1024   1026   
  1025   1027   /*

Changes to test/corruptL.test.

   574    574     DROP INDEX t1x2;
   575    575   } {0 {}}
   576    576   
   577    577   do_catchsql_test 5.3 {
   578    578     INSERT INTO t1(b) VALUES(zeroblob(40000));
   579    579   } {1 {database disk image is malformed}}
   580    580   
          581  +#-------------------------------------------------------------------------
          582  +reset_db
          583  +do_test 6.0 {
          584  +  sqlite3 db {}
          585  +  db deserialize [decode_hexdb {
          586  +| size 20480 pagesize 4096 filename crash-d260f001fa015c.db
          587  +| page 1 offset 0
          588  +|      0: 53 51 4c 69 74 65 20 66 6f 72 6d 61 74 20 33 00   SQLite format 3.
          589  +|     16: 10 00 01 01 00 40 20 20 00 00 00 00 00 00 00 05   .....@  ........
          590  +|     32: 00 00 00 00 00 ff ff f0 00 00 00 02 00 00 00 04   ................
          591  +|     48: 00 00 00 00 00 00 00 64 00 00 00 01 00 00 00 00   .......d........
          592  +|     96: 00 00 00 00 0d 0f f8 00 04 0e ce 00 0f 4c 0f d3   .............L..
          593  +|    112: 0e fa 0e ce 00 00 00 00 00 00 00 00 00 00 00 00   ................
          594  +|   3776: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 2a 04   ..............*.
          595  +|   3792: 06 17 13 11 01 3f 69 6e 64 65 78 74 31 62 74 31   .....?indext1bt1
          596  +|   3808: 05 43 52 45 41 54 45 20 49 4e 44 45 58 20 74 31   .CREATE INDEX t1
          597  +|   3824: 62 20 4f 4e 20 74 31 28 62 29 50 03 06 17 2b 2b   b ON t1(b)P...++
          598  +|   3840: 01 59 74 61 62 6c 65 73 71 6c 69 74 65 5f 73 65   .Ytablesqlite_se
          599  +|   3856: 71 75 65 6e 63 65 73 71 6c 69 74 65 5f 73 65 71   quencesqlite_seq
          600  +|   3872: 75 65 6e 63 65 04 43 52 45 41 54 45 20 54 41 42   uence.CREATE TAB
          601  +|   3888: 4c 45 20 73 71 6c 69 74 65 5f 73 65 71 75 65 6e   LE sqlite_sequen
          602  +|   3904: 63 65 28 6e 61 6d 65 2c 73 65 71 29 81 04 01 07   ce(name,seq)....
          603  +|   3920: 17 11 11 01 81 73 74 61 c2 6c 65 74 31 74 31 02   .....sta.let1t1.
          604  +|   3936: 43 52 45 41 54 45 20 54 41 42 4c 45 20 74 31 28   CREATE TABLE t1(
          605  +|   3952: 61 20 52 45 41 4c 20 4e 4f 54 20 4e 55 4c 4c 20   a REAL NOT NULL 
          606  +|   3968: 44 45 46 41 55 4c 54 28 32 35 2b 33 32 29 2c 62   DEFAULT(25+32),b
          607  +|   3984: 20 46 4c 4f 41 54 2c 63 20 44 4f 55 42 4c 45 20    FLOAT,c DOUBLE 
          608  +|   4000: 55 4e 49 51 55 45 2c 0a 64 20 43 4c 4f 42 2c 65   UNIQUE,.d CLOB,e
          609  +|   4016: 20 49 4e 54 45 47 45 52 20 50 52 49 4d 41 52 59    INTEGER PRIMARY
          610  +|   4032: 20 4b 45 59 20 41 55 54 4f 49 4e 43 52 45 4d 45    KEY AUTOINCREME
          611  +|   4048: 4e 54 29 23 02 06 17 37 11 01 00 69 6e 64 65 78   NT)#...7...index
          612  +|   4064: 73 71 6c 69 74 65 5f 61 75 74 6f 69 6e 64 65 78   sqlite_autoindex
          613  +|   4080: 5f 74 31 5f 31 74 31 05 00 00 00 08 00 00 00 00   _t1_1t1.........
          614  +| page 2 offset 4096
          615  +|      0: 0d 00 00 00 00 10 00 00 00 00 00 00 00 00 00 00   ................
          616  +| page 3 offset 8192
          617  +|      0: 0a 00 00 00 00 10 00 00 00 00 00 00 00 00 00 00   ................
          618  +| page 4 offset 12288
          619  +|      0: 0d 00 00 00 00 10 00 00 00 00 00 00 00 00 00 00   ................
          620  +| page 5 offset 16384
          621  +|      0: 0a 00 00 00 00 10 00 00 00 00 00 00 00 00 00 00   ................
          622  +| end crash-d260f001fa015c.db
          623  +}]} {}
          624  +
          625  +do_catchsql_test 6.1 {
          626  +  BEGIN;
          627  +    INSERT INTO t1(b) VALUES(1);
          628  +    INSERT INTO t1(b) VALUES(2);
          629  +  COMMIT;
          630  +} {1 {malformed database schema (t1b) - invalid rootpage}}
          631  +
          632  +#-------------------------------------------------------------------------
          633  +reset_db
          634  +do_test 7.0 {
          635  +  sqlite3 db {}
          636  +  db deserialize [decode_hexdb {
          637  +| size 20480 pagesize 4096 filename crash-8391315d75edff.db
          638  +| page 1 offset 0
          639  +|      0: 53 51 4c 69 74 65 20 66 6f 72 6d 61 74 20 33 00   SQLite format 3.
          640  +|     16: 10 00 01 01 00 40 20 20 00 00 00 00 00 00 00 05   .....@  ........
          641  +|     32: 00 00 00 00 00 00 00 00 00 00 00 05 00 00 00 04   ................
          642  +|     48: 00 00 00 00 00 00 00 00 00 00 00 01 00 00 00 00   ................
          643  +|     96: 00 00 00 00 0d 00 00 00 05 0e 55 00 0f 74 0f 3c   ..........U..t.<
          644  +|    112: 0e f9 0e d1 0e 55 00 00 00 00 00 00 00 00 00 00   .....U..........
          645  +|   3664: 00 00 00 00 00 7a 05 07 15 11 11 08 81 63 76 69   .....z.......cvi
          646  +|   3680: 65 77 76 31 76 31 43 52 45 41 54 45 20 56 49 45   ewv1v1CREATE VIE
          647  +|   3696: 57 20 76 31 28 78 2c 69 29 20 41 53 0a 53 45 4c   W v1(x,i) AS.SEL
          648  +|   3712: 45 43 54 20 74 31 2e 62 2c 74 32 2e 62 20 46 52   ECT t1.b,t2.b FR
          649  +|   3728: 4f 4d 20 74 31 2c 74 32 20 57 48 45 52 45 20 74   OM t1,t2 WHERE t
          650  +|   3744: 31 2e 61 3d 74 32 2e 61 20 47 52 4f 55 50 20 42   1.a=t2.a GROUP B
          651  +|   3760: 59 20 31 20 48 41 56 49 4e 47 20 74 32 2e 63 20   Y 1 HAVING t2.c 
          652  +|   3776: 4e 4f 54 20 4e 55 4c 4c 0a 4c 49 4d 49 54 20 31   NOT NULL.LIMIT 1
          653  +|   3792: 30 26 04 06 17 11 11 01 39 74 61 62 6c 65 74 32   0&......9tablet2
          654  +|   3808: 74 32 05 43 52 45 41 54 45 20 54 41 42 4c 45 20   t2.CREATE TABLE 
          655  +|   3824: 74 32 28 61 2c 62 2c 63 29 41 03 06 17 15 11 01   t2(a,b,c)A......
          656  +|   3840: 6b 69 6e 64 65 78 74 31 78 31 74 31 03 43 52 45   kindext1x1t1.CRE
          657  +|   3856: 41 54 45 20 49 4e 44 45 58 20 74 31 78 31 20 4f   ATE INDEX t1x1 O
          658  +|   3872: 4e 20 74 31 28 64 29 20 57 48 45 52 45 20 65 65   N t1(d) WHERE ee
          659  +|   3888: 20 49 53 20 4e 4f 54 20 4e 55 4c 4c 36 02 06 17    IS NOT NULL6...
          660  +|   3904: 17 11 01 53 69 6e 64 65 78 74 31 61 62 63 74 31   ...Sindext1abct1
          661  +|   3920: 03 43 52 45 41 54 45 20 49 4e 44 45 58 20 74 31   .CREATE INDEX t1
          662  +|   3936: 61 62 63 20 4f 4e 20 74 31 28 61 2c 62 2c 63 2b   abc ON t1(a,b,c+
          663  +|   3952: 64 2b 65 29 81 09 01 07 17 11 11 01 81 7d 74 61   d+e)..........ta
          664  +|   3968: 62 6c 65 74 31 74 31 02 43 52 45 41 54 45 20 54   blet1t1.CREATE T
          665  +|   3984: 41 42 4c 45 20 74 31 28 61 2c 62 2c 63 2c 64 2c   ABLE t1(a,b,c,d,
          666  +|   4000: 65 2c 66 2c 67 2c 68 2c 6a 2c 6a 6a 2c 6a 6a 6a   e,f,g,h,j,jj,jjj
          667  +|   4016: 2c 6b 2c 61 61 2c 62 69 8c 63 63 2c 64 64 2c 65   ,k,aa,bi.cc,dd,e
          668  +|   4032: 65 20 44 45 46 41 55 4c 54 20 33 2e 31 34 2c 0a   e DEFAULT 3.14,.
          669  +|   4048: 66 66 20 44 45 46 41 55 4c 54 28 27 68 69 63 63   ff DEFAULT('hicc
          670  +|   4064: 75 70 27 29 2c 67 67 20 4e 4f 54 20 4e 55 4c 4c   up'),gg NOT NULL
          671  +|   4080: 20 44 45 46 41 55 4c 54 28 66 61 6c 73 65 29 29    DEFAULT(false))
          672  +| page 2 offset 4096
          673  +|      0: 0d 00 00 00 0a 0e 7b 00 0f dc 0f b6 0f 8f 0f 68   ...............h
          674  +|     16: 0f 41 0f 1a 0e f3 0e cb 0e a3 0e 22 00 00 00 00   .A..............
          675  +|   3696: 00 00 00 00 00 00 00 00 00 00 00 26 0a 14 01 01   ...........&....
          676  +|   3712: 02 08 00 00 00 00 00 00 00 00 00 00 00 00 07 19   ................
          677  +|   3728: 08 09 5a 00 b4 40 09 1e b8 51 eb 95 1f 68 69 63   ..Z..@...Q...hic
          678  +|   3744: 63 75 70 26 09 14 01 01 02 08 00 00 00 00 00 00   cup&............
          679  +|   3760: 00 00 00 00 00 00 07 19 08 08 50 00 a0 40 09 1e   ..........P..@..
          680  +|   3776: b8 51 eb 85 1f 68 69 63 63 74 70 26 08 14 01 01   .Q...hicctp&....
          681  +|   3792: 03 08 00 00 00 00 00 00 00 00 00 00 00 00 07 19   ................
          682  +|   3808: 08 07 46 00 8c 40 09 1e b8 51 eb 85 1f 68 69 63   ..F..@...Q...hic
          683  +|   3824: 63 75 70 25 07 14 01 01 01 08 00 00 00 00 00 00   cup%............
          684  +|   3840: 00 00 00 00 00 10 07 19 08 06 3c 78 40 09 1e b8   ..........<x@...
          685  +|   3856: 51 eb 85 1f 68 69 63 63 75 70 25 06 14 01 01 01   Q...hiccup%.....
          686  +|   3872: 08 00 00 00 00 00 00 00 00 00 00 00 00 07 19 08   ................
          687  +|   3888: 05 32 64 40 09 1e b8 51 eb 85 1f 68 69 63 63 75   .2d@...Q...hiccu
          688  +|   3904: 70 25 05 14 01 01 01 08 00 00 00 00 00 00 00 00   p%..............
          689  +|   3920: 00 00 00 00 07 19 08 04 28 50 40 09 1e b8 51 eb   ........(P@...Q.
          690  +|   3936: 85 1f 68 69 63 63 75 70 25 04 14 01 00 f1 08 00   ..hiccup%.......
          691  +|   3952: 00 00 00 00 00 00 00 00 00 00 00 07 19 08 03 1e   ................
          692  +|   3968: 3c 40 09 1e b8 51 eb 85 1f 68 69 63 63 75 70 25   <@...Q...hiccup%
          693  +|   3984: 03 14 01 01 01 08 00 00 00 00 00 00 00 00 00 00   ................
          694  +|   4000: 00 00 07 19 08 02 14 28 40 09 1e b8 51 eb 85 1f   .......(@...Q...
          695  +|   4016: 68 69 63 63 75 70 24 02 14 09 01 01 08 00 00 00   hiccup$.........
          696  +|   4032: 00 00 00 00 00 00 00 00 00 07 19 08 0a 14 40 09   ..............@.
          697  +|   4048: 1e b8 51 eb 85 1f 68 69 63 63 75 70 22 01 14 08   ..Q...hiccup....
          698  +|   4064: 08 08 08 00 00 00 00 00 00 00 00 00 00 00 00 07   ................
          699  +|   4080: 19 08 40 09 1e b8 51 eb 85 1f 68 69 63 63 75 70   ..@...Q...hiccup
          700  +| page 3 offset 8192
          701  +|      0: 0a 00 00 00 0a 0f aa 00 0f fa 0f f2 0f e9 0f e0   ................
          702  +|     16: 0f d7 0f ce 0f c5 0f bc 0f b3 0f aa 00 00 00 00   ................
          703  +|   4000: 00 00 00 00 00 00 00 00 00 00 08 05 01 01 00 01   ................
          704  +|   4016: 09 5a 0a d8 05 01 01 00 01 08 50 09 08 05 01 01   .Z........P.....
          705  +|   4032: 00 01 07 46 08 08 05 01 01 00 01 06 3c 07 08 05   ...F........<...
          706  +|   4048: 01 01 00 01 05 32 06 08 05 01 01 00 01 04 28 05   .....2........(.
          707  +|   4064: 08 05 01 02 60 01 03 1e 04 08 05 01 01 00 01 02   ....`...........
          708  +|   4080: 14 03 07 05 09 01 00 01 0a 02 05 05 08 08 00 09   ................
          709  +| page 4 offset 12288
          710  +|      0: 0a 00 00 00 0a 0f cf 00 0f fc 0f f7 0f f2 0f ed   ................
          711  +|     16: 0f e8 0f e3 0f de 0f d9 0f d4 0f cf 00 00 00 00   ................
          712  +|   4032: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 04   ................
          713  +|   4048: 03 08 01 0a 04 03 08 01 09 04 03 08 01 08 04 03   ................
          714  +|   4064: 08 01 07 04 03 08 01 06 04 03 08 01 05 04 03 08   ................
          715  +|   4080: 01 04 04 03 08 01 03 04 03 08 01 02 03 03 08 09   ................
          716  +| page 5 offset 16384
          717  +|      0: 0d 00 00 00 00 10 00 00 00 00 00 00 00 00 00 00   ................
          718  +| end crash-8391315d75edff.db
          719  +}]} {}
   581    720   
          721  +do_catchsql_test 7.1 {
          722  +  SELECT * FROM sqlite_master;
          723  +} {1 {malformed database schema (t1x1) - invalid rootpage}}
   582    724   
   583    725   finish_test

Changes to test/dbfuzz001.test.

   164    164       |    432: 01 ec 01 c5 01 0d 43 00 00 48 01 54 00 01 f7 01   ......C..H.T....
   165    165       |    448: ec 01 c5 01 0d 42 00 00 48 01 54 00 01 f7 01 ec   .....B..H.T.....
   166    166       |    464: 01 c5 01 0d 41 00 00 48 01 54 00 01 f7 01 ec 01   ....A..H.T......
   167    167       |    480: c5 01 0d 40 00 00 48 01 54 00 01 f7 01 ec 01 c5   ...@..H.T.......
   168    168       |    496: 01 0d 3f 00 00 48 01 54 00 01 f7 01 ec 01 c5 01   ..?..H.T........
   169    169       | end c4.db
   170    170     }]
   171         -  db eval {PRAGMA writable_schema=on; PRAGMA integrity_check}
   172         -} {/Fragmentation of 384 bytes reported as 0 on page 8/}
          171  +} {}
          172  +
          173  +ifcapable !oversize_cell_check {
          174  +  # Non SQLITE_ENABLE_OVERSIZE_CELL_CHECK builds:
          175  +  do_test dbfuzz001-101a {
          176  +    db eval {PRAGMA writable_schema=on; PRAGMA integrity_check}
          177  +  } {/Fragmentation of 384 bytes reported as 0 on page 8/}
          178  +} else {
          179  +  # SQLITE_ENABLE_OVERSIZE_CELL_CHECK builds:
          180  +  do_catchsql_test dbfuzz001-101b {
          181  +    PRAGMA writable_schema=on; 
          182  +    PRAGMA integrity_check;
          183  +  } {1 {database disk image is malformed}}
          184  +}
   173    185   
   174    186   # The DELETE query below deletes the very last cell from page 8.
   175    187   # Prior to a certain fix to sqlite3BtreeDelete() and because of the
   176    188   # corruption to the freeblock list on page 8, this would fail to
   177    189   # cause a rebalance operation, which would leave the btree in a weird
   178    190   # state that would lead to segfaults and or assertion faults.
   179    191   #
   180         -do_execsql_test dbfuzz001-110 {
          192  +set res {0 {}}
          193  +ifcapable oversize_cell_check { set res {1 {database disk image is malformed}} }
          194  +do_catchsql_test dbfuzz001-110 {
   181    195     DELETE FROM t3 WHERE x IS NOT NULL AND +rowid=6;
   182         -} {}
          196  +} $res
   183    197   
   184    198   # This is a dbfuzz2-generate test case that can cause a page with
   185    199   # pPage->nCell==0 to enter the balancer.
   186    200   #
   187    201   do_test dbfuzz001-200 {
   188    202     db deserialize [decode_hexdb {
   189    203       | size 3076 pagesize 512 filename c03.db
................................................................................
   266    280       |    496: 07 40 18 00 04 02 01 04 03 03 02 01 04 03 02 02   .@..............
   267    281       | end x/c03.db
   268    282     }]
   269    283     catchsql {INSERT INTO t3 SELECT * FROM t2;}
   270    284   } {1 {database disk image is malformed}}
   271    285   
   272    286   
   273         -do_test dbfuzz001-110 {
          287  +do_test dbfuzz001-310 {
   274    288     sqlite3 db {}
   275    289     db deserialize [decode_hexdb {
   276    290   | size 3584 pagesize 512 filename x/c02.db
   277    291   | page 1 offset 0
   278    292   |      0: 53 51 4c 69 74 65 20 66 6f 72 6d 61 74 20 33 00   SQLite format 3.
   279    293   |     16: 02 00 01 01 00 40 20 20 00 00 00 0c 00 00 00 07   .....@  ........
   280    294   |     32: 00 00 00 00 00 00 00 00 00 00 00 08 00 00 00 04   ................
................................................................................
   345    359   |    464: 69 67 68 74 0a 06 02 07 40 18 00 00 00 00 00 00   ight....@.......
   346    360   |    480: 0a 05 02 07 40 18 00 00 00 00 00 00 03 04 02 01   ....@...........
   347    361   |    496: 04 03 03 02 01 04 03 02 02 01 02 03 01 02 01 02   ................
   348    362   | end x/c02.db
   349    363     }]
   350    364   } {}
   351    365   
   352         -do_catchsql_test dbfuzz001-120 {
          366  +do_catchsql_test dbfuzz001-320 {
   353    367     PRAGMA integrity_check;
   354    368   } {1 {database disk image is malformed}}
   355    369   
   356         -do_catchsql_test dbfuzz001-130 {
          370  +do_catchsql_test dbfuzz001-330 {
   357    371     DELETE FROM t3 WHERE x IN (SELECT x FROM t4);
   358    372   } {1 {database disk image is malformed}}
   359    373   
   360    374   finish_test

Changes to test/dbfuzz2.c.

    68     68   
    69     69   /* True to activate PRAGMA vdbe_debug=on */
    70     70   static int bVdbeDebug = 0;
    71     71   
    72     72   /* Maximum size of the in-memory database file */
    73     73   static sqlite3_int64 szMax = 104857600;
    74     74   
           75  +/***** Copy/paste from ext/misc/memtrace.c ***************************/
           76  +/* The original memory allocation routines */
           77  +static sqlite3_mem_methods memtraceBase;
           78  +static FILE *memtraceOut;
           79  +
           80  +/* Methods that trace memory allocations */
           81  +static void *memtraceMalloc(int n){
           82  +  if( memtraceOut ){
           83  +    fprintf(memtraceOut, "MEMTRACE: allocate %d bytes\n", 
           84  +            memtraceBase.xRoundup(n));
           85  +  }
           86  +  return memtraceBase.xMalloc(n);
           87  +}
           88  +static void memtraceFree(void *p){
           89  +  if( p==0 ) return;
           90  +  if( memtraceOut ){
           91  +    fprintf(memtraceOut, "MEMTRACE: free %d bytes\n", memtraceBase.xSize(p));
           92  +  }
           93  +  memtraceBase.xFree(p);
           94  +}
           95  +static void *memtraceRealloc(void *p, int n){
           96  +  if( p==0 ) return memtraceMalloc(n);
           97  +  if( n==0 ){
           98  +    memtraceFree(p);
           99  +    return 0;
          100  +  }
          101  +  if( memtraceOut ){
          102  +    fprintf(memtraceOut, "MEMTRACE: resize %d -> %d bytes\n",
          103  +            memtraceBase.xSize(p), memtraceBase.xRoundup(n));
          104  +  }
          105  +  return memtraceBase.xRealloc(p, n);
          106  +}
          107  +static int memtraceSize(void *p){
          108  +  return memtraceBase.xSize(p);
          109  +}
          110  +static int memtraceRoundup(int n){
          111  +  return memtraceBase.xRoundup(n);
          112  +}
          113  +static int memtraceInit(void *p){
          114  +  return memtraceBase.xInit(p);
          115  +}
          116  +static void memtraceShutdown(void *p){
          117  +  memtraceBase.xShutdown(p);
          118  +}
          119  +
          120  +/* The substitute memory allocator */
          121  +static sqlite3_mem_methods ersaztMethods = {
          122  +  memtraceMalloc,
          123  +  memtraceFree,
          124  +  memtraceRealloc,
          125  +  memtraceSize,
          126  +  memtraceRoundup,
          127  +  memtraceInit,
          128  +  memtraceShutdown
          129  +};
          130  +
          131  +/* Begin tracing memory allocations to out. */
          132  +int sqlite3MemTraceActivate(FILE *out){
          133  +  int rc = SQLITE_OK;
          134  +  if( memtraceBase.xMalloc==0 ){
          135  +    rc = sqlite3_config(SQLITE_CONFIG_GETMALLOC, &memtraceBase);
          136  +    if( rc==SQLITE_OK ){
          137  +      rc = sqlite3_config(SQLITE_CONFIG_MALLOC, &ersaztMethods);
          138  +    }
          139  +  }
          140  +  memtraceOut = out;
          141  +  return rc;
          142  +}
          143  +
          144  +/* Deactivate memory tracing */
          145  +int sqlite3MemTraceDeactivate(void){
          146  +  int rc = SQLITE_OK;
          147  +  if( memtraceBase.xMalloc!=0 ){
          148  +    rc = sqlite3_config(SQLITE_CONFIG_MALLOC, &memtraceBase);
          149  +    if( rc==SQLITE_OK ){
          150  +      memset(&memtraceBase, 0, sizeof(memtraceBase));
          151  +    }
          152  +  }
          153  +  memtraceOut = 0;
          154  +  return rc;
          155  +}
          156  +/***** End copy/paste from ext/misc/memtrace.c ***************************/
          157  +
    75    158   /* libFuzzer invokes this routine with fuzzed database files (in aData).
    76    159   ** This routine run SQLite against the malformed database to see if it
    77    160   ** can provoke a failure or malfunction.
    78    161   */
    79    162   int LLVMFuzzerTestOneInput(const uint8_t *aData, size_t nByte){
    80    163     unsigned char *a;
    81    164     sqlite3 *db;
    82    165     int rc;
    83    166     int i;
    84    167     sqlite3_int64 x;
          168  +  char *zErr = 0;
    85    169   
    86    170     if( eVerbosity>=1 ){
    87    171       printf("************** nByte=%d ***************\n", (int)nByte);
    88    172       fflush(stdout);
    89    173     }
    90    174     if( sqlite3_initialize() ) return 0;
    91    175     rc = sqlite3_open(0, &db);
................................................................................
   102    186       sqlite3_exec(db, "PRAGMA vdbe_debug=ON", 0, 0, 0);
   103    187     }
   104    188     for(i=0; i<sizeof(azSql)/sizeof(azSql[0]); i++){
   105    189       if( eVerbosity>=1 ){
   106    190         printf("%s\n", azSql[i]);
   107    191         fflush(stdout);
   108    192       }
   109         -    sqlite3_exec(db, azSql[i], 0, 0, 0);
          193  +    zErr = 0;
          194  +    rc = sqlite3_exec(db, azSql[i], 0, 0, &zErr);
          195  +    if( rc && eVerbosity>=1 ){
          196  +      printf("-- rc=%d zErr=%s\n", rc, zErr);
          197  +    }
          198  +    sqlite3_free(zErr);
   110    199     }
   111    200     rc = sqlite3_close(db);
   112    201     if( rc!=SQLITE_OK ){
   113    202       fprintf(stdout, "sqlite3_close() returns %d\n", rc);
   114    203     }
   115    204     if( sqlite3_memory_used()!=0 ){
   116    205       int nAlloc = 0;
................................................................................
   151    240         if( z[0]=='v' && (n = numberOfVChar(z))>0 ){
   152    241           eVerbosity += n;
   153    242           continue;
   154    243         }
   155    244         if( strcmp(z,"vdbe-debug")==0 ){
   156    245           bVdbeDebug = 1;
   157    246           continue;
          247  +      }
          248  +      if( strcmp(z,"memtrace")==0 ){
          249  +        sqlite3MemTraceActivate(stdout);
          250  +        continue;
          251  +      }
          252  +      if( strcmp(z,"mem")==0 ){
          253  +        bVdbeDebug = 1;
          254  +        continue;
   158    255         }
   159    256         if( strcmp(z,"max-db-size")==0 ){
   160    257           if( i+1==argc ){
   161    258             fprintf(stderr, "missing argument to %s\n", argv[i]);
   162    259             exit(1);
   163    260           }
   164    261           szMax = strtol(argv[++i], 0, 0);

Changes to test/fts3corrupt4.test.

  2825   2825   | end crash-4ce32d0608aff1.db
  2826   2826   }]} {}
  2827   2827   
  2828   2828   do_catchsql_test 18.1 {
  2829   2829     SELECT quote(matchinfo(t1,'pcxybs'))==0 FROM t1 WHERE b MATCH 'e*';
  2830   2830   } {0 0}
  2831   2831   
         2832  +#-------------------------------------------------------------------------
         2833  +reset_db
         2834  +do_test 19.0 {
         2835  +  sqlite3 db {}
         2836  +  db deserialize [decode_hexdb {
         2837  +| size 28672 pagesize 4096 filename crash-526ea445f41c02.db
         2838  +| page 1 offset 0
         2839  +|      0: 53 51 4c 69 74 65 20 66 6f 72 6d 61 74 20 33 00   SQLite format 3.
         2840  +|     16: 10 00 01 01 00 40 20 20 00 00 00 00 00 00 00 07   .....@  ........
         2841  +|     32: 00 00 00 02 00 00 00 01 00 00 00 07 00 00 00 04   ................
         2842  +|     48: 00 00 00 00 00 00 00 00 00 00 00 01 00 00 00 00   ................
         2843  +|     96: 00 00 00 00 0d 0e b1 00 06 0d a4 00 0f 8d 0f 21   ...............!
         2844  +|    112: 0e b9 0d c8 0e 7e 0d a4 00 00 00 00 00 00 00 00   .....~..........
         2845  +|   3488: 00 00 00 00 22 07 06 17 11 11 01 31 74 61 62 6c   ...........1tabl
         2846  +|   3504: 65 74 32 74 32 07 43 52 45 41 54 45 20 54 41 42   et2t2.CREATE TAB
         2847  +|   3520: 4c 45 20 74 32 28 78 29 81 33 05 07 17 1f 1f 01   LE t2(x).3......
         2848  +|   3536: 82 35 74 61 62 6c 65 74 31 5f 73 65 67 64 69 72   .5tablet1_segdir
         2849  +|   3552: 74 31 5f 73 65 67 64 69 72 05 43 52 45 41 54 45   t1_segdir.CREATE
         2850  +|   3568: 20 54 41 42 4c 45 20 27 74 31 5f 73 65 67 64 69    TABLE 't1_segdi
         2851  +|   3584: 72 27 28 6c 65 76 65 6c 20 49 4e 54 45 47 45 52   r'(level INTEGER
         2852  +|   3600: 2c 69 64 78 20 49 4e 54 45 47 45 52 2c 73 74 61   ,idx INTEGER,sta
         2853  +|   3616: 72 74 5f 62 6c 6f 63 6b 20 49 4e 54 45 47 45 52   rt_block INTEGER
         2854  +|   3632: 2c 6c 65 61 76 65 73 5f 65 6e 64 5f 62 6c 6f 63   ,leaves_end_bloc
         2855  +|   3648: 6b 20 49 4e 54 45 47 45 52 2c 65 6e 64 5f 62 6c   k INTEGER,end_bl
         2856  +|   3664: 6f 63 6b 20 49 4e 54 45 47 45 52 2c 72 6f 6f 74   ock INTEGER,root
         2857  +|   3680: 20 42 4c 4f 42 2c 50 52 49 4d 41 52 59 20 4b 45    BLOB,PRIMARY KE
         2858  +|   3696: 59 28 6c 65 76 65 6c 2c 20 69 64 78 29 29 31 06   Y(level, idx))1.
         2859  +|   3712: 06 17 45 1f 01 00 69 6e 64 65 78 73 71 6c 69 74   ..E...indexsqlit
         2860  +|   3728: 65 5f 61 75 74 6f 69 6e 64 65 78 5f 74 31 5f 73   e_autoindex_t1_s
         2861  +|   3744: 65 67 64 69 72 5f 31 74 31 5f 73 65 67 64 69 72   egdir_1t1_segdir
         2862  +|   3760: 06 0f c7 00 08 00 00 00 00 66 04 07 17 23 23 01   .........f...##.
         2863  +|   3776: 81 13 74 61 62 6c 65 74 31 5f 73 65 67 6d 65 6e   ..tablet1_segmen
         2864  +|   3792: 74 73 74 31 5f 73 65 67 6d 65 6e 74 73 04 43 52   tst1_segments.CR
         2865  +|   3808: 45 41 54 45 20 54 41 42 4c 45 20 27 74 31 5f 73   EATE TABLE 't1_s
         2866  +|   3824: 65 67 6d 65 6e 74 73 27 28 62 6c 6f 63 6b 69 64   egments'(blockid
         2867  +|   3840: 20 49 4e 54 45 47 45 52 20 50 52 49 4d 41 52 59    INTEGER PRIMARY
         2868  +|   3856: 20 4b 45 59 2c 20 62 6c 6f 63 6b 20 42 4c 4f 42    KEY, block BLOB
         2869  +|   3872: 29 6a 03 07 17 21 21 01 81 1f 74 61 62 6c 65 74   )j...!!...tablet
         2870  +|   3888: 31 5f 63 6f 6e 74 65 6e 74 74 31 5f 63 6f 6e 74   1_contentt1_cont
         2871  +|   3904: 65 6e 74 03 43 52 45 41 54 45 20 54 41 42 4c 45   ent.CREATE TABLE
         2872  +|   3920: 20 27 74 31 5f 63 6f 6e 74 65 6e 74 27 28 64 6f    't1_content'(do
         2873  +|   3936: 63 69 64 20 49 4e 54 45 47 45 52 20 50 52 49 4d   cid INTEGER PRIM
         2874  +|   3952: 41 52 59 20 4b 45 59 2c 20 27 63 30 61 27 2c 20   ARY KEY, 'c0a', 
         2875  +|   3968: 27 63 31 62 27 2c 20 27 63 32 63 27 29 38 02 06   'c1b', 'c2c')8..
         2876  +|   3984: 17 11 11 08 5f 74 61 62 6c 65 74 31 74 41 43 52   ...._tablet1tACR
         2877  +|   4000: 45 41 54 45 20 56 49 52 54 55 41 4c 20 54 41 42   EATE VIRTUAL TAB
         2878  +|   4016: 4c 45 20 74 31 20 55 53 49 4e 47 20 66 74 73 33   LE t1 USING fts3
         2879  +|   4032: 28 61 2c 62 2c 63 29 00 00 00 39 00 00 00 00 00   (a,b,c)...9.....
         2880  +| page 3 offset 8192
         2881  +|      0: 0d 00 00 00 25 0b 48 00 0f d8 0f af 0f 86 0f 74   ....%.H........t
         2882  +|     16: 0f 61 0f 4e 0f 2f 0f 0f 0e ef 0e d7 0e be 0e a5   .a.N./..........
         2883  +|     32: 0e 8d 0e 74 0e 5b 0e 40 0e 24 0e 08 0d ef 0d d5   ...t.[.@.$......
         2884  +|     48: 0d bb 0d a0 0d 84 0d 68 0d 4f 0d 35 0d 1b 0c fb   .......h.O.5....
         2885  +|     64: 0c da 0c b9 0c 99 0c 78 0c 57 0c 3e 0c 24 0c 0a   .......x.W.>.$..
         2886  +|     80: 0b 48 00 00 00 00 00 00 00 00 00 00 00 00 00 00   .H..............
         2887  +|   2880: 00 00 00 00 00 00 00 00 81 3f 25 06 00 82 7f 00   .........?%.....
         2888  +|   2896: 00 43 4f 4d 50 49 4c 45 52 3d 67 63 63 2d 35 2f   .COMPILER=gcc-5/
         2889  +|   2912: 34 2e 30 20 32 30 31 36 30 36 30 39 20 44 45 42   4.0 20160609 DEB
         2890  +|   2928: 55 47 20 45 4e 41 42 4c 45 20 44 42 53 54 41 54   UG ENABLE DBSTAT
         2891  +|   2944: 20 56 54 41 42 20 45 4e 41 42 4c 45 20 46 54 53    VTAB ENABLE FTS
         2892  +|   2960: 34 20 45 4e 41 42 4c 45 20 46 54 53 35 20 45 4e   4 ENABLE FTS5 EN
         2893  +|   2976: 41 42 4c 45 20 47 45 4f 50 4f 4c 59 20 45 4e 41   ABLE GEOPOLY ENA
         2894  +|   2992: 42 4c 45 20 4a 53 4f 4e 31 20 45 4e 41 42 4c 45   BLE JSON1 ENABLE
         2895  +|   3008: 20 4d 45 4d 53 59 53 35 20 45 4e 41 42 4c 45 20    MEMSYS5 ENABLE 
         2896  +|   3024: 52 54 52 45 45 20 4d 41 58 20 4d 45 4d 4f 52 59   RTREE MAX MEMORY
         2897  +|   3040: 3d 35 30 30 30 30 30 30 30 20 4f 4d 49 54 20 4c   =50000000 OMIT L
         2898  +|   3056: 4f 41 44 20 45 58 54 45 4e 53 49 4f 4e 20 54 48   OAD EXTENSION TH
         2899  +|   3072: 52 45 41 44 53 41 46 45 3d 30 18 24 05 00 25 0f   READSAFE=0.$..%.
         2900  +|   3088: 19 54 48 52 45 41 44 53 41 46 45 3d 30 58 42 49   .THREADSAFE=0XBI
         2901  +|   3104: 4e 41 52 59 18 23 05 00 25 0f 19 54 48 52 45 41   NARY.#..%..THREA
         2902  +|   3120: 44 53 41 46 45 3d 30 58 4e 4f 43 41 53 45 17 22   DSAFE=0XNOCASE..
         2903  +|   3136: 05 00 25 0f 17 54 48 52 45 41 44 53 41 46 45 3d   ..%..THREADSAFE=
         2904  +|   3152: 30 58 52 54 52 49 4d 1f 21 05 00 33 0f 19 4f 4d   0XRTRIM.!..3..OM
         2905  +|   3168: 49 54 20 4c 4f 41 44 20 45 58 54 45 4e 53 49 4f   IT LOAD EXTENSIO
         2906  +|   3184: 4e 58 42 49 4e 41 52 59 1f 20 05 00 33 0f 19 4f   NXBINARY. ..3..O
         2907  +|   3200: 4d 49 54 20 4c 4f 41 44 20 45 58 54 45 4e 53 49   MIT LOAD EXTENSI
         2908  +|   3216: 4f 4e 58 4e 4f 43 41 53 45 1e 1f 05 00 33 0f 17   ONXNOCASE....3..
         2909  +|   3232: 4f 4d 49 54 20 4c 4f 41 44 20 45 58 54 45 4e 53   OMIT LOAD EXTENS
         2910  +|   3248: 49 4f 4e 58 52 54 52 49 4d 1f 1e 05 00 33 0f 19   IONXRTRIM....3..
         2911  +|   3264: 4d 41 58 20 4d 45 4d 4f 52 59 3d 35 30 30 30 30   MAX MEMORY=50000
         2912  +|   3280: 30 30 30 58 42 49 4e 41 52 59 1f 1d 05 00 33 0f   000XBINARY....3.
         2913  +|   3296: 19 4d 41 58 20 4d 45 4d 4f 52 59 3d 35 30 30 30   .MAX MEMORY=5000
         2914  +|   3312: 30 30 30 30 58 4e 4f 43 41 53 45 1e 1c 05 00 33   0000XNOCASE....3
         2915  +|   3328: 0f 17 4d 41 58 20 4d 45 4d 4f 52 59 3d 35 30 30   ..MAX MEMORY=500
         2916  +|   3344: 30 30 30 30 30 58 52 54 52 49 4d 18 1b 05 00 25   00000XRTRIM....%
         2917  +|   3360: 0f 19 45 4e 41 42 4c 45 20 52 54 52 45 45 58 42   ..ENABLE RTREEXB
         2918  +|   3376: 49 4e 41 52 59 18 1a 05 00 25 0f 19 45 4e 41 42   INARY....%..ENAB
         2919  +|   3392: 4c 45 20 52 54 52 45 45 58 4e 4f 43 41 53 45 17   LE RTREEXNOCASE.
         2920  +|   3408: 19 05 00 25 0f 17 45 4e 41 42 4c 45 20 52 54 52   ...%..ENABLE RTR
         2921  +|   3424: 45 45 58 52 54 52 49 4d 1a 18 05 00 29 0f 19 45   EEXRTRIM....)..E
         2922  +|   3440: 4e 41 42 4c 45 20 4d 45 4d 53 59 53 35 58 42 49   NABLE MEMSYS5XBI
         2923  +|   3456: 4e 41 52 59 1a 17 05 00 29 0f 19 45 4e 41 42 4c   NARY....)..ENABL
         2924  +|   3472: 45 20 4d 45 4d 53 59 53 35 58 4e 4f 43 41 53 45   E MEMSYS5XNOCASE
         2925  +|   3488: 19 16 05 00 29 0f 17 45 4e 41 42 4c 45 20 4d 45   ....)..ENABLE ME
         2926  +|   3504: 4d 53 59 53 35 58 52 54 52 49 4d 18 15 05 00 25   MSYS5XRTRIM....%
         2927  +|   3520: 0f 19 45 4e 41 42 4c 45 20 4a 53 4f 4e 31 58 42   ..ENABLE JSON1XB
         2928  +|   3536: 49 4e 41 52 59 18 14 05 00 25 0f 19 45 4e 41 42   INARY....%..ENAB
         2929  +|   3552: 4c 45 20 4a 53 4f 4e 31 58 4e 4f 43 41 53 45 17   LE JSON1XNOCASE.
         2930  +|   3568: 13 05 00 25 0f 17 45 4e 41 42 4c 45 20 4a 53 4f   ...%..ENABLE JSO
         2931  +|   3584: 4e 31 58 52 54 52 49 4d 1a 12 05 00 29 0f 19 45   N1XRTRIM....)..E
         2932  +|   3600: 4e 41 42 4c 45 20 47 45 4f 50 4f 4c 59 58 42 49   NABLE GEOPOLYXBI
         2933  +|   3616: 4e 41 52 59 1a 11 05 00 29 0f 19 45 4e 41 42 4c   NARY....)..ENABL
         2934  +|   3632: 45 20 47 45 4f 50 4f 4c 59 58 4e 4f 43 41 53 45   E GEOPOLYXNOCASE
         2935  +|   3648: 19 10 05 00 29 0f 17 45 4e 41 42 4c 45 20 47 45   ....)..ENABLE GE
         2936  +|   3664: 4f 50 4f 4c 59 58 52 54 52 49 4d 17 0f 05 00 23   OPOLYXRTRIM....#
         2937  +|   3680: 0f 19 45 4e 41 42 4c 45 20 46 54 53 35 58 42 49   ..ENABLE FTS5XBI
         2938  +|   3696: 4f 41 52 59 17 0e 05 00 23 0f 19 45 4e 41 42 4c   OARY....#..ENABL
         2939  +|   3712: 45 20 46 54 53 35 58 4e 4f 43 41 53 45 16 0d 05   E FTS5XNOCASE...
         2940  +|   3728: 00 23 0f 17 45 4e 41 42 4c 45 20 46 54 53 35 58   .#..ENABLE FTS5X
         2941  +|   3744: 52 54 52 49 4d 17 0c 05 00 23 0f 19 45 4e 41 42   RTRIM....#..ENAB
         2942  +|   3760: 4c 45 20 46 54 53 34 58 42 49 4e 41 52 59 17 0b   LE FTS4XBINARY..
         2943  +|   3776: 05 00 23 0f 19 45 4e 41 42 4d f5 20 46 54 53 34   ..#..ENABM. FTS4
         2944  +|   3792: 58 4e 4f 43 41 53 45 16 0a 05 00 23 0f 17 45 4e   XNOCASE....#..EN
         2945  +|   3808: 41 52 4c 45 20 46 54 53 34 58 52 54 52 49 4d 1e   ARLE FTS4XRTRIM.
         2946  +|   3824: 09 05 00 31 0f 19 45 4e 41 42 4c 45 20 44 42 53   ...1..ENABLE DBS
         2947  +|   3840: 54 41 54 20 56 54 41 42 58 42 49 4e 41 52 59 1e   TAT VTABXBINARY.
         2948  +|   3856: 08 05 00 31 0f 19 45 4e 41 42 4c 45 20 44 42 53   ...1..ENABLE DBS
         2949  +|   3872: 54 41 54 20 56 54 41 42 58 4e 4f 43 41 53 45 1d   TAT VTABXNOCASE.
         2950  +|   3888: 07 05 00 31 0f 17 45 4e 41 42 4c 45 20 44 42 53   ...1..ENABLE DBS
         2951  +|   3904: 54 41 54 20 56 54 41 42 58 52 54 52 49 4d 11 06   TAT VTABXRTRIM..
         2952  +|   3920: 05 00 17 0f 19 44 45 42 55 47 58 42 49 4e 41 52   .....DEBUGXBINAR
         2953  +|   3936: 59 11 05 05 00 17 0f 19 44 45 42 55 47 58 4e 4f   Y.......DEBUGXNO
         2954  +|   3952: 43 41 53 45 10 04 05 00 17 0f 17 44 45 42 55 47   CASE.......DEBUG
         2955  +|   3968: 58 52 54 52 49 4d 27 03 05 00 43 0f 19 43 4f 4d   XRTRIM'...C..COM
         2956  +|   3984: 50 49 4c 45 52 3d 67 63 63 2d 35 2e 34 2e 30 20   PILER=gcc-5.4.0 
         2957  +|   4000: 32 30 31 36 30 36 30 39 58 42 49 4e 41 52 59 27   20160609XBINARY'
         2958  +|   4016: 02 04 00 43 0f 19 43 4f 4d 50 49 4c 45 52 3d 67   ...C..COMPILER=g
         2959  +|   4032: 63 63 2d 35 2e 34 2e 30 20 32 30 31 36 30 36 30   cc-5.4.0 2016060
         2960  +|   4048: 39 58 4e 4f 43 41 53 45 26 01 05 00 43 0f 17 43   9XNOCASE&...C..C
         2961  +|   4064: 4f 4d 50 49 4c 45 52 3d 67 63 63 2d 35 2e 34 2e   OMPILER=gcc-5.4.
         2962  +|   4080: 30 20 32 30 31 36 30 36 30 39 58 52 54 52 49 4d   0 20160609XRTRIM
         2963  +| page 4 offset 12288
         2964  +|      0: 0d 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00   ................
         2965  +| page 5 offset 16384
         2966  +|      0: 0d 00 00 00 02 0b a0 00 0c ad 0b a0 00 00 00 00   ................
         2967  +|   2976: 82 0a 02 08 08 09 08 08 17 84 06 30 20 32 35 33   ...........0 253
         2968  +|   2992: 00 01 30 04 25 06 1b 00 00 08 32 30 31 36 30 36   ..0.%.....201606
         2969  +|   3008: 30 39 03 25 07 00 00 01 34 03 25 05 00 00 01 35   09.%....4.%....5
         2970  +|   3024: 03 25 04 00 01 07 30 30 30 30 30 30 30 03 25 1a   .%....0000000.%.
         2971  +|   3040: 00 00 08 63 6f 6d 70 69 6c 65 72 03 25 02 00 00   ...compiler.%...
         2972  +|   3056: 06 64 62 73 74 61 74 03 25 0a 00 01 04 65 62 75   .dbstat.%....ebu
         2973  +|   3072: 67 03 25 08 00 00 06 65 6e 61 62 6c 65 09 25 09   g.%....enable.%.
         2974  +|   3088: 05 04 04 04 04 04 00 01 08 78 74 65 6e 73 69 6f   .........xtensio
         2975  +|   3104: 6e 03 25 1d 00 00 04 66 74 73 34 03 25 0d 00 03   n.%....fts4.%...
         2976  +|   3120: 01 35 03 25 0f 00 00 03 67 63 63 03 25 03 00 01   .5.%....gcc.%...
         2977  +|   3136: 06 65 6f 70 6f 6c 79 03 25 11 00 00 05 6a 73 6f   .eopoly.%....jso
         2978  +|   3152: 6e 31 03 25 13 00 00 04 6c 6f 61 64 03 25 1c 00   n1.%....load.%..
         2979  +|   3168: 00 03 6d 61 78 03 25 18 00 01 05 65 6d 6f 72 79   ..max.%....emory
         2980  +|   3184: 03 25 19 00 03 04 73 79 73 35 03 25 15 00 00 04   .%....sys5.%....
         2981  +|   3200: 6f 6d 69 74 03 25 1b 00 00 05 72 74 72 65 65 03   omit.%....rtree.
         2982  +|   3216: 25 17 00 00 0a 74 68 72 65 61 64 73 61 66 65 03   %....threadsafe.
         2983  +|   3232: 25 1e 00 00 04 76 74 61 62 03 25 0b 00 86 50 01   %....vtab.%...P.
         2984  +|   3248: 08 08 08 08 08 17 8d 12 30 20 38 33 35 00 01 30   ........0 835..0
         2985  +|   3264: 12 01 06 00 01 06 00 01 06 00 1f 03 00 01 03 00   ................
         2986  +|   3280: 01 03 00 00 08 32 30 31 36 30 36 30 39 09 01 07   .....20160609...
         2987  +|   3296: 00 01 07 00 01 07 00 00 01 34 09 01 05 00 01 05   .........4......
         2988  +|   3312: 00 01 05 00 00 01 35 09 01 04 00 01 04 00 01 04   ......5.........
         2989  +|   3328: 00 01 07 30 30 30 30 30 30 30 09 1c 04 00 01 04   ...0000000......
         2990  +|   3344: 00 01 04 00 00 06 62 69 6e 61 72 79 3c 03 01 02   ......binary<...
         2991  +|   3360: 02 00 03 01 02 02 00 03 01 02 02 00 03 01 02 02   ................
         2992  +|   3376: 00 03 01 02 02 00 03 01 02 02 00 03 01 02 02 00   ................
         2993  +|   3392: 03 01 02 02 00 03 01 02 02 00 03 01 02 02 00 03   ................
         2994  +|   3408: 01 02 02 00 03 01 02 02 00 00 08 63 6f 6d 70 69   ...........compi
         2995  +|   3424: 6c 65 72 09 01 02 00 01 02 00 01 02 00 00 06 64   ler............d
         2996  +|   3440: 62 73 74 61 74 09 07 03 00 01 03 00 01 03 00 01   bstat...........
         2997  +|   3456: 04 65 62 75 67 09 04 02 00 01 02 00 01 02 00 00   .ebug...........
         2998  +|   3472: 06 65 6e 61 62 6c 65 3f 07 02 00 01 02 00 01 02   .enable?........
         2999  +|   3488: 00 01 02 00 01 02 00 01 02 00 01 02 00 01 02 00   ................
         3000  +|   3504: 01 02 00 01 02 00 01 02 00 01 02 00 01 02 00 01   ................
         3001  +|   3520: 02 00 01 02 00 01 02 00 01 02 00 01 02 00 01 02   ................
         3002  +|   3536: 00 01 02 00 01 02 00 01 08 78 74 65 6e 73 69 6f   .........xtensio
         3003  +|   3552: 6e 09 1f 04 00 01 04 00 01 04 00 00 04 66 74 73   n............fts
         3004  +|   3568: 34 09 0a 03 00 01 03 00 01 03 00 03 01 35 09 0d   4............5..
         3005  +|   3584: 03 00 01 03 00 01 03 00 00 03 67 63 63 09 01 03   ..........gcc...
         3006  +|   3600: 00 01 03 00 01 03 00 01 06 65 6f 70 6f 6c 79 09   .........eopoly.
         3007  +|   3616: 10 03 00 01 03 00 01 03 00 00 05 6a 73 6f 6e 31   ...........json1
         3008  +|   3632: 09 13 03 00 01 03 00 01 03 00 00 04 6c 6f 61 64   ............load
         3009  +|   3648: 09 1f 03 00 01 03 00 01 03 00 00 03 6d 61 78 09   ............max.
         3010  +|   3664: 1c 02 00 01 02 00 01 02 00 01 05 65 6d 6f 72 79   ...........emory
         3011  +|   3680: 09 1c 03 00 01 03 00 01 03 00 03 04 73 79 73 35   ............sys5
         3012  +|   3696: 09 16 03 00 01 03 00 01 03 00 00 06 6e 6f 63 61   ............noca
         3013  +|   3712: 73 65 3c 02 01 02 02 00 03 01 02 02 00 03 01 02   se<.............
         3014  +|   3728: 02 00 03 01 02 02 00 03 01 02 02 00 03 01 02 02   ................
         3015  +|   3744: 00 03 01 02 02 00 03 01 02 02 00 03 01 02 02 00   ................
         3016  +|   3760: 03 01 02 02 00 13 01 02 02 00 03 01 02 02 00 00   ................
         3017  +|   3776: 04 6f 6d 69 74 09 1f 02 00 01 12 00 01 02 00 00   .omit...........
         3018  +|   3792: 05 72 74 72 65 65 09 19 03 00 01 81 00 01 03 00   .rtree..........
         3019  +|   3808: 03 02 69 6d 3c 01 01 02 02 00 03 01 02 02 00 03   ..im<...........
         3020  +|   3824: 01 02 02 00 03 01 02 02 00 03 01 02 02 00 03 01   ................
         3021  +|   3840: 02 02 00 03 01 02 02 00 03 01 02 02 00 03 01 02   ................
         3022  +|   3856: 02 00 03 01 02 02 00 03 01 02 02 00 03 01 02 02   ................
         3023  +|   3872: 00 00 0a 74 68 72 65 61 64 73 61 66 65 09 22 02   ...threadsafe...
         3024  +|   3888: 00 01 02 00 01 02 00 00 04 76 74 61 62 09 07 04   .........vtab...
         3025  +|   3904: 00 01 04 00 01 04 00 00 01 78 b4 01 01 01 01 02   .........x......
         3026  +|   3920: 00 01 01 01 02 00 01 01 01 02 00 01 01 01 02 00   ................
         3027  +|   3936: 01 01 01 02 00 01 01 01 02 00 01 01 01 02 00 01   ................
         3028  +|   3952: 01 01 02 00 01 01 01 02 00 01 01 01 02 00 01 01   ................
         3029  +|   3968: 01 02 00 01 01 01 02 00 01 01 01 02 00 01 01 01   ................
         3030  +|   3984: 02 00 01 01 01 02 00 01 01 01 02 00 01 01 01 02   ................
         3031  +|   4000: 00 01 01 01 02 00 01 01 01 02 00 01 01 01 02 00   ................
         3032  +|   4016: 01 01 01 02 00 01 01 01 02 00 01 01 01 02 00 01   ................
         3033  +|   4032: 01 01 02 00 01 01 01 02 00 01 01 01 02 00 01 01   ................
         3034  +|   4048: 01 02 00 01 01 01 02 00 01 01 01 02 00 01 01 01   ................
         3035  +|   4064: 02 00 01 01 01 02 00 01 01 01 02 00 01 01 01 02   ................
         3036  +|   4080: 00 01 01 01 02 00 01 01 01 02 00 01 01 01 02 00   ................
         3037  +| page 6 offset 20480
         3038  +|      0: 0a 00 00 00 02 0f f5 00 0f fb 0f f5 00 00 00 00   ................
         3039  +|   4080: 00 00 00 00 00 05 04 08 09 01 02 04 04 08 08 09   ................
         3040  +| page 7 offset 24576
         3041  +|      0: 0d 00 00 00 05 0f b8 00 0f f4 0f e9 0f d6 0f c7   ................
         3042  +|     16: 0f b8 00 00 00 00 00 00 00 00 00 00 00 00 00 00   ................
         3043  +|   4016: 00 00 00 00 00 00 00 00 0d 05 02 23 61 75 74 6f   ...........#auto
         3044  +|   4032: 6d 65 72 67 65 3d 35 0d 04 02 23 6d 65 72 67 65   merge=5...#merge
         3045  +|   4048: 3d 31 30 30 2c 38 11 03 02 2b 69 6e 74 65 67 72   =100,8...+integr
         3046  +|   4064: 69 74 79 2d 63 68 65 63 6b 09 02 02 1b 72 65 62   ity-check....reb
         3047  +|   4080: 75 69 6c 64 0a 01 02 1d 6f 70 74 69 6d 69 7a 65   uild....optimize
         3048  +| end crash-526ea445f41c02.db
         3049  +}]} {}
         3050  +
         3051  +do_catchsql_test 19.1 {
         3052  +  SELECT rowid,a,c,snippet(t1,85101090932165,-1,10) FROM t1 WHERE a MATCH 'rtree';
         3053  +} {1 {database disk image is malformed}}
  2832   3054   
  2833   3055   finish_test
  2834   3056   

Changes to test/fuzzcheck.c.

   529    529     a = sqlite3_malloc64( nAlloc );
   530    530     if( a==0 ){
   531    531       fprintf(stderr, "Out of memory!\n");
   532    532       exit(1);
   533    533     }
   534    534     memset(a, 0, nAlloc);
   535    535     for(i=k=0; i<n; i++){
   536         -    char c = zIn[i];
          536  +    unsigned char c = (unsigned char)zIn[i];
   537    537       if( isxdigit(c) ){
   538    538         k++;
   539    539         if( k & 1 ){
   540    540           b = hexToInt(c)*16;
   541    541         }else{
   542    542           b += hexToInt(c);
   543    543           j = k/2 - 1;
................................................................................
   647    647   
   648    648   /*
   649    649   ** Run the SQL text
   650    650   */
   651    651   static int runDbSql(sqlite3 *db, const char *zSql){
   652    652     int rc;
   653    653     sqlite3_stmt *pStmt;
   654         -  while( isspace(zSql[0]) ) zSql++;
          654  +  while( isspace(zSql[0]&0x7f) ) zSql++;
   655    655     if( zSql[0]==0 ) return SQLITE_OK;
   656    656     if( eVerbosity>=4 ){
   657    657       printf("RUNNING-SQL: [%s]\n", zSql);
   658    658       fflush(stdout);
   659    659     }
   660    660     rc = sqlite3_prepare_v2(db, zSql, -1, &pStmt, 0);
   661    661     if( rc==SQLITE_OK ){

Changes to test/fuzzdata8.db.

cannot compute difference between binary files

Changes to test/join.test.

   845    845             ON x3 IS TRUE AND b4=a3
   846    846           JOIN (SELECT x AS x4 FROM t2)
   847    847             ON x4<=CASE WHEN x3 THEN CASE WHEN a4 THEN 1 ELSE -1 END ELSE 0 END
   848    848           LEFT JOIN (SELECT a AS a5, b AS b5 FROM t1)
   849    849             ON x4 IS TRUE AND b5=a4
   850    850      ORDER BY a1, a2, a3, a4, a5;
   851    851   } {1 {} {} {} {} 1 11 {} {} {} 1 12 {} {} {} 1 12 121 {} {} 1 13 {} {} {}}
          852  +
          853  +# 2019-02-05 Ticket https://www.sqlite.org/src/tktview/5948e09b8c415bc45da5c
          854  +# Error in join due to the LEFT JOIN strength reduction optimization.
          855  +#
          856  +do_execsql_test join-16.100 {
          857  +  DROP TABLE IF EXISTS t1;
          858  +  DROP TABLE IF EXISTS t2;
          859  +  CREATE TABLE t1(a INT);
          860  +  INSERT INTO t1(a) VALUES(1);
          861  +  CREATE TABLE t2(b INT);
          862  +  SELECT a, b
          863  +    FROM t1 LEFT JOIN t2 ON 0
          864  +   WHERE (b IS NOT NULL)=0;
          865  +} {1 {}}
   852    866   
   853    867   finish_test

Changes to test/permutations.test.

   748    748     e_fts3.test fts3cov.test fts3malloc.test fts3rnd.test
   749    749     fts3snippet.test mmapfault.test sessionfault.test sessionfault2.test
   750    750   
   751    751     # Exclude test scripts that use tcl IO to access journal files or count
   752    752     # the number of fsync() calls.
   753    753     pager.test exclusive.test jrnlmode.test sync.test misc1.test 
   754    754     journal1.test conflict.test crash8.test tkt3457.test io.test
   755         -  journal3.test 8_3_names.test
          755  +  journal3.test 8_3_names.test shmlock.test
   756    756   
   757    757     pager1.test async4.test corrupt.test filefmt.test pager2.test
   758    758     corrupt5.test corruptA.test pageropt.test
   759    759   
   760    760     # Exclude stmt.test, which expects sub-journals to use temporary files.
   761    761     stmt.test symlink.test
   762    762   

Changes to test/releasetest.tcl.

    46     46   }
    47     47   
    48     48   array set ::Configs [strip_comments {
    49     49     "Default" {
    50     50       -O2
    51     51       --disable-amalgamation --disable-shared
    52     52       --enable-session
           53  +    -DSQLITE_ENABLE_DESERIALIZE
    53     54     }
    54     55     "Sanitize" {
    55     56       CC=clang -fsanitize=undefined
    56     57       -DSQLITE_ENABLE_STAT4
    57     58       --enable-session
    58     59     }
    59     60     "Stdcall" {

Changes to test/resetdb.test.

    79     79   
    80     80   do_test 210 {
    81     81     # Reset the database file using SQLITE_DBCONFIG_RESET_DATABASE
    82     82     sqlite3_db_config db RESET_DB 1
    83     83     db eval VACUUM
    84     84     sqlite3_db_config db RESET_DB 0
    85     85   
           86  +  # If using sqlite3_prepare() instead of _v2() or _v3(), the block 
           87  +  # below raises an SQLITE_SCHEMA error. The following fixes this.
           88  +  if {[permutation]=="prepare"} { catchsql "SELECT * FROM sqlite_master" db2 }
           89  +
    86     90     # Verify that the reset took, even on the separate database connection
    87     91     catchsql {
    88     92        PRAGMA page_count;
    89     93        PRAGMA page_size;
    90     94        PRAGMA quick_check;
    91     95        PRAGMA journal_mode;
    92     96     } db2

Changes to test/shell4.test.

   102    102   SELECT 1;
   103    103   }]
   104    104     list [regexp {Memory Used} $res] \
   105    105          [regexp {Heap Usage} $res] \
   106    106          [regexp {Autoindex Inserts} $res]
   107    107   } {1 1 1}
   108    108   
          109  +ifcapable trace {
   109    110   do_test shell4-2.1 {
   110    111     catchcmd ":memory:" "CREATE TABLE t1(x);\n.trace --unknown"
   111    112   } {1 {Unknown option "--unknown" on ".trace"}}
   112    113   do_test shell4-2.2 {
   113    114     catchcmd ":memory:" "CREATE TABLE t1(x);\n.trace off\n.trace off\n"
   114    115   } {0 {}}
   115    116   do_test shell4-2.3 {
   116    117     catchcmd ":memory:" ".trace stdout\n.dump\n.trace off\n"
   117    118   } {/^0 {PRAGMA.*}$/}
   118         -ifcapable trace {
   119    119   do_test shell4-2.4 {
   120    120     catchcmd ":memory:" ".trace stdout\nCREATE TABLE t1(x);SELECT * FROM t1;"
   121    121   } {0 {CREATE TABLE t1(x);
   122    122   SELECT * FROM t1;}}
   123    123   do_test shell4-2.5 {
   124    124     catchcmd ":memory:" "CREATE TABLE t1(x);\n.trace stdout\nSELECT * FROM t1;"
   125    125   } {0 {SELECT * FROM t1;}}

Changes to test/tester.tcl.

  2078   2078       foreach f $lStack {
  2079   2079         set frames($f) 1
  2080   2080       }
  2081   2081     }
  2082   2082   
  2083   2083     set tbl2 "CREATE TABLE ${database}.frame(frame INTEGER PRIMARY KEY, line);\n"
  2084   2084     set tbl3 "CREATE TABLE ${database}.file(name PRIMARY KEY, content);\n"
         2085  +
         2086  +  set pid [pid]
  2085   2087   
  2086   2088     foreach f [array names frames] {
  2087   2089       set addr [format %x $f]
  2088         -    set cmd "addr2line -e [info nameofexec] $addr"
         2090  +    set cmd "eu-addr2line --pid=$pid $addr"
  2089   2091       set line [eval exec $cmd]
  2090   2092       append sql "INSERT INTO ${database}.frame VALUES($f, '$line');\n"
  2091   2093   
  2092   2094       set file [lindex [split $line :] 0]
  2093   2095       set files($file) 1
  2094   2096     }
  2095   2097   

Changes to test/walfault2.test.

    32     32       SELECT 1 UNION ALL SELECT i+1 FROM s LIMIT 30
    33     33     )
    34     34     INSERT INTO t1 SELECT randomblob(400), randomblob(400) FROM s;
    35     35   } {wal}
    36     36   faultsim_save_and_close
    37     37   
    38     38   do_faultsim_test 1 -prep {
           39  +  catch { db close }
    39     40     faultsim_restore
    40     41     sqlite3 db file:test.db?psow=0 -uri 1
    41     42     file_control_powersafe_overwrite db 0
    42     43     execsql {
    43     44       PRAGMA wal_checkpoint;
    44     45       PRAGMA journal_size_limit = 10000;
    45     46       PRAGMA synchronous = full;

Changes to test/with1.test.

  1085   1085              SELECT 1 FROM c,c,c,c,c,c,c,c,c
  1086   1086           )
  1087   1087           SELECT  2 FROM c,c,c,c,c,c,c,c,c
  1088   1088        )
  1089   1089        SELECT 3 FROM c,c,c,c,c,c,c,c,c
  1090   1090     )
  1091   1091     SELECT 4 FROM c,c,c,c,c,c,c,c,c;
  1092         -} {1 {at most 64 tables in a join}}
         1092  +} {1 {too many FROM clause terms, max: 200}}
  1093   1093   
  1094   1094   finish_test

Changes to tool/index_usage.c.

    17     17   #include "sqlite3.h"
    18     18   #include <stdio.h>
    19     19   #include <stdlib.h>
    20     20   #include <assert.h>
    21     21   #include <string.h>
    22     22   
    23     23   static void usage(const char *argv0){
    24         -  printf("Usage: %s DATABASE LOG\n\n", argv0);
           24  +  printf("Usage: %s [OPTIONS] DATABASE LOG\n\n", argv0);
    25     25     printf(
    26     26       "DATABASE is an SQLite database against which various statements\n"
    27     27       "have been run.  The SQL text is stored in LOG.  LOG is an SQLite\n"
    28     28       "database with this schema:\n"
    29     29       "\n"
    30     30       "    CREATE TABLE sqllog(sql TEXT);\n"
    31     31       "\n"
................................................................................
    32     32       "This utility program analyzes statements contained in LOG and prints\n"
    33     33       "a report showing how many times each index in DATABASE is used by the\n"
    34     34       "statements in LOG.\n"
    35     35       "\n"
    36     36       "DATABASE only needs to contain the schema used by the statements in\n"
    37     37       "LOG. The content can be removed from DATABASE.\n"
    38     38     );
           39  +  printf(
           40  +    "\nOPTIONS:\n\n"
           41  +    "    --progress N   Show a progress message after every N input rows\n"
           42  +    "    -q             Omit error message when parsing log entries\n"
           43  +    "    --using NAME   Print SQL statements that use index NAME\n"
           44  +  );
    39     45     printf("\nAnalysis will be done by SQLite version %s dated %.20s\n"
    40     46            "checkin number %.40s. Different versions\n"
    41     47            "of SQLite might use different indexes.\n",
    42     48            sqlite3_libversion(), sqlite3_sourceid(), sqlite3_sourceid()+21);
    43     49     exit(1);
    44     50   }
    45     51   
    46     52   int main(int argc, char **argv){
    47     53     sqlite3 *db = 0;          /* The main database */
    48     54     sqlite3_stmt *pStmt = 0;  /* a query */
    49     55     char *zSql;
    50     56     int nErr = 0;
    51     57     int rc;
           58  +  int bQuiet = 0;
           59  +  int i, j;
           60  +  const char *zUsing = 0;
           61  +  sqlite3_stmt *pIncrCnt = 0;
           62  +  int nRow = 0;
           63  +  int iProgress = 0;
           64  +
           65  +  for(i=j=1; i<argc; i++){
           66  +    const char *z = argv[i];
           67  +    if( z[0]=='-' ){
           68  +      z++;
           69  +      if( z[0]=='-' ) z++;
           70  +      if( strcmp(z,"progress")==0 ){
           71  +        if( i+1<argc ){
           72  +          iProgress = strtol(argv[++i],0,0);
           73  +          continue;
           74  +        }
           75  +        printf("The --progress option requires an argument\n");
           76  +        exit(0);
           77  +      }
           78  +      if( strcmp(z,"q")==0 ){
           79  +        bQuiet = 1;
           80  +        continue;
           81  +      }
           82  +      if( strcmp(z,"using")==0 ){
           83  +        if( i+1<argc ){
           84  +          zUsing = argv[++i];
           85  +          continue;
           86  +        }
           87  +        printf("The --using option requires an argument\n");
           88  +        exit(0);
           89  +      }
           90  +      if( strcmp(z, "help")==0 || strcmp(z, "?")==0 ){
           91  +        usage(argv[0]);
           92  +      }
           93  +      printf("Unknown command-line option: \"%s\"\n", argv[i]);
           94  +      exit(0);
           95  +    }else{
           96  +      if( j<i ) argv[j++] = argv[i];
           97  +    }
           98  +  }
           99  +  argc = j;
    52    100   
    53    101     if( argc!=3 ) usage(argv[0]);
    54    102     rc = sqlite3_open_v2(argv[1], &db, SQLITE_OPEN_READONLY, 0);
    55    103     if( rc ){
    56    104       printf("Cannot open \"%s\" for reading: %s\n", argv[1], sqlite3_errmsg(db));
    57    105       goto errorOut;
    58    106     }
................................................................................
    62    110              sqlite3_errmsg(db));
    63    111       goto errorOut;
    64    112     }
    65    113     sqlite3_finalize(pStmt);
    66    114     pStmt = 0;
    67    115     rc = sqlite3_exec(db, 
    68    116        "CREATE TABLE temp.idxu(\n"
    69         -     "  tbl TEXT,\n"
    70         -     "  idx TEXT,\n"
          117  +     "  tbl TEXT COLLATE nocase,\n"
          118  +     "  idx TEXT COLLATE nocase,\n"
    71    119        "  cnt INT,\n"
    72    120        "  PRIMARY KEY(idx)\n"
    73    121        ") WITHOUT ROWID;", 0, 0, 0);
    74    122     if( rc ){
    75    123       printf("Cannot create the result table - %s\n",
    76    124              sqlite3_errmsg(db));
    77    125       goto errorOut;
................................................................................
    86    134     rc = sqlite3_exec(db, zSql, 0, 0, 0);
    87    135     sqlite3_free(zSql);
    88    136     if( rc ){
    89    137       printf("Cannot open the LOG database \"%s\" - %s\n",
    90    138              argv[2], sqlite3_errmsg(db));
    91    139       goto errorOut;
    92    140     }
    93         -  rc = sqlite3_prepare_v2(db, "SELECT sql, rowid FROM log.sqllog",
          141  +  rc = sqlite3_prepare_v2(db,
          142  +     "SELECT sql, rowid FROM log.sqllog"
          143  +     " WHERE upper(substr(sql,1,5)) NOT IN ('BEGIN','COMMI','ROLLB','PRAGM')",
    94    144                             -1, &pStmt, 0);
    95    145     if( rc ){
    96    146       printf("Cannot read the SQLLOG table in the LOG database \"%s\" - %s\n",
    97    147              argv[2], sqlite3_errmsg(db));
    98    148       goto errorOut;
    99    149     }
          150  +
          151  +  rc = sqlite3_prepare_v2(db,
          152  +    "UPDATE temp.idxu SET cnt=cnt+1 WHERE idx=?1",
          153  +    -1, &pIncrCnt, 0);
          154  +  if( rc ){
          155  +    printf("Cannot prepare a statement to increment a counter for "
          156  +           "indexes used\n");
          157  +    goto errorOut;
          158  +  }
   100    159   
   101    160     /* Update the counts based on LOG */
   102    161     while( sqlite3_step(pStmt)==SQLITE_ROW ){
   103    162       const char *zLog = (const char*)sqlite3_column_text(pStmt, 0);
   104    163       sqlite3_stmt *pS2;
   105    164       if( zLog==0 ) continue;
   106    165       zSql = sqlite3_mprintf("EXPLAIN QUERY PLAN %s", zLog);
   107    166       rc = sqlite3_prepare_v2(db, zSql, -1, &pS2, 0);
   108    167       sqlite3_free(zSql);
   109    168       if( rc ){
   110         -      printf("Cannot compile LOG entry %d (%s): %s\n",
          169  +      if( !bQuiet ){
          170  +        printf("Cannot compile LOG entry %d (%s): %s\n",
   111    171                sqlite3_column_int(pStmt, 1), zLog, sqlite3_errmsg(db));
          172  +        fflush(stdout);
          173  +      }
   112    174         nErr++;
   113    175       }else{
          176  +      nRow++;
          177  +      if( iProgress>0 && (nRow%iProgress)==0 ){
          178  +        printf("%d...\n", nRow);
          179  +        fflush(stdout);
          180  +      }
   114    181         while( sqlite3_step(pS2)==SQLITE_ROW ){
   115    182           const char *zExplain = (const char*)sqlite3_column_text(pS2,3);
   116    183           const char *z1, *z2;
   117    184           int n;
   118    185           /* printf("EXPLAIN: %s\n", zExplain); */
   119    186           z1 = strstr(zExplain, " USING INDEX ");
   120    187           if( z1==0 ) continue;
   121    188           z1 += 13;
   122         -        for(z2=z1+1; z2[1] && z2[1]!='('; z2++){}
          189  +        for(z2=z1+1; z2[0] && z2[1]!='('; z2++){}
   123    190           n = z2 - z1;
   124         -        zSql = sqlite3_mprintf(
   125         -          "UPDATE temp.idxu SET cnt=cnt+1 WHERE idx='%.*q'", n, z1
   126         -        );
   127         -        /* printf("sql: %s\n", zSql); */
   128         -        sqlite3_exec(db, zSql, 0, 0, 0);
   129         -        sqlite3_free(zSql);
          191  +        if( zUsing && sqlite3_strnicmp(zUsing, z1, n)==0 ){
          192  +          printf("Using %s:\n%s\n", zUsing, zLog);
          193  +          fflush(stdout);
          194  +        }
          195  +        sqlite3_bind_text(pIncrCnt,1,z1,n,SQLITE_STATIC);
          196  +        sqlite3_step(pIncrCnt);
          197  +        sqlite3_reset(pIncrCnt);
   130    198         }
   131    199       }
   132    200       sqlite3_finalize(pS2);
   133    201     }
   134    202     sqlite3_finalize(pStmt);
   135    203   
   136    204     /* Generate the report */
................................................................................
   154    222          sqlite3_column_text(pStmt, 0),
   155    223          sqlite3_column_text(pStmt, 3));
   156    224     }
   157    225     sqlite3_finalize(pStmt);
   158    226     pStmt = 0;
   159    227   
   160    228   errorOut:
          229  +  sqlite3_finalize(pIncrCnt);
   161    230     sqlite3_finalize(pStmt);
   162    231     sqlite3_close(db);
   163    232     return nErr;
   164    233   }

Changes to tool/mkpragmatab.tcl.

    21     21   set flagMeaning(NoColumns1) {zero columns if RHS argument is present}
    22     22   
    23     23   set pragma_def {
    24     24     NAME: full_column_names
    25     25     TYPE: FLAG
    26     26     ARG:  SQLITE_FullColNames
    27     27     IF:   !defined(SQLITE_OMIT_FLAG_PRAGMAS)
    28         -  IF:   !defined(SQLITE_OMIT_DEPRECATED)
    29     28   
    30     29     NAME: short_column_names
    31     30     TYPE: FLAG
    32     31     ARG:  SQLITE_ShortColNames
    33     32     IF:   !defined(SQLITE_OMIT_FLAG_PRAGMAS)
    34         -  IF:   !defined(SQLITE_OMIT_DEPRECATED)
    35     33   
    36     34     NAME: count_changes
    37     35     TYPE: FLAG
    38     36     ARG:  SQLITE_CountRows
    39     37     IF:   !defined(SQLITE_OMIT_FLAG_PRAGMAS)
    40         -  IF:   !defined(SQLITE_OMIT_DEPRECATED)
    41     38   
    42     39     NAME: empty_result_callbacks
    43     40     TYPE: FLAG
    44     41     ARG:  SQLITE_NullCallback
    45     42     IF:   !defined(SQLITE_OMIT_FLAG_PRAGMAS)
    46         -  IF:   !defined(SQLITE_OMIT_DEPRECATED)
    47     43   
    48     44     NAME: legacy_file_format
    49     45     TYPE: FLAG
    50     46     ARG:  SQLITE_LegacyFileFmt
    51     47     IF:   !defined(SQLITE_OMIT_FLAG_PRAGMAS)
    52     48   
    53     49     NAME: fullfsync
................................................................................
   152    148     NAME: cell_size_check
   153    149     TYPE: FLAG
   154    150     ARG:  SQLITE_CellSizeCk
   155    151   
   156    152     NAME: default_cache_size
   157    153     FLAG: NeedSchema Result0 SchemaReq NoColumns1
   158    154     COLS: cache_size
   159         -  IF:   !defined(SQLITE_OMIT_PAGER_PRAGMAS)
   160         -  IF:   !defined(SQLITE_OMIT_DEPRECATED)
   161         -
          155  +  IF:   !defined(SQLITE_OMIT_PAGER_PRAGMAS) && !defined(SQLITE_OMIT_DEPRECATED)
   162    156   
   163    157     NAME: page_size
   164    158     FLAG: Result0 SchemaReq NoColumns1
   165    159     IF:   !defined(SQLITE_OMIT_PAGER_PRAGMAS)
   166    160   
   167    161     NAME: secure_delete
   168    162     FLAG: Result0
................................................................................
   207    201     NAME: temp_store
   208    202     FLAG: Result0 NoColumns1
   209    203     IF:   !defined(SQLITE_OMIT_PAGER_PRAGMAS)
   210    204   
   211    205     NAME: temp_store_directory
   212    206     FLAG: NoColumns1
   213    207     IF:   !defined(SQLITE_OMIT_PAGER_PRAGMAS)
   214         -  IF:   !defined(SQLITE_OMIT_DEPRECATED)
   215    208   
   216    209     NAME: data_store_directory
   217    210     FLAG: NoColumns1
   218    211     IF:   !defined(SQLITE_OMIT_PAGER_PRAGMAS) && SQLITE_OS_WIN
   219         -  IF:   !defined(SQLITE_OMIT_DEPRECATED)
   220    212   
   221    213     NAME: lock_proxy_file
   222    214     FLAG: NoColumns1
   223    215     IF:   !defined(SQLITE_OMIT_PAGER_PRAGMAS) && SQLITE_ENABLE_LOCKING_STYLE
   224    216   
   225    217     NAME: synchronous
   226    218     FLAG: NeedSchema Result0 SchemaReq NoColumns1
................................................................................
   298    290   
   299    291     NAME: foreign_key_check
   300    292     FLAG: NeedSchema Result0
   301    293     COLS: table rowid parent fkid
   302    294     IF:   !defined(SQLITE_OMIT_FOREIGN_KEY) && !defined(SQLITE_OMIT_TRIGGER)
   303    295   
   304    296     NAME: parser_trace
   305         -  IF:   defined(SQLITE_DEBUG) && !defined(SQLITE_OMIT_PARSER_TRACE)
          297  +  TYPE: FLAG
          298  +  ARG:  SQLITE_ParserTrace
          299  +  IF:   !defined(SQLITE_OMIT_FLAG_PRAGMAS)
          300  +  IF:   defined(SQLITE_DEBUG)
   306    301   
   307    302     NAME: case_sensitive_like
   308    303     FLAG: NoColumns
   309    304   
   310    305     NAME: integrity_check
   311    306     FLAG: NeedSchema Result0 Result1
   312    307     IF:   !defined(SQLITE_OMIT_INTEGRITY_CHECK)