Fossil SCM
Update the built-in SQLite to version 3.8.11.
Commit
f8e26879acf4ab2e65a50415dfdd838406bee47e
Parent
acab077c4cbcba2…
2 files changed
+63
-24
+5
-3
+63
-24
| --- src/sqlite3.c | ||
| +++ src/sqlite3.c | ||
| @@ -325,11 +325,11 @@ | ||
| 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-23 20:44:49 017c5019e1ce042025d4f327e50ec50af49f9fa4" | |
| 330 | +#define SQLITE_SOURCE_ID "2015-07-27 13:49:41 b8e92227a469de677a66da62e4361f099c0b79d0" | |
| 331 | 331 | |
| 332 | 332 | /* |
| 333 | 333 | ** CAPI3REF: Run-Time Library Version Numbers |
| 334 | 334 | ** KEYWORDS: sqlite3_version, sqlite3_sourceid |
| 335 | 335 | ** |
| @@ -3774,10 +3774,11 @@ | ||
| 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 | ** |
| @@ -4746,12 +4747,12 @@ | ||
| 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. |
| @@ -4863,10 +4864,11 @@ | ||
| 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 | ** |
| @@ -8361,14 +8363,18 @@ | ||
| 8361 | 8363 | |
| 8362 | 8364 | /* |
| 8363 | 8365 | ** Make sure that the compiler intrinsics we desire are enabled when |
| 8364 | 8366 | ** compiling with an appropriate version of MSVC. |
| 8365 | 8367 | */ |
| 8366 | -#if defined(_MSC_VER) && _MSC_VER>=1300 && !defined(_WIN32_WCE) | |
| 8367 | -# include <intrin.h> | |
| 8368 | -# pragma intrinsic(_byteswap_ushort) | |
| 8369 | -# 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 | |
| 8370 | 8376 | #endif |
| 8371 | 8377 | |
| 8372 | 8378 | /* |
| 8373 | 8379 | ** The SQLITE_THREADSAFE macro must be defined as 0, 1, or 2. |
| 8374 | 8380 | ** 0 means mutexes are permanently disable and the library is never |
| @@ -70299,11 +70305,14 @@ | ||
| 70299 | 70305 | ** structure. |
| 70300 | 70306 | */ |
| 70301 | 70307 | SQLITE_API const void *SQLITE_STDCALL sqlite3_value_blob(sqlite3_value *pVal){ |
| 70302 | 70308 | Mem *p = (Mem*)pVal; |
| 70303 | 70309 | if( p->flags & (MEM_Blob|MEM_Str) ){ |
| 70304 | - sqlite3VdbeMemExpandBlob(p); | |
| 70310 | + if( sqlite3VdbeMemExpandBlob(p)!=SQLITE_OK ){ | |
| 70311 | + assert( p->flags==MEM_Null && p->z==0 ); | |
| 70312 | + return 0; | |
| 70313 | + } | |
| 70305 | 70314 | p->flags |= MEM_Blob; |
| 70306 | 70315 | return p->n ? p->z : 0; |
| 70307 | 70316 | }else{ |
| 70308 | 70317 | return sqlite3_value_text(pVal); |
| 70309 | 70318 | } |
| @@ -70560,10 +70569,19 @@ | ||
| 70560 | 70569 | sqlite3VdbeMemCopy(pCtx->pOut, pValue); |
| 70561 | 70570 | } |
| 70562 | 70571 | SQLITE_API void SQLITE_STDCALL sqlite3_result_zeroblob(sqlite3_context *pCtx, int n){ |
| 70563 | 70572 | assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) ); |
| 70564 | 70573 | sqlite3VdbeMemSetZeroBlob(pCtx->pOut, n); |
| 70574 | +} | |
| 70575 | +SQLITE_API int SQLITE_STDCALL sqlite3_result_zeroblob64(sqlite3_context *pCtx, u64 n){ | |
| 70576 | + Mem *pOut = pCtx->pOut; | |
| 70577 | + assert( sqlite3_mutex_held(pOut->db->mutex) ); | |
| 70578 | + if( n>(u64)pOut->db->aLimit[SQLITE_LIMIT_LENGTH] ){ | |
| 70579 | + return SQLITE_TOOBIG; | |
| 70580 | + } | |
| 70581 | + sqlite3VdbeMemSetZeroBlob(pCtx->pOut, (int)n); | |
| 70582 | + return SQLITE_OK; | |
| 70565 | 70583 | } |
| 70566 | 70584 | SQLITE_API void SQLITE_STDCALL sqlite3_result_error_code(sqlite3_context *pCtx, int errCode){ |
| 70567 | 70585 | pCtx->isError = errCode; |
| 70568 | 70586 | pCtx->fErrorOrAux = 1; |
| 70569 | 70587 | #ifdef SQLITE_DEBUG |
| @@ -71539,10 +71557,24 @@ | ||
| 71539 | 71557 | if( rc==SQLITE_OK ){ |
| 71540 | 71558 | sqlite3VdbeMemSetZeroBlob(&p->aVar[i-1], n); |
| 71541 | 71559 | sqlite3_mutex_leave(p->db->mutex); |
| 71542 | 71560 | } |
| 71543 | 71561 | return rc; |
| 71562 | +} | |
| 71563 | +SQLITE_API int SQLITE_STDCALL sqlite3_bind_zeroblob64(sqlite3_stmt *pStmt, int i, sqlite3_uint64 n){ | |
| 71564 | + int rc; | |
| 71565 | + Vdbe *p = (Vdbe *)pStmt; | |
| 71566 | + sqlite3_mutex_enter(p->db->mutex); | |
| 71567 | + if( n>(u64)p->db->aLimit[SQLITE_LIMIT_LENGTH] ){ | |
| 71568 | + rc = SQLITE_TOOBIG; | |
| 71569 | + }else{ | |
| 71570 | + assert( (n & 0x7FFFFFFF)==n ); | |
| 71571 | + rc = sqlite3_bind_zeroblob(pStmt, i, n); | |
| 71572 | + } | |
| 71573 | + rc = sqlite3ApiExit(p->db, rc); | |
| 71574 | + sqlite3_mutex_leave(p->db->mutex); | |
| 71575 | + return rc; | |
| 71544 | 71576 | } |
| 71545 | 71577 | |
| 71546 | 71578 | /* |
| 71547 | 71579 | ** Return the number of wildcards that can be potentially bound to. |
| 71548 | 71580 | ** This routine is added to support DBD::SQLite. |
| @@ -74756,11 +74788,11 @@ | ||
| 74756 | 74788 | assert( memIsValid(pRec) ); |
| 74757 | 74789 | pRec->uTemp = serial_type = sqlite3VdbeSerialType(pRec, file_format); |
| 74758 | 74790 | len = sqlite3VdbeSerialTypeLen(serial_type); |
| 74759 | 74791 | if( pRec->flags & MEM_Zero ){ |
| 74760 | 74792 | if( nData ){ |
| 74761 | - sqlite3VdbeMemExpandBlob(pRec); | |
| 74793 | + if( sqlite3VdbeMemExpandBlob(pRec) ) goto no_mem; | |
| 74762 | 74794 | }else{ |
| 74763 | 74795 | nZero += pRec->u.nZero; |
| 74764 | 74796 | len -= pRec->u.nZero; |
| 74765 | 74797 | } |
| 74766 | 74798 | } |
| @@ -98641,20 +98673,18 @@ | ||
| 98641 | 98673 | sqlite3_context *context, |
| 98642 | 98674 | int argc, |
| 98643 | 98675 | sqlite3_value **argv |
| 98644 | 98676 | ){ |
| 98645 | 98677 | i64 n; |
| 98646 | - sqlite3 *db = sqlite3_context_db_handle(context); | |
| 98678 | + int rc; | |
| 98647 | 98679 | assert( argc==1 ); |
| 98648 | 98680 | UNUSED_PARAMETER(argc); |
| 98649 | 98681 | 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 */ | |
| 98682 | + if( n<0 ) n = 0; | |
| 98683 | + rc = sqlite3_result_zeroblob64(context, n); /* IMP: R-00293-64994 */ | |
| 98684 | + if( rc ){ | |
| 98685 | + sqlite3_result_error_code(context, rc); | |
| 98656 | 98686 | } |
| 98657 | 98687 | } |
| 98658 | 98688 | |
| 98659 | 98689 | /* |
| 98660 | 98690 | ** The replace() function. Three arguments are all strings: call |
| @@ -103221,10 +103251,12 @@ | ||
| 103221 | 103251 | void(*)(void*), unsigned char); |
| 103222 | 103252 | int (*strglob)(const char*,const char*); |
| 103223 | 103253 | /* Version 3.8.11 and later */ |
| 103224 | 103254 | sqlite3_value *(*value_dup)(const sqlite3_value*); |
| 103225 | 103255 | void (*value_free)(sqlite3_value*); |
| 103256 | + int (*result_zeroblob64)(sqlite3_context*,sqlite3_uint64); | |
| 103257 | + int (*bind_zeroblob64)(sqlite3_stmt*, int, sqlite3_uint64); | |
| 103226 | 103258 | }; |
| 103227 | 103259 | |
| 103228 | 103260 | /* |
| 103229 | 103261 | ** The following macros redefine the API routines so that they are |
| 103230 | 103262 | ** redirected through the global sqlite3_api structure. |
| @@ -103454,10 +103486,12 @@ | ||
| 103454 | 103486 | #define sqlite3_result_text64 sqlite3_api->result_text64 |
| 103455 | 103487 | #define sqlite3_strglob sqlite3_api->strglob |
| 103456 | 103488 | /* Version 3.8.11 and later */ |
| 103457 | 103489 | #define sqlite3_value_dup sqlite3_api->value_dup |
| 103458 | 103490 | #define sqlite3_value_free sqlite3_api->value_free |
| 103491 | +#define sqlite3_result_zeroblob64 sqlite3_api->result_zeroblob64 | |
| 103492 | +#define sqlite3_bind_zeroblob64 sqlite3_api->bind_zeroblob64 | |
| 103459 | 103493 | #endif /* SQLITE_CORE */ |
| 103460 | 103494 | |
| 103461 | 103495 | #ifndef SQLITE_CORE |
| 103462 | 103496 | /* This case when the file really is being compiled as a loadable |
| 103463 | 103497 | ** extension */ |
| @@ -103863,11 +103897,13 @@ | ||
| 103863 | 103897 | sqlite3_result_blob64, |
| 103864 | 103898 | sqlite3_result_text64, |
| 103865 | 103899 | sqlite3_strglob, |
| 103866 | 103900 | /* Version 3.8.11 and later */ |
| 103867 | 103901 | (sqlite3_value*(*)(const sqlite3_value*))sqlite3_value_dup, |
| 103868 | - sqlite3_value_free | |
| 103902 | + sqlite3_value_free, | |
| 103903 | + sqlite3_result_zeroblob64, | |
| 103904 | + sqlite3_bind_zeroblob64 | |
| 103869 | 103905 | }; |
| 103870 | 103906 | |
| 103871 | 103907 | /* |
| 103872 | 103908 | ** Attempt to load an SQLite extension library contained in the file |
| 103873 | 103909 | ** zFile. The entry point is zProc. zProc may be 0 in which case a |
| @@ -138650,11 +138686,10 @@ | ||
| 138650 | 138686 | ** tokens or prefix tokens that cannot use a prefix-index. */ |
| 138651 | 138687 | int bHaveIncr = 0; |
| 138652 | 138688 | int bIncrOk = (bOptOk |
| 138653 | 138689 | && pCsr->bDesc==pTab->bDescIdx |
| 138654 | 138690 | && p->nToken<=MAX_INCR_PHRASE_TOKENS && p->nToken>0 |
| 138655 | - && p->nToken<=MAX_INCR_PHRASE_TOKENS && p->nToken>0 | |
| 138656 | 138691 | #ifdef SQLITE_TEST |
| 138657 | 138692 | && pTab->bNoIncrDoclist==0 |
| 138658 | 138693 | #endif |
| 138659 | 138694 | ); |
| 138660 | 138695 | for(i=0; bIncrOk==1 && i<p->nToken; i++){ |
| @@ -156922,11 +156957,14 @@ | ||
| 156922 | 156957 | */ |
| 156923 | 156958 | |
| 156924 | 156959 | /* #include <assert.h> */ |
| 156925 | 156960 | /* #include <string.h> */ |
| 156926 | 156961 | /* #include <stdio.h> */ |
| 156927 | -/* #include <unistd.h> */ | |
| 156962 | + | |
| 156963 | +#if !defined(_WIN32) | |
| 156964 | +/* # include <unistd.h> */ | |
| 156965 | +#endif | |
| 156928 | 156966 | |
| 156929 | 156967 | /* #include "sqlite3.h" */ |
| 156930 | 156968 | |
| 156931 | 156969 | #if !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_RBU) |
| 156932 | 156970 | /************** Include sqlite3rbu.h in the middle of sqlite3rbu.c ***********/ |
| @@ -156978,11 +157016,11 @@ | ||
| 156978 | 157016 | ** mobile device that is frequently rebooted. Even after the writer process |
| 156979 | 157017 | ** has committed one or more sub-transactions, other database clients continue |
| 156980 | 157018 | ** to read from the original database snapshot. In other words, partially |
| 156981 | 157019 | ** applied transactions are not visible to other clients. |
| 156982 | 157020 | ** |
| 156983 | -** "RBU" stands for "Over The Air" update. As in a large database update | |
| 157021 | +** "RBU" stands for "Resumable Bulk Update". As in a large database update | |
| 156984 | 157022 | ** transmitted via a wireless network to a mobile device. A transaction |
| 156985 | 157023 | ** applied using this extension is hence refered to as an "RBU update". |
| 156986 | 157024 | ** |
| 156987 | 157025 | ** |
| 156988 | 157026 | ** LIMITATIONS |
| @@ -157829,11 +157867,11 @@ | ||
| 157829 | 157867 | int rc; |
| 157830 | 157868 | memset(pIter, 0, sizeof(RbuObjIter)); |
| 157831 | 157869 | |
| 157832 | 157870 | rc = prepareAndCollectError(p->dbRbu, &pIter->pTblIter, &p->zErrmsg, |
| 157833 | 157871 | "SELECT substr(name, 6) FROM sqlite_master " |
| 157834 | - "WHERE type='table' AND name LIKE 'data_%'" | |
| 157872 | + "WHERE type IN ('table', 'view') AND name LIKE 'data_%'" | |
| 157835 | 157873 | ); |
| 157836 | 157874 | |
| 157837 | 157875 | if( rc==SQLITE_OK ){ |
| 157838 | 157876 | rc = prepareAndCollectError(p->dbMain, &pIter->pIdxIter, &p->zErrmsg, |
| 157839 | 157877 | "SELECT name, rootpage, sql IS NULL OR substr(8, 6)=='UNIQUE' " |
| @@ -157881,12 +157919,13 @@ | ||
| 157881 | 157919 | ** RBU handle. If an error has already occurred when this function is |
| 157882 | 157920 | ** called, it is a no-op. |
| 157883 | 157921 | */ |
| 157884 | 157922 | static int rbuMPrintfExec(sqlite3rbu *p, sqlite3 *db, const char *zFmt, ...){ |
| 157885 | 157923 | va_list ap; |
| 157924 | + char *zSql; | |
| 157886 | 157925 | va_start(ap, zFmt); |
| 157887 | - char *zSql = sqlite3_vmprintf(zFmt, ap); | |
| 157926 | + zSql = sqlite3_vmprintf(zFmt, ap); | |
| 157888 | 157927 | if( p->rc==SQLITE_OK ){ |
| 157889 | 157928 | if( zSql==0 ){ |
| 157890 | 157929 | p->rc = SQLITE_NOMEM; |
| 157891 | 157930 | }else{ |
| 157892 | 157931 | p->rc = sqlite3_exec(db, zSql, 0, 0, &p->zErrmsg); |
| @@ -159901,11 +159940,11 @@ | ||
| 159901 | 159940 | int rnd; |
| 159902 | 159941 | char zRnd[64]; |
| 159903 | 159942 | |
| 159904 | 159943 | assert( p->rc==SQLITE_OK ); |
| 159905 | 159944 | sqlite3_randomness(sizeof(int), (void*)&rnd); |
| 159906 | - sprintf(zRnd, "rbu_vfs_%d", rnd); | |
| 159945 | + sqlite3_snprintf(sizeof(zRnd), zRnd, "rbu_vfs_%d", rnd); | |
| 159907 | 159946 | p->rc = sqlite3rbu_create_vfs(zRnd, 0); |
| 159908 | 159947 | if( p->rc==SQLITE_OK ){ |
| 159909 | 159948 | sqlite3_vfs *pVfs = sqlite3_vfs_find(zRnd); |
| 159910 | 159949 | assert( pVfs ); |
| 159911 | 159950 | p->zVfsName = pVfs->zName; |
| @@ -160786,11 +160825,11 @@ | ||
| 160786 | 160825 | /* |
| 160787 | 160826 | ** Close the dynamic library handle pHandle. |
| 160788 | 160827 | */ |
| 160789 | 160828 | static void rbuVfsDlClose(sqlite3_vfs *pVfs, void *pHandle){ |
| 160790 | 160829 | sqlite3_vfs *pRealVfs = ((rbu_vfs*)pVfs)->pRealVfs; |
| 160791 | - return pRealVfs->xDlClose(pRealVfs, pHandle); | |
| 160830 | + pRealVfs->xDlClose(pRealVfs, pHandle); | |
| 160792 | 160831 | } |
| 160793 | 160832 | #endif /* SQLITE_OMIT_LOAD_EXTENSION */ |
| 160794 | 160833 | |
| 160795 | 160834 | /* |
| 160796 | 160835 | ** Populate the buffer pointed to by zBufOut with nByte bytes of |
| 160797 | 160836 |
| --- src/sqlite3.c | |
| +++ src/sqlite3.c | |
| @@ -325,11 +325,11 @@ | |
| 325 | ** [sqlite3_libversion_number()], [sqlite3_sourceid()], |
| 326 | ** [sqlite_version()] and [sqlite_source_id()]. |
| 327 | */ |
| 328 | #define SQLITE_VERSION "3.8.11" |
| 329 | #define SQLITE_VERSION_NUMBER 3008011 |
| 330 | #define SQLITE_SOURCE_ID "2015-07-23 20:44:49 017c5019e1ce042025d4f327e50ec50af49f9fa4" |
| 331 | |
| 332 | /* |
| 333 | ** CAPI3REF: Run-Time Library Version Numbers |
| 334 | ** KEYWORDS: sqlite3_version, sqlite3_sourceid |
| 335 | ** |
| @@ -3774,10 +3774,11 @@ | |
| 3774 | SQLITE_API int SQLITE_STDCALL sqlite3_bind_text16(sqlite3_stmt*, int, const void*, int, void(*)(void*)); |
| 3775 | SQLITE_API int SQLITE_STDCALL sqlite3_bind_text64(sqlite3_stmt*, int, const char*, sqlite3_uint64, |
| 3776 | void(*)(void*), unsigned char encoding); |
| 3777 | SQLITE_API int SQLITE_STDCALL sqlite3_bind_value(sqlite3_stmt*, int, const sqlite3_value*); |
| 3778 | SQLITE_API int SQLITE_STDCALL sqlite3_bind_zeroblob(sqlite3_stmt*, int, int n); |
| 3779 | |
| 3780 | /* |
| 3781 | ** CAPI3REF: Number Of SQL Parameters |
| 3782 | ** METHOD: sqlite3_stmt |
| 3783 | ** |
| @@ -4746,12 +4747,12 @@ | |
| 4746 | ** ^The sqlite3_result_blob() interface sets the result from |
| 4747 | ** an application-defined function to be the BLOB whose content is pointed |
| 4748 | ** to by the second parameter and which is N bytes long where N is the |
| 4749 | ** third parameter. |
| 4750 | ** |
| 4751 | ** ^The sqlite3_result_zeroblob() interfaces set the result of |
| 4752 | ** the application-defined function to be a BLOB containing all zero |
| 4753 | ** bytes and N bytes in size, where N is the value of the 2nd parameter. |
| 4754 | ** |
| 4755 | ** ^The sqlite3_result_double() interface sets the result from |
| 4756 | ** an application-defined function to be a floating point value specified |
| 4757 | ** by its 2nd argument. |
| @@ -4863,10 +4864,11 @@ | |
| 4863 | SQLITE_API void SQLITE_STDCALL sqlite3_result_text16(sqlite3_context*, const void*, int, void(*)(void*)); |
| 4864 | SQLITE_API void SQLITE_STDCALL sqlite3_result_text16le(sqlite3_context*, const void*, int,void(*)(void*)); |
| 4865 | SQLITE_API void SQLITE_STDCALL sqlite3_result_text16be(sqlite3_context*, const void*, int,void(*)(void*)); |
| 4866 | SQLITE_API void SQLITE_STDCALL sqlite3_result_value(sqlite3_context*, sqlite3_value*); |
| 4867 | SQLITE_API void SQLITE_STDCALL sqlite3_result_zeroblob(sqlite3_context*, int n); |
| 4868 | |
| 4869 | /* |
| 4870 | ** CAPI3REF: Define New Collating Sequences |
| 4871 | ** METHOD: sqlite3 |
| 4872 | ** |
| @@ -8361,14 +8363,18 @@ | |
| 8361 | |
| 8362 | /* |
| 8363 | ** Make sure that the compiler intrinsics we desire are enabled when |
| 8364 | ** compiling with an appropriate version of MSVC. |
| 8365 | */ |
| 8366 | #if defined(_MSC_VER) && _MSC_VER>=1300 && !defined(_WIN32_WCE) |
| 8367 | # include <intrin.h> |
| 8368 | # pragma intrinsic(_byteswap_ushort) |
| 8369 | # pragma intrinsic(_byteswap_ulong) |
| 8370 | #endif |
| 8371 | |
| 8372 | /* |
| 8373 | ** The SQLITE_THREADSAFE macro must be defined as 0, 1, or 2. |
| 8374 | ** 0 means mutexes are permanently disable and the library is never |
| @@ -70299,11 +70305,14 @@ | |
| 70299 | ** structure. |
| 70300 | */ |
| 70301 | SQLITE_API const void *SQLITE_STDCALL sqlite3_value_blob(sqlite3_value *pVal){ |
| 70302 | Mem *p = (Mem*)pVal; |
| 70303 | if( p->flags & (MEM_Blob|MEM_Str) ){ |
| 70304 | sqlite3VdbeMemExpandBlob(p); |
| 70305 | p->flags |= MEM_Blob; |
| 70306 | return p->n ? p->z : 0; |
| 70307 | }else{ |
| 70308 | return sqlite3_value_text(pVal); |
| 70309 | } |
| @@ -70560,10 +70569,19 @@ | |
| 70560 | sqlite3VdbeMemCopy(pCtx->pOut, pValue); |
| 70561 | } |
| 70562 | SQLITE_API void SQLITE_STDCALL sqlite3_result_zeroblob(sqlite3_context *pCtx, int n){ |
| 70563 | assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) ); |
| 70564 | sqlite3VdbeMemSetZeroBlob(pCtx->pOut, n); |
| 70565 | } |
| 70566 | SQLITE_API void SQLITE_STDCALL sqlite3_result_error_code(sqlite3_context *pCtx, int errCode){ |
| 70567 | pCtx->isError = errCode; |
| 70568 | pCtx->fErrorOrAux = 1; |
| 70569 | #ifdef SQLITE_DEBUG |
| @@ -71539,10 +71557,24 @@ | |
| 71539 | if( rc==SQLITE_OK ){ |
| 71540 | sqlite3VdbeMemSetZeroBlob(&p->aVar[i-1], n); |
| 71541 | sqlite3_mutex_leave(p->db->mutex); |
| 71542 | } |
| 71543 | return rc; |
| 71544 | } |
| 71545 | |
| 71546 | /* |
| 71547 | ** Return the number of wildcards that can be potentially bound to. |
| 71548 | ** This routine is added to support DBD::SQLite. |
| @@ -74756,11 +74788,11 @@ | |
| 74756 | assert( memIsValid(pRec) ); |
| 74757 | pRec->uTemp = serial_type = sqlite3VdbeSerialType(pRec, file_format); |
| 74758 | len = sqlite3VdbeSerialTypeLen(serial_type); |
| 74759 | if( pRec->flags & MEM_Zero ){ |
| 74760 | if( nData ){ |
| 74761 | sqlite3VdbeMemExpandBlob(pRec); |
| 74762 | }else{ |
| 74763 | nZero += pRec->u.nZero; |
| 74764 | len -= pRec->u.nZero; |
| 74765 | } |
| 74766 | } |
| @@ -98641,20 +98673,18 @@ | |
| 98641 | sqlite3_context *context, |
| 98642 | int argc, |
| 98643 | sqlite3_value **argv |
| 98644 | ){ |
| 98645 | i64 n; |
| 98646 | sqlite3 *db = sqlite3_context_db_handle(context); |
| 98647 | assert( argc==1 ); |
| 98648 | UNUSED_PARAMETER(argc); |
| 98649 | 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 */ |
| 98656 | } |
| 98657 | } |
| 98658 | |
| 98659 | /* |
| 98660 | ** The replace() function. Three arguments are all strings: call |
| @@ -103221,10 +103251,12 @@ | |
| 103221 | void(*)(void*), unsigned char); |
| 103222 | int (*strglob)(const char*,const char*); |
| 103223 | /* Version 3.8.11 and later */ |
| 103224 | sqlite3_value *(*value_dup)(const sqlite3_value*); |
| 103225 | void (*value_free)(sqlite3_value*); |
| 103226 | }; |
| 103227 | |
| 103228 | /* |
| 103229 | ** The following macros redefine the API routines so that they are |
| 103230 | ** redirected through the global sqlite3_api structure. |
| @@ -103454,10 +103486,12 @@ | |
| 103454 | #define sqlite3_result_text64 sqlite3_api->result_text64 |
| 103455 | #define sqlite3_strglob sqlite3_api->strglob |
| 103456 | /* Version 3.8.11 and later */ |
| 103457 | #define sqlite3_value_dup sqlite3_api->value_dup |
| 103458 | #define sqlite3_value_free sqlite3_api->value_free |
| 103459 | #endif /* SQLITE_CORE */ |
| 103460 | |
| 103461 | #ifndef SQLITE_CORE |
| 103462 | /* This case when the file really is being compiled as a loadable |
| 103463 | ** extension */ |
| @@ -103863,11 +103897,13 @@ | |
| 103863 | sqlite3_result_blob64, |
| 103864 | sqlite3_result_text64, |
| 103865 | sqlite3_strglob, |
| 103866 | /* Version 3.8.11 and later */ |
| 103867 | (sqlite3_value*(*)(const sqlite3_value*))sqlite3_value_dup, |
| 103868 | sqlite3_value_free |
| 103869 | }; |
| 103870 | |
| 103871 | /* |
| 103872 | ** Attempt to load an SQLite extension library contained in the file |
| 103873 | ** zFile. The entry point is zProc. zProc may be 0 in which case a |
| @@ -138650,11 +138686,10 @@ | |
| 138650 | ** tokens or prefix tokens that cannot use a prefix-index. */ |
| 138651 | int bHaveIncr = 0; |
| 138652 | int bIncrOk = (bOptOk |
| 138653 | && pCsr->bDesc==pTab->bDescIdx |
| 138654 | && p->nToken<=MAX_INCR_PHRASE_TOKENS && p->nToken>0 |
| 138655 | && p->nToken<=MAX_INCR_PHRASE_TOKENS && p->nToken>0 |
| 138656 | #ifdef SQLITE_TEST |
| 138657 | && pTab->bNoIncrDoclist==0 |
| 138658 | #endif |
| 138659 | ); |
| 138660 | for(i=0; bIncrOk==1 && i<p->nToken; i++){ |
| @@ -156922,11 +156957,14 @@ | |
| 156922 | */ |
| 156923 | |
| 156924 | /* #include <assert.h> */ |
| 156925 | /* #include <string.h> */ |
| 156926 | /* #include <stdio.h> */ |
| 156927 | /* #include <unistd.h> */ |
| 156928 | |
| 156929 | /* #include "sqlite3.h" */ |
| 156930 | |
| 156931 | #if !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_RBU) |
| 156932 | /************** Include sqlite3rbu.h in the middle of sqlite3rbu.c ***********/ |
| @@ -156978,11 +157016,11 @@ | |
| 156978 | ** mobile device that is frequently rebooted. Even after the writer process |
| 156979 | ** has committed one or more sub-transactions, other database clients continue |
| 156980 | ** to read from the original database snapshot. In other words, partially |
| 156981 | ** applied transactions are not visible to other clients. |
| 156982 | ** |
| 156983 | ** "RBU" stands for "Over The Air" update. As in a large database update |
| 156984 | ** transmitted via a wireless network to a mobile device. A transaction |
| 156985 | ** applied using this extension is hence refered to as an "RBU update". |
| 156986 | ** |
| 156987 | ** |
| 156988 | ** LIMITATIONS |
| @@ -157829,11 +157867,11 @@ | |
| 157829 | int rc; |
| 157830 | memset(pIter, 0, sizeof(RbuObjIter)); |
| 157831 | |
| 157832 | rc = prepareAndCollectError(p->dbRbu, &pIter->pTblIter, &p->zErrmsg, |
| 157833 | "SELECT substr(name, 6) FROM sqlite_master " |
| 157834 | "WHERE type='table' AND name LIKE 'data_%'" |
| 157835 | ); |
| 157836 | |
| 157837 | if( rc==SQLITE_OK ){ |
| 157838 | rc = prepareAndCollectError(p->dbMain, &pIter->pIdxIter, &p->zErrmsg, |
| 157839 | "SELECT name, rootpage, sql IS NULL OR substr(8, 6)=='UNIQUE' " |
| @@ -157881,12 +157919,13 @@ | |
| 157881 | ** RBU handle. If an error has already occurred when this function is |
| 157882 | ** called, it is a no-op. |
| 157883 | */ |
| 157884 | static int rbuMPrintfExec(sqlite3rbu *p, sqlite3 *db, const char *zFmt, ...){ |
| 157885 | va_list ap; |
| 157886 | va_start(ap, zFmt); |
| 157887 | char *zSql = sqlite3_vmprintf(zFmt, ap); |
| 157888 | if( p->rc==SQLITE_OK ){ |
| 157889 | if( zSql==0 ){ |
| 157890 | p->rc = SQLITE_NOMEM; |
| 157891 | }else{ |
| 157892 | p->rc = sqlite3_exec(db, zSql, 0, 0, &p->zErrmsg); |
| @@ -159901,11 +159940,11 @@ | |
| 159901 | int rnd; |
| 159902 | char zRnd[64]; |
| 159903 | |
| 159904 | assert( p->rc==SQLITE_OK ); |
| 159905 | sqlite3_randomness(sizeof(int), (void*)&rnd); |
| 159906 | sprintf(zRnd, "rbu_vfs_%d", rnd); |
| 159907 | p->rc = sqlite3rbu_create_vfs(zRnd, 0); |
| 159908 | if( p->rc==SQLITE_OK ){ |
| 159909 | sqlite3_vfs *pVfs = sqlite3_vfs_find(zRnd); |
| 159910 | assert( pVfs ); |
| 159911 | p->zVfsName = pVfs->zName; |
| @@ -160786,11 +160825,11 @@ | |
| 160786 | /* |
| 160787 | ** Close the dynamic library handle pHandle. |
| 160788 | */ |
| 160789 | static void rbuVfsDlClose(sqlite3_vfs *pVfs, void *pHandle){ |
| 160790 | sqlite3_vfs *pRealVfs = ((rbu_vfs*)pVfs)->pRealVfs; |
| 160791 | return pRealVfs->xDlClose(pRealVfs, pHandle); |
| 160792 | } |
| 160793 | #endif /* SQLITE_OMIT_LOAD_EXTENSION */ |
| 160794 | |
| 160795 | /* |
| 160796 | ** Populate the buffer pointed to by zBufOut with nByte bytes of |
| 160797 |
| --- src/sqlite3.c | |
| +++ src/sqlite3.c | |
| @@ -325,11 +325,11 @@ | |
| 325 | ** [sqlite3_libversion_number()], [sqlite3_sourceid()], |
| 326 | ** [sqlite_version()] and [sqlite_source_id()]. |
| 327 | */ |
| 328 | #define SQLITE_VERSION "3.8.11" |
| 329 | #define SQLITE_VERSION_NUMBER 3008011 |
| 330 | #define SQLITE_SOURCE_ID "2015-07-27 13:49:41 b8e92227a469de677a66da62e4361f099c0b79d0" |
| 331 | |
| 332 | /* |
| 333 | ** CAPI3REF: Run-Time Library Version Numbers |
| 334 | ** KEYWORDS: sqlite3_version, sqlite3_sourceid |
| 335 | ** |
| @@ -3774,10 +3774,11 @@ | |
| 3774 | SQLITE_API int SQLITE_STDCALL sqlite3_bind_text16(sqlite3_stmt*, int, const void*, int, void(*)(void*)); |
| 3775 | SQLITE_API int SQLITE_STDCALL sqlite3_bind_text64(sqlite3_stmt*, int, const char*, sqlite3_uint64, |
| 3776 | void(*)(void*), unsigned char encoding); |
| 3777 | SQLITE_API int SQLITE_STDCALL sqlite3_bind_value(sqlite3_stmt*, int, const sqlite3_value*); |
| 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); |
| 3780 | |
| 3781 | /* |
| 3782 | ** CAPI3REF: Number Of SQL Parameters |
| 3783 | ** METHOD: sqlite3_stmt |
| 3784 | ** |
| @@ -4746,12 +4747,12 @@ | |
| 4747 | ** ^The sqlite3_result_blob() interface sets the result from |
| 4748 | ** an application-defined function to be the BLOB whose content is pointed |
| 4749 | ** to by the second parameter and which is N bytes long where N is the |
| 4750 | ** third parameter. |
| 4751 | ** |
| 4752 | ** ^The sqlite3_result_zeroblob() and zeroblob64() interfaces set the result |
| 4753 | ** of the application-defined function to be a BLOB containing all zero |
| 4754 | ** bytes and N bytes in size, where N is the value of the 2nd parameter. |
| 4755 | ** |
| 4756 | ** ^The sqlite3_result_double() interface sets the result from |
| 4757 | ** an application-defined function to be a floating point value specified |
| 4758 | ** by its 2nd argument. |
| @@ -4863,10 +4864,11 @@ | |
| 4864 | SQLITE_API void SQLITE_STDCALL sqlite3_result_text16(sqlite3_context*, const void*, int, void(*)(void*)); |
| 4865 | SQLITE_API void SQLITE_STDCALL sqlite3_result_text16le(sqlite3_context*, const void*, int,void(*)(void*)); |
| 4866 | SQLITE_API void SQLITE_STDCALL sqlite3_result_text16be(sqlite3_context*, const void*, int,void(*)(void*)); |
| 4867 | SQLITE_API void SQLITE_STDCALL sqlite3_result_value(sqlite3_context*, sqlite3_value*); |
| 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); |
| 4870 | |
| 4871 | /* |
| 4872 | ** CAPI3REF: Define New Collating Sequences |
| 4873 | ** METHOD: sqlite3 |
| 4874 | ** |
| @@ -8361,14 +8363,18 @@ | |
| 8363 | |
| 8364 | /* |
| 8365 | ** Make sure that the compiler intrinsics we desire are enabled when |
| 8366 | ** compiling with an appropriate version of MSVC. |
| 8367 | */ |
| 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 |
| 8376 | #endif |
| 8377 | |
| 8378 | /* |
| 8379 | ** The SQLITE_THREADSAFE macro must be defined as 0, 1, or 2. |
| 8380 | ** 0 means mutexes are permanently disable and the library is never |
| @@ -70299,11 +70305,14 @@ | |
| 70305 | ** structure. |
| 70306 | */ |
| 70307 | SQLITE_API const void *SQLITE_STDCALL sqlite3_value_blob(sqlite3_value *pVal){ |
| 70308 | Mem *p = (Mem*)pVal; |
| 70309 | if( p->flags & (MEM_Blob|MEM_Str) ){ |
| 70310 | if( sqlite3VdbeMemExpandBlob(p)!=SQLITE_OK ){ |
| 70311 | assert( p->flags==MEM_Null && p->z==0 ); |
| 70312 | return 0; |
| 70313 | } |
| 70314 | p->flags |= MEM_Blob; |
| 70315 | return p->n ? p->z : 0; |
| 70316 | }else{ |
| 70317 | return sqlite3_value_text(pVal); |
| 70318 | } |
| @@ -70560,10 +70569,19 @@ | |
| 70569 | sqlite3VdbeMemCopy(pCtx->pOut, pValue); |
| 70570 | } |
| 70571 | SQLITE_API void SQLITE_STDCALL sqlite3_result_zeroblob(sqlite3_context *pCtx, int n){ |
| 70572 | assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) ); |
| 70573 | sqlite3VdbeMemSetZeroBlob(pCtx->pOut, n); |
| 70574 | } |
| 70575 | SQLITE_API int SQLITE_STDCALL sqlite3_result_zeroblob64(sqlite3_context *pCtx, u64 n){ |
| 70576 | Mem *pOut = pCtx->pOut; |
| 70577 | assert( sqlite3_mutex_held(pOut->db->mutex) ); |
| 70578 | if( n>(u64)pOut->db->aLimit[SQLITE_LIMIT_LENGTH] ){ |
| 70579 | return SQLITE_TOOBIG; |
| 70580 | } |
| 70581 | sqlite3VdbeMemSetZeroBlob(pCtx->pOut, (int)n); |
| 70582 | return SQLITE_OK; |
| 70583 | } |
| 70584 | SQLITE_API void SQLITE_STDCALL sqlite3_result_error_code(sqlite3_context *pCtx, int errCode){ |
| 70585 | pCtx->isError = errCode; |
| 70586 | pCtx->fErrorOrAux = 1; |
| 70587 | #ifdef SQLITE_DEBUG |
| @@ -71539,10 +71557,24 @@ | |
| 71557 | if( rc==SQLITE_OK ){ |
| 71558 | sqlite3VdbeMemSetZeroBlob(&p->aVar[i-1], n); |
| 71559 | sqlite3_mutex_leave(p->db->mutex); |
| 71560 | } |
| 71561 | return rc; |
| 71562 | } |
| 71563 | SQLITE_API int SQLITE_STDCALL sqlite3_bind_zeroblob64(sqlite3_stmt *pStmt, int i, sqlite3_uint64 n){ |
| 71564 | int rc; |
| 71565 | Vdbe *p = (Vdbe *)pStmt; |
| 71566 | sqlite3_mutex_enter(p->db->mutex); |
| 71567 | if( n>(u64)p->db->aLimit[SQLITE_LIMIT_LENGTH] ){ |
| 71568 | rc = SQLITE_TOOBIG; |
| 71569 | }else{ |
| 71570 | assert( (n & 0x7FFFFFFF)==n ); |
| 71571 | rc = sqlite3_bind_zeroblob(pStmt, i, n); |
| 71572 | } |
| 71573 | rc = sqlite3ApiExit(p->db, rc); |
| 71574 | sqlite3_mutex_leave(p->db->mutex); |
| 71575 | return rc; |
| 71576 | } |
| 71577 | |
| 71578 | /* |
| 71579 | ** Return the number of wildcards that can be potentially bound to. |
| 71580 | ** This routine is added to support DBD::SQLite. |
| @@ -74756,11 +74788,11 @@ | |
| 74788 | assert( memIsValid(pRec) ); |
| 74789 | pRec->uTemp = serial_type = sqlite3VdbeSerialType(pRec, file_format); |
| 74790 | len = sqlite3VdbeSerialTypeLen(serial_type); |
| 74791 | if( pRec->flags & MEM_Zero ){ |
| 74792 | if( nData ){ |
| 74793 | if( sqlite3VdbeMemExpandBlob(pRec) ) goto no_mem; |
| 74794 | }else{ |
| 74795 | nZero += pRec->u.nZero; |
| 74796 | len -= pRec->u.nZero; |
| 74797 | } |
| 74798 | } |
| @@ -98641,20 +98673,18 @@ | |
| 98673 | sqlite3_context *context, |
| 98674 | int argc, |
| 98675 | sqlite3_value **argv |
| 98676 | ){ |
| 98677 | i64 n; |
| 98678 | int rc; |
| 98679 | assert( argc==1 ); |
| 98680 | UNUSED_PARAMETER(argc); |
| 98681 | n = sqlite3_value_int64(argv[0]); |
| 98682 | if( n<0 ) n = 0; |
| 98683 | rc = sqlite3_result_zeroblob64(context, n); /* IMP: R-00293-64994 */ |
| 98684 | if( rc ){ |
| 98685 | sqlite3_result_error_code(context, rc); |
| 98686 | } |
| 98687 | } |
| 98688 | |
| 98689 | /* |
| 98690 | ** The replace() function. Three arguments are all strings: call |
| @@ -103221,10 +103251,12 @@ | |
| 103251 | void(*)(void*), unsigned char); |
| 103252 | int (*strglob)(const char*,const char*); |
| 103253 | /* Version 3.8.11 and later */ |
| 103254 | sqlite3_value *(*value_dup)(const sqlite3_value*); |
| 103255 | void (*value_free)(sqlite3_value*); |
| 103256 | int (*result_zeroblob64)(sqlite3_context*,sqlite3_uint64); |
| 103257 | int (*bind_zeroblob64)(sqlite3_stmt*, int, sqlite3_uint64); |
| 103258 | }; |
| 103259 | |
| 103260 | /* |
| 103261 | ** The following macros redefine the API routines so that they are |
| 103262 | ** redirected through the global sqlite3_api structure. |
| @@ -103454,10 +103486,12 @@ | |
| 103486 | #define sqlite3_result_text64 sqlite3_api->result_text64 |
| 103487 | #define sqlite3_strglob sqlite3_api->strglob |
| 103488 | /* Version 3.8.11 and later */ |
| 103489 | #define sqlite3_value_dup sqlite3_api->value_dup |
| 103490 | #define sqlite3_value_free sqlite3_api->value_free |
| 103491 | #define sqlite3_result_zeroblob64 sqlite3_api->result_zeroblob64 |
| 103492 | #define sqlite3_bind_zeroblob64 sqlite3_api->bind_zeroblob64 |
| 103493 | #endif /* SQLITE_CORE */ |
| 103494 | |
| 103495 | #ifndef SQLITE_CORE |
| 103496 | /* This case when the file really is being compiled as a loadable |
| 103497 | ** extension */ |
| @@ -103863,11 +103897,13 @@ | |
| 103897 | sqlite3_result_blob64, |
| 103898 | sqlite3_result_text64, |
| 103899 | sqlite3_strglob, |
| 103900 | /* Version 3.8.11 and later */ |
| 103901 | (sqlite3_value*(*)(const sqlite3_value*))sqlite3_value_dup, |
| 103902 | sqlite3_value_free, |
| 103903 | sqlite3_result_zeroblob64, |
| 103904 | sqlite3_bind_zeroblob64 |
| 103905 | }; |
| 103906 | |
| 103907 | /* |
| 103908 | ** Attempt to load an SQLite extension library contained in the file |
| 103909 | ** zFile. The entry point is zProc. zProc may be 0 in which case a |
| @@ -138650,11 +138686,10 @@ | |
| 138686 | ** tokens or prefix tokens that cannot use a prefix-index. */ |
| 138687 | int bHaveIncr = 0; |
| 138688 | int bIncrOk = (bOptOk |
| 138689 | && pCsr->bDesc==pTab->bDescIdx |
| 138690 | && p->nToken<=MAX_INCR_PHRASE_TOKENS && p->nToken>0 |
| 138691 | #ifdef SQLITE_TEST |
| 138692 | && pTab->bNoIncrDoclist==0 |
| 138693 | #endif |
| 138694 | ); |
| 138695 | for(i=0; bIncrOk==1 && i<p->nToken; i++){ |
| @@ -156922,11 +156957,14 @@ | |
| 156957 | */ |
| 156958 | |
| 156959 | /* #include <assert.h> */ |
| 156960 | /* #include <string.h> */ |
| 156961 | /* #include <stdio.h> */ |
| 156962 | |
| 156963 | #if !defined(_WIN32) |
| 156964 | /* # include <unistd.h> */ |
| 156965 | #endif |
| 156966 | |
| 156967 | /* #include "sqlite3.h" */ |
| 156968 | |
| 156969 | #if !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_RBU) |
| 156970 | /************** Include sqlite3rbu.h in the middle of sqlite3rbu.c ***********/ |
| @@ -156978,11 +157016,11 @@ | |
| 157016 | ** mobile device that is frequently rebooted. Even after the writer process |
| 157017 | ** has committed one or more sub-transactions, other database clients continue |
| 157018 | ** to read from the original database snapshot. In other words, partially |
| 157019 | ** applied transactions are not visible to other clients. |
| 157020 | ** |
| 157021 | ** "RBU" stands for "Resumable Bulk Update". As in a large database update |
| 157022 | ** transmitted via a wireless network to a mobile device. A transaction |
| 157023 | ** applied using this extension is hence refered to as an "RBU update". |
| 157024 | ** |
| 157025 | ** |
| 157026 | ** LIMITATIONS |
| @@ -157829,11 +157867,11 @@ | |
| 157867 | int rc; |
| 157868 | memset(pIter, 0, sizeof(RbuObjIter)); |
| 157869 | |
| 157870 | rc = prepareAndCollectError(p->dbRbu, &pIter->pTblIter, &p->zErrmsg, |
| 157871 | "SELECT substr(name, 6) FROM sqlite_master " |
| 157872 | "WHERE type IN ('table', 'view') AND name LIKE 'data_%'" |
| 157873 | ); |
| 157874 | |
| 157875 | if( rc==SQLITE_OK ){ |
| 157876 | rc = prepareAndCollectError(p->dbMain, &pIter->pIdxIter, &p->zErrmsg, |
| 157877 | "SELECT name, rootpage, sql IS NULL OR substr(8, 6)=='UNIQUE' " |
| @@ -157881,12 +157919,13 @@ | |
| 157919 | ** RBU handle. If an error has already occurred when this function is |
| 157920 | ** called, it is a no-op. |
| 157921 | */ |
| 157922 | static int rbuMPrintfExec(sqlite3rbu *p, sqlite3 *db, const char *zFmt, ...){ |
| 157923 | va_list ap; |
| 157924 | char *zSql; |
| 157925 | va_start(ap, zFmt); |
| 157926 | zSql = sqlite3_vmprintf(zFmt, ap); |
| 157927 | if( p->rc==SQLITE_OK ){ |
| 157928 | if( zSql==0 ){ |
| 157929 | p->rc = SQLITE_NOMEM; |
| 157930 | }else{ |
| 157931 | p->rc = sqlite3_exec(db, zSql, 0, 0, &p->zErrmsg); |
| @@ -159901,11 +159940,11 @@ | |
| 159940 | int rnd; |
| 159941 | char zRnd[64]; |
| 159942 | |
| 159943 | assert( p->rc==SQLITE_OK ); |
| 159944 | sqlite3_randomness(sizeof(int), (void*)&rnd); |
| 159945 | sqlite3_snprintf(sizeof(zRnd), zRnd, "rbu_vfs_%d", rnd); |
| 159946 | p->rc = sqlite3rbu_create_vfs(zRnd, 0); |
| 159947 | if( p->rc==SQLITE_OK ){ |
| 159948 | sqlite3_vfs *pVfs = sqlite3_vfs_find(zRnd); |
| 159949 | assert( pVfs ); |
| 159950 | p->zVfsName = pVfs->zName; |
| @@ -160786,11 +160825,11 @@ | |
| 160825 | /* |
| 160826 | ** Close the dynamic library handle pHandle. |
| 160827 | */ |
| 160828 | static void rbuVfsDlClose(sqlite3_vfs *pVfs, void *pHandle){ |
| 160829 | sqlite3_vfs *pRealVfs = ((rbu_vfs*)pVfs)->pRealVfs; |
| 160830 | pRealVfs->xDlClose(pRealVfs, pHandle); |
| 160831 | } |
| 160832 | #endif /* SQLITE_OMIT_LOAD_EXTENSION */ |
| 160833 | |
| 160834 | /* |
| 160835 | ** Populate the buffer pointed to by zBufOut with nByte bytes of |
| 160836 |
+5
-3
| --- src/sqlite3.h | ||
| +++ src/sqlite3.h | ||
| @@ -111,11 +111,11 @@ | ||
| 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-23 20:44:49 017c5019e1ce042025d4f327e50ec50af49f9fa4" | |
| 116 | +#define SQLITE_SOURCE_ID "2015-07-27 13:49:41 b8e92227a469de677a66da62e4361f099c0b79d0" | |
| 117 | 117 | |
| 118 | 118 | /* |
| 119 | 119 | ** CAPI3REF: Run-Time Library Version Numbers |
| 120 | 120 | ** KEYWORDS: sqlite3_version, sqlite3_sourceid |
| 121 | 121 | ** |
| @@ -3560,10 +3560,11 @@ | ||
| 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 | ** |
| @@ -4532,12 +4533,12 @@ | ||
| 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. |
| @@ -4649,10 +4650,11 @@ | ||
| 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 |
| --- src/sqlite3.h | |
| +++ src/sqlite3.h | |
| @@ -111,11 +111,11 @@ | |
| 111 | ** [sqlite3_libversion_number()], [sqlite3_sourceid()], |
| 112 | ** [sqlite_version()] and [sqlite_source_id()]. |
| 113 | */ |
| 114 | #define SQLITE_VERSION "3.8.11" |
| 115 | #define SQLITE_VERSION_NUMBER 3008011 |
| 116 | #define SQLITE_SOURCE_ID "2015-07-23 20:44:49 017c5019e1ce042025d4f327e50ec50af49f9fa4" |
| 117 | |
| 118 | /* |
| 119 | ** CAPI3REF: Run-Time Library Version Numbers |
| 120 | ** KEYWORDS: sqlite3_version, sqlite3_sourceid |
| 121 | ** |
| @@ -3560,10 +3560,11 @@ | |
| 3560 | SQLITE_API int SQLITE_STDCALL sqlite3_bind_text16(sqlite3_stmt*, int, const void*, int, void(*)(void*)); |
| 3561 | SQLITE_API int SQLITE_STDCALL sqlite3_bind_text64(sqlite3_stmt*, int, const char*, sqlite3_uint64, |
| 3562 | void(*)(void*), unsigned char encoding); |
| 3563 | SQLITE_API int SQLITE_STDCALL sqlite3_bind_value(sqlite3_stmt*, int, const sqlite3_value*); |
| 3564 | SQLITE_API int SQLITE_STDCALL sqlite3_bind_zeroblob(sqlite3_stmt*, int, int n); |
| 3565 | |
| 3566 | /* |
| 3567 | ** CAPI3REF: Number Of SQL Parameters |
| 3568 | ** METHOD: sqlite3_stmt |
| 3569 | ** |
| @@ -4532,12 +4533,12 @@ | |
| 4532 | ** ^The sqlite3_result_blob() interface sets the result from |
| 4533 | ** an application-defined function to be the BLOB whose content is pointed |
| 4534 | ** to by the second parameter and which is N bytes long where N is the |
| 4535 | ** third parameter. |
| 4536 | ** |
| 4537 | ** ^The sqlite3_result_zeroblob() interfaces set the result of |
| 4538 | ** the application-defined function to be a BLOB containing all zero |
| 4539 | ** bytes and N bytes in size, where N is the value of the 2nd parameter. |
| 4540 | ** |
| 4541 | ** ^The sqlite3_result_double() interface sets the result from |
| 4542 | ** an application-defined function to be a floating point value specified |
| 4543 | ** by its 2nd argument. |
| @@ -4649,10 +4650,11 @@ | |
| 4649 | SQLITE_API void SQLITE_STDCALL sqlite3_result_text16(sqlite3_context*, const void*, int, void(*)(void*)); |
| 4650 | SQLITE_API void SQLITE_STDCALL sqlite3_result_text16le(sqlite3_context*, const void*, int,void(*)(void*)); |
| 4651 | SQLITE_API void SQLITE_STDCALL sqlite3_result_text16be(sqlite3_context*, const void*, int,void(*)(void*)); |
| 4652 | SQLITE_API void SQLITE_STDCALL sqlite3_result_value(sqlite3_context*, sqlite3_value*); |
| 4653 | SQLITE_API void SQLITE_STDCALL sqlite3_result_zeroblob(sqlite3_context*, int n); |
| 4654 | |
| 4655 | /* |
| 4656 | ** CAPI3REF: Define New Collating Sequences |
| 4657 | ** METHOD: sqlite3 |
| 4658 | ** |
| 4659 |
| --- src/sqlite3.h | |
| +++ src/sqlite3.h | |
| @@ -111,11 +111,11 @@ | |
| 111 | ** [sqlite3_libversion_number()], [sqlite3_sourceid()], |
| 112 | ** [sqlite_version()] and [sqlite_source_id()]. |
| 113 | */ |
| 114 | #define SQLITE_VERSION "3.8.11" |
| 115 | #define SQLITE_VERSION_NUMBER 3008011 |
| 116 | #define SQLITE_SOURCE_ID "2015-07-27 13:49:41 b8e92227a469de677a66da62e4361f099c0b79d0" |
| 117 | |
| 118 | /* |
| 119 | ** CAPI3REF: Run-Time Library Version Numbers |
| 120 | ** KEYWORDS: sqlite3_version, sqlite3_sourceid |
| 121 | ** |
| @@ -3560,10 +3560,11 @@ | |
| 3560 | SQLITE_API int SQLITE_STDCALL sqlite3_bind_text16(sqlite3_stmt*, int, const void*, int, void(*)(void*)); |
| 3561 | SQLITE_API int SQLITE_STDCALL sqlite3_bind_text64(sqlite3_stmt*, int, const char*, sqlite3_uint64, |
| 3562 | void(*)(void*), unsigned char encoding); |
| 3563 | SQLITE_API int SQLITE_STDCALL sqlite3_bind_value(sqlite3_stmt*, int, const sqlite3_value*); |
| 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); |
| 3566 | |
| 3567 | /* |
| 3568 | ** CAPI3REF: Number Of SQL Parameters |
| 3569 | ** METHOD: sqlite3_stmt |
| 3570 | ** |
| @@ -4532,12 +4533,12 @@ | |
| 4533 | ** ^The sqlite3_result_blob() interface sets the result from |
| 4534 | ** an application-defined function to be the BLOB whose content is pointed |
| 4535 | ** to by the second parameter and which is N bytes long where N is the |
| 4536 | ** third parameter. |
| 4537 | ** |
| 4538 | ** ^The sqlite3_result_zeroblob() and zeroblob64() interfaces set the result |
| 4539 | ** of the application-defined function to be a BLOB containing all zero |
| 4540 | ** bytes and N bytes in size, where N is the value of the 2nd parameter. |
| 4541 | ** |
| 4542 | ** ^The sqlite3_result_double() interface sets the result from |
| 4543 | ** an application-defined function to be a floating point value specified |
| 4544 | ** by its 2nd argument. |
| @@ -4649,10 +4650,11 @@ | |
| 4650 | SQLITE_API void SQLITE_STDCALL sqlite3_result_text16(sqlite3_context*, const void*, int, void(*)(void*)); |
| 4651 | SQLITE_API void SQLITE_STDCALL sqlite3_result_text16le(sqlite3_context*, const void*, int,void(*)(void*)); |
| 4652 | SQLITE_API void SQLITE_STDCALL sqlite3_result_text16be(sqlite3_context*, const void*, int,void(*)(void*)); |
| 4653 | SQLITE_API void SQLITE_STDCALL sqlite3_result_value(sqlite3_context*, sqlite3_value*); |
| 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); |
| 4656 | |
| 4657 | /* |
| 4658 | ** CAPI3REF: Define New Collating Sequences |
| 4659 | ** METHOD: sqlite3 |
| 4660 | ** |
| 4661 |