Fossil SCM
Update the built-in SQLite to the second 3.12.0 beta.
Commit
314f194227c63e6c95801d917f30a42f607429b7
Parent
c693d82da27742e…
2 files changed
+42
-27
+1
-1
+42
-27
| --- src/sqlite3.c | ||
| +++ src/sqlite3.c | ||
| @@ -336,11 +336,11 @@ | ||
| 336 | 336 | ** [sqlite3_libversion_number()], [sqlite3_sourceid()], |
| 337 | 337 | ** [sqlite_version()] and [sqlite_source_id()]. |
| 338 | 338 | */ |
| 339 | 339 | #define SQLITE_VERSION "3.12.0" |
| 340 | 340 | #define SQLITE_VERSION_NUMBER 3012000 |
| 341 | -#define SQLITE_SOURCE_ID "2016-03-21 16:06:42 4dc30cce7fdb7dba9a9aad96bb8b499b965610b2" | |
| 341 | +#define SQLITE_SOURCE_ID "2016-03-22 15:26:03 142cd359d37f1d8d53de32e329523d9a93c7d6e5" | |
| 342 | 342 | |
| 343 | 343 | /* |
| 344 | 344 | ** CAPI3REF: Run-Time Library Version Numbers |
| 345 | 345 | ** KEYWORDS: sqlite3_version, sqlite3_sourceid |
| 346 | 346 | ** |
| @@ -9232,25 +9232,10 @@ | ||
| 9232 | 9232 | #else /* Generates a warning - but it always works */ |
| 9233 | 9233 | # define SQLITE_INT_TO_PTR(X) ((void*)(X)) |
| 9234 | 9234 | # define SQLITE_PTR_TO_INT(X) ((int)(X)) |
| 9235 | 9235 | #endif |
| 9236 | 9236 | |
| 9237 | -/* | |
| 9238 | -** The SQLITE_WITHIN(P,S,E) macro checks to see if pointer P points to | |
| 9239 | -** something between S (inclusive) and E (exclusive). | |
| 9240 | -** | |
| 9241 | -** In other words, S is a buffer and E is a pointer to the first byte after | |
| 9242 | -** the end of buffer S. This macro returns true if P points to something | |
| 9243 | -** contained within the buffer S. | |
| 9244 | -*/ | |
| 9245 | -#if defined(HAVE_STDINT_H) | |
| 9246 | -# define SQLITE_WITHIN(P,S,E) \ | |
| 9247 | - ((uintptr_t)(P)>=(uintptr_t)(S) && (uintptr_t)(P)<(uintptr_t)(E)) | |
| 9248 | -#else | |
| 9249 | -# define SQLITE_WITHIN(P,S,E) ((P)>=(S) && (P)<(E)) | |
| 9250 | -#endif | |
| 9251 | - | |
| 9252 | 9237 | /* |
| 9253 | 9238 | ** A macro to hint to the compiler that a function should not be |
| 9254 | 9239 | ** inlined. |
| 9255 | 9240 | */ |
| 9256 | 9241 | #if defined(__GNUC__) |
| @@ -9906,12 +9891,16 @@ | ||
| 9906 | 9891 | #endif |
| 9907 | 9892 | |
| 9908 | 9893 | /* |
| 9909 | 9894 | ** Macros to compute minimum and maximum of two numbers. |
| 9910 | 9895 | */ |
| 9911 | -#define MIN(A,B) ((A)<(B)?(A):(B)) | |
| 9912 | -#define MAX(A,B) ((A)>(B)?(A):(B)) | |
| 9896 | +#ifndef MIN | |
| 9897 | +# define MIN(A,B) ((A)<(B)?(A):(B)) | |
| 9898 | +#endif | |
| 9899 | +#ifndef MAX | |
| 9900 | +# define MAX(A,B) ((A)>(B)?(A):(B)) | |
| 9901 | +#endif | |
| 9913 | 9902 | |
| 9914 | 9903 | /* |
| 9915 | 9904 | ** Swap two objects of type TYPE. |
| 9916 | 9905 | */ |
| 9917 | 9906 | #define SWAP(TYPE,A,B) {TYPE t=A; A=B; B=t;} |
| @@ -10035,10 +10024,31 @@ | ||
| 10035 | 10024 | # define SQLITE_PTRSIZE 4 |
| 10036 | 10025 | # else |
| 10037 | 10026 | # define SQLITE_PTRSIZE 8 |
| 10038 | 10027 | # endif |
| 10039 | 10028 | #endif |
| 10029 | + | |
| 10030 | +/* The uptr type is an unsigned integer large enough to hold a pointer | |
| 10031 | +*/ | |
| 10032 | +#if defined(HAVE_STDINT_H) | |
| 10033 | + typedef uintptr_t uptr; | |
| 10034 | +#elif SQLITE_PTRSIZE==4 | |
| 10035 | + typedef u32 uptr; | |
| 10036 | +#else | |
| 10037 | + typedef u64 uptr; | |
| 10038 | +#endif | |
| 10039 | + | |
| 10040 | +/* | |
| 10041 | +** The SQLITE_WITHIN(P,S,E) macro checks to see if pointer P points to | |
| 10042 | +** something between S (inclusive) and E (exclusive). | |
| 10043 | +** | |
| 10044 | +** In other words, S is a buffer and E is a pointer to the first byte after | |
| 10045 | +** the end of buffer S. This macro returns true if P points to something | |
| 10046 | +** contained within the buffer S. | |
| 10047 | +*/ | |
| 10048 | +#define SQLITE_WITHIN(P,S,E) (((uptr)(P)>=(uptr)(S))&&((uptr)(P)<(uptr)(E))) | |
| 10049 | + | |
| 10040 | 10050 | |
| 10041 | 10051 | /* |
| 10042 | 10052 | ** Macros to determine whether the machine is big or little endian, |
| 10043 | 10053 | ** and whether or not that determination is run-time or compile-time. |
| 10044 | 10054 | ** |
| @@ -40698,11 +40708,11 @@ | ||
| 40698 | 40708 | #else |
| 40699 | 40709 | EntropyGatherer e; |
| 40700 | 40710 | UNUSED_PARAMETER(pVfs); |
| 40701 | 40711 | memset(zBuf, 0, nBuf); |
| 40702 | 40712 | #if defined(_MSC_VER) && _MSC_VER>=1400 |
| 40703 | - rand_s((int*)zBuf); /* rand_s() is not available with MinGW */ | |
| 40713 | + rand_s((unsigned int*)zBuf); /* rand_s() is not available with MinGW */ | |
| 40704 | 40714 | #endif /* defined(_MSC_VER) && _MSC_VER>=1400 */ |
| 40705 | 40715 | e.a = (unsigned char*)zBuf; |
| 40706 | 40716 | e.na = nBuf; |
| 40707 | 40717 | e.nXor = 0; |
| 40708 | 40718 | e.i = 0; |
| @@ -58131,16 +58141,16 @@ | ||
| 58131 | 58141 | int i; |
| 58132 | 58142 | Btree *pSib; |
| 58133 | 58143 | for(i=0; i<db->nDb; i++){ |
| 58134 | 58144 | if( (pSib = db->aDb[i].pBt)!=0 && pSib->sharable ){ |
| 58135 | 58145 | while( pSib->pPrev ){ pSib = pSib->pPrev; } |
| 58136 | - if( p->pBt<pSib->pBt ){ | |
| 58146 | + if( (uptr)p->pBt<(uptr)pSib->pBt ){ | |
| 58137 | 58147 | p->pNext = pSib; |
| 58138 | 58148 | p->pPrev = 0; |
| 58139 | 58149 | pSib->pPrev = p; |
| 58140 | 58150 | }else{ |
| 58141 | - while( pSib->pNext && pSib->pNext->pBt<p->pBt ){ | |
| 58151 | + while( pSib->pNext && (uptr)pSib->pNext->pBt<(uptr)p->pBt ){ | |
| 58142 | 58152 | pSib = pSib->pNext; |
| 58143 | 58153 | } |
| 58144 | 58154 | p->pNext = pSib->pNext; |
| 58145 | 58155 | p->pPrev = pSib; |
| 58146 | 58156 | if( p->pNext ){ |
| @@ -60243,12 +60253,17 @@ | ||
| 60243 | 60253 | #ifdef SQLITE_DIRECT_OVERFLOW_READ |
| 60244 | 60254 | bEnd = offset+amt==pCur->info.nPayload; |
| 60245 | 60255 | #endif |
| 60246 | 60256 | assert( offset+amt <= pCur->info.nPayload ); |
| 60247 | 60257 | |
| 60248 | - if( &aPayload[pCur->info.nLocal] > &pPage->aData[pBt->usableSize] ){ | |
| 60249 | - /* Trying to read or write past the end of the data is an error */ | |
| 60258 | + assert( aPayload > pPage->aData ); | |
| 60259 | + if( (uptr)(aPayload - pPage->aData) > (pBt->usableSize - pCur->info.nLocal) ){ | |
| 60260 | + /* Trying to read or write past the end of the data is an error. The | |
| 60261 | + ** conditional above is really: | |
| 60262 | + ** &aPayload[pCur->info.nLocal] > &pPage->aData[pBt->usableSize] | |
| 60263 | + ** but is recast into its current form to avoid integer overflow problems | |
| 60264 | + */ | |
| 60250 | 60265 | return SQLITE_CORRUPT_BKPT; |
| 60251 | 60266 | } |
| 60252 | 60267 | |
| 60253 | 60268 | /* Check if data must be read/written to/from the btree page itself. */ |
| 60254 | 60269 | if( offset<pCur->info.nLocal ){ |
| @@ -84947,11 +84962,11 @@ | ||
| 84947 | 84962 | /* |
| 84948 | 84963 | ** Return the number of bytes required to store a JournalFile that uses vfs |
| 84949 | 84964 | ** pVfs to create the underlying on-disk files. |
| 84950 | 84965 | */ |
| 84951 | 84966 | SQLITE_PRIVATE int sqlite3JournalSize(sqlite3_vfs *pVfs){ |
| 84952 | - return MAX(pVfs->szOsFile, sizeof(MemJournal)); | |
| 84967 | + return MAX(pVfs->szOsFile, (int)sizeof(MemJournal)); | |
| 84953 | 84968 | } |
| 84954 | 84969 | |
| 84955 | 84970 | /************** End of memjournal.c ******************************************/ |
| 84956 | 84971 | /************** Begin file walker.c ******************************************/ |
| 84957 | 84972 | /* |
| @@ -177340,11 +177355,11 @@ | ||
| 177340 | 177355 | if( p->rc==SQLITE_OK ){ |
| 177341 | 177356 | p->pStruct = fts5StructureReadUncached(p); |
| 177342 | 177357 | } |
| 177343 | 177358 | } |
| 177344 | 177359 | |
| 177345 | -#ifdef SQLITE_DEBUG | |
| 177360 | +#if 0 | |
| 177346 | 177361 | else{ |
| 177347 | 177362 | Fts5Structure *pTest = fts5StructureReadUncached(p); |
| 177348 | 177363 | if( pTest ){ |
| 177349 | 177364 | int i, j; |
| 177350 | 177365 | assert_nc( p->pStruct->nSegment==pTest->nSegment ); |
| @@ -180916,11 +180931,11 @@ | ||
| 180916 | 180931 | nByte += (pStruct->nLevel+1) * sizeof(Fts5StructureLevel); |
| 180917 | 180932 | pNew = (Fts5Structure*)sqlite3Fts5MallocZero(&p->rc, nByte); |
| 180918 | 180933 | |
| 180919 | 180934 | if( pNew ){ |
| 180920 | 180935 | Fts5StructureLevel *pLvl; |
| 180921 | - int nByte = nSeg * sizeof(Fts5StructureSegment); | |
| 180936 | + nByte = nSeg * sizeof(Fts5StructureSegment); | |
| 180922 | 180937 | pNew->nLevel = pStruct->nLevel+1; |
| 180923 | 180938 | pNew->nRef = 1; |
| 180924 | 180939 | pNew->nWriteCounter = pStruct->nWriteCounter; |
| 180925 | 180940 | pLvl = &pNew->aLevel[pStruct->nLevel]; |
| 180926 | 180941 | pLvl->aSeg = (Fts5StructureSegment*)sqlite3Fts5MallocZero(&p->rc, nByte); |
| @@ -185370,11 +185385,11 @@ | ||
| 185370 | 185385 | int nArg, /* Number of args */ |
| 185371 | 185386 | sqlite3_value **apUnused /* Function arguments */ |
| 185372 | 185387 | ){ |
| 185373 | 185388 | assert( nArg==0 ); |
| 185374 | 185389 | UNUSED_PARAM2(nArg, apUnused); |
| 185375 | - sqlite3_result_text(pCtx, "fts5: 2016-03-21 16:06:42 4dc30cce7fdb7dba9a9aad96bb8b499b965610b2", -1, SQLITE_TRANSIENT); | |
| 185390 | + sqlite3_result_text(pCtx, "fts5: 2016-03-22 15:01:54 e1ab2d376a72786098125a41c1ea8140fcbd15c6", -1, SQLITE_TRANSIENT); | |
| 185376 | 185391 | } |
| 185377 | 185392 | |
| 185378 | 185393 | static int fts5Init(sqlite3 *db){ |
| 185379 | 185394 | static const sqlite3_module fts5Mod = { |
| 185380 | 185395 | /* iVersion */ 2, |
| 185381 | 185396 |
| --- src/sqlite3.c | |
| +++ src/sqlite3.c | |
| @@ -336,11 +336,11 @@ | |
| 336 | ** [sqlite3_libversion_number()], [sqlite3_sourceid()], |
| 337 | ** [sqlite_version()] and [sqlite_source_id()]. |
| 338 | */ |
| 339 | #define SQLITE_VERSION "3.12.0" |
| 340 | #define SQLITE_VERSION_NUMBER 3012000 |
| 341 | #define SQLITE_SOURCE_ID "2016-03-21 16:06:42 4dc30cce7fdb7dba9a9aad96bb8b499b965610b2" |
| 342 | |
| 343 | /* |
| 344 | ** CAPI3REF: Run-Time Library Version Numbers |
| 345 | ** KEYWORDS: sqlite3_version, sqlite3_sourceid |
| 346 | ** |
| @@ -9232,25 +9232,10 @@ | |
| 9232 | #else /* Generates a warning - but it always works */ |
| 9233 | # define SQLITE_INT_TO_PTR(X) ((void*)(X)) |
| 9234 | # define SQLITE_PTR_TO_INT(X) ((int)(X)) |
| 9235 | #endif |
| 9236 | |
| 9237 | /* |
| 9238 | ** The SQLITE_WITHIN(P,S,E) macro checks to see if pointer P points to |
| 9239 | ** something between S (inclusive) and E (exclusive). |
| 9240 | ** |
| 9241 | ** In other words, S is a buffer and E is a pointer to the first byte after |
| 9242 | ** the end of buffer S. This macro returns true if P points to something |
| 9243 | ** contained within the buffer S. |
| 9244 | */ |
| 9245 | #if defined(HAVE_STDINT_H) |
| 9246 | # define SQLITE_WITHIN(P,S,E) \ |
| 9247 | ((uintptr_t)(P)>=(uintptr_t)(S) && (uintptr_t)(P)<(uintptr_t)(E)) |
| 9248 | #else |
| 9249 | # define SQLITE_WITHIN(P,S,E) ((P)>=(S) && (P)<(E)) |
| 9250 | #endif |
| 9251 | |
| 9252 | /* |
| 9253 | ** A macro to hint to the compiler that a function should not be |
| 9254 | ** inlined. |
| 9255 | */ |
| 9256 | #if defined(__GNUC__) |
| @@ -9906,12 +9891,16 @@ | |
| 9906 | #endif |
| 9907 | |
| 9908 | /* |
| 9909 | ** Macros to compute minimum and maximum of two numbers. |
| 9910 | */ |
| 9911 | #define MIN(A,B) ((A)<(B)?(A):(B)) |
| 9912 | #define MAX(A,B) ((A)>(B)?(A):(B)) |
| 9913 | |
| 9914 | /* |
| 9915 | ** Swap two objects of type TYPE. |
| 9916 | */ |
| 9917 | #define SWAP(TYPE,A,B) {TYPE t=A; A=B; B=t;} |
| @@ -10035,10 +10024,31 @@ | |
| 10035 | # define SQLITE_PTRSIZE 4 |
| 10036 | # else |
| 10037 | # define SQLITE_PTRSIZE 8 |
| 10038 | # endif |
| 10039 | #endif |
| 10040 | |
| 10041 | /* |
| 10042 | ** Macros to determine whether the machine is big or little endian, |
| 10043 | ** and whether or not that determination is run-time or compile-time. |
| 10044 | ** |
| @@ -40698,11 +40708,11 @@ | |
| 40698 | #else |
| 40699 | EntropyGatherer e; |
| 40700 | UNUSED_PARAMETER(pVfs); |
| 40701 | memset(zBuf, 0, nBuf); |
| 40702 | #if defined(_MSC_VER) && _MSC_VER>=1400 |
| 40703 | rand_s((int*)zBuf); /* rand_s() is not available with MinGW */ |
| 40704 | #endif /* defined(_MSC_VER) && _MSC_VER>=1400 */ |
| 40705 | e.a = (unsigned char*)zBuf; |
| 40706 | e.na = nBuf; |
| 40707 | e.nXor = 0; |
| 40708 | e.i = 0; |
| @@ -58131,16 +58141,16 @@ | |
| 58131 | int i; |
| 58132 | Btree *pSib; |
| 58133 | for(i=0; i<db->nDb; i++){ |
| 58134 | if( (pSib = db->aDb[i].pBt)!=0 && pSib->sharable ){ |
| 58135 | while( pSib->pPrev ){ pSib = pSib->pPrev; } |
| 58136 | if( p->pBt<pSib->pBt ){ |
| 58137 | p->pNext = pSib; |
| 58138 | p->pPrev = 0; |
| 58139 | pSib->pPrev = p; |
| 58140 | }else{ |
| 58141 | while( pSib->pNext && pSib->pNext->pBt<p->pBt ){ |
| 58142 | pSib = pSib->pNext; |
| 58143 | } |
| 58144 | p->pNext = pSib->pNext; |
| 58145 | p->pPrev = pSib; |
| 58146 | if( p->pNext ){ |
| @@ -60243,12 +60253,17 @@ | |
| 60243 | #ifdef SQLITE_DIRECT_OVERFLOW_READ |
| 60244 | bEnd = offset+amt==pCur->info.nPayload; |
| 60245 | #endif |
| 60246 | assert( offset+amt <= pCur->info.nPayload ); |
| 60247 | |
| 60248 | if( &aPayload[pCur->info.nLocal] > &pPage->aData[pBt->usableSize] ){ |
| 60249 | /* Trying to read or write past the end of the data is an error */ |
| 60250 | return SQLITE_CORRUPT_BKPT; |
| 60251 | } |
| 60252 | |
| 60253 | /* Check if data must be read/written to/from the btree page itself. */ |
| 60254 | if( offset<pCur->info.nLocal ){ |
| @@ -84947,11 +84962,11 @@ | |
| 84947 | /* |
| 84948 | ** Return the number of bytes required to store a JournalFile that uses vfs |
| 84949 | ** pVfs to create the underlying on-disk files. |
| 84950 | */ |
| 84951 | SQLITE_PRIVATE int sqlite3JournalSize(sqlite3_vfs *pVfs){ |
| 84952 | return MAX(pVfs->szOsFile, sizeof(MemJournal)); |
| 84953 | } |
| 84954 | |
| 84955 | /************** End of memjournal.c ******************************************/ |
| 84956 | /************** Begin file walker.c ******************************************/ |
| 84957 | /* |
| @@ -177340,11 +177355,11 @@ | |
| 177340 | if( p->rc==SQLITE_OK ){ |
| 177341 | p->pStruct = fts5StructureReadUncached(p); |
| 177342 | } |
| 177343 | } |
| 177344 | |
| 177345 | #ifdef SQLITE_DEBUG |
| 177346 | else{ |
| 177347 | Fts5Structure *pTest = fts5StructureReadUncached(p); |
| 177348 | if( pTest ){ |
| 177349 | int i, j; |
| 177350 | assert_nc( p->pStruct->nSegment==pTest->nSegment ); |
| @@ -180916,11 +180931,11 @@ | |
| 180916 | nByte += (pStruct->nLevel+1) * sizeof(Fts5StructureLevel); |
| 180917 | pNew = (Fts5Structure*)sqlite3Fts5MallocZero(&p->rc, nByte); |
| 180918 | |
| 180919 | if( pNew ){ |
| 180920 | Fts5StructureLevel *pLvl; |
| 180921 | int nByte = nSeg * sizeof(Fts5StructureSegment); |
| 180922 | pNew->nLevel = pStruct->nLevel+1; |
| 180923 | pNew->nRef = 1; |
| 180924 | pNew->nWriteCounter = pStruct->nWriteCounter; |
| 180925 | pLvl = &pNew->aLevel[pStruct->nLevel]; |
| 180926 | pLvl->aSeg = (Fts5StructureSegment*)sqlite3Fts5MallocZero(&p->rc, nByte); |
| @@ -185370,11 +185385,11 @@ | |
| 185370 | int nArg, /* Number of args */ |
| 185371 | sqlite3_value **apUnused /* Function arguments */ |
| 185372 | ){ |
| 185373 | assert( nArg==0 ); |
| 185374 | UNUSED_PARAM2(nArg, apUnused); |
| 185375 | sqlite3_result_text(pCtx, "fts5: 2016-03-21 16:06:42 4dc30cce7fdb7dba9a9aad96bb8b499b965610b2", -1, SQLITE_TRANSIENT); |
| 185376 | } |
| 185377 | |
| 185378 | static int fts5Init(sqlite3 *db){ |
| 185379 | static const sqlite3_module fts5Mod = { |
| 185380 | /* iVersion */ 2, |
| 185381 |
| --- src/sqlite3.c | |
| +++ src/sqlite3.c | |
| @@ -336,11 +336,11 @@ | |
| 336 | ** [sqlite3_libversion_number()], [sqlite3_sourceid()], |
| 337 | ** [sqlite_version()] and [sqlite_source_id()]. |
| 338 | */ |
| 339 | #define SQLITE_VERSION "3.12.0" |
| 340 | #define SQLITE_VERSION_NUMBER 3012000 |
| 341 | #define SQLITE_SOURCE_ID "2016-03-22 15:26:03 142cd359d37f1d8d53de32e329523d9a93c7d6e5" |
| 342 | |
| 343 | /* |
| 344 | ** CAPI3REF: Run-Time Library Version Numbers |
| 345 | ** KEYWORDS: sqlite3_version, sqlite3_sourceid |
| 346 | ** |
| @@ -9232,25 +9232,10 @@ | |
| 9232 | #else /* Generates a warning - but it always works */ |
| 9233 | # define SQLITE_INT_TO_PTR(X) ((void*)(X)) |
| 9234 | # define SQLITE_PTR_TO_INT(X) ((int)(X)) |
| 9235 | #endif |
| 9236 | |
| 9237 | /* |
| 9238 | ** A macro to hint to the compiler that a function should not be |
| 9239 | ** inlined. |
| 9240 | */ |
| 9241 | #if defined(__GNUC__) |
| @@ -9906,12 +9891,16 @@ | |
| 9891 | #endif |
| 9892 | |
| 9893 | /* |
| 9894 | ** Macros to compute minimum and maximum of two numbers. |
| 9895 | */ |
| 9896 | #ifndef MIN |
| 9897 | # define MIN(A,B) ((A)<(B)?(A):(B)) |
| 9898 | #endif |
| 9899 | #ifndef MAX |
| 9900 | # define MAX(A,B) ((A)>(B)?(A):(B)) |
| 9901 | #endif |
| 9902 | |
| 9903 | /* |
| 9904 | ** Swap two objects of type TYPE. |
| 9905 | */ |
| 9906 | #define SWAP(TYPE,A,B) {TYPE t=A; A=B; B=t;} |
| @@ -10035,10 +10024,31 @@ | |
| 10024 | # define SQLITE_PTRSIZE 4 |
| 10025 | # else |
| 10026 | # define SQLITE_PTRSIZE 8 |
| 10027 | # endif |
| 10028 | #endif |
| 10029 | |
| 10030 | /* The uptr type is an unsigned integer large enough to hold a pointer |
| 10031 | */ |
| 10032 | #if defined(HAVE_STDINT_H) |
| 10033 | typedef uintptr_t uptr; |
| 10034 | #elif SQLITE_PTRSIZE==4 |
| 10035 | typedef u32 uptr; |
| 10036 | #else |
| 10037 | typedef u64 uptr; |
| 10038 | #endif |
| 10039 | |
| 10040 | /* |
| 10041 | ** The SQLITE_WITHIN(P,S,E) macro checks to see if pointer P points to |
| 10042 | ** something between S (inclusive) and E (exclusive). |
| 10043 | ** |
| 10044 | ** In other words, S is a buffer and E is a pointer to the first byte after |
| 10045 | ** the end of buffer S. This macro returns true if P points to something |
| 10046 | ** contained within the buffer S. |
| 10047 | */ |
| 10048 | #define SQLITE_WITHIN(P,S,E) (((uptr)(P)>=(uptr)(S))&&((uptr)(P)<(uptr)(E))) |
| 10049 | |
| 10050 | |
| 10051 | /* |
| 10052 | ** Macros to determine whether the machine is big or little endian, |
| 10053 | ** and whether or not that determination is run-time or compile-time. |
| 10054 | ** |
| @@ -40698,11 +40708,11 @@ | |
| 40708 | #else |
| 40709 | EntropyGatherer e; |
| 40710 | UNUSED_PARAMETER(pVfs); |
| 40711 | memset(zBuf, 0, nBuf); |
| 40712 | #if defined(_MSC_VER) && _MSC_VER>=1400 |
| 40713 | rand_s((unsigned int*)zBuf); /* rand_s() is not available with MinGW */ |
| 40714 | #endif /* defined(_MSC_VER) && _MSC_VER>=1400 */ |
| 40715 | e.a = (unsigned char*)zBuf; |
| 40716 | e.na = nBuf; |
| 40717 | e.nXor = 0; |
| 40718 | e.i = 0; |
| @@ -58131,16 +58141,16 @@ | |
| 58141 | int i; |
| 58142 | Btree *pSib; |
| 58143 | for(i=0; i<db->nDb; i++){ |
| 58144 | if( (pSib = db->aDb[i].pBt)!=0 && pSib->sharable ){ |
| 58145 | while( pSib->pPrev ){ pSib = pSib->pPrev; } |
| 58146 | if( (uptr)p->pBt<(uptr)pSib->pBt ){ |
| 58147 | p->pNext = pSib; |
| 58148 | p->pPrev = 0; |
| 58149 | pSib->pPrev = p; |
| 58150 | }else{ |
| 58151 | while( pSib->pNext && (uptr)pSib->pNext->pBt<(uptr)p->pBt ){ |
| 58152 | pSib = pSib->pNext; |
| 58153 | } |
| 58154 | p->pNext = pSib->pNext; |
| 58155 | p->pPrev = pSib; |
| 58156 | if( p->pNext ){ |
| @@ -60243,12 +60253,17 @@ | |
| 60253 | #ifdef SQLITE_DIRECT_OVERFLOW_READ |
| 60254 | bEnd = offset+amt==pCur->info.nPayload; |
| 60255 | #endif |
| 60256 | assert( offset+amt <= pCur->info.nPayload ); |
| 60257 | |
| 60258 | assert( aPayload > pPage->aData ); |
| 60259 | if( (uptr)(aPayload - pPage->aData) > (pBt->usableSize - pCur->info.nLocal) ){ |
| 60260 | /* Trying to read or write past the end of the data is an error. The |
| 60261 | ** conditional above is really: |
| 60262 | ** &aPayload[pCur->info.nLocal] > &pPage->aData[pBt->usableSize] |
| 60263 | ** but is recast into its current form to avoid integer overflow problems |
| 60264 | */ |
| 60265 | return SQLITE_CORRUPT_BKPT; |
| 60266 | } |
| 60267 | |
| 60268 | /* Check if data must be read/written to/from the btree page itself. */ |
| 60269 | if( offset<pCur->info.nLocal ){ |
| @@ -84947,11 +84962,11 @@ | |
| 84962 | /* |
| 84963 | ** Return the number of bytes required to store a JournalFile that uses vfs |
| 84964 | ** pVfs to create the underlying on-disk files. |
| 84965 | */ |
| 84966 | SQLITE_PRIVATE int sqlite3JournalSize(sqlite3_vfs *pVfs){ |
| 84967 | return MAX(pVfs->szOsFile, (int)sizeof(MemJournal)); |
| 84968 | } |
| 84969 | |
| 84970 | /************** End of memjournal.c ******************************************/ |
| 84971 | /************** Begin file walker.c ******************************************/ |
| 84972 | /* |
| @@ -177340,11 +177355,11 @@ | |
| 177355 | if( p->rc==SQLITE_OK ){ |
| 177356 | p->pStruct = fts5StructureReadUncached(p); |
| 177357 | } |
| 177358 | } |
| 177359 | |
| 177360 | #if 0 |
| 177361 | else{ |
| 177362 | Fts5Structure *pTest = fts5StructureReadUncached(p); |
| 177363 | if( pTest ){ |
| 177364 | int i, j; |
| 177365 | assert_nc( p->pStruct->nSegment==pTest->nSegment ); |
| @@ -180916,11 +180931,11 @@ | |
| 180931 | nByte += (pStruct->nLevel+1) * sizeof(Fts5StructureLevel); |
| 180932 | pNew = (Fts5Structure*)sqlite3Fts5MallocZero(&p->rc, nByte); |
| 180933 | |
| 180934 | if( pNew ){ |
| 180935 | Fts5StructureLevel *pLvl; |
| 180936 | nByte = nSeg * sizeof(Fts5StructureSegment); |
| 180937 | pNew->nLevel = pStruct->nLevel+1; |
| 180938 | pNew->nRef = 1; |
| 180939 | pNew->nWriteCounter = pStruct->nWriteCounter; |
| 180940 | pLvl = &pNew->aLevel[pStruct->nLevel]; |
| 180941 | pLvl->aSeg = (Fts5StructureSegment*)sqlite3Fts5MallocZero(&p->rc, nByte); |
| @@ -185370,11 +185385,11 @@ | |
| 185385 | int nArg, /* Number of args */ |
| 185386 | sqlite3_value **apUnused /* Function arguments */ |
| 185387 | ){ |
| 185388 | assert( nArg==0 ); |
| 185389 | UNUSED_PARAM2(nArg, apUnused); |
| 185390 | sqlite3_result_text(pCtx, "fts5: 2016-03-22 15:01:54 e1ab2d376a72786098125a41c1ea8140fcbd15c6", -1, SQLITE_TRANSIENT); |
| 185391 | } |
| 185392 | |
| 185393 | static int fts5Init(sqlite3 *db){ |
| 185394 | static const sqlite3_module fts5Mod = { |
| 185395 | /* iVersion */ 2, |
| 185396 |
+1
-1
| --- 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.12.0" |
| 115 | 115 | #define SQLITE_VERSION_NUMBER 3012000 |
| 116 | -#define SQLITE_SOURCE_ID "2016-03-21 16:06:42 4dc30cce7fdb7dba9a9aad96bb8b499b965610b2" | |
| 116 | +#define SQLITE_SOURCE_ID "2016-03-22 15:26:03 142cd359d37f1d8d53de32e329523d9a93c7d6e5" | |
| 117 | 117 | |
| 118 | 118 | /* |
| 119 | 119 | ** CAPI3REF: Run-Time Library Version Numbers |
| 120 | 120 | ** KEYWORDS: sqlite3_version, sqlite3_sourceid |
| 121 | 121 | ** |
| 122 | 122 |
| --- 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.12.0" |
| 115 | #define SQLITE_VERSION_NUMBER 3012000 |
| 116 | #define SQLITE_SOURCE_ID "2016-03-21 16:06:42 4dc30cce7fdb7dba9a9aad96bb8b499b965610b2" |
| 117 | |
| 118 | /* |
| 119 | ** CAPI3REF: Run-Time Library Version Numbers |
| 120 | ** KEYWORDS: sqlite3_version, sqlite3_sourceid |
| 121 | ** |
| 122 |
| --- 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.12.0" |
| 115 | #define SQLITE_VERSION_NUMBER 3012000 |
| 116 | #define SQLITE_SOURCE_ID "2016-03-22 15:26:03 142cd359d37f1d8d53de32e329523d9a93c7d6e5" |
| 117 | |
| 118 | /* |
| 119 | ** CAPI3REF: Run-Time Library Version Numbers |
| 120 | ** KEYWORDS: sqlite3_version, sqlite3_sourceid |
| 121 | ** |
| 122 |