System.Data.SQLite
Check-in [70629abeb3]
Not logged in

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

Overview
Comment:Update SQLite core library to the latest trunk code.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 70629abeb3269342eb968c4312604abefa3d3708
User & Date: mistachkin 2016-01-05 18:54:45
Context
2016-01-05
21:15
Add missing GOTO statements to several batch tools. check-in: 7705088027 user: mistachkin tags: trunk
18:54
Update SQLite core library to the latest trunk code. check-in: 70629abeb3 user: mistachkin tags: trunk
2015-12-31
22:58
Merge fix for [5251bd0878]. Update SQLite core library to the latest trunk code. Bump version to 1.0.100.0. Update version history docs. check-in: 59a224a9cf user: mistachkin tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to SQLite.Interop/src/core/sqlite3.c.

   323    323   **
   324    324   ** See also: [sqlite3_libversion()],
   325    325   ** [sqlite3_libversion_number()], [sqlite3_sourceid()],
   326    326   ** [sqlite_version()] and [sqlite_source_id()].
   327    327   */
   328    328   #define SQLITE_VERSION        "3.10.0"
   329    329   #define SQLITE_VERSION_NUMBER 3010000
   330         -#define SQLITE_SOURCE_ID      "2015-12-31 22:29:36 d41d4d7396fba60895535f21c438f8c75e7b2097"
          330  +#define SQLITE_SOURCE_ID      "2016-01-05 03:39:52 a855697719e288c908ddb7950d32fd17ef546509"
   331    331   
   332    332   /*
   333    333   ** CAPI3REF: Run-Time Library Version Numbers
   334    334   ** KEYWORDS: sqlite3_version, sqlite3_sourceid
   335    335   **
   336    336   ** These interfaces provide the same information as the [SQLITE_VERSION],
   337    337   ** [SQLITE_VERSION_NUMBER], and [SQLITE_SOURCE_ID] C preprocessor macros
................................................................................
 13525  13525     int iRangeReg;       /* First register in temporary register block */
 13526  13526     int nErr;            /* Number of errors seen */
 13527  13527     int nTab;            /* Number of previously allocated VDBE cursors */
 13528  13528     int nMem;            /* Number of memory cells used so far */
 13529  13529     int nSet;            /* Number of sets used so far */
 13530  13530     int nOnce;           /* Number of OP_Once instructions so far */
 13531  13531     int nOpAlloc;        /* Number of slots allocated for Vdbe.aOp[] */
        13532  +  int szOpAlloc;       /* Bytes of memory space allocated for Vdbe.aOp[] */
 13532  13533     int iFixedOp;        /* Never back out opcodes iFixedOp-1 or earlier */
 13533  13534     int ckBase;          /* Base register of data during check constraints */
 13534  13535     int iSelfTab;        /* Table of an index whose exprs are being coded */
 13535  13536     int iCacheLevel;     /* ColCache valid when aColCache[].iLevel<=iCacheLevel */
 13536  13537     int iCacheCnt;       /* Counter used to generate aColCache[].lru values */
 13537  13538     int nLabel;          /* Number of labels used */
 13538  13539     int *aLabel;         /* Space to hold the labels */
................................................................................
 13756  13757   ** An objected used to accumulate the text of a string where we
 13757  13758   ** do not necessarily know how big the string will be in the end.
 13758  13759   */
 13759  13760   struct StrAccum {
 13760  13761     sqlite3 *db;         /* Optional database for lookaside.  Can be NULL */
 13761  13762     char *zBase;         /* A base allocation.  Not from malloc. */
 13762  13763     char *zText;         /* The string collected so far */
 13763         -  int  nChar;          /* Length of the string so far */
 13764         -  int  nAlloc;         /* Amount of space allocated in zText */
 13765         -  int  mxAlloc;        /* Maximum allowed allocation.  0 for no malloc usage */
        13764  +  u32  nChar;          /* Length of the string so far */
        13765  +  u32  nAlloc;         /* Amount of space allocated in zText */
        13766  +  u32  mxAlloc;        /* Maximum allowed allocation.  0 for no malloc usage */
 13766  13767     u8   accError;       /* STRACCUM_NOMEM or STRACCUM_TOOBIG */
 13767  13768     u8   bMalloced;      /* zText points to allocated space */
 13768  13769   };
 13769  13770   #define STRACCUM_NOMEM   1
 13770  13771   #define STRACCUM_TOOBIG  2
 13771  13772   
 13772  13773   /*
................................................................................
 63309  63310         releasePage(pCur->apPage[pCur->iPage--]);
 63310  63311       }
 63311  63312       rc = balance(pCur);
 63312  63313     }
 63313  63314   
 63314  63315     if( rc==SQLITE_OK ){
 63315  63316       if( bSkipnext ){
 63316         -      assert( bPreserve && pCur->iPage==iCellDepth );
        63317  +      assert( bPreserve && (pCur->iPage==iCellDepth || CORRUPT_DB) );
 63317  63318         assert( pPage==pCur->apPage[pCur->iPage] );
 63318  63319         assert( (pPage->nCell>0 || CORRUPT_DB) && iCellIdx<=pPage->nCell );
 63319  63320         pCur->eState = CURSOR_SKIPNEXT;
 63320  63321         if( iCellIdx>=pPage->nCell ){
 63321  63322           pCur->skipNext = -1;
 63322  63323           pCur->aiIdx[iCellDepth] = pPage->nCell-1;
 63323  63324         }else{
................................................................................
 67320  67321     p->pPrev = 0;
 67321  67322     db->pVdbe = p;
 67322  67323     p->magic = VDBE_MAGIC_INIT;
 67323  67324     p->pParse = pParse;
 67324  67325     assert( pParse->aLabel==0 );
 67325  67326     assert( pParse->nLabel==0 );
 67326  67327     assert( pParse->nOpAlloc==0 );
        67328  +  assert( pParse->szOpAlloc==0 );
 67327  67329     return p;
 67328  67330   }
 67329  67331   
 67330  67332   /*
 67331  67333   ** Change the error string stored in Vdbe.zErrMsg
 67332  67334   */
 67333  67335   SQLITE_PRIVATE void sqlite3VdbeError(Vdbe *p, const char *zFormat, ...){
................................................................................
 67409  67411     UNUSED_PARAMETER(nOp);
 67410  67412   #endif
 67411  67413   
 67412  67414     assert( nOp<=(1024/sizeof(Op)) );
 67413  67415     assert( nNew>=(p->nOpAlloc+nOp) );
 67414  67416     pNew = sqlite3DbRealloc(p->db, v->aOp, nNew*sizeof(Op));
 67415  67417     if( pNew ){
 67416         -    p->nOpAlloc = sqlite3DbMallocSize(p->db, pNew)/sizeof(Op);
        67418  +    p->szOpAlloc = sqlite3DbMallocSize(p->db, pNew);
        67419  +    p->nOpAlloc = p->szOpAlloc/sizeof(Op);
 67417  67420       v->aOp = pNew;
 67418  67421     }
 67419  67422     return (pNew ? SQLITE_OK : SQLITE_NOMEM);
 67420  67423   }
 67421  67424   
 67422  67425   #ifdef SQLITE_DEBUG
 67423  67426   /* This routine is just a convenient place to set a breakpoint that will
................................................................................
 69131  69134     ** cursor 0 is stored in memory cell nMem. Memory cell (nMem-1)
 69132  69135     ** stores the blob of memory associated with cursor 1, etc.
 69133  69136     **
 69134  69137     ** See also: allocateCursor().
 69135  69138     */
 69136  69139     nMem += nCursor;
 69137  69140   
 69138         -  /* Allocate space for memory registers, SQL variables, VDBE cursors and 
 69139         -  ** an array to marshal SQL function arguments in.
        69141  +  /* zCsr will initially point to nFree bytes of unused space at the
        69142  +  ** end of the opcode array, p->aOp.  The computation of nFree is
        69143  +  ** conservative - it might be smaller than the true number of free
        69144  +  ** bytes, but never larger.  nFree must be a multiple of 8 - it is
        69145  +  ** rounded down if is not.
 69140  69146     */
 69141         -  zCsr = (u8*)&p->aOp[p->nOp];            /* Memory avaliable for allocation */
 69142         -  assert( pParse->nOpAlloc*sizeof(Op) <= 0x7fffff00 );
 69143         -  nFree = (pParse->nOpAlloc - p->nOp)*sizeof(p->aOp[0]); /* Available space */
        69147  +  n = ROUND8(sizeof(Op)*p->nOp);              /* Bytes of opcode space used */
        69148  +  zCsr = &((u8*)p->aOp)[n];                   /* Unused opcode space */
        69149  +  assert( EIGHT_BYTE_ALIGNMENT(zCsr) );
        69150  +  nFree = ROUNDDOWN8(pParse->szOpAlloc - n);  /* Bytes of unused space */
        69151  +  assert( nFree>=0 );
        69152  +  if( nFree>0 ){
        69153  +    memset(zCsr, 0, nFree);
        69154  +    assert( EIGHT_BYTE_ALIGNMENT(&zCsr[nFree]) );
        69155  +  }
 69144  69156   
 69145  69157     resolveP2Values(p, &nArg);
 69146  69158     p->usesStmtJournal = (u8)(pParse->isMultiWrite && pParse->mayAbort);
 69147  69159     if( pParse->explain && nMem<10 ){
 69148  69160       nMem = 10;
 69149  69161     }
 69150         -  memset(zCsr, 0, nFree);
 69151         -  assert( EIGHT_BYTE_ALIGNMENT(&zCsr[nFree]) );
 69152  69162     p->expired = 0;
 69153  69163   
 69154  69164     /* Memory for registers, parameters, cursor, etc, is allocated in two
 69155  69165     ** passes.  On the first pass, we try to reuse unused space at the 
 69156  69166     ** end of the opcode array.  If we are unable to satisfy all memory
 69157  69167     ** requirements by reusing the opcode array tail, then the second
 69158  69168     ** pass will fill in the rest using a fresh allocation.  
................................................................................
 76197  76207         if( (zHdr>=zEndHdr && (zHdr>zEndHdr || offset64!=pC->payloadSize))
 76198  76208          || (offset64 > pC->payloadSize)
 76199  76209         ){
 76200  76210           rc = SQLITE_CORRUPT_BKPT;
 76201  76211           goto op_column_error;
 76202  76212         }
 76203  76213       }else{
 76204         -      VVA_ONLY( t = 0; ) /* Only needed by assert() statements */
        76214  +      t = 0;
 76205  76215       }
 76206  76216   
 76207  76217       /* If after trying to extract new entries from the header, nHdrParsed is
 76208  76218       ** still not up to p2, that means that the record has fewer than p2
 76209  76219       ** columns.  So the result will be either the default value or a NULL.
 76210  76220       */
 76211  76221       if( pC->nHdrParsed<=p2 ){
................................................................................
 77075  77085     ** since moved into the btree layer.  */  
 77076  77086     pCur->isTable = pOp->p4type!=P4_KEYINFO;
 77077  77087   
 77078  77088   open_cursor_set_hints:
 77079  77089     assert( OPFLAG_BULKCSR==BTREE_BULKLOAD );
 77080  77090     assert( OPFLAG_SEEKEQ==BTREE_SEEK_EQ );
 77081  77091     testcase( pOp->p5 & OPFLAG_BULKCSR );
 77082         -#ifdef SQLITE_ENABLE_CURSOR_HINT
        77092  +#ifdef SQLITE_ENABLE_CURSOR_HINTS
 77083  77093     testcase( pOp->p2 & OPFLAG_SEEKEQ );
 77084  77094   #endif
 77085  77095     sqlite3BtreeCursorHintFlags(pCur->uc.pCursor,
 77086  77096                                  (pOp->p5 & (OPFLAG_BULKCSR|OPFLAG_SEEKEQ)));
 77087  77097     break;
 77088  77098   }
 77089  77099   
................................................................................
 95461  95471     assert( pPk!=0 );
 95462  95472     nPk = pPk->nKeyCol;
 95463  95473   
 95464  95474     /* Make sure every column of the PRIMARY KEY is NOT NULL.  (Except,
 95465  95475     ** do not enforce this for imposter tables.) */
 95466  95476     if( !db->init.imposterTable ){
 95467  95477       for(i=0; i<nPk; i++){
 95468         -      pTab->aCol[pPk->aiColumn[i]].notNull = 1;
        95478  +      pTab->aCol[pPk->aiColumn[i]].notNull = OE_Abort;
 95469  95479       }
 95470  95480       pPk->uniqNotNull = 1;
 95471  95481     }
 95472  95482   
 95473  95483     /* The root page of the PRIMARY KEY is the table root page */
 95474  95484     pPk->tnum = pTab->tnum;
 95475  95485   
................................................................................
166450 166460     JsonString *pStr;
166451 166461     pStr = (JsonString*)sqlite3_aggregate_context(ctx, 0);
166452 166462     if( pStr ){
166453 166463       pStr->pCtx = ctx;
166454 166464       jsonAppendChar(pStr, ']');
166455 166465       if( pStr->bErr ){
166456 166466         sqlite3_result_error_nomem(ctx);
166457         -      if( !pStr->bStatic ) sqlite3_free(pStr->zBuf);
       166467  +      assert( pStr->bStatic );
166458 166468       }else{
166459 166469         sqlite3_result_text(ctx, pStr->zBuf, pStr->nUsed,
166460 166470                             pStr->bStatic ? SQLITE_TRANSIENT : sqlite3_free);
166461 166471         pStr->bStatic = 1;
166462 166472       }
166463 166473     }else{
166464 166474       sqlite3_result_text(ctx, "[]", 2, SQLITE_STATIC);
................................................................................
166498 166508   static void jsonObjectFinal(sqlite3_context *ctx){
166499 166509     JsonString *pStr;
166500 166510     pStr = (JsonString*)sqlite3_aggregate_context(ctx, 0);
166501 166511     if( pStr ){
166502 166512       jsonAppendChar(pStr, '}');
166503 166513       if( pStr->bErr ){
166504 166514         sqlite3_result_error_nomem(ctx);
166505         -      if( !pStr->bStatic ) sqlite3_free(pStr->zBuf);
       166515  +      assert( pStr->bStatic );
166506 166516       }else{
166507 166517         sqlite3_result_text(ctx, pStr->zBuf, pStr->nUsed,
166508 166518                             pStr->bStatic ? SQLITE_TRANSIENT : sqlite3_free);
166509 166519         pStr->bStatic = 1;
166510 166520       }
166511 166521     }else{
166512 166522       sqlite3_result_text(ctx, "{}", 2, SQLITE_STATIC);
................................................................................
182235 182245   */
182236 182246   static void fts5SourceIdFunc(
182237 182247     sqlite3_context *pCtx,          /* Function call context */
182238 182248     int nArg,                       /* Number of args */
182239 182249     sqlite3_value **apVal           /* Function arguments */
182240 182250   ){
182241 182251     assert( nArg==0 );
182242         -  sqlite3_result_text(pCtx, "fts5: 2015-12-31 22:29:36 d41d4d7396fba60895535f21c438f8c75e7b2097", -1, SQLITE_TRANSIENT);
       182252  +  sqlite3_result_text(pCtx, "fts5: 2016-01-05 03:39:52 a855697719e288c908ddb7950d32fd17ef546509", -1, SQLITE_TRANSIENT);
182243 182253   }
182244 182254   
182245 182255   static int fts5Init(sqlite3 *db){
182246 182256     static const sqlite3_module fts5Mod = {
182247 182257       /* iVersion      */ 2,
182248 182258       /* xCreate       */ fts5CreateMethod,
182249 182259       /* xConnect      */ fts5ConnectMethod,

Changes to SQLite.Interop/src/core/sqlite3.h.

   109    109   **
   110    110   ** See also: [sqlite3_libversion()],
   111    111   ** [sqlite3_libversion_number()], [sqlite3_sourceid()],
   112    112   ** [sqlite_version()] and [sqlite_source_id()].
   113    113   */
   114    114   #define SQLITE_VERSION        "3.10.0"
   115    115   #define SQLITE_VERSION_NUMBER 3010000
   116         -#define SQLITE_SOURCE_ID      "2015-12-31 22:29:36 d41d4d7396fba60895535f21c438f8c75e7b2097"
          116  +#define SQLITE_SOURCE_ID      "2016-01-05 03:39:52 a855697719e288c908ddb7950d32fd17ef546509"
   117    117   
   118    118   /*
   119    119   ** CAPI3REF: Run-Time Library Version Numbers
   120    120   ** KEYWORDS: sqlite3_version, sqlite3_sourceid
   121    121   **
   122    122   ** These interfaces provide the same information as the [SQLITE_VERSION],
   123    123   ** [SQLITE_VERSION_NUMBER], and [SQLITE_SOURCE_ID] C preprocessor macros

Changes to SQLite.Interop/src/ext/fts5.c.

 15237  15237   */
 15238  15238   static void fts5SourceIdFunc(
 15239  15239     sqlite3_context *pCtx,          /* Function call context */
 15240  15240     int nArg,                       /* Number of args */
 15241  15241     sqlite3_value **apVal           /* Function arguments */
 15242  15242   ){
 15243  15243     assert( nArg==0 );
 15244         -  sqlite3_result_text(pCtx, "fts5: 2015-12-31 22:29:36 d41d4d7396fba60895535f21c438f8c75e7b2097", -1, SQLITE_TRANSIENT);
        15244  +  sqlite3_result_text(pCtx, "fts5: 2016-01-05 03:39:52 a855697719e288c908ddb7950d32fd17ef546509", -1, SQLITE_TRANSIENT);
 15245  15245   }
 15246  15246   
 15247  15247   static int fts5Init(sqlite3 *db){
 15248  15248     static const sqlite3_module fts5Mod = {
 15249  15249       /* iVersion      */ 2,
 15250  15250       /* xCreate       */ fts5CreateMethod,
 15251  15251       /* xConnect      */ fts5ConnectMethod,

Changes to SQLite.Interop/src/ext/json1.c.

  1545   1545     JsonString *pStr;
  1546   1546     pStr = (JsonString*)sqlite3_aggregate_context(ctx, 0);
  1547   1547     if( pStr ){
  1548   1548       pStr->pCtx = ctx;
  1549   1549       jsonAppendChar(pStr, ']');
  1550   1550       if( pStr->bErr ){
  1551   1551         sqlite3_result_error_nomem(ctx);
  1552         -      if( !pStr->bStatic ) sqlite3_free(pStr->zBuf);
         1552  +      assert( pStr->bStatic );
  1553   1553       }else{
  1554   1554         sqlite3_result_text(ctx, pStr->zBuf, pStr->nUsed,
  1555   1555                             pStr->bStatic ? SQLITE_TRANSIENT : sqlite3_free);
  1556   1556         pStr->bStatic = 1;
  1557   1557       }
  1558   1558     }else{
  1559   1559       sqlite3_result_text(ctx, "[]", 2, SQLITE_STATIC);
................................................................................
  1593   1593   static void jsonObjectFinal(sqlite3_context *ctx){
  1594   1594     JsonString *pStr;
  1595   1595     pStr = (JsonString*)sqlite3_aggregate_context(ctx, 0);
  1596   1596     if( pStr ){
  1597   1597       jsonAppendChar(pStr, '}');
  1598   1598       if( pStr->bErr ){
  1599   1599         sqlite3_result_error_nomem(ctx);
  1600         -      if( !pStr->bStatic ) sqlite3_free(pStr->zBuf);
         1600  +      assert( pStr->bStatic );
  1601   1601       }else{
  1602   1602         sqlite3_result_text(ctx, pStr->zBuf, pStr->nUsed,
  1603   1603                             pStr->bStatic ? SQLITE_TRANSIENT : sqlite3_free);
  1604   1604         pStr->bStatic = 1;
  1605   1605       }
  1606   1606     }else{
  1607   1607       sqlite3_result_text(ctx, "{}", 2, SQLITE_STATIC);