/ Check-in [dbedd81b]
Login

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

Overview
Comment:Merge latest trunk changes into this branch.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | reuse-schema
Files: files | file ages | folders
SHA3-256:dbedd81bf2e29ae9ed88526c1cc97e5c4d0a256ad7d960304bbb5e15c44f51f0
User & Date: dan 2019-02-11 20:13:13
Wiki:reuse-schema
Context
2019-02-12
19:20
Share schemas between databases attached to the same database handle. check-in: ea611d7c user: dan tags: reuse-schema
2019-02-11
20:13
Merge latest trunk changes into this branch. check-in: dbedd81b user: dan tags: reuse-schema
19:34
Add eponymous virtual table "schemapool". For inspecting the current contents of the schema-pool. check-in: 2ebeb747 user: dan tags: reuse-schema
16:12
Fix another segfault that could occur in fts5 with a corrupted database. check-in: 09e33738 user: dan tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to ext/fts3/fts3_write.c.

  3231   3231       iNewLevel = getAbsoluteLevel(p, iLangid, iIndex, iLevel+1);
  3232   3232       rc = fts3AllocateSegdirIdx(p, iLangid, iIndex, iLevel+1, &iIdx);
  3233   3233       bIgnoreEmpty = (iLevel!=FTS3_SEGCURSOR_PENDING) && (iNewLevel>iMaxLevel);
  3234   3234     }
  3235   3235     if( rc!=SQLITE_OK ) goto finished;
  3236   3236   
  3237   3237     assert( csr.nSegment>0 );
  3238         -  assert( iNewLevel>=getAbsoluteLevel(p, iLangid, iIndex, 0) );
  3239         -  assert( iNewLevel<getAbsoluteLevel(p, iLangid, iIndex,FTS3_SEGDIR_MAXLEVEL) );
         3238  +  assert_fts3_nc( iNewLevel>=getAbsoluteLevel(p, iLangid, iIndex, 0) );
         3239  +  assert_fts3_nc( 
         3240  +    iNewLevel<getAbsoluteLevel(p, iLangid, iIndex,FTS3_SEGDIR_MAXLEVEL) 
         3241  +  );
  3240   3242   
  3241   3243     memset(&filter, 0, sizeof(Fts3SegFilter));
  3242   3244     filter.flags = FTS3_SEGMENT_REQUIRE_POS;
  3243   3245     filter.flags |= (bIgnoreEmpty ? FTS3_SEGMENT_IGNORE_EMPTY : 0);
  3244   3246   
  3245   3247     rc = sqlite3Fts3SegReaderStart(p, &csr, &filter);
  3246   3248     while( SQLITE_OK==rc ){

Changes to ext/fts5/fts5.h.

   158    158   **
   159    159   **
   160    160   ** xSetAuxdata(pFts5, pAux, xDelete)
   161    161   **
   162    162   **   Save the pointer passed as the second argument as the extension functions 
   163    163   **   "auxiliary data". The pointer may then be retrieved by the current or any
   164    164   **   future invocation of the same fts5 extension function made as part of
   165         -**   of the same MATCH query using the xGetAuxdata() API.
          165  +**   the same MATCH query using the xGetAuxdata() API.
   166    166   **
   167    167   **   Each extension function is allocated a single auxiliary data slot for
   168    168   **   each FTS query (MATCH expression). If the extension function is invoked 
   169    169   **   more than once for a single FTS query, then all invocations share a 
   170    170   **   single auxiliary data context.
   171    171   **
   172    172   **   If there is already an auxiliary data pointer when this function is
................................................................................
   173    173   **   invoked, then it is replaced by the new pointer. If an xDelete callback
   174    174   **   was specified along with the original pointer, it is invoked at this
   175    175   **   point.
   176    176   **
   177    177   **   The xDelete callback, if one is specified, is also invoked on the
   178    178   **   auxiliary data pointer after the FTS5 query has finished.
   179    179   **
   180         -**   If an error (e.g. an OOM condition) occurs within this function, an
          180  +**   If an error (e.g. an OOM condition) occurs within this function,
   181    181   **   the auxiliary data is set to NULL and an error code returned. If the
   182    182   **   xDelete parameter was not NULL, it is invoked on the auxiliary data
   183    183   **   pointer before returning.
   184    184   **
   185    185   **
   186    186   ** xGetAuxdata(pFts5, bClear)
   187    187   **

Changes to ext/fts5/fts5_index.c.

  4165   4165               /* Set the szLeaf field */
  4166   4166               fts5PutU16(&buf.p[2], (u16)buf.n);
  4167   4167             }
  4168   4168   
  4169   4169             /* Set up the new page-index array */
  4170   4170             fts5BufferAppendVarint(&p->rc, &buf, 4);
  4171   4171             if( pSeg->iLeafPgno==pSeg->iTermLeafPgno 
  4172         -              && pSeg->iEndofDoclist<pData->szLeaf 
  4173         -            ){
         4172  +           && pSeg->iEndofDoclist<pData->szLeaf
         4173  +           && pSeg->iPgidxOff<=pData->nn
         4174  +          ){
  4174   4175               int nDiff = pData->szLeaf - pSeg->iEndofDoclist;
  4175   4176               fts5BufferAppendVarint(&p->rc, &buf, buf.n - 1 - nDiff - 4);
  4176   4177               fts5BufferAppendBlob(&p->rc, &buf, 
  4177   4178                   pData->nn - pSeg->iPgidxOff, &pData->p[pSeg->iPgidxOff]
  4178         -                );
         4179  +            );
  4179   4180             }
  4180   4181   
  4181   4182             pSeg->pSeg->pgnoFirst = pSeg->iTermLeafPgno;
  4182   4183             fts5DataDelete(p, FTS5_SEGMENT_ROWID(iId, 1), iLeafRowid);
  4183   4184             fts5DataWrite(p, iLeafRowid, buf.p, buf.n);
  4184   4185           }
  4185   4186           fts5DataRelease(pData);

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

  7776   7776     SAVEPOINT one;
  7777   7777     DELETE FROM t1 WHERE a MATCH 'ts';
  7778   7778   }
  7779   7779   
  7780   7780   do_execsql_test 55.2 {
  7781   7781     ROLLBACK TO one;
  7782   7782   }
         7783  +
         7784  +#-------------------------------------------------------------------------
         7785  +reset_db
         7786  +do_test 56.0 {
         7787  +  sqlite3 db {}
         7788  +  db deserialize [decode_hexdb {
         7789  +.open --hexdb
         7790  +| size 24576 pagesize 4096 filename crash-2acc487d09f033.db
         7791  +| page 1 offset 0
         7792  +|      0: 53 51 4c 69 74 65 20 66 6f 72 6d 61 74 20 33 00   SQLite format 3.
         7793  +|     16: 10 00 01 01 00 40 20 20 00 00 00 00 00 00 00 06   .....@  ........
         7794  +|     32: 00 00 00 00 00 00 00 00 00 00 00 06 00 00 00 04   ................
         7795  +|     48: 00 00 00 00 00 00 00 00 00 00 00 01 00 00 00 00   ................
         7796  +|     96: 00 00 00 00 0d 00 00 00 06 0e 0f 00 0f aa 0f 53   ...............S
         7797  +|    112: 0e e8 0e 8b 0e 33 0e 0f 00 00 00 00 00 00 00 00   .....3..........
         7798  +|   3584: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 22   ................
         7799  +|   3600: 06 06 17 11 11 01 31 74 61 62 6c 65 62 62 62 62   ......1tablebbbb
         7800  +|   3616: 06 43 52 45 41 54 45 20 54 41 42 4c 45 20 62 62   .CREATE TABLE bb
         7801  +|   3632: 28 61 29 56 05 06 17 1f 1f 01 7d 74 61 62 6c 65   (a)V.......table
         7802  +|   3648: 74 31 5f 63 6f 6e 66 69 67 74 31 5f 63 6f 6e 66   t1_configt1_conf
         7803  +|   3664: 69 67 05 43 52 45 41 54 45 20 54 41 42 4c 45 20   ig.CREATE TABLE 
         7804  +|   3680: 27 74 31 5f 63 6f 6e 66 69 67 27 28 6b 20 50 52   't1_config'(k PR
         7805  +|   3696: 49 4d 41 52 59 20 4b 45 59 2c 20 76 29 20 57 49   IMARY KEY, v) WI
         7806  +|   3712: 54 48 4f 55 54 20 52 4f 57 49 44 5b 04 07 17 21   THOUT ROWID[...!
         7807  +|   3728: 21 01 81 01 74 61 62 6c 65 74 31 5f 64 6f 63 73   !...tablet1_docs
         7808  +|   3744: 69 7a 65 74 31 4f 64 6f 63 73 69 7a 65 04 43 52   izet1Odocsize.CR
         7809  +|   3760: 45 41 54 45 20 54 41 42 4c 45 20 27 74 31 5f 64   EATE TABLE 't1_d
         7810  +|   3776: 6f 63 73 69 7a 65 27 28 69 64 20 49 4e 54 45 47   ocsize'(id INTEG
         7811  +|   3792: 45 52 20 50 52 49 4d 41 52 59 20 4b 45 59 2c 20   ER PRIMARY KEY, 
         7812  +|   3808: 73 7a 20 42 4c 4f 42 29 69 03 07 17 19 19 01 81   sz BLOB)i.......
         7813  +|   3824: 2d 74 61 62 6c 65 74 31 5f 69 64 78 74 31 5f 69   -tablet1_idxt1_i
         7814  +|   3840: 64 78 03 43 52 45 41 54 45 20 54 41 42 4c 45 20   dx.CREATE TABLE 
         7815  +|   3856: 27 74 31 5f 69 64 78 27 28 73 65 67 69 64 2c 20   't1_idx'(segid, 
         7816  +|   3872: 74 65 72 6d 2c 20 70 67 6e 6f 2c 20 50 52 49 4d   term, pgno, PRIM
         7817  +|   3888: 41 52 59 20 4b 45 59 28 73 65 67 69 64 2c 20 74   ARY KEY(segid, t
         7818  +|   3904: 65 72 6d 29 29 20 57 49 54 48 4f 55 54 20 52 4f   erm)) WITHOUT RO
         7819  +|   3920: 57 49 44 55 02 07 17 1b 1b 01 81 01 74 61 62 6c   WIDU........tabl
         7820  +|   3936: 65 74 31 5f 64 61 74 61 74 31 5f 64 61 74 61 02   et1_datat1_data.
         7821  +|   3952: 43 52 45 41 54 45 20 54 41 42 4c 45 20 27 74 31   CREATE TABLE 't1
         7822  +|   3968: 5f 64 61 74 61 27 28 69 64 20 49 4e 54 45 47 45   _data'(id INTEGE
         7823  +|   3984: 52 20 50 52 49 4d 41 52 59 20 4b 45 59 2c 20 62   R PRIMARY KEY, b
         7824  +|   4000: 6c 6f 63 6b 20 42 4c 4f 42 29 54 01 07 17 11 11   lock BLOB)T.....
         7825  +|   4016: 08 81 15 74 61 62 6c 65 74 31 74 31 43 52 45 41   ...tablet1t1CREA
         7826  +|   4032: 54 45 20 56 49 52 54 55 41 4c 20 54 41 42 4c 45   TE VIRTUAL TABLE
         7827  +|   4048: 20 74 31 20 55 53 49 4e 47 20 66 74 73 35 28 61    t1 USING fts5(a
         7828  +|   4064: 2c 62 2c 70 72 65 66 69 78 3d 22 32 2c 32 2c 33   ,b,prefix=.2,2,3
         7829  +|   4080: 2c 34 22 2c 20 63 6f 6e 74 65 6e 74 3d 22 22 29   ,4., content=..)
         7830  +| page 2 offset 4096
         7831  +|      0: 0d 0b 6a 00 37 09 4c 02 0f e7 09 4c 0f c6 0f a4   ..j.7.L....L....
         7832  +|     16: 0f 88 0f 6d 0f 4b 0f 2c 0f 0e 0e ec 0e cd 0e ad   ...m.K.,........
         7833  +|     32: 0e 8e 0e 6c 0e 4b 0e 29 0e 08 0d e6 0d c4 0d b5   ...l.K.)........
         7834  +|     48: 0d 97 0d 76 0d 54 0d 31 0d 15 0c f3 0c d3 0c b5   ...v.T.1........
         7835  +|     64: 0c 95 0c 73 0c 54 0c 32 0c 10 0b ee 0b cc 0b b0   ...s.T.2........
         7836  +|     80: 0b 8d 0b 7e 0b 48 0b 2e 0b 0b 0a ef 0a cc 0a ad   ...~.H..........
         7837  +|     96: 0a 8c 0a 6d 0a 4d 0a 2b 0a 0c 09 ec 09 ca 09 a8   ...m.M.+........
         7838  +|    112: 09 86 09 63 0f f1 00 00 00 00 00 00 00 00 00 00   ...c............
         7839  +|   2368: 00 00 00 00 00 00 00 00 00 00 00 00 15 0a 03 00   ................
         7840  +|   2384: 30 00 00 00 01 01 03 35 00 03 01 01 12 02 01 12   0......5........
         7841  +|   2400: 03 01 11 1c 8c 80 80 80 80 10 03 00 3e 00 00 00   ............>...
         7842  +|   2416: 17 01 05 05 34 74 61 62 6c 03 02 03 01 04 77 68   ....4tabl.....wh
         7843  +|   2432: 65 72 03 02 06 09 1b 8c 80 80 80 80 0f 03 00 3c   er.............<
         7844  +|   2448: 00 00 00 16 05 34 66 74 73 34 03 02 02 01 04 6e   .....4fts4.....n
         7845  +|   2464: 75 6d 62 03 06 01 04 09 1b 8c 80 80 80 80 0e 03   umb.............
         7846  +|   2480: 00 3c 00 00 00 16 04 33 74 68 65 03 06 01 01 04   .<.....3the.....
         7847  +|   2496: 01 03 77 68 65 03 02 04 04 0a 1b 8c 80 80 80 80   ..whe...........
         7848  +|   2512: 0d 03 00 3c 00 00 00 16 04 33 6e 75 6d 03 06 01   ...<.....3num...
         7849  +|   2528: 01 05 01 03 74 61 62 03 02 03 04 0a 19 8c 80 80   ....tab.........
         7850  +|   2544: 80 80 0c 03 00 38 00 00 00 14 03 32 77 68 03 02   .....8.....2wh..
         7851  +|   2560: 04 00 04 33 66 74 73 03 02 02 04 07 18 8c 80 80   ...3fts.........
         7852  +|   2576: 80 80 0b 03 00 36 00 00 00 13 03 32 74 61 03 02   .....6.....2ta..
         7853  +|   2592: 03 02 01 68 03 06 01 01 04 04 07 1b 8c 80 80 80   ...h............
         7854  +|   2608: 80 09 03 00 3c 00 00 00 16 03 32 6e 75 03 06 01   ....<.....2nu...
         7855  +|   2624: 01 05 01 02 6f 66 03 3b 01 01 06 04 09 19 8c 80   ....of.;........
         7856  +|   2640: 80 80 80 09 03 00 38 00 00 00 14 03 32 66 74 03   ......8.....2ft.
         7857  +|   2656: 02 02 01 02 69 73 03 06 01 01 03 04 07 18 8c 80   ....is..........
         7858  +|   2672: 80 80 80 08 03 00 36 00 00 00 13 02 31 74 03 08   ......6.....1t..
         7859  +|   2688: 03 01 01 04 01 01 77 03 02 04 04 09 1a 8c 80 80   ......w.........
         7860  +|   2704: 80 80 07 03 00 3a ff 00 00 15 02 31 6e 03 08 01   .....:.....1n...
         7861  +|   2720: 01 02 05 01 01 6f 03 06 01 01 06 04 09 18 8c 80   .....o..........
         7862  +|   2736: 80 80 80 06 03 00 36 00 00 00 13 04 02 31 66 03   ......6......1f.
         7863  +|   2752: 02 02 01 01 69 03 06 01 01 03 05 06 1c 8c 80 80   ....i...........
         7864  +|   2768: 80 80 05 03 00 3e 00 00 00 17 04 30 74 68 65 03   .....>.....0the.
         7865  +|   2784: 06 00 f1 04 01 05 77 68 65 72 65 03 02 04 0a 15   ......where.....
         7866  +|   2800: 8c 80 80 80 80 04 03 00 30 00 00 00 11 01 01 06   ........0.......
         7867  +|   2816: 06 30 74 61 62 6c 65 03 02 03 07 1c 8c 80 80 80   .0table.........
         7868  +|   2832: 80 03 03 00 3e 00 00 00 17 07 30 6e 75 6d 62 65   ....>.....0numbe
         7869  +|   2848: 72 03 06 01 01 05 01 02 6f 66 03 06 04 0d 13 8c   r.......of......
         7870  +|   2864: 80 80 80 80 02 03 00 2c 00 00 00 0f 01 01 03 02   .......,........
         7871  +|   2880: 30 6e 03 06 01 01 02 07 1b 8c 80 80 80 80 01 03   0n..............
         7872  +|   2896: 00 3c 00 00 00 16 08 30 66 74 73 34 61 75 78 03   .<.....0fts4aux.
         7873  +|   2912: 02 02 01 02 69 73 03 06 04 0c 00 00 00 14 2a 00   ....is........*.
         7874  +|   2928: 00 00 01 01 02 24 00 02 01 01 12 02 01 12 08 88   .....$..........
         7875  +|   2944: 80 80 80 80 12 03 00 16 00 00 00 05 02 1c 88 80   ................
         7876  +|   2960: 80 80 80 11 03 00 3e 00 00 00 17 05 34 72 6f 77   ......>.....4row
         7877  +|   2976: 73 02 06 01 01 05 01 04 74 68 65 72 02 02 04 0b   s.......ther....
         7878  +|   2992: 15 88 80 80 80 80 10 03 00 30 00 00 00 11 02 01   .........0......
         7879  +|   3008: 01 07 05 34 62 65 74 77 02 02 04 08 1b 88 80 80   ...4betw........
         7880  +|   3024: 80 80 0f 03 00 3c 00 00 00 16 04 04 33 72 6f 77   .....<......3row
         7881  +|   3040: 02 06 01 01 05 01 03 74 68 65 02 08 05 0a 1b 88   .......the......
         7882  +|   3056: 80 80 80 80 0e 03 00 3c 00 00 00 16 01 01 02 04   .......<........
         7883  +|   3072: 33 61 72 65 02 02 03 01 03 62 65 74 02 02 07 08   3are.....bet....
         7884  +|   3088: 1b 88 80 80 80 80 0d 03 00 3c 00 00 00 16 03 32   .........<.....2
         7885  +|   3104: 74 68 02 08 02 01 01 07 00 04 33 61 6e 64 02 06   th........3and..
         7886  +|   3120: 04 0a 1b 88 80 80 80 80 0c 03 00 3c 00 00 00 16   ...........<....
         7887  +|   3136: 03 32 69 6e 02 06 01 01 06 01 02 72 6f 02 06 01   .2in.......ro...
         7888  +|   3152: 01 05 04 09 18 88 80 80 80 80 0b 03 00 36 00 00   .............6..
         7889  +|   3168: 00 13 02 03 32 61 72 02 02 03 01 02 62 65 02 02   ....2ar.....be..
         7890  +|   3184: 04 05 07 1b 88 80 80 80 80 0a 03 00 3c 00 00 00   ............<...
         7891  +|   3200: 16 02 31 74 02 08 02 01 01 07 00 03 32 61 6e 02   ..1t........2an.
         7892  +|   3216: 06 01 01 04 09 19 88 80 80 80 80 09 03 00 38 00   ..............8.
         7893  +|   3232: 00 00 14 02 31 6e 02 06 01 01 03 01 01 72 02 06   ....1n.......r..
         7894  +|   3248: 01 01 05 04 08 17 88 80 80 80 80 08 03 00 34 00   ..............4.
         7895  +|   3264: 00 00 12 02 31 62 02 02 04 01 01 69 02 06 01 01   ....1b.....i....
         7896  +|   3280: 06 04 06 19 88 80 80 80 80 07 03 00 38 00 00 00   ............8...
         7897  +|   3296: 14 04 02 31 32 02 02 05 01 01 61 02 08 03 01 01   ...12.....a.....
         7898  +|   3312: 02 05 06 1b 88 80 80 80 80 06 03 00 3c 00 00 00   ............<...
         7899  +|   3328: 16 06 30 74 68 65 72 65 02 02 02 00 02 31 31 02   ..0there.....11.
         7900  +|   3344: 06 01 01 04 0a 15 88 80 80 80 80 05 03 00 30 00   ..............0.
         7901  +|   3360: 00 00 11 01 01 05 04 30 74 68 65 02 06 01 01 07   .......0the.....
         7902  +|   3376: 07 1c 88 80 80 80 80 04 03 00 3e 00 00 00 17 01   ..........>.....
         7903  +|   3392: 01 06 02 30 6e 02 06 01 01 03 01 04 72 6f 77 73   ...0n.......rows
         7904  +|   3408: 02 06 07 08 1b 88 80 80 80 80 03 03 00 3c 00 00   .............<..
         7905  +|   3424: 00 16 08 30 62 65 74 77 65 65 6e 02 02 04 01 02   ...0between.....
         7906  +|   3440: 69 6e 02 06 04 0c 1a 88 80 80 80 80 02 03 00 3a   in.............:
         7907  +|   3456: 00 00 00 15 04 30 61 6e 64 02 06 01 01 02 02 02   .....0and.......
         7908  +|   3472: 72 65 02 02 03 04 0a 17 88 80 80 80 80 01 03 00   re..............
         7909  +|   3488: 34 00 00 00 12 02 30 31 02 06 01 01 04 01 01 32   4.....01.......2
         7910  +|   3504: 02 02 05 04 08 08 84 80 80 80 81 12 03 00 16 00   ................
         7911  +|   3520: 00 00 05 04 1b 84 61 80 80 80 11 03 00 3c 00 00   ......a......<..
         7912  +|   3536: 00 16 05 34 74 61 62 6c 01 06 01 01 05 02 03 65   ...4tabl.......e
         7913  +|   3552: 72 6d 01 02 04 0b 1b 84 80 80 80 80 10 03 00 3c   rm.............<
         7914  +|   3568: 00 00 00 16 05 34 65 61 63 68 01 02 03 01 04 70   .....4each.....p
         7915  +|   3584: 72 65 73 01 02 05 04 09 1a 84 80 80 80 80 0f 03   res.............
         7916  +|   3600: 00 3a 00 00 00 15 04 33 74 65 72 01 02 04 02 02   .:.....3ter.....
         7917  +|   3616: 68 65 01 06 01 01 03 04 08 1b 84 80 80 80 80 0e   he..............
         7918  +|   3632: 03 00 3c 00 00 00 16 04 33 70 72 65 01 02 05 01   ..<.....3pre....
         7919  +|   3648: 03 74 61 62 01 06 01 01 05 14 08 1a 84 80 80 80   .tab............
         7920  +|   3664: 80 0d 03 00 3a 00 00 00 15 04 33 66 6f 72 01 02   ....:.....3for..
         7921  +|   3680: 02 02 02 74 73 01 06 01 01 04 04 08 1b 84 80 80   ...ts...........
         7922  +|   3696: 80 80 0c 03 00 3c 00 00 00 16 03 32 74 68 01 06   .....<.....2th..
         7923  +|   3712: 01 01 03 00 04 33 65 61 63 01 02 03 04 09 18 84   .....3eac.......
         7924  +|   3728: 80 80 80 80 0b 03 00 36 00 00 00 13 03 32 74 71   .......6.....2tq
         7925  +|   3744: 01 06 01 01 05 02 01 65 01 02 04 04 09 19 84 80   .......e........
         7926  +|   3760: 80 80 80 0a 03 00 38 00 00 00 14 03 32 69 6e 01   ......8.....2in.
         7927  +|   3776: 06 01 01 02 01 02 70 72 01 02 05 0b 89 18 84 80   ......pr........
         7928  +|   3792: 80 80 80 09 03 00 36 00 00 00 13 03 32 66 6f 01   ......6.....2fo.
         7929  +|   3808: 02 02 02 01 74 01 06 01 01 04 04 07 1b 84 80 80   ....t...........
         7930  +|   3824: 80 80 08 03 00 3c 00 00 00 16 02 31 74 01 0a 04   .....<.....1t...
         7931  +|   3840: 01 01 03 04 00 03 32 65 61 01 02 03 04 0a 17 84   ......2ea.......
         7932  +|   3856: 80 80 80 80 07 03 00 34 00 00 00 12 02 31 69 01   .......4.....1i.
         7933  +|   3872: 06 01 01 02 01 01 70 01 02 05 04 08 18 84 80 80   ......p.........
         7934  +|   3888: 80 80 06 03 00 36 00 00 00 13 02 31 65 01 02 03   .....6.....1e...
         7935  +|   3904: 01 01 66 01 08 02 01 01 04 04 06 1b 84 80 80 80   ..f.............
         7936  +|   3920: 80 05 03 00 3c 00 00 00 16 05 30 74 65 72 6d 01   ....<.....0term.
         7937  +|   3936: 02 04 02 02 68 65 01 06 01 01 03 04 09 14 84 80   ....he..........
         7938  +|   3952: 80 80 80 04 03 00 2e 00 00 00 10 06 30 74 61 62   ............0tab
         7939  +|   3968: 6c 65 01 06 01 01 05 04 15 84 80 80 80 80 03 03   le..............
         7940  +|   3984: 00 30 00 00 00 11 02 08 30 70 72 65 73 65 6e 74   .0......0present
         7941  +|   4000: 01 02 05 05 1b 84 80 80 80 80 02 03 00 3c 00 00   .............<..
         7942  +|   4016: 00 16 04 30 66 74 73 01 06 01 01 04 01 02 69 6e   ...0fts.......in
         7943  +|   4032: 01 06 01 01 04 0a 1a 84 80 80 80 80 01 03 00 3a   ...............:
         7944  +|   4048: 00 00 00 15 05 30 65 61 63 f4 01 02 03 01 03 66   .....0eac......f
         7945  +|   4064: 6f 72 01 02 02 04 09 06 01 03 00 12 03 0b 0f 00   or..............
         7946  +|   4080: 00 08 8c 80 80 80 80 11 03 00 16 00 00 00 05 04   ................
         7947  +| page 3 offset 8192
         7948  +|      0: 0a 00 00 00 32 0e 4f 00 0f fa 0f f1 0f e9 0f e1   ....2.O.........
         7949  +|     16: 0f d8 0f d1 0f c9 0f c1 0f b9 0f b1 0f a9 0f a0   ................
         7950  +|     32: 0f 98 0f 90 0f 87 0f 80 0f 78 0f 71 0f 68 0f 5f   .........x.q.h._
         7951  +|     48: 0f 56 0f 4d 0f 41 0f 38 0f 2f 0f 26 0f 1d 0f 13   .V.M.A.8./.&....
         7952  +|     64: 0f 0a 0f 01 0e f7 0e ee 0e e6 0e dd 0e d6 0e cd   ................
         7953  +|     80: 0e c3 0e ba 0e b0 0e a8 0e 9f 0e 96 0e 8e 0e 85   ................
         7954  +|     96: 0e 7c 0e 73 0e 6a 0e 60 0e 58 0e 4f 00 00 00 00   .|.s.j.`.X.O....
         7955  +|   3648: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 08   ................
         7956  +|   3664: 04 01 10 01 03 34 74 20 07 04 01 0e 01 03 34 1e   .....4t ......4.
         7957  +|   3680: 09 04 01 12 01 03 33 74 68 1c 08 04 01 10 01 03   ......3th.......
         7958  +|   3696: 33 6e 1a 08 04 01 10 01 03 32 77 18 08 04 01 10   3n.......2w.....
         7959  +|   3712: 01 03 32 74 16 08 04 01 10 01 03 32 6e 14 07 04   ..2t.......2n...
         7960  +|   3728: 01 0e 01 03 32 12 08 04 01 10 01 03 31 74 10 08   ....2.......1t..
         7961  +|   3744: 04 01 10 01 03 31 6e 0e 07 04 01 0e 01 03 31 0c   .....1n.......1.
         7962  +|   3760: 09 04 01 12 01 03 30 74 68 0a 08 04 01 10 01 03   ......0th.......
         7963  +|   3776: 30 74 08 09 04 01 12 01 03 30 6e 75 06 08 04 01   0t.......0nu....
         7964  +|   3792: 10 01 03 30 6e 04 06 04 01 0c 01 03 02 08 04 01   ...0n...........
         7965  +|   3808: 10 01 02 34 72 22 07 04 01 0e 01 02 34 20 08 04   ...4r.......4 ..
         7966  +|   3824: 01 10 01 02 33 72 1e 09 04 01 12 01 02 33 61 72   ....3r.......3ar
         7967  +|   3840: 1c 08 04 01 10 01 02 32 74 1a 08 04 01 10 b3 02   .......2t.......
         7968  +|   3856: 32 69 18 09 04 01 12 01 02 32 61 72 16 08 04 01   2i.......2ar....
         7969  +|   3872: 10 01 02 31 74 14 08 04 01 10 01 02 31 6e 12 08   ...1t.......1n..
         7970  +|   3888: 04 01 10 01 02 31 62 10 08 04 01 10 01 02 31 32   .....1b.......12
         7971  +|   3904: 0e 0b 04 01 16 01 02 30 74 68 65 72 0c 08 04 01   .......0ther....
         7972  +|   3920: 10 01 02 30 74 0a 08 04 01 10 01 02 30 6e 08 08   ...0t.......0n..
         7973  +|   3936: 04 01 10 01 02 30 62 06 08 04 01 10 01 02 30 61   .....0b.......0a
         7974  +|   3952: 05 06 04 01 0c 01 02 02 07 04 09 10 01 34 74 22   .............4t.
         7975  +|   3968: 06 04 09 0e 01 34 20 08 04 09 12 01 33 74 65 1e   .....4 .....3te.
         7976  +|   3984: 07 04 09 10 01 33 70 1c 07 04 09 10 01 33 66 1a   .....3p......3f.
         7977  +|   4000: 08 04 09 12 01 32 74 68 18 07 04 09 10 01 32 2d   .....2th......2-
         7978  +|   4016: 16 07 04 09 10 01 32 69 14 07 04 09 10 01 32 66   ......2i......2f
         7979  +|   4032: 12 07 04 09 10 01 31 74 10 07 04 09 10 01 31 69   ......1t......1i
         7980  +|   4048: 0e 06 04 09 0e 01 31 0c 08 04 09 12 01 30 74 65   ......1......0te
         7981  +|   4064: 0a 07 04 09 10 01 30 74 08 07 04 09 10 01 30 70   ......0t......0p
         7982  +|   4080: 06 08 04 09 12 01 30 66 74 04 05 04 09 0c 01 02   ......0ft.......
         7983  +| page 4 offset 12288
         7984  +|      0: 0d 00 00 00 03 0f eb 00 0f f9 0f f2 0f eb 00 00   ................
         7985  +|   4064: 00 00 00 00 00 00 00 00 00 00 00 05 03 03 00 10   ................
         7986  +|   4080: 03 05 05 02 03 00 10 04 06 05 01 03 00 10 04 03   ................
         7987  +| page 5 offset 16384
         7988  +|      0: 0a 00 00 00 02 0f eb 00 0f eb 0f f4 00 00 00 00   ................
         7989  +|   4064: 00 00 00 00 00 00 00 00 00 00 00 08 03 15 01 70   ...............p
         7990  +|   4080: 67 73 7a 18 0b 03 1b 01 76 65 72 73 69 6f 6e 04   gsz.....version.
         7991  +| page 6 offset 20480
         7992  +|      0: 0d 00 00 00 03 0f f2 00 0f fc 0f f7 0f f2 00 00   ................
         7993  +|   4080: 00 00 03 03 02 01 03 03 02 02 01 02 02 01 02 09   ................
         7994  +| end crash-2acc487d09f033.db
         7995  +}]} {}
         7996  +
         7997  +do_catchsql_test 56.1 {
         7998  +  INSERT INTO t1(b) VALUES(randomblob(250));
         7999  +  INSERT INTO t1(b) VALUES(randomblob(250));
         8000  +} {1 {database disk image is malformed}}
  7783   8001   
  7784   8002   sqlite3_fts5_may_be_corrupt 0
  7785   8003   finish_test
  7786   8004   

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 src/btree.c.

  1529   1529   ** detected then *pRc is set to SQLITE_CORRUPT and NULL is returned.
  1530   1530   **
  1531   1531   ** Slots on the free list that are between 1 and 3 bytes larger than nByte
  1532   1532   ** will be ignored if adding the extra space to the fragmentation count
  1533   1533   ** causes the fragmentation count to exceed 60.
  1534   1534   */
  1535   1535   static u8 *pageFindSlot(MemPage *pPg, int nByte, int *pRc){
  1536         -  const int hdr = pPg->hdrOffset;
  1537         -  u8 * const aData = pPg->aData;
  1538         -  int iAddr = hdr + 1;
  1539         -  int pc = get2byte(&aData[iAddr]);
  1540         -  int x;
  1541         -  int usableSize = pPg->pBt->usableSize;
  1542         -  int size;            /* Size of the free slot */
         1536  +  const int hdr = pPg->hdrOffset;            /* Offset to page header */
         1537  +  u8 * const aData = pPg->aData;             /* Page data */
         1538  +  int iAddr = hdr + 1;                       /* Address of ptr to pc */
         1539  +  int pc = get2byte(&aData[iAddr]);          /* Address of a free slot */
         1540  +  int x;                                     /* Excess size of the slot */
         1541  +  int maxPC = pPg->pBt->usableSize - nByte;  /* Max address for a usable slot */
         1542  +  int size;                                  /* Size of the free slot */
  1543   1543   
  1544   1544     assert( pc>0 );
  1545         -  while( pc<=usableSize-4 ){
         1545  +  while( pc<=maxPC ){
  1546   1546       /* EVIDENCE-OF: R-22710-53328 The third and fourth bytes of each
  1547   1547       ** freeblock form a big-endian integer which is the size of the freeblock
  1548   1548       ** in bytes, including the 4-byte header. */
  1549   1549       size = get2byte(&aData[pc+2]);
  1550   1550       if( (x = size - nByte)>=0 ){
  1551   1551         testcase( x==4 );
  1552   1552         testcase( x==3 );
  1553         -      if( size+pc > usableSize ){
  1554         -        *pRc = SQLITE_CORRUPT_PAGE(pPg);
  1555         -        return 0;
  1556         -      }else if( x<4 ){
         1553  +      if( x<4 ){
  1557   1554           /* EVIDENCE-OF: R-11498-58022 In a well-formed b-tree page, the total
  1558   1555           ** number of bytes in fragments may not exceed 60. */
  1559   1556           if( aData[hdr+7]>57 ) return 0;
  1560   1557   
  1561   1558           /* Remove the slot from the free-list. Update the number of
  1562   1559           ** fragmented bytes within the page. */
  1563   1560           memcpy(&aData[iAddr], &aData[pc], 2);
  1564   1561           aData[hdr+7] += (u8)x;
         1562  +      }else if( x+pc > maxPC ){
         1563  +        /* This slot extends off the end of the usable part of the page */
         1564  +        *pRc = SQLITE_CORRUPT_PAGE(pPg);
         1565  +        return 0;
  1565   1566         }else{
  1566   1567           /* The slot remains on the free-list. Reduce its size to account
  1567         -         ** for the portion used by the new allocation. */
         1568  +        ** for the portion used by the new allocation. */
  1568   1569           put2byte(&aData[pc+2], x);
  1569   1570         }
  1570   1571         return &aData[pc + x];
  1571   1572       }
  1572   1573       iAddr = pc;
  1573   1574       pc = get2byte(&aData[pc]);
  1574         -    if( pc<iAddr+size ) break;
         1575  +    if( pc<iAddr+size ){
         1576  +      if( pc ){
         1577  +        /* The next slot in the chain is not past the end of the current slot */
         1578  +        *pRc = SQLITE_CORRUPT_PAGE(pPg);
         1579  +      }
         1580  +      return 0;
         1581  +    }
  1575   1582     }
  1576         -  if( pc ){
         1583  +  if( pc>maxPC+nByte-4 ){
         1584  +    /* The free slot chain extends off the end of the page */
  1577   1585       *pRc = SQLITE_CORRUPT_PAGE(pPg);
  1578   1586     }
  1579         -
  1580   1587     return 0;
  1581   1588   }
  1582   1589   
  1583   1590   /*
  1584   1591   ** Allocate nByte bytes of space from within the B-Tree page passed
  1585   1592   ** as the first argument. Write into *pIdx the index into pPage->aData[]
  1586   1593   ** of the first byte of allocated space. Return either SQLITE_OK or

Changes to src/build.c.

  1817   1817       sqlite3CreateIndex(pParse, 0, 0, 0, pList, pTab->keyConf, 0, 0, 0, 0,
  1818   1818                          SQLITE_IDXTYPE_PRIMARYKEY);
  1819   1819       if( db->mallocFailed || pParse->nErr ) return;
  1820   1820       pPk = sqlite3PrimaryKeyIndex(pTab);
  1821   1821       pTab->iPKey = -1;
  1822   1822     }else{
  1823   1823       pPk = sqlite3PrimaryKeyIndex(pTab);
         1824  +    assert( pPk!=0 );
  1824   1825   
  1825   1826       /*
  1826   1827       ** Remove all redundant columns from the PRIMARY KEY.  For example, change
  1827   1828       ** "PRIMARY KEY(a,b,a,b,c,b,c,d)" into just "PRIMARY KEY(a,b,c,d)".  Later
  1828   1829       ** code assumes the PRIMARY KEY contains no repeated columns.
  1829   1830       */
  1830   1831       for(i=j=1; i<pPk->nKeyCol; i++){
................................................................................
  3876   3877     assert( pSrc!=0 );
  3877   3878     assert( iStart<=pSrc->nSrc );
  3878   3879   
  3879   3880     /* Allocate additional space if needed */
  3880   3881     if( (u32)pSrc->nSrc+nExtra>pSrc->nAlloc ){
  3881   3882       SrcList *pNew;
  3882   3883       int nAlloc = pSrc->nSrc*2+nExtra;
  3883         -    int nGot;
  3884   3884       sqlite3 *db = pParse->db;
  3885   3885   
  3886   3886       if( pSrc->nSrc+nExtra>=SQLITE_MAX_SRCLIST ){
  3887   3887         sqlite3ErrorMsg(pParse, "too many FROM clause terms, max: %d",
  3888   3888                         SQLITE_MAX_SRCLIST);
  3889   3889         return 0;
  3890   3890       }
................................................................................
  3892   3892       pNew = sqlite3DbRealloc(db, pSrc,
  3893   3893                  sizeof(*pSrc) + (nAlloc-1)*sizeof(pSrc->a[0]) );
  3894   3894       if( pNew==0 ){
  3895   3895         assert( db->mallocFailed );
  3896   3896         return 0;
  3897   3897       }
  3898   3898       pSrc = pNew;
  3899         -    nGot = (sqlite3DbMallocSize(db, pNew) - sizeof(*pSrc))/sizeof(pSrc->a[0])+1;
  3900         -    pSrc->nAlloc = nGot;
         3899  +    pSrc->nAlloc = nAlloc;
  3901   3900     }
  3902   3901   
  3903   3902     /* Move existing slots that come after the newly inserted slots
  3904   3903     ** out of the way */
  3905   3904     for(i=pSrc->nSrc-1; i>=iStart; i--){
  3906   3905       pSrc->a[i+nExtra] = pSrc->a[i];
  3907   3906     }

Changes to src/insert.c.

  2343   2343         addr1 = sqlite3VdbeAddOp2(v, OP_Rowid, iSrc, regRowid);
  2344   2344         sqlite3VdbeVerifyAbortable(v, onError);
  2345   2345         addr2 = sqlite3VdbeAddOp3(v, OP_NotExists, iDest, 0, regRowid);
  2346   2346         VdbeCoverage(v);
  2347   2347         sqlite3RowidConstraint(pParse, onError, pDest);
  2348   2348         sqlite3VdbeJumpHere(v, addr2);
  2349   2349         autoIncStep(pParse, regAutoinc, regRowid);
  2350         -    }else if( pDest->pIndex==0 ){
         2350  +    }else if( pDest->pIndex==0 && !(db->mDbFlags & DBFLAG_Vacuum) ){
  2351   2351         addr1 = sqlite3VdbeAddOp2(v, OP_NewRowid, iDest, regRowid);
  2352   2352       }else{
  2353   2353         addr1 = sqlite3VdbeAddOp2(v, OP_Rowid, iSrc, regRowid);
  2354   2354         assert( (pDest->tabFlags & TF_Autoincrement)==0 );
  2355   2355       }
  2356   2356       sqlite3VdbeAddOp3(v, OP_RowData, iSrc, regData, 1);
  2357   2357       if( db->mDbFlags & DBFLAG_Vacuum ){

Changes to src/malloc.c.

   657    657   void sqlite3OomFault(sqlite3 *db){
   658    658     if( db->mallocFailed==0 && db->bBenignMalloc==0 ){
   659    659       db->mallocFailed = 1;
   660    660       if( db->nVdbeExec>0 ){
   661    661         db->u1.isInterrupted = 1;
   662    662       }
   663    663       db->lookaside.bDisable++;
          664  +    if( db->pParse ){
          665  +      db->pParse->rc = SQLITE_NOMEM_BKPT;
          666  +    }
   664    667     }
   665    668   }
   666    669   
   667    670   /*
   668    671   ** This routine reactivates the memory allocator and clears the
   669    672   ** db->mallocFailed flag as necessary.
   670    673   **

Changes to src/pager.c.

  7693   7693   
  7694   7694   /*
  7695   7695   ** Release a lock obtained by an earlier successful call to
  7696   7696   ** sqlite3PagerSnapshotCheck().
  7697   7697   */
  7698   7698   void sqlite3PagerSnapshotUnlock(Pager *pPager){
  7699   7699     assert( pPager->pWal );
  7700         -  return sqlite3WalSnapshotUnlock(pPager->pWal);
         7700  +  sqlite3WalSnapshotUnlock(pPager->pWal);
  7701   7701   }
  7702   7702   
  7703   7703   #endif /* SQLITE_ENABLE_SNAPSHOT */
  7704   7704   #endif /* !SQLITE_OMIT_WAL */
  7705   7705   
  7706   7706   #ifdef SQLITE_ENABLE_ZIPVFS
  7707   7707   /*

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.h.

   206    206    {/* zName:     */ "compile_options",
   207    207     /* ePragTyp:  */ PragTyp_COMPILE_OPTIONS,
   208    208     /* ePragFlg:  */ PragFlg_Result0,
   209    209     /* ColNames:  */ 0, 0,
   210    210     /* iArg:      */ 0 },
   211    211   #endif
   212    212   #if !defined(SQLITE_OMIT_FLAG_PRAGMAS)
   213         -#if !defined(SQLITE_OMIT_DEPRECATED)
   214    213    {/* zName:     */ "count_changes",
   215    214     /* ePragTyp:  */ PragTyp_FLAG,
   216    215     /* ePragFlg:  */ PragFlg_Result0|PragFlg_NoColumns1,
   217    216     /* ColNames:  */ 0, 0,
   218    217     /* iArg:      */ SQLITE_CountRows },
   219         -#endif
   220    218   #endif
   221    219   #if !defined(SQLITE_OMIT_PAGER_PRAGMAS) && SQLITE_OS_WIN
   222    220    {/* zName:     */ "data_store_directory",
   223    221     /* ePragTyp:  */ PragTyp_DATA_STORE_DIRECTORY,
   224    222     /* ePragFlg:  */ PragFlg_NoColumns1,
   225    223     /* ColNames:  */ 0, 0,
   226    224     /* iArg:      */ 0 },
................................................................................
   235    233   #if !defined(SQLITE_OMIT_SCHEMA_PRAGMAS)
   236    234    {/* zName:     */ "database_list",
   237    235     /* ePragTyp:  */ PragTyp_DATABASE_LIST,
   238    236     /* ePragFlg:  */ PragFlg_NeedSchema|PragFlg_Result0,
   239    237     /* ColNames:  */ 35, 3,
   240    238     /* iArg:      */ 0 },
   241    239   #endif
   242         -#if !defined(SQLITE_OMIT_PAGER_PRAGMAS)
   243         -#if !defined(SQLITE_OMIT_DEPRECATED)
          240  +#if !defined(SQLITE_OMIT_PAGER_PRAGMAS) && !defined(SQLITE_OMIT_DEPRECATED)
   244    241    {/* zName:     */ "default_cache_size",
   245    242     /* ePragTyp:  */ PragTyp_DEFAULT_CACHE_SIZE,
   246    243     /* ePragFlg:  */ PragFlg_NeedSchema|PragFlg_Result0|PragFlg_SchemaReq|PragFlg_NoColumns1,
   247    244     /* ColNames:  */ 45, 1,
   248    245     /* iArg:      */ 0 },
   249         -#endif
   250    246   #endif
   251    247   #if !defined(SQLITE_OMIT_FLAG_PRAGMAS)
   252    248   #if !defined(SQLITE_OMIT_FOREIGN_KEY) && !defined(SQLITE_OMIT_TRIGGER)
   253    249    {/* zName:     */ "defer_foreign_keys",
   254    250     /* ePragTyp:  */ PragTyp_FLAG,
   255    251     /* ePragFlg:  */ PragFlg_Result0|PragFlg_NoColumns1,
   256    252     /* ColNames:  */ 0, 0,
   257    253     /* iArg:      */ SQLITE_DeferFKs },
   258    254   #endif
   259    255   #endif
   260    256   #if !defined(SQLITE_OMIT_FLAG_PRAGMAS)
   261         -#if !defined(SQLITE_OMIT_DEPRECATED)
   262    257    {/* zName:     */ "empty_result_callbacks",
   263    258     /* ePragTyp:  */ PragTyp_FLAG,
   264    259     /* ePragFlg:  */ PragFlg_Result0|PragFlg_NoColumns1,
   265    260     /* ColNames:  */ 0, 0,
   266    261     /* iArg:      */ SQLITE_NullCallback },
   267         -#endif
   268    262   #endif
   269    263   #if !defined(SQLITE_OMIT_UTF16)
   270    264    {/* zName:     */ "encoding",
   271    265     /* ePragTyp:  */ PragTyp_ENCODING,
   272    266     /* ePragFlg:  */ PragFlg_Result0|PragFlg_NoColumns1,
   273    267     /* ColNames:  */ 0, 0,
   274    268     /* iArg:      */ 0 },
................................................................................
   300    294    {/* zName:     */ "freelist_count",
   301    295     /* ePragTyp:  */ PragTyp_HEADER_VALUE,
   302    296     /* ePragFlg:  */ PragFlg_ReadOnly|PragFlg_Result0,
   303    297     /* ColNames:  */ 0, 0,
   304    298     /* iArg:      */ BTREE_FREE_PAGE_COUNT },
   305    299   #endif
   306    300   #if !defined(SQLITE_OMIT_FLAG_PRAGMAS)
   307         -#if !defined(SQLITE_OMIT_DEPRECATED)
   308    301    {/* zName:     */ "full_column_names",
   309    302     /* ePragTyp:  */ PragTyp_FLAG,
   310    303     /* ePragFlg:  */ PragFlg_Result0|PragFlg_NoColumns1,
   311    304     /* ColNames:  */ 0, 0,
   312    305     /* iArg:      */ SQLITE_FullColNames },
   313         -#endif
   314         -#endif
   315         -#if !defined(SQLITE_OMIT_FLAG_PRAGMAS)
   316    306    {/* zName:     */ "fullfsync",
   317    307     /* ePragTyp:  */ PragTyp_FLAG,
   318    308     /* ePragFlg:  */ PragFlg_Result0|PragFlg_NoColumns1,
   319    309     /* ColNames:  */ 0, 0,
   320    310     /* iArg:      */ SQLITE_FullFSync },
   321    311   #endif
   322    312   #if !defined(SQLITE_OMIT_SCHEMA_PRAGMAS)
................................................................................
   537    527    {/* zName:     */ "secure_delete",
   538    528     /* ePragTyp:  */ PragTyp_SECURE_DELETE,
   539    529     /* ePragFlg:  */ PragFlg_Result0,
   540    530     /* ColNames:  */ 0, 0,
   541    531     /* iArg:      */ 0 },
   542    532   #endif
   543    533   #if !defined(SQLITE_OMIT_FLAG_PRAGMAS)
   544         -#if !defined(SQLITE_OMIT_DEPRECATED)
   545    534    {/* zName:     */ "short_column_names",
   546    535     /* ePragTyp:  */ PragTyp_FLAG,
   547    536     /* ePragFlg:  */ PragFlg_Result0|PragFlg_NoColumns1,
   548    537     /* ColNames:  */ 0, 0,
   549    538     /* iArg:      */ SQLITE_ShortColNames },
   550         -#endif
   551    539   #endif
   552    540    {/* zName:     */ "shrink_memory",
   553    541     /* ePragTyp:  */ PragTyp_SHRINK_MEMORY,
   554    542     /* ePragFlg:  */ PragFlg_NoColumns,
   555    543     /* ColNames:  */ 0, 0,
   556    544     /* iArg:      */ 0 },
   557    545    {/* zName:     */ "soft_heap_limit",

Changes to src/resolve.c.

  1529   1529             sqlite3ErrorMsg(pParse, "aggregate functions are not allowed in "
  1530   1530                 "the GROUP BY clause");
  1531   1531             return WRC_Abort;
  1532   1532           }
  1533   1533         }
  1534   1534       }
  1535   1535   
         1536  +#ifndef SQLITE_OMIT_WINDOWFUNC
  1536   1537       if( IN_RENAME_OBJECT ){
  1537   1538         Window *pWin;
  1538   1539         for(pWin=p->pWinDefn; pWin; pWin=pWin->pNextWin){
  1539   1540           if( sqlite3ResolveExprListNames(&sNC, pWin->pOrderBy)
  1540   1541            || sqlite3ResolveExprListNames(&sNC, pWin->pPartition)
  1541   1542           ){
  1542   1543             return WRC_Abort;
  1543   1544           }
  1544   1545         }
  1545   1546       }
         1547  +#endif
  1546   1548   
  1547   1549       /* If this is part of a compound SELECT, check that it has the right
  1548   1550       ** number of expressions in the select list. */
  1549   1551       if( p->pNext && p->pEList->nExpr!=p->pNext->pEList->nExpr ){
  1550   1552         sqlite3SelectWrongNumTermsError(pParse, p->pNext);
  1551   1553         return WRC_Abort;
  1552   1554       }

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.

  1083   1083   /* Allowed values for ShellState.eTraceType
  1084   1084   */
  1085   1085   #define SHELL_TRACE_PLAIN      0      /* Show input SQL text */
  1086   1086   #define SHELL_TRACE_EXPANDED   1      /* Show expanded SQL text */
  1087   1087   #define SHELL_TRACE_NORMALIZED 2      /* Show normalized SQL text */
  1088   1088   
  1089   1089   /* Bits in the ShellState.flgProgress variable */
  1090         -#define PROGRESS_QUIET   0x01         /* Omit announcing every progress callback */
  1091         -#define PROGRESS_RESET   0x02         /* Reset the count when the progres
  1092         -                                      ** callback limit is reached, and for each
  1093         -                                      ** top-level SQL statement */
  1094         -#define PROGRESS_ONCE    0x04         /* Cancel the --limit after firing once */
         1090  +#define SHELL_PROGRESS_QUIET 0x01  /* Omit announcing every progress callback */
         1091  +#define SHELL_PROGRESS_RESET 0x02  /* Reset the count when the progres
         1092  +                                   ** callback limit is reached, and for each
         1093  +                                   ** top-level SQL statement */
         1094  +#define SHELL_PROGRESS_ONCE  0x04  /* Cancel the --limit after firing once */
  1095   1095   
  1096   1096   /*
  1097   1097   ** These are the allowed shellFlgs values
  1098   1098   */
  1099   1099   #define SHFLG_Pagecache      0x00000001 /* The --pagecache option is used */
  1100   1100   #define SHFLG_Lookaside      0x00000002 /* Lookaside memory is used */
  1101   1101   #define SHFLG_Backslash      0x00000004 /* The --backslash option is used */
................................................................................
  1789   1789       }
  1790   1790       p->sGraph.zPrefix[0] = 0;
  1791   1791       eqp_render_level(p, 0);
  1792   1792       eqp_reset(p);
  1793   1793     }
  1794   1794   }
  1795   1795   
         1796  +#ifndef SQLITE_OMIT_PROGRESS_CALLBACK
  1796   1797   /*
  1797   1798   ** Progress handler callback.
  1798   1799   */
  1799   1800   static int progress_handler(void *pClientData) {
  1800   1801     ShellState *p = (ShellState*)pClientData;
  1801   1802     p->nProgress++;
  1802   1803     if( p->nProgress>=p->mxProgress && p->mxProgress>0 ){
  1803   1804       raw_printf(p->out, "Progress limit reached (%u)\n", p->nProgress);
  1804         -    if( p->flgProgress & PROGRESS_RESET ) p->nProgress = 0;
  1805         -    if( p->flgProgress & PROGRESS_ONCE ) p->mxProgress = 0;
         1805  +    if( p->flgProgress & SHELL_PROGRESS_RESET ) p->nProgress = 0;
         1806  +    if( p->flgProgress & SHELL_PROGRESS_ONCE ) p->mxProgress = 0;
  1806   1807       return 1;
  1807   1808     }
  1808         -  if( (p->flgProgress & PROGRESS_QUIET)==0 ){
         1809  +  if( (p->flgProgress & SHELL_PROGRESS_QUIET)==0 ){
  1809   1810       raw_printf(p->out, "Progress %u\n", p->nProgress);
  1810   1811     }
  1811   1812     return 0;
  1812   1813   }
         1814  +#endif /* SQLITE_OMIT_PROGRESS_CALLBACK */
  1813   1815   
  1814   1816   /*
  1815   1817   ** This is the callback routine that the shell
  1816   1818   ** invokes for each row of a query result.
  1817   1819   */
  1818   1820   static int shell_callback(
  1819   1821     void *pArg,
................................................................................
  3493   3495   #endif
  3494   3496     "        --new           Initialize FILE to an empty database",
  3495   3497     "        --readonly      Open FILE readonly",
  3496   3498     "        --zip           FILE is a ZIP archive",
  3497   3499     ".output ?FILE?           Send output to FILE or stdout if FILE is omitted",
  3498   3500     "     If FILE begins with '|' then open it as a pipe.",
  3499   3501     ".print STRING...         Print literal STRING",
         3502  +#ifndef SQLITE_OMIT_PROGRESS_CALLBACK
  3500   3503     ".progress N              Invoke progress handler after every N opcodes",
  3501   3504     "   --limit N                 Interrupt after N progress callbacks",
  3502   3505     "   --once                    Do no more than one progress interrupt",
  3503   3506     "   --quiet|-q                No output except at interrupts",
  3504   3507     "   --reset                   Reset the count for each input and interrupt",
         3508  +#endif
  3505   3509     ".prompt MAIN CONTINUE    Replace the standard prompts",
  3506   3510     ".quit                    Exit this program",
  3507   3511     ".read FILE               Read input from FILE",
  3508   3512     ".restore ?DB? FILE       Restore content of DB (default \"main\") from FILE",
  3509   3513     ".save FILE               Write in-memory database into FILE",
  3510   3514     ".scanstats on|off        Turn sqlite3_stmt_scanstatus() metrics on or off",
  3511   3515     ".schema ?PATTERN?        Show the CREATE statements matching PATTERN",
................................................................................
  7038   7042       for(i=1; i<nArg; i++){
  7039   7043         if( i>1 ) raw_printf(p->out, " ");
  7040   7044         utf8_printf(p->out, "%s", azArg[i]);
  7041   7045       }
  7042   7046       raw_printf(p->out, "\n");
  7043   7047     }else
  7044   7048   
         7049  +#ifndef SQLITE_OMIT_PROGRESS_CALLBACK
  7045   7050     if( c=='p' && n>=3 && strncmp(azArg[0], "progress", n)==0 ){
  7046   7051       int i;
  7047         -    int n = 0;
         7052  +    int nn = 0;
  7048   7053       p->flgProgress = 0;
  7049   7054       p->mxProgress = 0;
  7050   7055       p->nProgress = 0;
  7051   7056       for(i=1; i<nArg; i++){
  7052   7057         const char *z = azArg[i];
  7053   7058         if( z[0]=='-' ){
  7054   7059           z++;
  7055   7060           if( z[0]=='-' ) z++;
  7056   7061           if( strcmp(z,"quiet")==0 || strcmp(z,"q")==0 ){
  7057         -          p->flgProgress |= PROGRESS_QUIET;
         7062  +          p->flgProgress |= SHELL_PROGRESS_QUIET;
  7058   7063             continue;
  7059   7064           }
  7060   7065           if( strcmp(z,"reset")==0 ){
  7061         -          p->flgProgress |= PROGRESS_RESET;
         7066  +          p->flgProgress |= SHELL_PROGRESS_RESET;
  7062   7067             continue;
  7063   7068           }
  7064   7069           if( strcmp(z,"once")==0 ){
  7065         -          p->flgProgress |= PROGRESS_ONCE;
         7070  +          p->flgProgress |= SHELL_PROGRESS_ONCE;
  7066   7071             continue;
  7067   7072           }
  7068   7073           if( strcmp(z,"limit")==0 ){
  7069   7074             if( i+1>=nArg ){
  7070   7075               utf8_printf(stderr, "Error: missing argument on --limit\n");
  7071   7076               rc = 1;
  7072   7077               goto meta_command_exit;
................................................................................
  7075   7080             }
  7076   7081             continue;
  7077   7082           }
  7078   7083           utf8_printf(stderr, "Error: unknown option: \"%s\"\n", azArg[i]);
  7079   7084           rc = 1;
  7080   7085           goto meta_command_exit;
  7081   7086         }else{
  7082         -        n = (int)integerValue(z);
         7087  +        nn = (int)integerValue(z);
  7083   7088         }
  7084   7089       }
  7085   7090       open_db(p, 0);
  7086         -    sqlite3_progress_handler(p->db, n, progress_handler, p);
         7091  +    sqlite3_progress_handler(p->db, nn, progress_handler, p);
  7087   7092     }else
         7093  +#endif /* SQLITE_OMIT_PROGRESS_CALLBACK */
  7088   7094   
  7089   7095     if( c=='p' && strncmp(azArg[0], "prompt", n)==0 ){
  7090   7096       if( nArg >= 2) {
  7091   7097         strncpy(mainPrompt,azArg[1],(int)ArraySize(mainPrompt)-1);
  7092   7098       }
  7093   7099       if( nArg >= 3) {
  7094   7100         strncpy(continuePrompt,azArg[2],(int)ArraySize(continuePrompt)-1);
................................................................................
  8417   8423   */
  8418   8424   static int runOneSqlLine(ShellState *p, char *zSql, FILE *in, int startline){
  8419   8425     int rc;
  8420   8426     char *zErrMsg = 0;
  8421   8427   
  8422   8428     open_db(p, 0);
  8423   8429     if( ShellHasFlag(p,SHFLG_Backslash) ) resolve_backslashes(zSql);
  8424         -  if( p->flgProgress & PROGRESS_RESET ) p->nProgress = 0;
         8430  +  if( p->flgProgress & SHELL_PROGRESS_RESET ) p->nProgress = 0;
  8425   8431     BEGIN_TIMER;
  8426   8432     rc = shell_exec(p, zSql, &zErrMsg);
  8427   8433     END_TIMER;
  8428   8434     if( rc || zErrMsg ){
  8429   8435       char zPrefix[100];
  8430   8436       if( in!=0 || !stdin_is_interactive ){
  8431   8437         sqlite3_snprintf(sizeof(zPrefix), zPrefix,

Changes to src/sqliteInt.h.

  1431   1431   #endif
  1432   1432     void *pCommitArg;                 /* Argument to xCommitCallback() */
  1433   1433     int (*xCommitCallback)(void*);    /* Invoked at every commit. */
  1434   1434     void *pRollbackArg;               /* Argument to xRollbackCallback() */
  1435   1435     void (*xRollbackCallback)(void*); /* Invoked at every commit. */
  1436   1436     void *pUpdateArg;
  1437   1437     void (*xUpdateCallback)(void*,int, const char*,const char*,sqlite_int64);
         1438  +  Parse *pParse;                /* Current parse */
  1438   1439   #ifdef SQLITE_ENABLE_PREUPDATE_HOOK
  1439   1440     void *pPreUpdateArg;          /* First argument to xPreUpdateCallback */
  1440   1441     void (*xPreUpdateCallback)(   /* Registered using sqlite3_preupdate_hook() */
  1441   1442       void*,sqlite3*,int,char const*,char const*,sqlite3_int64,sqlite3_int64
  1442   1443     );
  1443   1444     PreUpdate *pPreUpdate;        /* Context for active pre-update callback */
  1444   1445   #endif /* SQLITE_ENABLE_PREUPDATE_HOOK */
................................................................................
  3099   3100   #ifndef SQLITE_OMIT_SHARED_CACHE
  3100   3101     int nTableLock;        /* Number of locks in aTableLock */
  3101   3102     TableLock *aTableLock; /* Required table locks for shared-cache mode */
  3102   3103   #endif
  3103   3104     AutoincInfo *pAinc;  /* Information about AUTOINCREMENT counters */
  3104   3105     Parse *pToplevel;    /* Parse structure for main program (or NULL) */
  3105   3106     Table *pTriggerTab;  /* Table triggers are being coded for */
         3107  +  Parse *pParentParse; /* Parent parser if this parser is nested */
  3106   3108     int addrCrTab;       /* Address of OP_CreateBtree opcode on CREATE TABLE */
  3107   3109     u32 nQueryLoop;      /* Est number of iterations of a query (10*log2(N)) */
  3108   3110     u32 oldmask;         /* Mask of old.* columns referenced */
  3109   3111     u32 newmask;         /* Mask of new.* columns referenced */
  3110   3112     u8 eTriggerOp;       /* TK_UPDATE, TK_INSERT or TK_DELETE */
  3111   3113     u8 eOrconf;          /* Default ON CONFLICT policy for trigger steps */
  3112   3114     u8 disableTriggers;  /* True to disable triggers */

Changes to src/test1.c.

  7137   7137     extern int sqlite3_eval_init(sqlite3*,char**,const sqlite3_api_routines*);
  7138   7138     extern int sqlite3_explain_init(sqlite3*,char**,const sqlite3_api_routines*);
  7139   7139     extern int sqlite3_fileio_init(sqlite3*,char**,const sqlite3_api_routines*);
  7140   7140     extern int sqlite3_fuzzer_init(sqlite3*,char**,const sqlite3_api_routines*);
  7141   7141     extern int sqlite3_ieee_init(sqlite3*,char**,const sqlite3_api_routines*);
  7142   7142     extern int sqlite3_nextchar_init(sqlite3*,char**,const sqlite3_api_routines*);
  7143   7143     extern int sqlite3_percentile_init(sqlite3*,char**,const sqlite3_api_routines*);
         7144  +#ifndef SQLITE_OMIT_VIRTUALTABLE
  7144   7145     extern int sqlite3_prefixes_init(sqlite3*,char**,const sqlite3_api_routines*);
         7146  +#endif
  7145   7147     extern int sqlite3_regexp_init(sqlite3*,char**,const sqlite3_api_routines*);
  7146   7148     extern int sqlite3_remember_init(sqlite3*,char**,const sqlite3_api_routines*);
  7147   7149     extern int sqlite3_series_init(sqlite3*,char**,const sqlite3_api_routines*);
  7148   7150     extern int sqlite3_spellfix_init(sqlite3*,char**,const sqlite3_api_routines*);
  7149   7151     extern int sqlite3_totype_init(sqlite3*,char**,const sqlite3_api_routines*);
  7150   7152     extern int sqlite3_wholenumber_init(sqlite3*,char**,const sqlite3_api_routines*);
  7151   7153     extern int sqlite3_unionvtab_init(sqlite3*,char**,const sqlite3_api_routines*);
................................................................................
  7163   7165       { "eval",                  sqlite3_eval_init                 },
  7164   7166       { "explain",               sqlite3_explain_init              },
  7165   7167       { "fileio",                sqlite3_fileio_init               },
  7166   7168       { "fuzzer",                sqlite3_fuzzer_init               },
  7167   7169       { "ieee754",               sqlite3_ieee_init                 },
  7168   7170       { "nextchar",              sqlite3_nextchar_init             },
  7169   7171       { "percentile",            sqlite3_percentile_init           },
         7172  +#ifndef SQLITE_OMIT_VIRTUALTABLE
  7170   7173       { "prefixes",              sqlite3_prefixes_init             },
         7174  +#endif
  7171   7175       { "regexp",                sqlite3_regexp_init               },
  7172   7176       { "remember",              sqlite3_remember_init             },
  7173   7177       { "series",                sqlite3_series_init               },
  7174   7178       { "spellfix",              sqlite3_spellfix_init             },
  7175   7179       { "totype",                sqlite3_totype_init               },
  7176   7180       { "unionvtab",             sqlite3_unionvtab_init            },
  7177   7181       { "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.

   556    556     int nErr = 0;                   /* Number of errors encountered */
   557    557     void *pEngine;                  /* The LEMON-generated LALR(1) parser */
   558    558     int n = 0;                      /* Length of the next token token */
   559    559     int tokenType;                  /* type of the next token */
   560    560     int lastTokenParsed = -1;       /* type of the previous token */
   561    561     sqlite3 *db = pParse->db;       /* The database connection */
   562    562     int mxSqlLen;                   /* Max length of an SQL string */
          563  +  VVA_ONLY( u8 startedWithOom = db->mallocFailed );
   563    564   #ifdef sqlite3Parser_ENGINEALWAYSONSTACK
   564    565     yyParser sEngine;    /* Space to hold the Lemon-generated Parser object */
   565    566   #endif
   566    567   
   567    568     assert( zSql!=0 );
   568    569     mxSqlLen = db->aLimit[SQLITE_LIMIT_SQL_LENGTH];
   569    570     if( db->nVdbeActive==0 ){
................................................................................
   590    591       return SQLITE_NOMEM_BKPT;
   591    592     }
   592    593   #endif
   593    594     assert( pParse->pNewTable==0 );
   594    595     assert( pParse->pNewTrigger==0 );
   595    596     assert( pParse->nVar==0 );
   596    597     assert( pParse->pVList==0 );
          598  +  pParse->pParentParse = db->pParse;
          599  +  db->pParse = pParse;
   597    600     while( 1 ){
   598    601       n = sqlite3GetToken((u8*)zSql, &tokenType);
   599    602       mxSqlLen -= n;
   600    603       if( mxSqlLen<0 ){
   601    604         pParse->rc = SQLITE_TOOBIG;
   602    605         break;
   603    606       }
................................................................................
   646    649         }
   647    650       }
   648    651       pParse->sLastToken.z = zSql;
   649    652       pParse->sLastToken.n = n;
   650    653       sqlite3Parser(pEngine, tokenType, pParse->sLastToken);
   651    654       lastTokenParsed = tokenType;
   652    655       zSql += n;
   653         -    if( pParse->rc!=SQLITE_OK || db->mallocFailed ) break;
          656  +    assert( db->mallocFailed==0 || pParse->rc!=SQLITE_OK || startedWithOom );
          657  +    if( pParse->rc!=SQLITE_OK ) break;
   654    658     }
   655    659     assert( nErr==0 );
   656    660   #ifdef YYTRACKMAXSTACKDEPTH
   657    661     sqlite3_mutex_enter(sqlite3MallocMutex());
   658    662     sqlite3StatusHighwater(SQLITE_STATUS_PARSER_STACK,
   659    663         sqlite3ParserStackPeak(pEngine)
   660    664     );
................................................................................
   714    718       sqlite3DbFreeNN(db, p);
   715    719     }
   716    720     while( pParse->pZombieTab ){
   717    721       Table *p = pParse->pZombieTab;
   718    722       pParse->pZombieTab = p->pNextZombie;
   719    723       sqlite3DeleteTable(db, p);
   720    724     }
          725  +  db->pParse = pParse->pParentParse;
          726  +  pParse->pParentParse = 0;
   721    727     assert( nErr==0 || pParse->rc!=SQLITE_OK );
   722    728     return nErr;
   723    729   }
   724    730   
   725    731   
   726    732   #ifdef SQLITE_ENABLE_NORMALIZE
   727    733   /*

Changes to src/vdbemem.c.

   174    174     assert(rc==SQLITE_OK    || pMem->enc!=desiredEnc);
   175    175     assert(rc==SQLITE_NOMEM || pMem->enc==desiredEnc);
   176    176     return rc;
   177    177   #endif
   178    178   }
   179    179   
   180    180   /*
   181         -** Make sure pMem->z points to a writable allocation of at least 
   182         -** min(n,32) bytes.
          181  +** Make sure pMem->z points to a writable allocation of at least n bytes.
   183    182   **
   184    183   ** If the bPreserve argument is true, then copy of the content of
   185    184   ** pMem->z into the new allocation.  pMem must be either a string or
   186    185   ** blob if bPreserve is true.  If bPreserve is false, any prior content
   187    186   ** in pMem->z is discarded.
   188    187   */
   189    188   SQLITE_NOINLINE int sqlite3VdbeMemGrow(Mem *pMem, int n, int bPreserve){
................................................................................
   194    193     /* If the bPreserve flag is set to true, then the memory cell must already
   195    194     ** contain a valid string or blob value.  */
   196    195     assert( bPreserve==0 || pMem->flags&(MEM_Blob|MEM_Str) );
   197    196     testcase( bPreserve && pMem->z==0 );
   198    197   
   199    198     assert( pMem->szMalloc==0
   200    199          || pMem->szMalloc==sqlite3DbMallocSize(pMem->db, pMem->zMalloc) );
   201         -  if( n<32 ) n = 32;
   202    200     if( pMem->szMalloc>0 && bPreserve && pMem->z==pMem->zMalloc ){
   203    201       pMem->z = pMem->zMalloc = sqlite3DbReallocOrFree(pMem->db, pMem->z, n);
   204    202       bPreserve = 0;
   205    203     }else{
   206    204       if( pMem->szMalloc>0 ) sqlite3DbFreeNN(pMem->db, pMem->zMalloc);
   207    205       pMem->zMalloc = sqlite3DbMallocRaw(pMem->db, n);
   208    206     }
................................................................................
  1043   1041       iLimit = SQLITE_MAX_LENGTH;
  1044   1042     }
  1045   1043     flags = (enc==0?MEM_Blob:MEM_Str);
  1046   1044     if( nByte<0 ){
  1047   1045       assert( enc!=0 );
  1048   1046       if( enc==SQLITE_UTF8 ){
  1049   1047         nByte = 0x7fffffff & (int)strlen(z);
  1050         -      if( nByte>iLimit ) nByte = iLimit+1;
  1051   1048       }else{
  1052   1049         for(nByte=0; nByte<=iLimit && (z[nByte] | z[nByte+1]); nByte+=2){}
  1053   1050       }
  1054   1051       flags |= MEM_Term;
  1055   1052     }
  1056   1053   
  1057   1054     /* The following block sets the new values of Mem.z and Mem.xDel. It
  1058   1055     ** also sets a flag in local variable "flags" to indicate the memory
  1059   1056     ** management (one of MEM_Dyn or MEM_Static).
  1060   1057     */
  1061   1058     if( xDel==SQLITE_TRANSIENT ){
  1062         -    int nAlloc = nByte;
         1059  +    u32 nAlloc = nByte;
  1063   1060       if( flags&MEM_Term ){
  1064   1061         nAlloc += (enc==SQLITE_UTF8?1:2);
  1065   1062       }
  1066   1063       if( nByte>iLimit ){
  1067   1064         return SQLITE_TOOBIG;
  1068   1065       }
  1069   1066       testcase( nAlloc==0 );
  1070   1067       testcase( nAlloc==31 );
  1071   1068       testcase( nAlloc==32 );
  1072         -    if( sqlite3VdbeMemClearAndResize(pMem, MAX(nAlloc,32)) ){
         1069  +    if( sqlite3VdbeMemClearAndResize(pMem, (int)MAX(nAlloc,32)) ){
  1073   1070         return SQLITE_NOMEM_BKPT;
  1074   1071       }
  1075   1072       memcpy(pMem->z, z, nAlloc);
  1076         -  }else if( xDel==SQLITE_DYNAMIC ){
  1077         -    sqlite3VdbeMemRelease(pMem);
  1078         -    pMem->zMalloc = pMem->z = (char *)z;
  1079         -    pMem->szMalloc = sqlite3DbMallocSize(pMem->db, pMem->zMalloc);
  1080   1073     }else{
  1081   1074       sqlite3VdbeMemRelease(pMem);
  1082   1075       pMem->z = (char *)z;
  1083         -    pMem->xDel = xDel;
  1084         -    flags |= ((xDel==SQLITE_STATIC)?MEM_Static:MEM_Dyn);
         1076  +    if( xDel==SQLITE_DYNAMIC ){
         1077  +      pMem->zMalloc = pMem->z;
         1078  +      pMem->szMalloc = sqlite3DbMallocSize(pMem->db, pMem->zMalloc);
         1079  +    }else{
         1080  +      pMem->xDel = xDel;
         1081  +      flags |= ((xDel==SQLITE_STATIC)?MEM_Static:MEM_Dyn);
         1082  +    }
  1085   1083     }
  1086   1084   
  1087   1085     pMem->n = nByte;
  1088   1086     pMem->flags = flags;
  1089   1087     pMem->enc = (enc==0 ? SQLITE_UTF8 : enc);
  1090   1088   
  1091   1089   #ifndef SQLITE_OMIT_UTF16

Changes to src/wherecode.c.

  1752   1752       ** into reference to index columns.
  1753   1753       **
  1754   1754       ** Do not do this for the RHS of a LEFT JOIN. This is because the 
  1755   1755       ** expression may be evaluated after OP_NullRow has been executed on
  1756   1756       ** the cursor. In this case it is important to do the full evaluation,
  1757   1757       ** as the result of the expression may not be NULL, even if all table
  1758   1758       ** column values are.  https://www.sqlite.org/src/info/7fa8049685b50b5a
         1759  +    **
         1760  +    ** Also, do not do this when processing one index an a multi-index
         1761  +    ** OR clause, since the transformation will become invalid once we
         1762  +    ** move forward to the next index.
         1763  +    ** https://sqlite.org/src/info/4e8e4857d32d401f
  1759   1764       */
  1760         -    if( pLevel->iLeftJoin==0 ){
         1765  +    if( pLevel->iLeftJoin==0 && (pWInfo->wctrlFlags & WHERE_OR_SUBCLAUSE)==0 ){
  1761   1766         whereIndexExprTrans(pIdx, iCur, iIdxCur, pWInfo);
  1762   1767       }
  1763   1768   
  1764   1769       /* Record the instruction used to terminate the loop. */
  1765   1770       if( pLoop->wsFlags & WHERE_ONEROW ){
  1766   1771         pLevel->op = OP_Noop;
  1767   1772       }else if( bRev ){

Changes to test/altertab2.test.

   175    175   } {
   176    176   {CREATE TRIGGER r1 AFTER INSERT ON "t1x" WHEN new.aaa NOT NULL BEGIN
   177    177       UPDATE "t1x" SET (c,ddd)=(aaa,b);
   178    178     END}
   179    179   }
   180    180   
   181    181   #-------------------------------------------------------------------------
          182  +ifcapable windowfunc {
   182    183   do_execsql_test 5.0 {
   183    184     CREATE TABLE t2(a);
   184    185     CREATE TRIGGER r2 AFTER INSERT ON t2 WHEN new.a NOT NULL BEGIN
   185    186       SELECT a, sum(a) OVER w1 FROM t2
   186    187         WINDOW w1 AS (
   187    188           PARTITION BY a ORDER BY a 
   188    189           ROWS BETWEEN 2 PRECEDING AND 3 FOLLOWING
................................................................................
   231    232         );
   232    233     END}
   233    234   }
   234    235   
   235    236   do_execsql_test 5.3 {
   236    237     INSERT INTO t2x VALUES(1);
   237    238   } {}
          239  +} ;# windowfunc
   238    240   
   239    241   #-------------------------------------------------------------------------
   240    242   
   241    243   do_execsql_test 6.0 {
   242    244     CREATE TABLE t3(a,b,c,d);
   243    245     CREATE TRIGGER r3 AFTER INSERT ON t3 WHEN new.a NOT NULL BEGIN
   244    246       SELECT a,b,c FROM t3 EXCEPT SELECT a,b,c FROM t3 ORDER BY a;

Changes to test/altertab3.test.

    16     16   
    17     17   # If SQLITE_OMIT_ALTERTABLE is defined, omit this file.
    18     18   ifcapable !altertable {
    19     19     finish_test
    20     20     return
    21     21   }
    22     22   
           23  +ifcapable windowfunc {
    23     24   do_execsql_test 1.0 {
    24     25     CREATE TABLE t1(a, b);
    25     26     CREATE TRIGGER tr1 AFTER INSERT ON t1 BEGIN
    26     27       SELECT sum(b) OVER w FROM t1 WINDOW w AS (ORDER BY a);
    27     28     END;
    28     29   }
    29     30   
................................................................................
    36     37   } {{CREATE TRIGGER tr1 AFTER INSERT ON t1 BEGIN
    37     38       SELECT sum(b) OVER w FROM t1 WINDOW w AS (ORDER BY aaa);
    38     39     END}}
    39     40   
    40     41   do_execsql_test 1.3 {
    41     42     INSERT INTO t1 VALUES(1, 2);
    42     43   }
           44  +} ;# windowfunc
    43     45   
    44     46   #-------------------------------------------------------------------------
    45     47   reset_db
    46     48   do_execsql_test 2.0 {
    47     49     CREATE TABLE t1(a,b,c);
    48     50     CREATE TABLE t2(a,b,c);
    49     51     CREATE TRIGGER r1 AFTER INSERT ON t1 WHEN new.a NOT NULL BEGIN

Changes to test/autoindex5.test.

   124    124     ) FROM one;
   125    125   } {8.0}
   126    126   
   127    127   # Ticket https://www.sqlite.org/src/info/787fa716be3a7f65
   128    128   # Segfault due to multiple uses of the same subquery where the
   129    129   # subquery is implemented via coroutine.
   130    130   #
          131  +ifcapable windowfunc {
   131    132   sqlite3 db :memory:
   132    133   do_execsql_test 3.0 {
   133    134     -- This is the original test case reported on the mailing list
   134    135     CREATE TABLE artists (
   135    136       id integer NOT NULL PRIMARY KEY AUTOINCREMENT,
   136    137       name varchar(255)
   137    138     );
................................................................................
   162    163             WHERE (name = 'Al')
   163    164           ) AS 't1'
   164    165           WHERE (x = 1)
   165    166         ))
   166    167         AND (albums.id IN (1, 2)))
   167    168     ));
   168    169   } {1 Ar}
          170  +} ;# windowfunc
          171  +
   169    172   # The remaining test cases were discovered (by Dan) during trouble-shooting
   170    173   sqlite3 db :memory:
   171    174   do_execsql_test 3.1 {
   172    175     CREATE TABLE t1 (a); INSERT INTO t1 (a) VALUES (104);
   173    176     CREATE TABLE t2 (b); INSERT INTO t2 (b) VALUES (104);
   174    177     CREATE TABLE t3 (c); INSERT INTO t3 (c) VALUES (104);
   175    178     CREATE TABLE t4 (d); INSERT INTO t4 (d) VALUES (104);

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/e_vacuum.test.

   215    215   # entries in any tables that do not have an explicit INTEGER PRIMARY
   216    216   # KEY.
   217    217   #
   218    218   #   Tests e_vacuum-3.1.1 - 3.1.2 demonstrate that rowids can change when
   219    219   #   a database is VACUUMed. Tests e_vacuum-3.1.3 - 3.1.4 show that adding
   220    220   #   an INTEGER PRIMARY KEY column to a table stops this from happening.
   221    221   #
          222  +#   Update 2019-01-07:  Rowids are now preserved by VACUUM.
          223  +#
   222    224   do_execsql_test e_vacuum-3.1.1 {
   223    225     CREATE TABLE t4(x);
   224    226     INSERT INTO t4(x) VALUES('x');
   225    227     INSERT INTO t4(x) VALUES('y');
   226    228     INSERT INTO t4(x) VALUES('z');
   227    229     DELETE FROM t4 WHERE x = 'y';
   228    230     SELECT rowid, x FROM t4;
   229    231   } {1 x 3 z}
   230    232   do_execsql_test e_vacuum-3.1.2 {
   231    233     VACUUM;
   232    234     SELECT rowid, x FROM t4;
   233         -} {1 x 2 z}
          235  +} {1 x 3 z}
          236  +# Was: {1 x 2 z}
   234    237   
   235    238   do_execsql_test e_vacuum-3.1.3 {
   236    239     CREATE TABLE t5(x, y INTEGER PRIMARY KEY);
   237    240     INSERT INTO t5(x) VALUES('x');
   238    241     INSERT INTO t5(x) VALUES('y');
   239    242     INSERT INTO t5(x) VALUES('z');
   240    243     DELETE FROM t5 WHERE x = 'y';

Changes to test/fts3corrupt4.test.

  3047   3047   |   4080: 75 69 6c 64 0a 01 02 1d 6f 70 74 69 6d 69 7a 65   uild....optimize
  3048   3048   | end crash-526ea445f41c02.db
  3049   3049   }]} {}
  3050   3050   
  3051   3051   do_catchsql_test 19.1 {
  3052   3052     SELECT rowid,a,c,snippet(t1,85101090932165,-1,10) FROM t1 WHERE a MATCH 'rtree';
  3053   3053   } {1 {database disk image is malformed}}
         3054  +
         3055  +#-------------------------------------------------------------------------
         3056  +reset_db
         3057  +do_test 20.0 {
         3058  +  sqlite3 db {}
         3059  +  db deserialize [decode_hexdb {
         3060  +.open --hexdb
         3061  +| size 28672 pagesize 4096 filename crash-afecd03c862e58.db
         3062  +| page 1 offset 0
         3063  +|      0: 53 51 4c 69 74 65 20 66 6f 72 6d 61 74 20 33 00   SQLite format 3.
         3064  +|     16: 10 00 01 01 00 40 20 20 00 00 00 00 00 00 00 07   .....@  ........
         3065  +|     32: 00 00 00 00 00 00 00 00 00 00 00 06 00 00 00 04   ................
         3066  +|     96: 00 00 00 00 0d 0e ef 00 07 0d 4d 00 0f bd 0f 5f   ..........M...._
         3067  +|    112: 0e f7 0e 06 0e bc 0d a4 0d 4d 00 00 01 00 00 00   .........M......
         3068  +|   3392: 00 00 00 00 00 00 00 00 00 00 00 00 00 55 07 07   .............U..
         3069  +|   3408: 17 1b 1b 01 81 01 74 61 62 6c 65 74 31 5f 73 74   ......tablet1_st
         3070  +|   3424: 61 74 74 31 5f 73 74 61 74 07 43 52 45 41 54 45   att1_stat.CREATE
         3071  +|   3440: 20 54 41 42 4c 45 20 27 74 31 5f 73 74 61 74 27    TABLE 't1_stat'
         3072  +|   3456: 28 69 64 20 49 4e 54 45 47 45 52 20 50 52 49 4d   (id INTEGER PRIM
         3073  +|   3472: 41 52 59 20 4b 45 59 2c 20 76 61 6c 75 65 20 42   ARY KEY, value B
         3074  +|   3488: 4c 4f 42 29 60 06 07 17 21 21 01 81 0b 74 61 62   LOB)`...!!...tab
         3075  +|   3504: 6c 65 74 31 5f 64 6f 63 73 69 7a 65 74 31 5f 64   let1_docsizet1_d
         3076  +|   3520: 6f 63 73 69 7a 65 06 43 52 45 41 54 45 20 54 41   ocsize.CREATE TA
         3077  +|   3536: 42 4c 45 20 27 74 31 5f 64 6f 63 73 69 7a 65 27   BLE 't1_docsize'
         3078  +|   3552: 28 64 6f 63 69 64 20 49 4e 54 45 47 45 52 20 50   (docid INTEGER P
         3079  +|   3568: 52 49 4d 41 52 59 30 4b 45 59 2c 20 73 69 7a 65   RIMARY0KEY, size
         3080  +|   3584: 20 42 4c 4f 42 29 81 33 04 07 17 1f 1f 01 82 35    BLOB).3.......5
         3081  +|   3600: 74 61 62 6c 65 74 31 5f 73 65 67 64 69 72 74 31   tablet1_segdirt1
         3082  +|   3616: 5f 73 65 67 64 69 25 04 43 52 45 41 54 45 20 54   _segdi%.CREATE T
         3083  +|   3632: 41 42 4c 45 20 27 74 31 5f 73 65 67 64 69 72 27   ABLE 't1_segdir'
         3084  +|   3648: 28 6c 65 76 65 6c 20 49 4e 54 45 47 45 52 2c 69   (level INTEGER,i
         3085  +|   3664: 64 78 20 49 4e 54 45 47 45 52 2c 73 74 61 72 74   dx INTEGER,start
         3086  +|   3680: 5f 62 6c 6f 63 6b 20 49 4e 54 45 47 45 52 2c 6c   _block INTEGER,l
         3087  +|   3696: 65 61 76 65 73 5f 65 6e 64 5f 62 6c 6f 63 6b 20   eaves_end_block 
         3088  +|   3712: 49 4d 54 45 47 45 52 2c 65 6e 64 5f 62 6c 6f 63   IMTEGER,end_bloc
         3089  +|   3728: 6b 20 49 4e 54 45 47 45 52 2c 72 6f 6f 74 20 42   k INTEGER,root B
         3090  +|   3744: 4c 4f 42 2c 50 52 49 4d 41 52 59 20 4b 45 59 28   LOB,PRIMARY KEY(
         3091  +|   3760: 6c 65 76 65 6c 2c 20 69 64 78 29 29 31 05 06 17   level, idx))1...
         3092  +|   3776: 45 1f 01 00 69 6e 64 65 78 73 71 6c 69 74 65 5f   E...indexsqlite_
         3093  +|   3792: 61 75 74 6f 69 6e 64 65 78 5f 74 31 5f 73 65 67   autoindex_t1_seg
         3094  +|   3808: 64 69 72 5f 31 74 31 5f 73 65 67 64 69 72 05 00   dir_1t1_segdir..
         3095  +|   3824: 00 00 08 00 00 00 00 66 03 07 17 23 23 01 81 13   .......f...##...
         3096  +|   3840: 74 61 62 6c 65 74 31 5f 73 65 67 6d 65 6e 74 73   tablet1_segments
         3097  +|   3856: 74 31 5f 73 65 67 6d 65 6e 74 73 03 43 52 45 41   t1_segments.CREA
         3098  +|   3872: 54 45 20 54 41 42 4c 45 20 27 74 31 5f 73 65 67   TE TABLE 't1_seg
         3099  +|   3888: 6d 65 6e 74 73 27 28 62 6c 6f 63 6b 69 64 20 49   ments'(blockid I
         3100  +|   3904: 4e 54 45 47 45 52 20 50 52 49 4d 41 52 59 20 4b   NTEGER PRIMARY K
         3101  +|   3920: 45 59 2c 20 62 6c 6f 63 6b 20 42 4c 4f 42 29 5c   EY, block BLOB).
         3102  +|   3936: 02 07 17 21 21 01 81 03 74 61 62 6c 65 74 31 5f   ...!!...tablet1_
         3103  +|   3952: 63 6f 6e 74 65 6e 74 74 31 5f 63 6f 6e 74 65 6e   contentt1_conten
         3104  +|   3968: 74 02 43 52 45 41 54 45 20 54 41 42 4c 45 20 27   t.CREATE TABLE '
         3105  +|   3984: 74 31 5f 63 6f 6e 74 65 6e 74 27 28 64 6f 63 69   t1_content'(doci
         3106  +|   4000: 64 20 49 4e 54 45 47 45 52 20 50 52 49 4d 41 52   d INTEGER PRIMAR
         3107  +|   4016: 59 20 4b 45 59 2c 20 27 63 30 61 27 29 41 01 06   Y KEY, 'c0a')A..
         3108  +|   4032: 17 11 11 08 71 74 61 62 6c 65 74 31 74 31 43 52   ....qtablet1t1CR
         3109  +|   4048: 45 41 54 45 20 56 49 52 54 55 41 4c 20 54 41 42   EATE VIRTUAL TAB
         3110  +|   4064: 4c 45 20 74 31 20 55 53 49 4e 47 20 66 74 73 34   LE t1 USING fts4
         3111  +|   4080: 28 61 2c 70 72 65 66 69 78 3d 27 31 2c 32 27 29   (a,prefix='1,2')
         3112  +| page 2 offset 4096
         3113  +|      0: 0d 00 00 00 08 0e 1f 00 0f c4 0f 7c 0f 34 0f 07   ...........|.4..
         3114  +|     16: 0e c3 0e 97 0e 63 0e 1f 00 00 00 00 00 00 00 00   .....c..........
         3115  +|   3600: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 42   ...............B
         3116  +|   3616: 08 04 00 81 09 73 75 6e 74 20 69 6e 20 63 75 6c   .....sunt in cul
         3117  +|   3632: 70 61 20 71 75 68 20 6f 66 66 69 63 69 61 20 64   pa quh officia d
         3118  +|   3648: 65 73 65 72 75 6e 74 20 6d 6f 6c 6c 69 74 20 61   eserunt mollit a
         3119  +|   3664: 6e 69 6d 20 69 64 20 65 73 74 20 6c 61 62 6f 72   nim id est labor
         3120  +|   3680: 75 6d 2e 32 07 03 01 6b 45 78 63 65 70 74 65 75   um.2...kExcepteu
         3121  +|   3696: 72 20 73 69 6e 74 20 6f 63 63 61 65 63 61 74 20   r sint occaecat 
         3122  +|   3712: 63 75 70 69 64 61 74 61 74 20 6e 6f 6e 20 70 72   cupidatat non pr
         3123  +|   3728: 6f 69 64 65 6e 74 2c 2a 06 03 00 5b 63 69 6c 6c   oident,*...[cill
         3124  +|   3744: 75 6d 20 64 6f 6c 6f 72 65 20 65 75 20 66 75 67   um dolore eu fug
         3125  +|   3760: 69 61 74 20 6e 75 6c 6c 61 20 70 61 72 69 61 74   iat nulla pariat
         3126  +|   3776: 75 72 2e 43 05 04 00 81 09 44 75 69 73 20 61 75   ur.C.....Duis au
         3127  +|   3792: 74 65 20 69 72 75 72 65 20 64 6f 6c 6f 72 20 69   te irure dolor i
         3128  +|   3808: 6e 20 72 65 70 72 65 68 65 6e 64 65 72 69 74 20   n reprehenderit 
         3129  +|   3824: 69 6e 20 76 6f 6c 75 70 74 61 74 65 20 76 65 6c   in voluptate vel
         3130  +|   3840: 69 74 20 65 73 73 65 2b 14 03 00 5d 6e 69 73 69   it esse+...]nisi
         3131  +|   3856: 20 75 74 20 61 6c 69 71 75 69 70 20 65 78 20 65    ut aliquip ex e
         3132  +|   3872: 61 20 63 6f 6d 6d 6f 64 6f 20 63 6f 6e 73 65 71   a commodo conseq
         3133  +|   3888: 75 61 74 2e 46 03 04 00 81 11 55 74 20 65 6e 69   uat.F.....Ut eni
         3134  +|   3904: 6d 20 61 63 20 6d 69 6e 69 6d 20 76 65 6e 69 61   m ac minim venia
         3135  +|   3920: 6d 2c 20 71 75 69 73 20 6e 6f 73 74 72 75 64 20   m, quis nostrud 
         3136  +|   3936: 65 78 65 72 63 69 74 61 74 69 6f 6e 20 75 6c 6c   exercitation ull
         3137  +|   3952: 61 6d 63 6f 20 6c 61 62 6f 72 69 73 46 02 04 00   amco laborisF...
         3138  +|   3968: 81 11 73 65 64 20 64 6f 20 65 69 75 73 6d 6f 64   ..sed do eiusmod
         3139  +|   3984: 20 74 65 6d 70 6f 72 20 69 6e 63 69 64 69 64 75    tempor incididu
         3140  +|   4000: 6e 74 20 75 74 20 6c 61 62 6f 72 65 20 65 74 20   nt ut labore et 
         3141  +|   4016: 64 6f 6c 6f 72 65 20 6d 61 67 6e 61 20 61 6c 69   dolore magna ali
         3142  +|   4032: 71 75 61 2e 3a 01 03 00 7b 4c 6f 72 65 6d 20 69   qua.:....Lorem i
         3143  +|   4048: 70 73 75 6d 20 64 6f 6c 6f 72 20 73 69 74 20 61   psum dolor sit a
         3144  +|   4064: 6d 65 74 2c 20 63 6f 6e 73 65 63 74 65 74 75 72   met, consectetur
         3145  +|   4080: 20 61 64 69 70 69 73 63 69 6e 67 20 65 6c 69 74    adipiscing elit
         3146  +| page 3 offset 8192
         3147  +|      0: 0d 00 00 00 00 10 00 00 00 00 00 00 00 00 00 00   ................
         3148  +| page 4 offset 12288
         3149  +|      0: 0d 00 00 00 03 0a a6 00 0d 57 0c 4a 0a a6 00 00   .........W.J....
         3150  +|   2720: 00 00 00 00 00 00 83 21 03 08 02 08 08 08 17 86   .......!........
         3151  +|   2736: 30 08 00 30 20 34 30 32 00 02 61 64 06 01 08 00   0..0 402..ad....
         3152  +|   2752: 02 04 00 01 01 6c 06 02 0c 00 02 04 00 01 01 6d   .....l.........m
         3153  +|   2768: 03 01 06 00 01 01 6e 03 08 09 00 01 01 75 03 05   ......n......u..
         3154  +|   2784: 03 00 00 02 63 69 03 06 01 00 01 01 6f 07 01 07   ....ci......o...
         3155  +|   2800: 00 03 07 03 00 01 01 75 06 07 05 00 01 04 00 00   .......u........
         3156  +|   2816: 02 64 65 03 08 07 00 01 01 6f 0d 01 04 00 01 03   .de......o......
         3157  +|   2832: 09 00 03 05 00 01 03 00 01 01 75 03 05 02 00 00   ..........u.....
         3158  +|   2848: 02 65 61 03 04 06 00 01 01 69 03 02 04 00 01 01   .ea......i......
         3159  +|   2864: 6c 03 01 09 00 01 01 6e 03 03 03 00 01 01 73 06   l......n......s.
         3160  +|   2880: 05 0b 00 03 0b 00 01 01 74 03 02 09 00 01 01 75   ........t......u
         3161  +|   2896: 03 06 04 00 01 01 78 09 03 09 00 01 05 00 03 02   ......x.........
         3162  +|   2912: 00 00 02 66 75 03 06 05 00 00 02 69 64 03 08 0a   ...fu......id...
         3163  +|   2928: 00 01 01 6e 0a 02 06 00 03 06 04 00 03 03 00 01   ...n............
         3164  +|   2944: 01 70 03 01 13 00 01 01 72 03 05 04 00 00 02 6c   .p......r......l
         3165  +|   2960: 61 09 02 08 00 01 0b 00 05 0c 00 01 01 6f 03 01   a............o..
         3166  +|   2976: 02 00 00 02 6d 61 03 02 0b 00 01 01 69 03 03 05   ....ma......i...
         3167  +|   2992: 00 01 01 6f 03 08 08 00 00 02 6e 69 03 04 02 00   ...o......ni....
         3168  +|   3008: 01 01 6f 06 03 08 00 04 06 00 01 01 75 03 06 06   ..o.........u...
         3169  +|   3024: 00 00 02 6f 63 03 07 04 00 01 01 66 03 08 06 00   ...oc......f....
         3170  +|   3040: 00 02 70 61 03 06 07 00 01 01 72 03 07 07 00 00   ..pa......r.....
         3171  +|   3056: 02 71 75 06 03 07 00 05 05 00 00 02 72 65 03 05   .qu.........re..
         3172  +|   3072: 07 00 00 02 73 65 03 02 02 00 01 01 69 06 01 05   ....se......i...
         3173  +|   3088: 00 06 03 00 01 01 75 03 08 02 00 00 02 74 65 03   ......u......te.
         3174  +|   3104: 03 05 00 00 02 72 bc 03 03 0a 00 01 01 74 09 02   .....r.......t..
         3175  +|   3120: 07 00 01 02 00 01 03 00 00 02 76 65 06 03 06 00   ..........ve....
         3176  +|   3136: 02 0a 00 01 01 6f 03 05 09 00 82 0a 02 08 02 08   .....o..........
         3177  +|   3152: 08 08 17 84 02 04 00 30 20 32 35 31 00 01 61 13   .......0 251..a.
         3178  +|   3168: 01 06 04 00 01 0c 00 01 04 00 01 04 00 01 03 00   ................
         3179  +|   3184: 03 09 00 00 01 63 10 01 07 00 03 07 03 00 02 02   .....c..........
         3180  +|   3200: 00 01 05 00 01 04 00 00 01 64 11 01 04 00 01 03   .........d......
         3181  +|   3216: 09 00 03 02 05 00 01 03 00 02 07 00 00 01 65 1b   ..............e.
         3182  +|   3232: 01 09 00 01 04 07 00 01 03 08 00 01 05 03 00 01   ................
         3183  +|   3248: 0b 00 01 04 00 01 02 00 01 0b 00 00 01 66 03 06   .............f..
         3184  +|   3264: 05 00 00 01 69 0f 01 03 00 01 06 00 02 04 04 04   ....i...........
         3185  +|   3280: 00 03 03 09 00 00 01 6c 0c 01 02 00 01 08 00 01   .......l........
         3186  +|   3296: 0b 00 05 0c 00 00 01 6d 09 02 0b 00 01 05 00 05   .......m........
         3187  +|   3312: 08 00 00 01 6e 0c 03 08 00 01 02 00 02 06 00 01   ....n...........
         3188  +|   3328: 06 00 f0 01 6f 06 07 04 00 01 06 00 00 01 70 06   ....o.........p.
         3189  +|   3344: 06 07 00 01 07 00 00 01 71 06 03 07 00 05 05 00   ........q.......
         3190  +|   3360: 00 01 72 03 05 08 00 00 01 73 0c 01 05 00 01 02   ..r......s......
         3191  +|   3376: 00 05 03 00 01 02 00 00 01 74 03 02 05 00 00 01   .........t......
         3192  +|   3392: 75 0a 02 07 00 01 02 0a 00 01 03 00 00 01 76 07   u.............v.
         3193  +|   3408: 03 06 00 02 09 03 00 85 26 01 08 08 08 08 08 17   ........&.......
         3194  +|   3424: 8a 3e 30 21 36 36 35 00 02 61 64 03 03 04 00 02   .>0!665..ad.....
         3195  +|   3440: 08 69 70 69 73 63 69 6e 67 03 01 08 00 01 05 6c   .ipiscing......l
         3196  +|   3456: 69 71 75 61 03 02 0c 00 05 02 69 70 03 04 04 00   iqua......ip....
         3197  +|   3472: 01 03 6d 65 74 03 01 06 00 01 03 6e 69 6d 03 08   ..met......nim..
         3198  +|   3488: 09 00 01 03 75 74 65 03 05 03 00 00 06 63 69 6c   ....ute......cil
         3199  +|   3504: 6c 75 6d 03 06 02 00 01 06 6f 6d 6d 6f 64 6f 03   lum......ommodo.
         3200  +|   3520: 04 07 00 02 09 6e 73 65 63 74 65 74 75 72 03 01   .....nsectetur..
         3201  +|   3536: 07 00 05 04 71 75 61 74 03 04 08 00 01 04 75 6c   ....quat......ul
         3202  +|   3552: 70 61 03 08 04 00 02 07 70 69 64 61 74 61 74 03   pa......pidatat.
         3203  +|   3568: 07 05 00 00 08 64 65 73 65 72 75 6e 74 03 08 07   .....deserunt...
         3204  +|   3584: 00 01 01 6f 03 02 03 00 02 03 6c 6f 72 06 01 04   ...o......lor...
         3205  +|   3600: 00 04 05 00 05 01 65 06 02 0a 00 04 03 00 01 03   ......e.........
         3206  +|   3616: 75 69 73 03 05 02 00 00 02 65 61 03 04 06 00 01   uis......ea.....
         3207  +|   3632: 06 69 75 73 6d 6f 64 03 02 04 00 01 03 6c 69 74   .iusmod......lit
         3208  +|   3648: 03 01 09 00 01 03 6e 69 6d 03 03 03 00 01 03 73   ......nim......s
         3209  +|   3664: 73 65 03 05 0b 00 02 01 74 03 08 0b 00 01 01 74   se......t......t
         3210  +|   3680: 03 02 09 00 01 01 75 03 06 04 00 01 01 78 03 04   ......u......x..
         3211  +|   3696: 05 00 02 07 63 65 70 74 65 75 72 03 07 02 00 02   ....cepteur.....
         3212  +|   3712: 0a 65 72 63 69 74 61 74 69 6f 6e 03 03 09 00 00   .ercitation.....
         3213  +|   3728: 06 66 75 67 69 61 74 03 06 05 00 00 02 69 64 03   .fugiat......id.
         3214  +|   3744: 08 0a 00 01 01 6e 07 05 06 04 00 03 03 00 02 08   .....n..........
         3215  +|   3760: 63 69 64 69 64 75 6e 74 03 02 06 00 01 04 70 73   cididunt......ps
         3216  +|   3776: 75 6d 03 01 03 00 01 04 72 75 72 65 03 05 04 00   um......rure....
         3217  +|   3792: 00 06 6c 61 62 6f 72 65 03 02 08 00 05 02 69 73   ..labore......is
         3218  +|   3808: 03 03 0b 00 05 02 75 6d 03 08 0c 00 01 04 6f 72   ......um......or
         3219  +|   3824: 65 6d 03 01 02 00 00 05 6d 61 67 6e 61 03 02 0b   em......magna...
         3220  +|   3840: 00 01 04 69 6e 69 6d 03 03 05 00 01 05 6f 6c 6c   ...inim......oll
         3221  +|   3856: 69 74 03 08 08 00 00 04 6e 69 73 69 03 04 02 00   it......nisi....
         3222  +|   3872: 01 02 6f 6e 03 07 06 00 02 05 73 74 72 75 64 03   ..on......strud.
         3223  +|   3888: 03 08 00 01 04 75 6c 6c 61 03 06 06 00 00 08 6f   .....ulla......o
         3224  +|   3904: 63 63 61 65 63 61 74 03 07 04 00 01 06 66 66 69   ccaecat......ffi
         3225  +|   3920: 63 69 61 03 08 06 00 00 08 70 61 72 69 61 74 75   cia......pariatu
         3226  +|   3936: 72 03 06 07 00 01 07 72 6f 69 64 65 6e 74 03 07   r......roident..
         3227  +|   3952: 07 00 00 03 71 75 69 03 08 05 00 03 01 73 03 03   ....qui......s..
         3228  +|   3968: 07 00 00 0d 72 65 41 72 65 68 65 6e 64 65 72 69   ....reArehenderi
         3229  +|   3984: 74 03 05 07 00 00 03 73 65 64 03 02 02 00 01 03   t......sed......
         3230  +|   4000: 69 6e 74 03 07 03 00 02 01 74 03 01 05 00 01 03   int......t......
         3231  +|   4016: 75 6e 74 03 08 02 00 00 06 74 65 6d 70 6f 72 03   unt......tempor.
         3232  +|   4032: 02 05 00 00 07 75 6c 6c 61 6d 63 6f 03 03 0a 00   .....ullamco....
         3233  +|   4048: 01 01 74 09 02 07 00 01 02 00 01 03 00 00 05 76   ..t............v
         3234  +|   4064: 65 6c 69 74 03 05 0a 00 02 04 6e 69 61 6d 03 03   elit......niam..
         3235  +|   4080: 06 00 01 08 70 6c 75 70 74 61 74 65 03 05 09 00   ....pluptate....
         3236  +| page 5 offset 16384
         3237  +|      0: 0a 00 00 00 03 0f eb 00 0f fb 0f f3 0f eb 00 00   ................
         3238  +|   4064: 00 00 00 00 00 00 00 00 00 00 00 07 04 02 08 01   ................
         3239  +|   4080: 08 00 03 07 04 0a 98 01 04 00 02 04 04 08 08 09   ................
         3240  +| page 6 offset 20480
         3241  +|      0: 0d 00 00 00 08 0f d0 00 0f fa 0f f4 0f ee 0f e8   ................
         3242  +|     16: 0f e2 00 00 00 00 00 00 00 00 00 00 00 00 00 00   ................
         3243  +|   4048: 04 08 03 00 0e 0b 04 07 03 00 0e 06 04 06 03 00   ................
         3244  +|   4064: 0e 06 04 05 03 00 0e 0a 04 04 03 00 0e 07 04 03   ................
         3245  +|   4080: 03 00 0e 0a 04 02 03 00 0e 0b 04 01 03 00 0e 08   ................
         3246  +| page 7 offset 24576
         3247  +|      0: 0d 00 00 00 01 0f f7 00 0f f7 00 00 00 00 00 00   ................
         3248  +|   4080: 00 00 00 00 00 00 00 07 00 03 00 14 08 45 b5 03   .............E..
         3249  +| end crash-afecd03c862e58.db
         3250  +}]} {}
         3251  +
         3252  +do_execsql_test 20.1 {
         3253  +  BEGIN;
         3254  +  WITH RECURSIVE c(x) AS (VALUES(1) UNION ALL SELECT x+1 FROM c WHERE x<10)
         3255  +    INSERT INTO t1(a) SELECT randomblob(3000) FROM c;
         3256  +}
         3257  +
         3258  +do_execsql_test 20.2 {
         3259  +  INSERT INTO t1(t1) VALUES('optimize');
         3260  +} 
         3261  +
  3054   3262   
  3055   3263   finish_test
  3056   3264   

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/join5.test.

   236    236     SELECT ifnull(z, '!!!') FROM t3 LEFT JOIN t4 ON (x=y);
   237    237   } {!!!}
   238    238   
   239    239   do_execsql_test 6.3.2 {
   240    240     CREATE INDEX t4i ON t4(y, ifnull(z, '!!!'));
   241    241     SELECT ifnull(z, '!!!') FROM t3 LEFT JOIN t4 ON (x=y);
   242    242   } {!!!}
          243  +
          244  +# 2019-02-08 https://sqlite.org/src/info/4e8e4857d32d401f
          245  +reset_db
          246  +do_execsql_test 6.100 {
          247  +  CREATE TABLE t1(aa, bb);
          248  +  CREATE INDEX t1x1 on t1(abs(aa), abs(bb));
          249  +  INSERT INTO t1 VALUES(-2,-3),(+2,-3),(-2,+3),(+2,+3);
          250  +  SELECT * FROM (t1) 
          251  +   WHERE ((abs(aa)=1 AND 1=2) OR abs(aa)=2)
          252  +     AND abs(bb)=3
          253  +  ORDER BY +1, +2;
          254  +} {-2 -3 -2 3 2 -3 2 3}
   243    255   
   244    256   #-------------------------------------------------------------------------
   245    257   #
   246    258   reset_db
   247    259   do_execsql_test 7.0 {
   248    260     CREATE TABLE t1(x);
   249    261     INSERT INTO t1 VALUES(1);

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/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/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/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