SQLite Android Bindings
Check-in [b3ab16ec53]
Not logged in

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

Overview
Comment:Update this project to sqlite 3.16.1.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: b3ab16ec536e95f2c102ef1ce7e977c6c24f33eb
User & Date: dan 2017-01-03 18:38:45
Context
2017-02-13
16:27
Upgrade this project to version 3.17.0. check-in: 46756eb243 user: dan tags: trunk
2017-01-03
18:38
Update this project to sqlite 3.16.1. check-in: b3ab16ec53 user: dan tags: trunk
2017-01-02
12:14
Update this project to version 3.16.0. check-in: 92c34b8b04 user: dan tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Show Whitespace Changes Patch

Changes to sqlite3/src/main/jni/sqlite/sqlite3.c.

     1      1   /******************************************************************************
     2      2   ** This file is an amalgamation of many separate C source files from SQLite
     3         -** version 3.16.0.  By combining all the individual C code files into this
            3  +** version 3.16.1.  By combining all the individual C code files into this
     4      4   ** single large file, the entire code can be compiled as a single translation
     5      5   ** unit.  This allows many compilers to do optimizations that would not be
     6      6   ** possible if the files were compiled separately.  Performance improvements
     7      7   ** of 5% or more are commonly seen when SQLite is compiled as a single
     8      8   ** translation unit.
     9      9   **
    10     10   ** This file is all you need to compile SQLite.  To use SQLite in other
................................................................................
   377    377   ** string contains the date and time of the check-in (UTC) and an SHA1
   378    378   ** hash of the entire source tree.
   379    379   **
   380    380   ** See also: [sqlite3_libversion()],
   381    381   ** [sqlite3_libversion_number()], [sqlite3_sourceid()],
   382    382   ** [sqlite_version()] and [sqlite_source_id()].
   383    383   */
   384         -#define SQLITE_VERSION        "3.16.0"
   385         -#define SQLITE_VERSION_NUMBER 3016000
   386         -#define SQLITE_SOURCE_ID      "2017-01-02 11:57:58 04ac0b75b1716541b2b97704f4809cb7ef19cccf"
          384  +#define SQLITE_VERSION        "3.16.1"
          385  +#define SQLITE_VERSION_NUMBER 3016001
          386  +#define SQLITE_SOURCE_ID      "2017-01-03 18:27:03 979f04392853b8053817a3eea2fc679947b437fd"
   387    387   
   388    388   /*
   389    389   ** CAPI3REF: Run-Time Library Version Numbers
   390    390   ** KEYWORDS: sqlite3_version sqlite3_sourceid
   391    391   **
   392    392   ** These interfaces provide the same information as the [SQLITE_VERSION],
   393    393   ** [SQLITE_VERSION_NUMBER], and [SQLITE_SOURCE_ID] C preprocessor macros
................................................................................
 90659  90659     int iField           /* Which column of the vector to return */
 90660  90660   ){
 90661  90661     Expr *pRet;
 90662  90662     if( pVector->op==TK_SELECT ){
 90663  90663       assert( pVector->flags & EP_xIsSelect );
 90664  90664       /* The TK_SELECT_COLUMN Expr node:
 90665  90665       **
 90666         -    ** pLeft:           pVector containing TK_SELECT
        90666  +    ** pLeft:           pVector containing TK_SELECT.  Not deleted.
 90667  90667       ** pRight:          not used.  But recursively deleted.
 90668  90668       ** iColumn:         Index of a column in pVector
        90669  +    ** iTable:          0 or the number of columns on the LHS of an assignment
 90669  90670       ** pLeft->iTable:   First in an array of register holding result, or 0
 90670  90671       **                  if the result is not yet computed.
 90671  90672       **
 90672  90673       ** sqlite3ExprDelete() specifically skips the recursive delete of
 90673  90674       ** pLeft on TK_SELECT_COLUMN nodes.  But pRight is followed, so pVector
 90674  90675       ** can be attached to pRight to cause this node to take ownership of
 90675  90676       ** pVector.  Typically there will be multiple TK_SELECT_COLUMN nodes
................................................................................
 91333  91334   ** to enforce this constraint.
 91334  91335   */
 91335  91336   static int dupedExprStructSize(Expr *p, int flags){
 91336  91337     int nSize;
 91337  91338     assert( flags==EXPRDUP_REDUCE || flags==0 ); /* Only one flag value allowed */
 91338  91339     assert( EXPR_FULLSIZE<=0xfff );
 91339  91340     assert( (0xfff & (EP_Reduced|EP_TokenOnly))==0 );
 91340         -  if( 0==flags ){
        91341  +  if( 0==flags || p->op==TK_SELECT_COLUMN ){
 91341  91342       nSize = EXPR_FULLSIZE;
 91342  91343     }else{
 91343  91344       assert( !ExprHasProperty(p, EP_TokenOnly|EP_Reduced) );
 91344  91345       assert( !ExprHasProperty(p, EP_FromJoin) ); 
 91345  91346       assert( !ExprHasProperty(p, EP_MemToken) );
 91346  91347       assert( !ExprHasProperty(p, EP_NoReduce) );
 91347  91348       if( p->pLeft || p->x.pList ){
................................................................................
 91476  91477         if( pzBuffer ){
 91477  91478           *pzBuffer = zAlloc;
 91478  91479         }
 91479  91480       }else{
 91480  91481         if( !ExprHasProperty(p, EP_TokenOnly|EP_Leaf) ){
 91481  91482           if( pNew->op==TK_SELECT_COLUMN ){
 91482  91483             pNew->pLeft = p->pLeft;
        91484  +          assert( p->iColumn==0 || p->pRight==0 );
        91485  +          assert( p->pRight==0  || p->pRight==p->pLeft );
 91483  91486           }else{
 91484  91487             pNew->pLeft = sqlite3ExprDup(db, p->pLeft, 0);
 91485  91488           }
 91486  91489           pNew->pRight = sqlite3ExprDup(db, p->pRight, 0);
 91487  91490         }
 91488  91491       }
 91489  91492     }
................................................................................
 91538  91541     assert( flags==0 || flags==EXPRDUP_REDUCE );
 91539  91542     return p ? exprDup(db, p, flags, 0) : 0;
 91540  91543   }
 91541  91544   SQLITE_PRIVATE ExprList *sqlite3ExprListDup(sqlite3 *db, ExprList *p, int flags){
 91542  91545     ExprList *pNew;
 91543  91546     struct ExprList_item *pItem, *pOldItem;
 91544  91547     int i;
        91548  +  Expr *pPriorSelectCol = 0;
 91545  91549     assert( db!=0 );
 91546  91550     if( p==0 ) return 0;
 91547  91551     pNew = sqlite3DbMallocRawNN(db, sizeof(*pNew) );
 91548  91552     if( pNew==0 ) return 0;
 91549  91553     pNew->nExpr = i = p->nExpr;
 91550  91554     if( (flags & EXPRDUP_REDUCE)==0 ) for(i=1; i<p->nExpr; i+=i){}
 91551  91555     pNew->a = pItem = sqlite3DbMallocRawNN(db,  i*sizeof(p->a[0]) );
................................................................................
 91552  91556     if( pItem==0 ){
 91553  91557       sqlite3DbFree(db, pNew);
 91554  91558       return 0;
 91555  91559     } 
 91556  91560     pOldItem = p->a;
 91557  91561     for(i=0; i<p->nExpr; i++, pItem++, pOldItem++){
 91558  91562       Expr *pOldExpr = pOldItem->pExpr;
        91563  +    Expr *pNewExpr;
 91559  91564       pItem->pExpr = sqlite3ExprDup(db, pOldExpr, flags);
        91565  +    if( pOldExpr 
        91566  +     && pOldExpr->op==TK_SELECT_COLUMN
        91567  +     && (pNewExpr = pItem->pExpr)!=0 
        91568  +    ){
        91569  +      assert( pNewExpr->iColumn==0 || i>0 );
        91570  +      if( pNewExpr->iColumn==0 ){
        91571  +        assert( pOldExpr->pLeft==pOldExpr->pRight );
        91572  +        pPriorSelectCol = pNewExpr->pLeft = pNewExpr->pRight;
        91573  +      }else{
        91574  +        assert( i>0 );
        91575  +        assert( pItem[-1].pExpr!=0 );
        91576  +        assert( pNewExpr->iColumn==pItem[-1].pExpr->iColumn+1 );
        91577  +        assert( pPriorSelectCol==pItem[-1].pExpr->pLeft );
        91578  +        pNewExpr->pLeft = pPriorSelectCol;
        91579  +      }
        91580  +    }
 91560  91581       pItem->zName = sqlite3DbStrDup(db, pOldItem->zName);
 91561  91582       pItem->zSpan = sqlite3DbStrDup(db, pOldItem->zSpan);
 91562  91583       pItem->sortOrder = pOldItem->sortOrder;
 91563  91584       pItem->done = 0;
 91564  91585       pItem->bSpanIsTab = pOldItem->bSpanIsTab;
 91565  91586       pItem->u = pOldItem->u;
 91566  91587     }
................................................................................
 91744  91765     int n;
 91745  91766     int i;
 91746  91767     int iFirst = pList ? pList->nExpr : 0;
 91747  91768     /* pColumns can only be NULL due to an OOM but an OOM will cause an
 91748  91769     ** exit prior to this routine being invoked */
 91749  91770     if( NEVER(pColumns==0) ) goto vector_append_error;
 91750  91771     if( pExpr==0 ) goto vector_append_error;
 91751         -  n = sqlite3ExprVectorSize(pExpr);
 91752         -  if( pColumns->nId!=n ){
        91772  +
        91773  +  /* If the RHS is a vector, then we can immediately check to see that 
        91774  +  ** the size of the RHS and LHS match.  But if the RHS is a SELECT, 
        91775  +  ** wildcards ("*") in the result set of the SELECT must be expanded before
        91776  +  ** we can do the size check, so defer the size check until code generation.
        91777  +  */
        91778  +  if( pExpr->op!=TK_SELECT && pColumns->nId!=(n=sqlite3ExprVectorSize(pExpr)) ){
 91753  91779       sqlite3ErrorMsg(pParse, "%d columns assigned %d values",
 91754  91780                       pColumns->nId, n);
 91755  91781       goto vector_append_error;
 91756  91782     }
 91757         -  for(i=0; i<n; i++){
        91783  +
        91784  +  for(i=0; i<pColumns->nId; i++){
 91758  91785       Expr *pSubExpr = sqlite3ExprForVectorField(pParse, pExpr, i);
 91759  91786       pList = sqlite3ExprListAppend(pParse, pList, pSubExpr);
 91760  91787       if( pList ){
 91761  91788         assert( pList->nExpr==iFirst+i+1 );
 91762  91789         pList->a[pList->nExpr-1].zName = pColumns->a[i].zName;
 91763  91790         pColumns->a[i].zName = 0;
 91764  91791       }
 91765  91792     }
        91793  +
 91766  91794     if( pExpr->op==TK_SELECT ){
 91767  91795       if( pList && pList->a[iFirst].pExpr ){
 91768         -      assert( pList->a[iFirst].pExpr->op==TK_SELECT_COLUMN );
 91769         -      pList->a[iFirst].pExpr->pRight = pExpr;
        91796  +      Expr *pFirst = pList->a[iFirst].pExpr;
        91797  +      assert( pFirst->op==TK_SELECT_COLUMN );
        91798  +     
        91799  +      /* Store the SELECT statement in pRight so it will be deleted when
        91800  +      ** sqlite3ExprListDelete() is called */
        91801  +      pFirst->pRight = pExpr;
 91770  91802         pExpr = 0;
        91803  +
        91804  +      /* Remember the size of the LHS in iTable so that we can check that
        91805  +      ** the RHS and LHS sizes match during code generation. */
        91806  +      pFirst->iTable = pColumns->nId;
 91771  91807       }
 91772  91808     }
 91773  91809   
 91774  91810   vector_append_error:
 91775  91811     sqlite3ExprDelete(db, pExpr);
 91776  91812     sqlite3IdListDelete(db, pColumns);
 91777  91813     return pList;
................................................................................
 93957  93993           sqlite3SubselectError(pParse, nCol, 1);
 93958  93994         }else{
 93959  93995           return sqlite3CodeSubselect(pParse, pExpr, 0, 0);
 93960  93996         }
 93961  93997         break;
 93962  93998       }
 93963  93999       case TK_SELECT_COLUMN: {
        94000  +      int n;
 93964  94001         if( pExpr->pLeft->iTable==0 ){
 93965  94002           pExpr->pLeft->iTable = sqlite3CodeSubselect(pParse, pExpr->pLeft, 0, 0);
        94003  +      }
        94004  +      assert( pExpr->iTable==0 || pExpr->pLeft->op==TK_SELECT );
        94005  +      if( pExpr->iTable
        94006  +       && pExpr->iTable!=(n = sqlite3ExprVectorSize(pExpr->pLeft)) 
        94007  +      ){
        94008  +        sqlite3ErrorMsg(pParse, "%d columns assigned %d values",
        94009  +                                pExpr->iTable, n);
 93966  94010         }
 93967  94011         return pExpr->pLeft->iTable + pExpr->iColumn;
 93968  94012       }
 93969  94013       case TK_IN: {
 93970  94014         int destIfFalse = sqlite3VdbeMakeLabel(v);
 93971  94015         int destIfNull = sqlite3VdbeMakeLabel(v);
 93972  94016         sqlite3VdbeAddOp2(v, OP_Null, 0, target);
................................................................................
196768 196812   static void fts5SourceIdFunc(
196769 196813     sqlite3_context *pCtx,          /* Function call context */
196770 196814     int nArg,                       /* Number of args */
196771 196815     sqlite3_value **apUnused        /* Function arguments */
196772 196816   ){
196773 196817     assert( nArg==0 );
196774 196818     UNUSED_PARAM2(nArg, apUnused);
196775         -  sqlite3_result_text(pCtx, "fts5: 2017-01-02 11:57:58 04ac0b75b1716541b2b97704f4809cb7ef19cccf", -1, SQLITE_TRANSIENT);
       196819  +  sqlite3_result_text(pCtx, "fts5: 2017-01-03 18:27:03 979f04392853b8053817a3eea2fc679947b437fd", -1, SQLITE_TRANSIENT);
196776 196820   }
196777 196821   
196778 196822   static int fts5Init(sqlite3 *db){
196779 196823     static const sqlite3_module fts5Mod = {
196780 196824       /* iVersion      */ 2,
196781 196825       /* xCreate       */ fts5CreateMethod,
196782 196826       /* xConnect      */ fts5ConnectMethod,

Changes to sqlite3/src/main/jni/sqlite/sqlite3.h.

   117    117   ** string contains the date and time of the check-in (UTC) and an SHA1
   118    118   ** hash of the entire source tree.
   119    119   **
   120    120   ** See also: [sqlite3_libversion()],
   121    121   ** [sqlite3_libversion_number()], [sqlite3_sourceid()],
   122    122   ** [sqlite_version()] and [sqlite_source_id()].
   123    123   */
   124         -#define SQLITE_VERSION        "3.16.0"
   125         -#define SQLITE_VERSION_NUMBER 3016000
   126         -#define SQLITE_SOURCE_ID      "2017-01-02 11:57:58 04ac0b75b1716541b2b97704f4809cb7ef19cccf"
          124  +#define SQLITE_VERSION        "3.16.1"
          125  +#define SQLITE_VERSION_NUMBER 3016001
          126  +#define SQLITE_SOURCE_ID      "2017-01-03 18:27:03 979f04392853b8053817a3eea2fc679947b437fd"
   127    127   
   128    128   /*
   129    129   ** CAPI3REF: Run-Time Library Version Numbers
   130    130   ** KEYWORDS: sqlite3_version sqlite3_sourceid
   131    131   **
   132    132   ** These interfaces provide the same information as the [SQLITE_VERSION],
   133    133   ** [SQLITE_VERSION_NUMBER], and [SQLITE_SOURCE_ID] C preprocessor macros