System.Data.SQLite
Check-in [161010cf55]
Not logged in

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

Overview
Comment:Import the latest SQLite core library changes.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 161010cf556b634eb388f65fff166805ab584adc
User & Date: mistachkin 2015-07-25 00:32:56
Context
2015-07-25
17:58
Simplify and update documentation formatting. check-in: 0602185155 user: mistachkin tags: trunk
00:32
Import the latest SQLite core library changes. check-in: 161010cf55 user: mistachkin tags: trunk
2015-07-24
19:18
Update SQLite core library to the latest RC. check-in: 8dbd32a7ae 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.8.11"
   329    329   #define SQLITE_VERSION_NUMBER 3008011
   330         -#define SQLITE_SOURCE_ID      "2015-07-24 17:36:34 1997ee548b2e569a39e73319b661c1a78dfe5dae"
          330  +#define SQLITE_SOURCE_ID      "2015-07-24 23:28:05 db129149812cb4eadb4cd79ad293d14962d2638d"
   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
................................................................................
  8361   8361   #  define SQLITE_NOINLINE
  8362   8362   #endif
  8363   8363   
  8364   8364   /*
  8365   8365   ** Make sure that the compiler intrinsics we desire are enabled when
  8366   8366   ** compiling with an appropriate version of MSVC.
  8367   8367   */
  8368         -#if defined(_MSC_VER) && _MSC_VER>=1300 && !defined(_WIN32_WCE)
  8369         -#  include <intrin.h>
  8370         -#  pragma intrinsic(_byteswap_ushort)
  8371         -#  pragma intrinsic(_byteswap_ulong)
         8368  +#if defined(_MSC_VER) && _MSC_VER>=1300
         8369  +#  if !defined(_WIN32_WCE)
         8370  +#    include <intrin.h>
         8371  +#    pragma intrinsic(_byteswap_ushort)
         8372  +#    pragma intrinsic(_byteswap_ulong)
         8373  +#  else
         8374  +#    include <cmnintrin.h>
         8375  +#  endif
  8372   8376   #endif
  8373   8377   
  8374   8378   /*
  8375   8379   ** The SQLITE_THREADSAFE macro must be defined as 0, 1, or 2.
  8376   8380   ** 0 means mutexes are permanently disable and the library is never
  8377   8381   ** threadsafe.  1 means the library is serialized which is the highest
  8378   8382   ** level of threadsafety.  2 means the library is multithreaded - multiple
................................................................................
156952 156956   **  update database than is strictly necessary.
156953 156957   ** 
156954 156958   */
156955 156959   
156956 156960   /* #include <assert.h> */
156957 156961   /* #include <string.h> */
156958 156962   /* #include <stdio.h> */
156959         -/* #include <unistd.h> */
       156963  +
       156964  +#if !defined(_WIN32)
       156965  +/* #  include <unistd.h> */
       156966  +#endif
156960 156967   
156961 156968   /* #include "sqlite3.h" */
156962 156969   
156963 156970   #if !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_RBU)
156964 156971   /************** Include sqlite3rbu.h in the middle of sqlite3rbu.c ***********/
156965 156972   /************** Begin file sqlite3rbu.h **************************************/
156966 156973   /*
................................................................................
157859 157866   */
157860 157867   static int rbuObjIterFirst(sqlite3rbu *p, RbuObjIter *pIter){
157861 157868     int rc;
157862 157869     memset(pIter, 0, sizeof(RbuObjIter));
157863 157870   
157864 157871     rc = prepareAndCollectError(p->dbRbu, &pIter->pTblIter, &p->zErrmsg, 
157865 157872         "SELECT substr(name, 6) FROM sqlite_master "
157866         -      "WHERE type='table' AND name LIKE 'data_%'"
       157873  +      "WHERE type IN ('table', 'view') AND name LIKE 'data_%'"
157867 157874     );
157868 157875   
157869 157876     if( rc==SQLITE_OK ){
157870 157877       rc = prepareAndCollectError(p->dbMain, &pIter->pIdxIter, &p->zErrmsg,
157871 157878           "SELECT name, rootpage, sql IS NULL OR substr(8, 6)=='UNIQUE' "
157872 157879           "  FROM main.sqlite_master "
157873 157880           "  WHERE type='index' AND tbl_name = ?"
................................................................................
157911 157918   **
157912 157919   ** If an error occurs, an error code and error message is stored in the
157913 157920   ** RBU handle. If an error has already occurred when this function is
157914 157921   ** called, it is a no-op.
157915 157922   */
157916 157923   static int rbuMPrintfExec(sqlite3rbu *p, sqlite3 *db, const char *zFmt, ...){
157917 157924     va_list ap;
       157925  +  char *zSql;
157918 157926     va_start(ap, zFmt);
157919         -  char *zSql = sqlite3_vmprintf(zFmt, ap);
       157927  +  zSql = sqlite3_vmprintf(zFmt, ap);
157920 157928     if( p->rc==SQLITE_OK ){
157921 157929       if( zSql==0 ){
157922 157930         p->rc = SQLITE_NOMEM;
157923 157931       }else{
157924 157932         p->rc = sqlite3_exec(db, zSql, 0, 0, &p->zErrmsg);
157925 157933       }
157926 157934     }
................................................................................
159931 159939   */
159932 159940   static void rbuCreateVfs(sqlite3rbu *p){
159933 159941     int rnd;
159934 159942     char zRnd[64];
159935 159943   
159936 159944     assert( p->rc==SQLITE_OK );
159937 159945     sqlite3_randomness(sizeof(int), (void*)&rnd);
159938         -  sprintf(zRnd, "rbu_vfs_%d", rnd);
       159946  +  sqlite3_snprintf(sizeof(zRnd), zRnd, "rbu_vfs_%d", rnd);
159939 159947     p->rc = sqlite3rbu_create_vfs(zRnd, 0);
159940 159948     if( p->rc==SQLITE_OK ){
159941 159949       sqlite3_vfs *pVfs = sqlite3_vfs_find(zRnd);
159942 159950       assert( pVfs );
159943 159951       p->zVfsName = pVfs->zName;
159944 159952     }
159945 159953   }
................................................................................
160816 160824   }
160817 160825   
160818 160826   /*
160819 160827   ** Close the dynamic library handle pHandle.
160820 160828   */
160821 160829   static void rbuVfsDlClose(sqlite3_vfs *pVfs, void *pHandle){
160822 160830     sqlite3_vfs *pRealVfs = ((rbu_vfs*)pVfs)->pRealVfs;
160823         -  return pRealVfs->xDlClose(pRealVfs, pHandle);
       160831  +  pRealVfs->xDlClose(pRealVfs, pHandle);
160824 160832   }
160825 160833   #endif /* SQLITE_OMIT_LOAD_EXTENSION */
160826 160834   
160827 160835   /*
160828 160836   ** Populate the buffer pointed to by zBufOut with nByte bytes of 
160829 160837   ** random data.
160830 160838   */

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.8.11"
   115    115   #define SQLITE_VERSION_NUMBER 3008011
   116         -#define SQLITE_SOURCE_ID      "2015-07-24 17:36:34 1997ee548b2e569a39e73319b661c1a78dfe5dae"
          116  +#define SQLITE_SOURCE_ID      "2015-07-24 23:28:05 db129149812cb4eadb4cd79ad293d14962d2638d"
   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.

  2836   2836   
  2837   2837     i64 iRowid;                     /* Current rowid */
  2838   2838     Fts5ExprNearset *pNear;         /* For FTS5_STRING - cluster of phrases */
  2839   2839   
  2840   2840     /* Child nodes. For a NOT node, this array always contains 2 entries. For 
  2841   2841     ** AND or OR nodes, it contains 2 or more entries.  */
  2842   2842     int nChild;                     /* Number of child nodes */
  2843         -  Fts5ExprNode *apChild[0];       /* Array of child nodes */
         2843  +  Fts5ExprNode *apChild[1];       /* Array of child nodes */
  2844   2844   };
  2845   2845   
  2846   2846   #define Fts5NodeIsString(p) ((p)->eType==FTS5_TERM || (p)->eType==FTS5_STRING)
  2847   2847   
  2848   2848   /*
  2849   2849   ** An instance of the following structure represents a single search term
  2850   2850   ** or term prefix.
................................................................................
  4395   4395         nChild = 2;
  4396   4396       }else if( eType==FTS5_AND || eType==FTS5_OR ){
  4397   4397         nChild = 2;
  4398   4398         if( pLeft->eType==eType ) nChild += pLeft->nChild-1;
  4399   4399         if( pRight->eType==eType ) nChild += pRight->nChild-1;
  4400   4400       }
  4401   4401   
  4402         -    nByte = sizeof(Fts5ExprNode) + sizeof(Fts5ExprNode*)*nChild;
         4402  +    nByte = sizeof(Fts5ExprNode) + sizeof(Fts5ExprNode*)*(nChild-1);
  4403   4403       pRet = (Fts5ExprNode*)sqlite3Fts5MallocZero(&pParse->rc, nByte);
  4404   4404   
  4405   4405       if( pRet ){
  4406   4406         pRet->eType = eType;
  4407   4407         pRet->pNear = pNear;
  4408   4408         if( eType==FTS5_STRING ){
  4409   4409           int iPhrase;
................................................................................
  9037   9037     bOldest = (pLvlOut->nSeg==1 && pStruct->nLevel==iLvl+2);
  9038   9038   
  9039   9039     assert( iLvl>=0 );
  9040   9040     for(fts5MultiIterNew(p, pStruct, 0, 0, 0, 0, iLvl, nInput, &pIter);
  9041   9041         fts5MultiIterEof(p, pIter)==0;
  9042   9042         fts5MultiIterNext(p, pIter, 0, 0)
  9043   9043     ){
  9044         -    Fts5SegIter *pSeg = &pIter->aSeg[ pIter->aFirst[1].iFirst ];
         9044  +    Fts5SegIter *pSegIter = &pIter->aSeg[ pIter->aFirst[1].iFirst ];
  9045   9045       int nPos;                     /* position-list size field value */
  9046   9046       int nTerm;
  9047   9047       const u8 *pTerm;
  9048   9048   
  9049   9049       /* Check for key annihilation. */
  9050         -    if( pSeg->nPos==0 && (bOldest || pSeg->bDel==0) ) continue;
         9050  +    if( pSegIter->nPos==0 && (bOldest || pSegIter->bDel==0) ) continue;
  9051   9051   
  9052   9052       pTerm = fts5MultiIterTerm(pIter, &nTerm);
  9053   9053       if( nTerm!=term.n || memcmp(pTerm, term.p, nTerm) ){
  9054   9054         if( pnRem && writer.nLeafWritten>nRem ){
  9055   9055           break;
  9056   9056         }
  9057   9057   
................................................................................
  9062   9062         fts5WriteAppendTerm(p, &writer, nTerm, pTerm);
  9063   9063         fts5BufferSet(&p->rc, &term, nTerm, pTerm);
  9064   9064         bRequireDoclistTerm = 1;
  9065   9065       }
  9066   9066   
  9067   9067       /* Append the rowid to the output */
  9068   9068       /* WRITEPOSLISTSIZE */
  9069         -    nPos = pSeg->nPos*2 + pSeg->bDel;
         9069  +    nPos = pSegIter->nPos*2 + pSegIter->bDel;
  9070   9070       fts5WriteAppendRowid(p, &writer, fts5MultiIterRowid(pIter), nPos);
  9071   9071   
  9072   9072       /* Append the position-list data to the output */
  9073         -    fts5ChunkIterate(p, pSeg, (void*)&writer, fts5MergeChunkCallback);
         9073  +    fts5ChunkIterate(p, pSegIter, (void*)&writer, fts5MergeChunkCallback);
  9074   9074     }
  9075   9075   
  9076   9076     /* Flush the last leaf page to disk. Set the output segment b-tree height
  9077   9077     ** and last leaf page number at the same time.  */
  9078   9078     fts5WriteFinish(p, &writer, &pSeg->nHeight, &pSeg->pgnoLast);
  9079   9079   
  9080   9080     if( fts5MultiIterEof(p, pIter) ){
................................................................................
 13244  13244   */
 13245  13245   static void fts5SourceIdFunc(
 13246  13246     sqlite3_context *pCtx,          /* Function call context */
 13247  13247     int nArg,                       /* Number of args */
 13248  13248     sqlite3_value **apVal           /* Function arguments */
 13249  13249   ){
 13250  13250     assert( nArg==0 );
 13251         -  sqlite3_result_text(pCtx, "fts5: 2015-07-16 20:17:57 e9bf275cd969eca6fb41384d3637528d6a19f819", -1, SQLITE_TRANSIENT);
        13251  +  sqlite3_result_text(pCtx, "fts5: 2015-07-24 23:28:05 db129149812cb4eadb4cd79ad293d14962d2638d", -1, SQLITE_TRANSIENT);
 13252  13252   }
 13253  13253   
 13254  13254   #ifdef _WIN32
 13255  13255   __declspec(dllexport)
 13256  13256   #endif
 13257  13257   int sqlite3_fts5_init(
 13258  13258     sqlite3 *db,