Fossil SCM
Update the built-in SQLite to 3.8.7 beta 4.
Commit
c9a20b617480dce909133ecaad3ef6185816192d
Parent
c5588966c099011…
2 files changed
+20
-8
+1
-1
+20
-8
| --- src/sqlite3.c | ||
| +++ src/sqlite3.c | ||
| @@ -231,11 +231,11 @@ | ||
| 231 | 231 | ** [sqlite3_libversion_number()], [sqlite3_sourceid()], |
| 232 | 232 | ** [sqlite_version()] and [sqlite_source_id()]. |
| 233 | 233 | */ |
| 234 | 234 | #define SQLITE_VERSION "3.8.7" |
| 235 | 235 | #define SQLITE_VERSION_NUMBER 3008007 |
| 236 | -#define SQLITE_SOURCE_ID "2014-10-14 20:25:43 eab82330631187dcc3e5d2dddd23dbda5752904b" | |
| 236 | +#define SQLITE_SOURCE_ID "2014-10-15 15:28:27 3c1e70f4d55bc009ed9ed4cf6d756d7061985851" | |
| 237 | 237 | |
| 238 | 238 | /* |
| 239 | 239 | ** CAPI3REF: Run-Time Library Version Numbers |
| 240 | 240 | ** KEYWORDS: sqlite3_version, sqlite3_sourceid |
| 241 | 241 | ** |
| @@ -51651,11 +51651,11 @@ | ||
| 51651 | 51651 | int nRef; /* Number of references to this structure */ |
| 51652 | 51652 | BtShared *pNext; /* Next on a list of sharable BtShared structs */ |
| 51653 | 51653 | BtLock *pLock; /* List of locks held on this shared-btree struct */ |
| 51654 | 51654 | Btree *pWriter; /* Btree with currently open write transaction */ |
| 51655 | 51655 | #endif |
| 51656 | - u8 *pTmpSpace; /* BtShared.pageSize bytes of space for tmp use */ | |
| 51656 | + u8 *pTmpSpace; /* Temp space sufficient to hold a single cell */ | |
| 51657 | 51657 | }; |
| 51658 | 51658 | |
| 51659 | 51659 | /* |
| 51660 | 51660 | ** Allowed values for BtShared.btsFlags |
| 51661 | 51661 | */ |
| @@ -54281,11 +54281,12 @@ | ||
| 54281 | 54281 | #endif |
| 54282 | 54282 | } |
| 54283 | 54283 | |
| 54284 | 54284 | /* |
| 54285 | 54285 | ** Make sure pBt->pTmpSpace points to an allocation of |
| 54286 | -** MX_CELL_SIZE(pBt) bytes. | |
| 54286 | +** MX_CELL_SIZE(pBt) bytes with a 4-byte prefix for a left-child | |
| 54287 | +** pointer. | |
| 54287 | 54288 | */ |
| 54288 | 54289 | static void allocateTempSpace(BtShared *pBt){ |
| 54289 | 54290 | if( !pBt->pTmpSpace ){ |
| 54290 | 54291 | pBt->pTmpSpace = sqlite3PageMalloc( pBt->pageSize ); |
| 54291 | 54292 | |
| @@ -54296,21 +54297,32 @@ | ||
| 54296 | 54297 | ** can mean that fillInCell() only initializes the first 2 or 3 |
| 54297 | 54298 | ** bytes of pTmpSpace, but that the first 4 bytes are copied from |
| 54298 | 54299 | ** it into a database page. This is not actually a problem, but it |
| 54299 | 54300 | ** does cause a valgrind error when the 1 or 2 bytes of unitialized |
| 54300 | 54301 | ** data is passed to system call write(). So to avoid this error, |
| 54301 | - ** zero the first 4 bytes of temp space here. */ | |
| 54302 | - if( pBt->pTmpSpace ) memset(pBt->pTmpSpace, 0, 4); | |
| 54302 | + ** zero the first 4 bytes of temp space here. | |
| 54303 | + ** | |
| 54304 | + ** Also: Provide four bytes of initialized space before the | |
| 54305 | + ** beginning of pTmpSpace as an area available to prepend the | |
| 54306 | + ** left-child pointer to the beginning of a cell. | |
| 54307 | + */ | |
| 54308 | + if( pBt->pTmpSpace ){ | |
| 54309 | + memset(pBt->pTmpSpace, 0, 8); | |
| 54310 | + pBt->pTmpSpace += 4; | |
| 54311 | + } | |
| 54303 | 54312 | } |
| 54304 | 54313 | } |
| 54305 | 54314 | |
| 54306 | 54315 | /* |
| 54307 | 54316 | ** Free the pBt->pTmpSpace allocation |
| 54308 | 54317 | */ |
| 54309 | 54318 | static void freeTempSpace(BtShared *pBt){ |
| 54310 | - sqlite3PageFree( pBt->pTmpSpace); | |
| 54311 | - pBt->pTmpSpace = 0; | |
| 54319 | + if( pBt->pTmpSpace ){ | |
| 54320 | + pBt->pTmpSpace -= 4; | |
| 54321 | + sqlite3PageFree(pBt->pTmpSpace); | |
| 54322 | + pBt->pTmpSpace = 0; | |
| 54323 | + } | |
| 54312 | 54324 | } |
| 54313 | 54325 | |
| 54314 | 54326 | /* |
| 54315 | 54327 | ** Close an open database and invalidate all cursors. |
| 54316 | 54328 | */ |
| @@ -61738,11 +61750,11 @@ | ||
| 61738 | 61750 | }else{ |
| 61739 | 61751 | pMem->szMalloc = sqlite3DbMallocSize(pMem->db, pMem->zMalloc); |
| 61740 | 61752 | } |
| 61741 | 61753 | } |
| 61742 | 61754 | |
| 61743 | - if( pMem->z && bPreserve && pMem->z!=pMem->zMalloc ){ | |
| 61755 | + if( bPreserve && pMem->z && pMem->z!=pMem->zMalloc ){ | |
| 61744 | 61756 | memcpy(pMem->zMalloc, pMem->z, pMem->n); |
| 61745 | 61757 | } |
| 61746 | 61758 | if( (pMem->flags&MEM_Dyn)!=0 ){ |
| 61747 | 61759 | assert( pMem->xDel!=0 && pMem->xDel!=SQLITE_DYNAMIC ); |
| 61748 | 61760 | pMem->xDel((void *)(pMem->z)); |
| 61749 | 61761 |
| --- src/sqlite3.c | |
| +++ src/sqlite3.c | |
| @@ -231,11 +231,11 @@ | |
| 231 | ** [sqlite3_libversion_number()], [sqlite3_sourceid()], |
| 232 | ** [sqlite_version()] and [sqlite_source_id()]. |
| 233 | */ |
| 234 | #define SQLITE_VERSION "3.8.7" |
| 235 | #define SQLITE_VERSION_NUMBER 3008007 |
| 236 | #define SQLITE_SOURCE_ID "2014-10-14 20:25:43 eab82330631187dcc3e5d2dddd23dbda5752904b" |
| 237 | |
| 238 | /* |
| 239 | ** CAPI3REF: Run-Time Library Version Numbers |
| 240 | ** KEYWORDS: sqlite3_version, sqlite3_sourceid |
| 241 | ** |
| @@ -51651,11 +51651,11 @@ | |
| 51651 | int nRef; /* Number of references to this structure */ |
| 51652 | BtShared *pNext; /* Next on a list of sharable BtShared structs */ |
| 51653 | BtLock *pLock; /* List of locks held on this shared-btree struct */ |
| 51654 | Btree *pWriter; /* Btree with currently open write transaction */ |
| 51655 | #endif |
| 51656 | u8 *pTmpSpace; /* BtShared.pageSize bytes of space for tmp use */ |
| 51657 | }; |
| 51658 | |
| 51659 | /* |
| 51660 | ** Allowed values for BtShared.btsFlags |
| 51661 | */ |
| @@ -54281,11 +54281,12 @@ | |
| 54281 | #endif |
| 54282 | } |
| 54283 | |
| 54284 | /* |
| 54285 | ** Make sure pBt->pTmpSpace points to an allocation of |
| 54286 | ** MX_CELL_SIZE(pBt) bytes. |
| 54287 | */ |
| 54288 | static void allocateTempSpace(BtShared *pBt){ |
| 54289 | if( !pBt->pTmpSpace ){ |
| 54290 | pBt->pTmpSpace = sqlite3PageMalloc( pBt->pageSize ); |
| 54291 | |
| @@ -54296,21 +54297,32 @@ | |
| 54296 | ** can mean that fillInCell() only initializes the first 2 or 3 |
| 54297 | ** bytes of pTmpSpace, but that the first 4 bytes are copied from |
| 54298 | ** it into a database page. This is not actually a problem, but it |
| 54299 | ** does cause a valgrind error when the 1 or 2 bytes of unitialized |
| 54300 | ** data is passed to system call write(). So to avoid this error, |
| 54301 | ** zero the first 4 bytes of temp space here. */ |
| 54302 | if( pBt->pTmpSpace ) memset(pBt->pTmpSpace, 0, 4); |
| 54303 | } |
| 54304 | } |
| 54305 | |
| 54306 | /* |
| 54307 | ** Free the pBt->pTmpSpace allocation |
| 54308 | */ |
| 54309 | static void freeTempSpace(BtShared *pBt){ |
| 54310 | sqlite3PageFree( pBt->pTmpSpace); |
| 54311 | pBt->pTmpSpace = 0; |
| 54312 | } |
| 54313 | |
| 54314 | /* |
| 54315 | ** Close an open database and invalidate all cursors. |
| 54316 | */ |
| @@ -61738,11 +61750,11 @@ | |
| 61738 | }else{ |
| 61739 | pMem->szMalloc = sqlite3DbMallocSize(pMem->db, pMem->zMalloc); |
| 61740 | } |
| 61741 | } |
| 61742 | |
| 61743 | if( pMem->z && bPreserve && pMem->z!=pMem->zMalloc ){ |
| 61744 | memcpy(pMem->zMalloc, pMem->z, pMem->n); |
| 61745 | } |
| 61746 | if( (pMem->flags&MEM_Dyn)!=0 ){ |
| 61747 | assert( pMem->xDel!=0 && pMem->xDel!=SQLITE_DYNAMIC ); |
| 61748 | pMem->xDel((void *)(pMem->z)); |
| 61749 |
| --- src/sqlite3.c | |
| +++ src/sqlite3.c | |
| @@ -231,11 +231,11 @@ | |
| 231 | ** [sqlite3_libversion_number()], [sqlite3_sourceid()], |
| 232 | ** [sqlite_version()] and [sqlite_source_id()]. |
| 233 | */ |
| 234 | #define SQLITE_VERSION "3.8.7" |
| 235 | #define SQLITE_VERSION_NUMBER 3008007 |
| 236 | #define SQLITE_SOURCE_ID "2014-10-15 15:28:27 3c1e70f4d55bc009ed9ed4cf6d756d7061985851" |
| 237 | |
| 238 | /* |
| 239 | ** CAPI3REF: Run-Time Library Version Numbers |
| 240 | ** KEYWORDS: sqlite3_version, sqlite3_sourceid |
| 241 | ** |
| @@ -51651,11 +51651,11 @@ | |
| 51651 | int nRef; /* Number of references to this structure */ |
| 51652 | BtShared *pNext; /* Next on a list of sharable BtShared structs */ |
| 51653 | BtLock *pLock; /* List of locks held on this shared-btree struct */ |
| 51654 | Btree *pWriter; /* Btree with currently open write transaction */ |
| 51655 | #endif |
| 51656 | u8 *pTmpSpace; /* Temp space sufficient to hold a single cell */ |
| 51657 | }; |
| 51658 | |
| 51659 | /* |
| 51660 | ** Allowed values for BtShared.btsFlags |
| 51661 | */ |
| @@ -54281,11 +54281,12 @@ | |
| 54281 | #endif |
| 54282 | } |
| 54283 | |
| 54284 | /* |
| 54285 | ** Make sure pBt->pTmpSpace points to an allocation of |
| 54286 | ** MX_CELL_SIZE(pBt) bytes with a 4-byte prefix for a left-child |
| 54287 | ** pointer. |
| 54288 | */ |
| 54289 | static void allocateTempSpace(BtShared *pBt){ |
| 54290 | if( !pBt->pTmpSpace ){ |
| 54291 | pBt->pTmpSpace = sqlite3PageMalloc( pBt->pageSize ); |
| 54292 | |
| @@ -54296,21 +54297,32 @@ | |
| 54297 | ** can mean that fillInCell() only initializes the first 2 or 3 |
| 54298 | ** bytes of pTmpSpace, but that the first 4 bytes are copied from |
| 54299 | ** it into a database page. This is not actually a problem, but it |
| 54300 | ** does cause a valgrind error when the 1 or 2 bytes of unitialized |
| 54301 | ** data is passed to system call write(). So to avoid this error, |
| 54302 | ** zero the first 4 bytes of temp space here. |
| 54303 | ** |
| 54304 | ** Also: Provide four bytes of initialized space before the |
| 54305 | ** beginning of pTmpSpace as an area available to prepend the |
| 54306 | ** left-child pointer to the beginning of a cell. |
| 54307 | */ |
| 54308 | if( pBt->pTmpSpace ){ |
| 54309 | memset(pBt->pTmpSpace, 0, 8); |
| 54310 | pBt->pTmpSpace += 4; |
| 54311 | } |
| 54312 | } |
| 54313 | } |
| 54314 | |
| 54315 | /* |
| 54316 | ** Free the pBt->pTmpSpace allocation |
| 54317 | */ |
| 54318 | static void freeTempSpace(BtShared *pBt){ |
| 54319 | if( pBt->pTmpSpace ){ |
| 54320 | pBt->pTmpSpace -= 4; |
| 54321 | sqlite3PageFree(pBt->pTmpSpace); |
| 54322 | pBt->pTmpSpace = 0; |
| 54323 | } |
| 54324 | } |
| 54325 | |
| 54326 | /* |
| 54327 | ** Close an open database and invalidate all cursors. |
| 54328 | */ |
| @@ -61738,11 +61750,11 @@ | |
| 61750 | }else{ |
| 61751 | pMem->szMalloc = sqlite3DbMallocSize(pMem->db, pMem->zMalloc); |
| 61752 | } |
| 61753 | } |
| 61754 | |
| 61755 | if( bPreserve && pMem->z && pMem->z!=pMem->zMalloc ){ |
| 61756 | memcpy(pMem->zMalloc, pMem->z, pMem->n); |
| 61757 | } |
| 61758 | if( (pMem->flags&MEM_Dyn)!=0 ){ |
| 61759 | assert( pMem->xDel!=0 && pMem->xDel!=SQLITE_DYNAMIC ); |
| 61760 | pMem->xDel((void *)(pMem->z)); |
| 61761 |
+1
-1
| --- src/sqlite3.h | ||
| +++ src/sqlite3.h | ||
| @@ -107,11 +107,11 @@ | ||
| 107 | 107 | ** [sqlite3_libversion_number()], [sqlite3_sourceid()], |
| 108 | 108 | ** [sqlite_version()] and [sqlite_source_id()]. |
| 109 | 109 | */ |
| 110 | 110 | #define SQLITE_VERSION "3.8.7" |
| 111 | 111 | #define SQLITE_VERSION_NUMBER 3008007 |
| 112 | -#define SQLITE_SOURCE_ID "2014-10-14 20:25:43 eab82330631187dcc3e5d2dddd23dbda5752904b" | |
| 112 | +#define SQLITE_SOURCE_ID "2014-10-15 15:28:27 3c1e70f4d55bc009ed9ed4cf6d756d7061985851" | |
| 113 | 113 | |
| 114 | 114 | /* |
| 115 | 115 | ** CAPI3REF: Run-Time Library Version Numbers |
| 116 | 116 | ** KEYWORDS: sqlite3_version, sqlite3_sourceid |
| 117 | 117 | ** |
| 118 | 118 |
| --- src/sqlite3.h | |
| +++ src/sqlite3.h | |
| @@ -107,11 +107,11 @@ | |
| 107 | ** [sqlite3_libversion_number()], [sqlite3_sourceid()], |
| 108 | ** [sqlite_version()] and [sqlite_source_id()]. |
| 109 | */ |
| 110 | #define SQLITE_VERSION "3.8.7" |
| 111 | #define SQLITE_VERSION_NUMBER 3008007 |
| 112 | #define SQLITE_SOURCE_ID "2014-10-14 20:25:43 eab82330631187dcc3e5d2dddd23dbda5752904b" |
| 113 | |
| 114 | /* |
| 115 | ** CAPI3REF: Run-Time Library Version Numbers |
| 116 | ** KEYWORDS: sqlite3_version, sqlite3_sourceid |
| 117 | ** |
| 118 |
| --- src/sqlite3.h | |
| +++ src/sqlite3.h | |
| @@ -107,11 +107,11 @@ | |
| 107 | ** [sqlite3_libversion_number()], [sqlite3_sourceid()], |
| 108 | ** [sqlite_version()] and [sqlite_source_id()]. |
| 109 | */ |
| 110 | #define SQLITE_VERSION "3.8.7" |
| 111 | #define SQLITE_VERSION_NUMBER 3008007 |
| 112 | #define SQLITE_SOURCE_ID "2014-10-15 15:28:27 3c1e70f4d55bc009ed9ed4cf6d756d7061985851" |
| 113 | |
| 114 | /* |
| 115 | ** CAPI3REF: Run-Time Library Version Numbers |
| 116 | ** KEYWORDS: sqlite3_version, sqlite3_sourceid |
| 117 | ** |
| 118 |