Fossil SCM

Update SQLite to version 3.11.0 final.

drh 2016-02-15 17:43 trunk
Commit 7ad8230273fa79de7785ef80b1c878bbc5a7132d
2 files changed +17 -9 +2 -2
+17 -9
--- src/sqlite3.c
+++ src/sqlite3.c
@@ -328,11 +328,11 @@
328328
** [sqlite3_libversion_number()], [sqlite3_sourceid()],
329329
** [sqlite_version()] and [sqlite_source_id()].
330330
*/
331331
#define SQLITE_VERSION "3.11.0"
332332
#define SQLITE_VERSION_NUMBER 3011000
333
-#define SQLITE_SOURCE_ID "2016-02-12 05:19:29 717c1fc41a2246e27b324a4071073c286bac4efc"
333
+#define SQLITE_SOURCE_ID "2016-02-15 17:29:24 3d862f207e3adc00f78066799ac5a8c282430a5f"
334334
335335
/*
336336
** CAPI3REF: Run-Time Library Version Numbers
337337
** KEYWORDS: sqlite3_version, sqlite3_sourceid
338338
**
@@ -562,11 +562,11 @@
562562
** subsequent statements are skipped. ^If the 5th parameter to sqlite3_exec()
563563
** is not NULL then any error message is written into memory obtained
564564
** from [sqlite3_malloc()] and passed back through the 5th parameter.
565565
** To avoid memory leaks, the application should invoke [sqlite3_free()]
566566
** on error message strings returned through the 5th parameter of
567
-** of sqlite3_exec() after the error message string is no longer needed.
567
+** sqlite3_exec() after the error message string is no longer needed.
568568
** ^If the 5th parameter to sqlite3_exec() is not NULL and no errors
569569
** occur, then sqlite3_exec() sets the pointer in its 5th parameter to
570570
** NULL before returning.
571571
**
572572
** ^If an sqlite3_exec() callback returns non-zero, the sqlite3_exec()
@@ -54189,14 +54189,20 @@
5418954189
u32 iWrite = 0;
5419054190
VVA_ONLY(rc =) sqlite3WalFindFrame(pWal, p->pgno, &iWrite);
5419154191
assert( rc==SQLITE_OK || iWrite==0 );
5419254192
if( iWrite>=iFirst ){
5419354193
i64 iOff = walFrameOffset(iWrite, szPage) + WAL_FRAME_HDRSIZE;
54194
+ void *pData;
5419454195
if( pWal->iReCksum==0 || iWrite<pWal->iReCksum ){
5419554196
pWal->iReCksum = iWrite;
5419654197
}
54197
- rc = sqlite3OsWrite(pWal->pWalFd, p->pData, szPage, iOff);
54198
+#if defined(SQLITE_HAS_CODEC)
54199
+ if( (pData = sqlite3PagerCodec(p))==0 ) return SQLITE_NOMEM;
54200
+#else
54201
+ pData = p->pData;
54202
+#endif
54203
+ rc = sqlite3OsWrite(pWal->pWalFd, pData, szPage, iOff);
5419854204
if( rc ) return rc;
5419954205
p->flags &= ~PGHDR_WAL_APPEND;
5420054206
continue;
5420154207
}
5420254208
}
@@ -168506,10 +168512,11 @@
168506168512
#ifndef SQLITE_AMALGAMATION
168507168513
168508168514
typedef unsigned char u8;
168509168515
typedef unsigned int u32;
168510168516
typedef unsigned short u16;
168517
+typedef short i16;
168511168518
typedef sqlite3_int64 i64;
168512168519
typedef sqlite3_uint64 u64;
168513168520
168514168521
#define ArraySize(x) ((int)(sizeof(x) / sizeof(x[0])))
168515168522
@@ -174994,14 +175001,14 @@
174994175001
Fts5HashEntry *pScanNext; /* Next entry in sorted order */
174995175002
174996175003
int nAlloc; /* Total size of allocation */
174997175004
int iSzPoslist; /* Offset of space for 4-byte poslist size */
174998175005
int nData; /* Total bytes of data (incl. structure) */
175006
+ int nKey; /* Length of zKey[] in bytes */
174999175007
u8 bDel; /* Set delete-flag @ iSzPoslist */
175000175008
u8 bContent; /* Set content-flag (detail=none mode) */
175001
-
175002
- int iCol; /* Column of last value written */
175009
+ i16 iCol; /* Column of last value written */
175003175010
int iPos; /* Position of last value written */
175004175011
i64 iRowid; /* Rowid of last value written */
175005175012
char zKey[8]; /* Nul-terminated entry key */
175006175013
};
175007175014
@@ -175177,12 +175184,12 @@
175177175184
175178175185
/* Attempt to locate an existing hash entry */
175179175186
iHash = fts5HashKey2(pHash->nSlot, (u8)bByte, (const u8*)pToken, nToken);
175180175187
for(p=pHash->aSlot[iHash]; p; p=p->pHashNext){
175181175188
if( p->zKey[0]==bByte
175189
+ && p->nKey==nToken
175182175190
&& memcmp(&p->zKey[1], pToken, nToken)==0
175183
- && p->zKey[nToken+1]==0
175184175191
){
175185175192
break;
175186175193
}
175187175194
}
175188175195
@@ -175205,10 +175212,11 @@
175205175212
memset(p, 0, FTS5_HASHENTRYSIZE);
175206175213
p->nAlloc = nByte;
175207175214
p->zKey[0] = bByte;
175208175215
memcpy(&p->zKey[1], pToken, nToken);
175209175216
assert( iHash==fts5HashKey(pHash->nSlot, (u8*)p->zKey, nToken+1) );
175217
+ p->nKey = nToken;
175210175218
p->zKey[nToken+1] = '\0';
175211175219
p->nData = nToken+1 + 1 + FTS5_HASHENTRYSIZE;
175212175220
p->pHashNext = pHash->aSlot[iHash];
175213175221
pHash->aSlot[iHash] = p;
175214175222
pHash->nEntry++;
@@ -184345,11 +184353,11 @@
184345184353
int nArg, /* Number of args */
184346184354
sqlite3_value **apUnused /* Function arguments */
184347184355
){
184348184356
assert( nArg==0 );
184349184357
UNUSED_PARAM2(nArg, apUnused);
184350
- sqlite3_result_text(pCtx, "fts5: 2016-02-12 05:19:29 717c1fc41a2246e27b324a4071073c286bac4efc", -1, SQLITE_TRANSIENT);
184358
+ sqlite3_result_text(pCtx, "fts5: 2016-02-15 17:29:24 3d862f207e3adc00f78066799ac5a8c282430a5f", -1, SQLITE_TRANSIENT);
184351184359
}
184352184360
184353184361
static int fts5Init(sqlite3 *db){
184354184362
static const sqlite3_module fts5Mod = {
184355184363
/* iVersion */ 2,
@@ -186946,13 +186954,13 @@
186946186954
};
186947186955
static const unsigned int aAscii[4] = {
186948186956
0xFFFFFFFF, 0xFC00FFFF, 0xF8000001, 0xF8000001,
186949186957
};
186950186958
186951
- if( c<128 ){
186959
+ if( (unsigned int)c<128 ){
186952186960
return ( (aAscii[c >> 5] & (1 << (c & 0x001F)))==0 );
186953
- }else if( c<(1<<22) ){
186961
+ }else if( (unsigned int)c<(1<<22) ){
186954186962
unsigned int key = (((unsigned int)c)<<10) | 0x000003FF;
186955186963
int iRes = 0;
186956186964
int iHi = sizeof(aEntry)/sizeof(aEntry[0]) - 1;
186957186965
int iLo = 0;
186958186966
while( iHi>=iLo ){
186959186967
--- src/sqlite3.c
+++ src/sqlite3.c
@@ -328,11 +328,11 @@
328 ** [sqlite3_libversion_number()], [sqlite3_sourceid()],
329 ** [sqlite_version()] and [sqlite_source_id()].
330 */
331 #define SQLITE_VERSION "3.11.0"
332 #define SQLITE_VERSION_NUMBER 3011000
333 #define SQLITE_SOURCE_ID "2016-02-12 05:19:29 717c1fc41a2246e27b324a4071073c286bac4efc"
334
335 /*
336 ** CAPI3REF: Run-Time Library Version Numbers
337 ** KEYWORDS: sqlite3_version, sqlite3_sourceid
338 **
@@ -562,11 +562,11 @@
562 ** subsequent statements are skipped. ^If the 5th parameter to sqlite3_exec()
563 ** is not NULL then any error message is written into memory obtained
564 ** from [sqlite3_malloc()] and passed back through the 5th parameter.
565 ** To avoid memory leaks, the application should invoke [sqlite3_free()]
566 ** on error message strings returned through the 5th parameter of
567 ** of sqlite3_exec() after the error message string is no longer needed.
568 ** ^If the 5th parameter to sqlite3_exec() is not NULL and no errors
569 ** occur, then sqlite3_exec() sets the pointer in its 5th parameter to
570 ** NULL before returning.
571 **
572 ** ^If an sqlite3_exec() callback returns non-zero, the sqlite3_exec()
@@ -54189,14 +54189,20 @@
54189 u32 iWrite = 0;
54190 VVA_ONLY(rc =) sqlite3WalFindFrame(pWal, p->pgno, &iWrite);
54191 assert( rc==SQLITE_OK || iWrite==0 );
54192 if( iWrite>=iFirst ){
54193 i64 iOff = walFrameOffset(iWrite, szPage) + WAL_FRAME_HDRSIZE;
 
54194 if( pWal->iReCksum==0 || iWrite<pWal->iReCksum ){
54195 pWal->iReCksum = iWrite;
54196 }
54197 rc = sqlite3OsWrite(pWal->pWalFd, p->pData, szPage, iOff);
 
 
 
 
 
54198 if( rc ) return rc;
54199 p->flags &= ~PGHDR_WAL_APPEND;
54200 continue;
54201 }
54202 }
@@ -168506,10 +168512,11 @@
168506 #ifndef SQLITE_AMALGAMATION
168507
168508 typedef unsigned char u8;
168509 typedef unsigned int u32;
168510 typedef unsigned short u16;
 
168511 typedef sqlite3_int64 i64;
168512 typedef sqlite3_uint64 u64;
168513
168514 #define ArraySize(x) ((int)(sizeof(x) / sizeof(x[0])))
168515
@@ -174994,14 +175001,14 @@
174994 Fts5HashEntry *pScanNext; /* Next entry in sorted order */
174995
174996 int nAlloc; /* Total size of allocation */
174997 int iSzPoslist; /* Offset of space for 4-byte poslist size */
174998 int nData; /* Total bytes of data (incl. structure) */
 
174999 u8 bDel; /* Set delete-flag @ iSzPoslist */
175000 u8 bContent; /* Set content-flag (detail=none mode) */
175001
175002 int iCol; /* Column of last value written */
175003 int iPos; /* Position of last value written */
175004 i64 iRowid; /* Rowid of last value written */
175005 char zKey[8]; /* Nul-terminated entry key */
175006 };
175007
@@ -175177,12 +175184,12 @@
175177
175178 /* Attempt to locate an existing hash entry */
175179 iHash = fts5HashKey2(pHash->nSlot, (u8)bByte, (const u8*)pToken, nToken);
175180 for(p=pHash->aSlot[iHash]; p; p=p->pHashNext){
175181 if( p->zKey[0]==bByte
 
175182 && memcmp(&p->zKey[1], pToken, nToken)==0
175183 && p->zKey[nToken+1]==0
175184 ){
175185 break;
175186 }
175187 }
175188
@@ -175205,10 +175212,11 @@
175205 memset(p, 0, FTS5_HASHENTRYSIZE);
175206 p->nAlloc = nByte;
175207 p->zKey[0] = bByte;
175208 memcpy(&p->zKey[1], pToken, nToken);
175209 assert( iHash==fts5HashKey(pHash->nSlot, (u8*)p->zKey, nToken+1) );
 
175210 p->zKey[nToken+1] = '\0';
175211 p->nData = nToken+1 + 1 + FTS5_HASHENTRYSIZE;
175212 p->pHashNext = pHash->aSlot[iHash];
175213 pHash->aSlot[iHash] = p;
175214 pHash->nEntry++;
@@ -184345,11 +184353,11 @@
184345 int nArg, /* Number of args */
184346 sqlite3_value **apUnused /* Function arguments */
184347 ){
184348 assert( nArg==0 );
184349 UNUSED_PARAM2(nArg, apUnused);
184350 sqlite3_result_text(pCtx, "fts5: 2016-02-12 05:19:29 717c1fc41a2246e27b324a4071073c286bac4efc", -1, SQLITE_TRANSIENT);
184351 }
184352
184353 static int fts5Init(sqlite3 *db){
184354 static const sqlite3_module fts5Mod = {
184355 /* iVersion */ 2,
@@ -186946,13 +186954,13 @@
186946 };
186947 static const unsigned int aAscii[4] = {
186948 0xFFFFFFFF, 0xFC00FFFF, 0xF8000001, 0xF8000001,
186949 };
186950
186951 if( c<128 ){
186952 return ( (aAscii[c >> 5] & (1 << (c & 0x001F)))==0 );
186953 }else if( c<(1<<22) ){
186954 unsigned int key = (((unsigned int)c)<<10) | 0x000003FF;
186955 int iRes = 0;
186956 int iHi = sizeof(aEntry)/sizeof(aEntry[0]) - 1;
186957 int iLo = 0;
186958 while( iHi>=iLo ){
186959
--- src/sqlite3.c
+++ src/sqlite3.c
@@ -328,11 +328,11 @@
328 ** [sqlite3_libversion_number()], [sqlite3_sourceid()],
329 ** [sqlite_version()] and [sqlite_source_id()].
330 */
331 #define SQLITE_VERSION "3.11.0"
332 #define SQLITE_VERSION_NUMBER 3011000
333 #define SQLITE_SOURCE_ID "2016-02-15 17:29:24 3d862f207e3adc00f78066799ac5a8c282430a5f"
334
335 /*
336 ** CAPI3REF: Run-Time Library Version Numbers
337 ** KEYWORDS: sqlite3_version, sqlite3_sourceid
338 **
@@ -562,11 +562,11 @@
562 ** subsequent statements are skipped. ^If the 5th parameter to sqlite3_exec()
563 ** is not NULL then any error message is written into memory obtained
564 ** from [sqlite3_malloc()] and passed back through the 5th parameter.
565 ** To avoid memory leaks, the application should invoke [sqlite3_free()]
566 ** on error message strings returned through the 5th parameter of
567 ** sqlite3_exec() after the error message string is no longer needed.
568 ** ^If the 5th parameter to sqlite3_exec() is not NULL and no errors
569 ** occur, then sqlite3_exec() sets the pointer in its 5th parameter to
570 ** NULL before returning.
571 **
572 ** ^If an sqlite3_exec() callback returns non-zero, the sqlite3_exec()
@@ -54189,14 +54189,20 @@
54189 u32 iWrite = 0;
54190 VVA_ONLY(rc =) sqlite3WalFindFrame(pWal, p->pgno, &iWrite);
54191 assert( rc==SQLITE_OK || iWrite==0 );
54192 if( iWrite>=iFirst ){
54193 i64 iOff = walFrameOffset(iWrite, szPage) + WAL_FRAME_HDRSIZE;
54194 void *pData;
54195 if( pWal->iReCksum==0 || iWrite<pWal->iReCksum ){
54196 pWal->iReCksum = iWrite;
54197 }
54198 #if defined(SQLITE_HAS_CODEC)
54199 if( (pData = sqlite3PagerCodec(p))==0 ) return SQLITE_NOMEM;
54200 #else
54201 pData = p->pData;
54202 #endif
54203 rc = sqlite3OsWrite(pWal->pWalFd, pData, szPage, iOff);
54204 if( rc ) return rc;
54205 p->flags &= ~PGHDR_WAL_APPEND;
54206 continue;
54207 }
54208 }
@@ -168506,10 +168512,11 @@
168512 #ifndef SQLITE_AMALGAMATION
168513
168514 typedef unsigned char u8;
168515 typedef unsigned int u32;
168516 typedef unsigned short u16;
168517 typedef short i16;
168518 typedef sqlite3_int64 i64;
168519 typedef sqlite3_uint64 u64;
168520
168521 #define ArraySize(x) ((int)(sizeof(x) / sizeof(x[0])))
168522
@@ -174994,14 +175001,14 @@
175001 Fts5HashEntry *pScanNext; /* Next entry in sorted order */
175002
175003 int nAlloc; /* Total size of allocation */
175004 int iSzPoslist; /* Offset of space for 4-byte poslist size */
175005 int nData; /* Total bytes of data (incl. structure) */
175006 int nKey; /* Length of zKey[] in bytes */
175007 u8 bDel; /* Set delete-flag @ iSzPoslist */
175008 u8 bContent; /* Set content-flag (detail=none mode) */
175009 i16 iCol; /* Column of last value written */
 
175010 int iPos; /* Position of last value written */
175011 i64 iRowid; /* Rowid of last value written */
175012 char zKey[8]; /* Nul-terminated entry key */
175013 };
175014
@@ -175177,12 +175184,12 @@
175184
175185 /* Attempt to locate an existing hash entry */
175186 iHash = fts5HashKey2(pHash->nSlot, (u8)bByte, (const u8*)pToken, nToken);
175187 for(p=pHash->aSlot[iHash]; p; p=p->pHashNext){
175188 if( p->zKey[0]==bByte
175189 && p->nKey==nToken
175190 && memcmp(&p->zKey[1], pToken, nToken)==0
 
175191 ){
175192 break;
175193 }
175194 }
175195
@@ -175205,10 +175212,11 @@
175212 memset(p, 0, FTS5_HASHENTRYSIZE);
175213 p->nAlloc = nByte;
175214 p->zKey[0] = bByte;
175215 memcpy(&p->zKey[1], pToken, nToken);
175216 assert( iHash==fts5HashKey(pHash->nSlot, (u8*)p->zKey, nToken+1) );
175217 p->nKey = nToken;
175218 p->zKey[nToken+1] = '\0';
175219 p->nData = nToken+1 + 1 + FTS5_HASHENTRYSIZE;
175220 p->pHashNext = pHash->aSlot[iHash];
175221 pHash->aSlot[iHash] = p;
175222 pHash->nEntry++;
@@ -184345,11 +184353,11 @@
184353 int nArg, /* Number of args */
184354 sqlite3_value **apUnused /* Function arguments */
184355 ){
184356 assert( nArg==0 );
184357 UNUSED_PARAM2(nArg, apUnused);
184358 sqlite3_result_text(pCtx, "fts5: 2016-02-15 17:29:24 3d862f207e3adc00f78066799ac5a8c282430a5f", -1, SQLITE_TRANSIENT);
184359 }
184360
184361 static int fts5Init(sqlite3 *db){
184362 static const sqlite3_module fts5Mod = {
184363 /* iVersion */ 2,
@@ -186946,13 +186954,13 @@
186954 };
186955 static const unsigned int aAscii[4] = {
186956 0xFFFFFFFF, 0xFC00FFFF, 0xF8000001, 0xF8000001,
186957 };
186958
186959 if( (unsigned int)c<128 ){
186960 return ( (aAscii[c >> 5] & (1 << (c & 0x001F)))==0 );
186961 }else if( (unsigned int)c<(1<<22) ){
186962 unsigned int key = (((unsigned int)c)<<10) | 0x000003FF;
186963 int iRes = 0;
186964 int iHi = sizeof(aEntry)/sizeof(aEntry[0]) - 1;
186965 int iLo = 0;
186966 while( iHi>=iLo ){
186967
+2 -2
--- src/sqlite3.h
+++ src/sqlite3.h
@@ -111,11 +111,11 @@
111111
** [sqlite3_libversion_number()], [sqlite3_sourceid()],
112112
** [sqlite_version()] and [sqlite_source_id()].
113113
*/
114114
#define SQLITE_VERSION "3.11.0"
115115
#define SQLITE_VERSION_NUMBER 3011000
116
-#define SQLITE_SOURCE_ID "2016-02-12 05:19:29 717c1fc41a2246e27b324a4071073c286bac4efc"
116
+#define SQLITE_SOURCE_ID "2016-02-15 17:29:24 3d862f207e3adc00f78066799ac5a8c282430a5f"
117117
118118
/*
119119
** CAPI3REF: Run-Time Library Version Numbers
120120
** KEYWORDS: sqlite3_version, sqlite3_sourceid
121121
**
@@ -345,11 +345,11 @@
345345
** subsequent statements are skipped. ^If the 5th parameter to sqlite3_exec()
346346
** is not NULL then any error message is written into memory obtained
347347
** from [sqlite3_malloc()] and passed back through the 5th parameter.
348348
** To avoid memory leaks, the application should invoke [sqlite3_free()]
349349
** on error message strings returned through the 5th parameter of
350
-** of sqlite3_exec() after the error message string is no longer needed.
350
+** sqlite3_exec() after the error message string is no longer needed.
351351
** ^If the 5th parameter to sqlite3_exec() is not NULL and no errors
352352
** occur, then sqlite3_exec() sets the pointer in its 5th parameter to
353353
** NULL before returning.
354354
**
355355
** ^If an sqlite3_exec() callback returns non-zero, the sqlite3_exec()
356356
--- 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.11.0"
115 #define SQLITE_VERSION_NUMBER 3011000
116 #define SQLITE_SOURCE_ID "2016-02-12 05:19:29 717c1fc41a2246e27b324a4071073c286bac4efc"
117
118 /*
119 ** CAPI3REF: Run-Time Library Version Numbers
120 ** KEYWORDS: sqlite3_version, sqlite3_sourceid
121 **
@@ -345,11 +345,11 @@
345 ** subsequent statements are skipped. ^If the 5th parameter to sqlite3_exec()
346 ** is not NULL then any error message is written into memory obtained
347 ** from [sqlite3_malloc()] and passed back through the 5th parameter.
348 ** To avoid memory leaks, the application should invoke [sqlite3_free()]
349 ** on error message strings returned through the 5th parameter of
350 ** of sqlite3_exec() after the error message string is no longer needed.
351 ** ^If the 5th parameter to sqlite3_exec() is not NULL and no errors
352 ** occur, then sqlite3_exec() sets the pointer in its 5th parameter to
353 ** NULL before returning.
354 **
355 ** ^If an sqlite3_exec() callback returns non-zero, the sqlite3_exec()
356
--- 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.11.0"
115 #define SQLITE_VERSION_NUMBER 3011000
116 #define SQLITE_SOURCE_ID "2016-02-15 17:29:24 3d862f207e3adc00f78066799ac5a8c282430a5f"
117
118 /*
119 ** CAPI3REF: Run-Time Library Version Numbers
120 ** KEYWORDS: sqlite3_version, sqlite3_sourceid
121 **
@@ -345,11 +345,11 @@
345 ** subsequent statements are skipped. ^If the 5th parameter to sqlite3_exec()
346 ** is not NULL then any error message is written into memory obtained
347 ** from [sqlite3_malloc()] and passed back through the 5th parameter.
348 ** To avoid memory leaks, the application should invoke [sqlite3_free()]
349 ** on error message strings returned through the 5th parameter of
350 ** sqlite3_exec() after the error message string is no longer needed.
351 ** ^If the 5th parameter to sqlite3_exec() is not NULL and no errors
352 ** occur, then sqlite3_exec() sets the pointer in its 5th parameter to
353 ** NULL before returning.
354 **
355 ** ^If an sqlite3_exec() callback returns non-zero, the sqlite3_exec()
356

Keyboard Shortcuts

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