System.Data.SQLite
Check-in [8dbd32a7ae]
Not logged in

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

Overview
Comment:Update SQLite core library to the latest RC.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 8dbd32a7ae9b8058b28c9df5e4800c558d1c421c
User & Date: mistachkin 2015-07-24 19:18:25
Context
2015-07-25
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
00:59
Enhance the test suite infrastructure to permit a non-default .NET Framework version to be used for a particular 'build year'. check-in: 13498a4979 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 00:02:15 119883a21bdcab66c15d1e80f3da20addda328ad"
          330  +#define SQLITE_SOURCE_ID      "2015-07-24 17:36:34 1997ee548b2e569a39e73319b661c1a78dfe5dae"
   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
................................................................................
  3772   3772   SQLITE_API int SQLITE_STDCALL sqlite3_bind_null(sqlite3_stmt*, int);
  3773   3773   SQLITE_API int SQLITE_STDCALL sqlite3_bind_text(sqlite3_stmt*,int,const char*,int,void(*)(void*));
  3774   3774   SQLITE_API int SQLITE_STDCALL sqlite3_bind_text16(sqlite3_stmt*, int, const void*, int, void(*)(void*));
  3775   3775   SQLITE_API int SQLITE_STDCALL sqlite3_bind_text64(sqlite3_stmt*, int, const char*, sqlite3_uint64,
  3776   3776                            void(*)(void*), unsigned char encoding);
  3777   3777   SQLITE_API int SQLITE_STDCALL sqlite3_bind_value(sqlite3_stmt*, int, const sqlite3_value*);
  3778   3778   SQLITE_API int SQLITE_STDCALL sqlite3_bind_zeroblob(sqlite3_stmt*, int, int n);
         3779  +SQLITE_API int SQLITE_STDCALL sqlite3_bind_zeroblob64(sqlite3_stmt*, int, sqlite3_uint64);
  3779   3780   
  3780   3781   /*
  3781   3782   ** CAPI3REF: Number Of SQL Parameters
  3782   3783   ** METHOD: sqlite3_stmt
  3783   3784   **
  3784   3785   ** ^This routine can be used to find the number of [SQL parameters]
  3785   3786   ** in a [prepared statement].  SQL parameters are tokens of the
................................................................................
  4744   4745   ** Refer to the [SQL parameter] documentation for additional information.
  4745   4746   **
  4746   4747   ** ^The sqlite3_result_blob() interface sets the result from
  4747   4748   ** an application-defined function to be the BLOB whose content is pointed
  4748   4749   ** to by the second parameter and which is N bytes long where N is the
  4749   4750   ** third parameter.
  4750   4751   **
  4751         -** ^The sqlite3_result_zeroblob() interfaces set the result of
  4752         -** the application-defined function to be a BLOB containing all zero
         4752  +** ^The sqlite3_result_zeroblob() and zeroblob64() interfaces set the result 
         4753  +** of the application-defined function to be a BLOB containing all zero
  4753   4754   ** bytes and N bytes in size, where N is the value of the 2nd parameter.
  4754   4755   **
  4755   4756   ** ^The sqlite3_result_double() interface sets the result from
  4756   4757   ** an application-defined function to be a floating point value specified
  4757   4758   ** by its 2nd argument.
  4758   4759   **
  4759   4760   ** ^The sqlite3_result_error() and sqlite3_result_error16() functions
................................................................................
  4861   4862   SQLITE_API void SQLITE_STDCALL sqlite3_result_text64(sqlite3_context*, const char*,sqlite3_uint64,
  4862   4863                              void(*)(void*), unsigned char encoding);
  4863   4864   SQLITE_API void SQLITE_STDCALL sqlite3_result_text16(sqlite3_context*, const void*, int, void(*)(void*));
  4864   4865   SQLITE_API void SQLITE_STDCALL sqlite3_result_text16le(sqlite3_context*, const void*, int,void(*)(void*));
  4865   4866   SQLITE_API void SQLITE_STDCALL sqlite3_result_text16be(sqlite3_context*, const void*, int,void(*)(void*));
  4866   4867   SQLITE_API void SQLITE_STDCALL sqlite3_result_value(sqlite3_context*, sqlite3_value*);
  4867   4868   SQLITE_API void SQLITE_STDCALL sqlite3_result_zeroblob(sqlite3_context*, int n);
         4869  +SQLITE_API int SQLITE_STDCALL sqlite3_result_zeroblob64(sqlite3_context*, sqlite3_uint64 n);
  4868   4870   
  4869   4871   /*
  4870   4872   ** CAPI3REF: Define New Collating Sequences
  4871   4873   ** METHOD: sqlite3
  4872   4874   **
  4873   4875   ** ^These functions add, remove, or modify a [collation] associated
  4874   4876   ** with the [database connection] specified as the first argument.
................................................................................
 70297  70299   /**************************** sqlite3_value_  *******************************
 70298  70300   ** The following routines extract information from a Mem or sqlite3_value
 70299  70301   ** structure.
 70300  70302   */
 70301  70303   SQLITE_API const void *SQLITE_STDCALL sqlite3_value_blob(sqlite3_value *pVal){
 70302  70304     Mem *p = (Mem*)pVal;
 70303  70305     if( p->flags & (MEM_Blob|MEM_Str) ){
 70304         -    sqlite3VdbeMemExpandBlob(p);
        70306  +    if( sqlite3VdbeMemExpandBlob(p)!=SQLITE_OK ){
        70307  +      assert( p->flags==MEM_Null && p->z==0 );
        70308  +      return 0;
        70309  +    }
 70305  70310       p->flags |= MEM_Blob;
 70306  70311       return p->n ? p->z : 0;
 70307  70312     }else{
 70308  70313       return sqlite3_value_text(pVal);
 70309  70314     }
 70310  70315   }
 70311  70316   SQLITE_API int SQLITE_STDCALL sqlite3_value_bytes(sqlite3_value *pVal){
................................................................................
 70558  70563   SQLITE_API void SQLITE_STDCALL sqlite3_result_value(sqlite3_context *pCtx, sqlite3_value *pValue){
 70559  70564     assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) );
 70560  70565     sqlite3VdbeMemCopy(pCtx->pOut, pValue);
 70561  70566   }
 70562  70567   SQLITE_API void SQLITE_STDCALL sqlite3_result_zeroblob(sqlite3_context *pCtx, int n){
 70563  70568     assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) );
 70564  70569     sqlite3VdbeMemSetZeroBlob(pCtx->pOut, n);
        70570  +}
        70571  +SQLITE_API int SQLITE_STDCALL sqlite3_result_zeroblob64(sqlite3_context *pCtx, u64 n){
        70572  +  Mem *pOut = pCtx->pOut;
        70573  +  assert( sqlite3_mutex_held(pOut->db->mutex) );
        70574  +  if( n>(u64)pOut->db->aLimit[SQLITE_LIMIT_LENGTH] ){
        70575  +    return SQLITE_TOOBIG;
        70576  +  }
        70577  +  sqlite3VdbeMemSetZeroBlob(pCtx->pOut, (int)n);
        70578  +  return SQLITE_OK;
 70565  70579   }
 70566  70580   SQLITE_API void SQLITE_STDCALL sqlite3_result_error_code(sqlite3_context *pCtx, int errCode){
 70567  70581     pCtx->isError = errCode;
 70568  70582     pCtx->fErrorOrAux = 1;
 70569  70583   #ifdef SQLITE_DEBUG
 70570  70584     if( pCtx->pVdbe ) pCtx->pVdbe->rcApp = errCode;
 70571  70585   #endif
................................................................................
 71537  71551     Vdbe *p = (Vdbe *)pStmt;
 71538  71552     rc = vdbeUnbind(p, i);
 71539  71553     if( rc==SQLITE_OK ){
 71540  71554       sqlite3VdbeMemSetZeroBlob(&p->aVar[i-1], n);
 71541  71555       sqlite3_mutex_leave(p->db->mutex);
 71542  71556     }
 71543  71557     return rc;
        71558  +}
        71559  +SQLITE_API int SQLITE_STDCALL sqlite3_bind_zeroblob64(sqlite3_stmt *pStmt, int i, sqlite3_uint64 n){
        71560  +  int rc;
        71561  +  Vdbe *p = (Vdbe *)pStmt;
        71562  +  sqlite3_mutex_enter(p->db->mutex);
        71563  +  if( n>(u64)p->db->aLimit[SQLITE_LIMIT_LENGTH] ){
        71564  +    rc = SQLITE_TOOBIG;
        71565  +  }else{
        71566  +    assert( (n & 0x7FFFFFFF)==n );
        71567  +    rc = sqlite3_bind_zeroblob(pStmt, i, n);
        71568  +  }
        71569  +  rc = sqlite3ApiExit(p->db, rc);
        71570  +  sqlite3_mutex_leave(p->db->mutex);
        71571  +  return rc;
 71544  71572   }
 71545  71573   
 71546  71574   /*
 71547  71575   ** Return the number of wildcards that can be potentially bound to.
 71548  71576   ** This routine is added to support DBD::SQLite.  
 71549  71577   */
 71550  71578   SQLITE_API int SQLITE_STDCALL sqlite3_bind_parameter_count(sqlite3_stmt *pStmt){
................................................................................
 74754  74782     pRec = pLast;
 74755  74783     do{
 74756  74784       assert( memIsValid(pRec) );
 74757  74785       pRec->uTemp = serial_type = sqlite3VdbeSerialType(pRec, file_format);
 74758  74786       len = sqlite3VdbeSerialTypeLen(serial_type);
 74759  74787       if( pRec->flags & MEM_Zero ){
 74760  74788         if( nData ){
 74761         -        sqlite3VdbeMemExpandBlob(pRec);
        74789  +        if( sqlite3VdbeMemExpandBlob(pRec) ) goto no_mem;
 74762  74790         }else{
 74763  74791           nZero += pRec->u.nZero;
 74764  74792           len -= pRec->u.nZero;
 74765  74793         }
 74766  74794       }
 74767  74795       nData += len;
 74768  74796       testcase( serial_type==127 );
................................................................................
 98639  98667   */
 98640  98668   static void zeroblobFunc(
 98641  98669     sqlite3_context *context,
 98642  98670     int argc,
 98643  98671     sqlite3_value **argv
 98644  98672   ){
 98645  98673     i64 n;
 98646         -  sqlite3 *db = sqlite3_context_db_handle(context);
        98674  +  int rc;
 98647  98675     assert( argc==1 );
 98648  98676     UNUSED_PARAMETER(argc);
 98649  98677     n = sqlite3_value_int64(argv[0]);
 98650         -  testcase( n==db->aLimit[SQLITE_LIMIT_LENGTH] );
 98651         -  testcase( n==db->aLimit[SQLITE_LIMIT_LENGTH]+1 );
 98652         -  if( n>db->aLimit[SQLITE_LIMIT_LENGTH] ){
 98653         -    sqlite3_result_error_toobig(context);
 98654         -  }else{
 98655         -    sqlite3_result_zeroblob(context, (int)n); /* IMP: R-00293-64994 */
        98678  +  if( n<0 ) n = 0;
        98679  +  rc = sqlite3_result_zeroblob64(context, n); /* IMP: R-00293-64994 */
        98680  +  if( rc ){
        98681  +    sqlite3_result_error_code(context, rc);
 98656  98682     }
 98657  98683   }
 98658  98684   
 98659  98685   /*
 98660  98686   ** The replace() function.  Three arguments are all strings: call
 98661  98687   ** them A, B, and C. The result is also a string which is derived
 98662  98688   ** from A by replacing every occurrence of B with C.  The match
................................................................................
103219 103245                           void(*)(void*));
103220 103246     void (*result_text64)(sqlite3_context*,const char*,sqlite3_uint64,
103221 103247                            void(*)(void*), unsigned char);
103222 103248     int (*strglob)(const char*,const char*);
103223 103249     /* Version 3.8.11 and later */
103224 103250     sqlite3_value *(*value_dup)(const sqlite3_value*);
103225 103251     void (*value_free)(sqlite3_value*);
       103252  +  int (*result_zeroblob64)(sqlite3_context*,sqlite3_uint64);
       103253  +  int (*bind_zeroblob64)(sqlite3_stmt*, int, sqlite3_uint64);
103226 103254   };
103227 103255   
103228 103256   /*
103229 103257   ** The following macros redefine the API routines so that they are
103230 103258   ** redirected through the global sqlite3_api structure.
103231 103259   **
103232 103260   ** This header file is also used by the loadext.c source file
................................................................................
103452 103480   #define sqlite3_reset_auto_extension   sqlite3_api->reset_auto_extension
103453 103481   #define sqlite3_result_blob64          sqlite3_api->result_blob64
103454 103482   #define sqlite3_result_text64          sqlite3_api->result_text64
103455 103483   #define sqlite3_strglob                sqlite3_api->strglob
103456 103484   /* Version 3.8.11 and later */
103457 103485   #define sqlite3_value_dup              sqlite3_api->value_dup
103458 103486   #define sqlite3_value_free             sqlite3_api->value_free
       103487  +#define sqlite3_result_zeroblob64      sqlite3_api->result_zeroblob64
       103488  +#define sqlite3_bind_zeroblob64        sqlite3_api->bind_zeroblob64
103459 103489   #endif /* SQLITE_CORE */
103460 103490   
103461 103491   #ifndef SQLITE_CORE
103462 103492     /* This case when the file really is being compiled as a loadable 
103463 103493     ** extension */
103464 103494   # define SQLITE_EXTENSION_INIT1     const sqlite3_api_routines *sqlite3_api=0;
103465 103495   # define SQLITE_EXTENSION_INIT2(v)  sqlite3_api=v;
................................................................................
103861 103891     sqlite3_realloc64,
103862 103892     sqlite3_reset_auto_extension,
103863 103893     sqlite3_result_blob64,
103864 103894     sqlite3_result_text64,
103865 103895     sqlite3_strglob,
103866 103896     /* Version 3.8.11 and later */
103867 103897     (sqlite3_value*(*)(const sqlite3_value*))sqlite3_value_dup,
103868         -  sqlite3_value_free
       103898  +  sqlite3_value_free,
       103899  +  sqlite3_result_zeroblob64,
       103900  +  sqlite3_bind_zeroblob64
103869 103901   };
103870 103902   
103871 103903   /*
103872 103904   ** Attempt to load an SQLite extension library contained in the file
103873 103905   ** zFile.  The entry point is zProc.  zProc may be 0 in which case a
103874 103906   ** default entry point name (sqlite3_extension_init) is used.  Use
103875 103907   ** of the default name is recommended.

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 00:02:15 119883a21bdcab66c15d1e80f3da20addda328ad"
          116  +#define SQLITE_SOURCE_ID      "2015-07-24 17:36:34 1997ee548b2e569a39e73319b661c1a78dfe5dae"
   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
................................................................................
  3558   3558   SQLITE_API int SQLITE_STDCALL sqlite3_bind_null(sqlite3_stmt*, int);
  3559   3559   SQLITE_API int SQLITE_STDCALL sqlite3_bind_text(sqlite3_stmt*,int,const char*,int,void(*)(void*));
  3560   3560   SQLITE_API int SQLITE_STDCALL sqlite3_bind_text16(sqlite3_stmt*, int, const void*, int, void(*)(void*));
  3561   3561   SQLITE_API int SQLITE_STDCALL sqlite3_bind_text64(sqlite3_stmt*, int, const char*, sqlite3_uint64,
  3562   3562                            void(*)(void*), unsigned char encoding);
  3563   3563   SQLITE_API int SQLITE_STDCALL sqlite3_bind_value(sqlite3_stmt*, int, const sqlite3_value*);
  3564   3564   SQLITE_API int SQLITE_STDCALL sqlite3_bind_zeroblob(sqlite3_stmt*, int, int n);
         3565  +SQLITE_API int SQLITE_STDCALL sqlite3_bind_zeroblob64(sqlite3_stmt*, int, sqlite3_uint64);
  3565   3566   
  3566   3567   /*
  3567   3568   ** CAPI3REF: Number Of SQL Parameters
  3568   3569   ** METHOD: sqlite3_stmt
  3569   3570   **
  3570   3571   ** ^This routine can be used to find the number of [SQL parameters]
  3571   3572   ** in a [prepared statement].  SQL parameters are tokens of the
................................................................................
  4530   4531   ** Refer to the [SQL parameter] documentation for additional information.
  4531   4532   **
  4532   4533   ** ^The sqlite3_result_blob() interface sets the result from
  4533   4534   ** an application-defined function to be the BLOB whose content is pointed
  4534   4535   ** to by the second parameter and which is N bytes long where N is the
  4535   4536   ** third parameter.
  4536   4537   **
  4537         -** ^The sqlite3_result_zeroblob() interfaces set the result of
  4538         -** the application-defined function to be a BLOB containing all zero
         4538  +** ^The sqlite3_result_zeroblob() and zeroblob64() interfaces set the result 
         4539  +** of the application-defined function to be a BLOB containing all zero
  4539   4540   ** bytes and N bytes in size, where N is the value of the 2nd parameter.
  4540   4541   **
  4541   4542   ** ^The sqlite3_result_double() interface sets the result from
  4542   4543   ** an application-defined function to be a floating point value specified
  4543   4544   ** by its 2nd argument.
  4544   4545   **
  4545   4546   ** ^The sqlite3_result_error() and sqlite3_result_error16() functions
................................................................................
  4647   4648   SQLITE_API void SQLITE_STDCALL sqlite3_result_text64(sqlite3_context*, const char*,sqlite3_uint64,
  4648   4649                              void(*)(void*), unsigned char encoding);
  4649   4650   SQLITE_API void SQLITE_STDCALL sqlite3_result_text16(sqlite3_context*, const void*, int, void(*)(void*));
  4650   4651   SQLITE_API void SQLITE_STDCALL sqlite3_result_text16le(sqlite3_context*, const void*, int,void(*)(void*));
  4651   4652   SQLITE_API void SQLITE_STDCALL sqlite3_result_text16be(sqlite3_context*, const void*, int,void(*)(void*));
  4652   4653   SQLITE_API void SQLITE_STDCALL sqlite3_result_value(sqlite3_context*, sqlite3_value*);
  4653   4654   SQLITE_API void SQLITE_STDCALL sqlite3_result_zeroblob(sqlite3_context*, int n);
         4655  +SQLITE_API int SQLITE_STDCALL sqlite3_result_zeroblob64(sqlite3_context*, sqlite3_uint64 n);
  4654   4656   
  4655   4657   /*
  4656   4658   ** CAPI3REF: Define New Collating Sequences
  4657   4659   ** METHOD: sqlite3
  4658   4660   **
  4659   4661   ** ^These functions add, remove, or modify a [collation] associated
  4660   4662   ** with the [database connection] specified as the first argument.

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

   266    266                           void(*)(void*));
   267    267     void (*result_text64)(sqlite3_context*,const char*,sqlite3_uint64,
   268    268                            void(*)(void*), unsigned char);
   269    269     int (*strglob)(const char*,const char*);
   270    270     /* Version 3.8.11 and later */
   271    271     sqlite3_value *(*value_dup)(const sqlite3_value*);
   272    272     void (*value_free)(sqlite3_value*);
          273  +  int (*result_zeroblob64)(sqlite3_context*,sqlite3_uint64);
          274  +  int (*bind_zeroblob64)(sqlite3_stmt*, int, sqlite3_uint64);
   273    275   };
   274    276   
   275    277   /*
   276    278   ** The following macros redefine the API routines so that they are
   277    279   ** redirected through the global sqlite3_api structure.
   278    280   **
   279    281   ** This header file is also used by the loadext.c source file
................................................................................
   499    501   #define sqlite3_reset_auto_extension   sqlite3_api->reset_auto_extension
   500    502   #define sqlite3_result_blob64          sqlite3_api->result_blob64
   501    503   #define sqlite3_result_text64          sqlite3_api->result_text64
   502    504   #define sqlite3_strglob                sqlite3_api->strglob
   503    505   /* Version 3.8.11 and later */
   504    506   #define sqlite3_value_dup              sqlite3_api->value_dup
   505    507   #define sqlite3_value_free             sqlite3_api->value_free
          508  +#define sqlite3_result_zeroblob64      sqlite3_api->result_zeroblob64
          509  +#define sqlite3_bind_zeroblob64        sqlite3_api->bind_zeroblob64
   506    510   #endif /* SQLITE_CORE */
   507    511   
   508    512   #ifndef SQLITE_CORE
   509    513     /* This case when the file really is being compiled as a loadable 
   510    514     ** extension */
   511    515   # define SQLITE_EXTENSION_INIT1     const sqlite3_api_routines *sqlite3_api=0;
   512    516   # define SQLITE_EXTENSION_INIT2(v)  sqlite3_api=v;