Fossil SCM

Update the built-in SQLite to 3.8.7 beta 4.

drh 2014-10-15 15:47 trunk
Commit c9a20b617480dce909133ecaad3ef6185816192d
2 files changed +20 -8 +1 -1
+20 -8
--- src/sqlite3.c
+++ src/sqlite3.c
@@ -231,11 +231,11 @@
231231
** [sqlite3_libversion_number()], [sqlite3_sourceid()],
232232
** [sqlite_version()] and [sqlite_source_id()].
233233
*/
234234
#define SQLITE_VERSION "3.8.7"
235235
#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"
237237
238238
/*
239239
** CAPI3REF: Run-Time Library Version Numbers
240240
** KEYWORDS: sqlite3_version, sqlite3_sourceid
241241
**
@@ -51651,11 +51651,11 @@
5165151651
int nRef; /* Number of references to this structure */
5165251652
BtShared *pNext; /* Next on a list of sharable BtShared structs */
5165351653
BtLock *pLock; /* List of locks held on this shared-btree struct */
5165451654
Btree *pWriter; /* Btree with currently open write transaction */
5165551655
#endif
51656
- u8 *pTmpSpace; /* BtShared.pageSize bytes of space for tmp use */
51656
+ u8 *pTmpSpace; /* Temp space sufficient to hold a single cell */
5165751657
};
5165851658
5165951659
/*
5166051660
** Allowed values for BtShared.btsFlags
5166151661
*/
@@ -54281,11 +54281,12 @@
5428154281
#endif
5428254282
}
5428354283
5428454284
/*
5428554285
** 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.
5428754288
*/
5428854289
static void allocateTempSpace(BtShared *pBt){
5428954290
if( !pBt->pTmpSpace ){
5429054291
pBt->pTmpSpace = sqlite3PageMalloc( pBt->pageSize );
5429154292
@@ -54296,21 +54297,32 @@
5429654297
** can mean that fillInCell() only initializes the first 2 or 3
5429754298
** bytes of pTmpSpace, but that the first 4 bytes are copied from
5429854299
** it into a database page. This is not actually a problem, but it
5429954300
** does cause a valgrind error when the 1 or 2 bytes of unitialized
5430054301
** 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
+ }
5430354312
}
5430454313
}
5430554314
5430654315
/*
5430754316
** Free the pBt->pTmpSpace allocation
5430854317
*/
5430954318
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
+ }
5431254324
}
5431354325
5431454326
/*
5431554327
** Close an open database and invalidate all cursors.
5431654328
*/
@@ -61738,11 +61750,11 @@
6173861750
}else{
6173961751
pMem->szMalloc = sqlite3DbMallocSize(pMem->db, pMem->zMalloc);
6174061752
}
6174161753
}
6174261754
61743
- if( pMem->z && bPreserve && pMem->z!=pMem->zMalloc ){
61755
+ if( bPreserve && pMem->z && pMem->z!=pMem->zMalloc ){
6174461756
memcpy(pMem->zMalloc, pMem->z, pMem->n);
6174561757
}
6174661758
if( (pMem->flags&MEM_Dyn)!=0 ){
6174761759
assert( pMem->xDel!=0 && pMem->xDel!=SQLITE_DYNAMIC );
6174861760
pMem->xDel((void *)(pMem->z));
6174961761
--- 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 @@
107107
** [sqlite3_libversion_number()], [sqlite3_sourceid()],
108108
** [sqlite_version()] and [sqlite_source_id()].
109109
*/
110110
#define SQLITE_VERSION "3.8.7"
111111
#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"
113113
114114
/*
115115
** CAPI3REF: Run-Time Library Version Numbers
116116
** KEYWORDS: sqlite3_version, sqlite3_sourceid
117117
**
118118
--- 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

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button