Fossil SCM

Update the built-in SQLite to version 3.8.6 beta3.

drh 2014-08-12 20:18 trunk
Commit 75c4808653d0c508b184309f30441103d21a6512
3 files changed +1 -4 +71 -31 +3 -3
+1 -4
--- src/shell.c
+++ src/shell.c
@@ -1692,25 +1692,22 @@
16921692
int argc,
16931693
sqlite3_value **argv
16941694
){
16951695
FILE *out;
16961696
const char *z;
1697
- int n;
16981697
sqlite3_int64 rc;
16991698
const char *zFile;
17001699
17011700
zFile = (const char*)sqlite3_value_text(argv[0]);
17021701
if( zFile==0 ) return;
17031702
out = fopen(zFile, "wb");
17041703
if( out==0 ) return;
17051704
z = (const char*)sqlite3_value_blob(argv[1]);
17061705
if( z==0 ){
1707
- n = 0;
17081706
rc = 0;
17091707
}else{
1710
- n = sqlite3_value_bytes(argv[1]);
1711
- rc = fwrite(z, 1, n, out);
1708
+ rc = fwrite(z, 1, sqlite3_value_bytes(argv[1]), out);
17121709
}
17131710
fclose(out);
17141711
sqlite3_result_int64(context, rc);
17151712
}
17161713
17171714
--- src/shell.c
+++ src/shell.c
@@ -1692,25 +1692,22 @@
1692 int argc,
1693 sqlite3_value **argv
1694 ){
1695 FILE *out;
1696 const char *z;
1697 int n;
1698 sqlite3_int64 rc;
1699 const char *zFile;
1700
1701 zFile = (const char*)sqlite3_value_text(argv[0]);
1702 if( zFile==0 ) return;
1703 out = fopen(zFile, "wb");
1704 if( out==0 ) return;
1705 z = (const char*)sqlite3_value_blob(argv[1]);
1706 if( z==0 ){
1707 n = 0;
1708 rc = 0;
1709 }else{
1710 n = sqlite3_value_bytes(argv[1]);
1711 rc = fwrite(z, 1, n, out);
1712 }
1713 fclose(out);
1714 sqlite3_result_int64(context, rc);
1715 }
1716
1717
--- src/shell.c
+++ src/shell.c
@@ -1692,25 +1692,22 @@
1692 int argc,
1693 sqlite3_value **argv
1694 ){
1695 FILE *out;
1696 const char *z;
 
1697 sqlite3_int64 rc;
1698 const char *zFile;
1699
1700 zFile = (const char*)sqlite3_value_text(argv[0]);
1701 if( zFile==0 ) return;
1702 out = fopen(zFile, "wb");
1703 if( out==0 ) return;
1704 z = (const char*)sqlite3_value_blob(argv[1]);
1705 if( z==0 ){
 
1706 rc = 0;
1707 }else{
1708 rc = fwrite(z, 1, sqlite3_value_bytes(argv[1]), out);
 
1709 }
1710 fclose(out);
1711 sqlite3_result_int64(context, rc);
1712 }
1713
1714
+71 -31
--- src/sqlite3.c
+++ src/sqlite3.c
@@ -222,11 +222,11 @@
222222
** [sqlite3_libversion_number()], [sqlite3_sourceid()],
223223
** [sqlite_version()] and [sqlite_source_id()].
224224
*/
225225
#define SQLITE_VERSION "3.8.6"
226226
#define SQLITE_VERSION_NUMBER 3008006
227
-#define SQLITE_SOURCE_ID "2014-08-11 13:53:30 de27c742c0dcda20b51339598bf6094a8dcf5fb9"
227
+#define SQLITE_SOURCE_ID "2014-08-12 16:13:37 6715991296886c2a02b9a285a1e61189ad1f79c0"
228228
229229
/*
230230
** CAPI3REF: Run-Time Library Version Numbers
231231
** KEYWORDS: sqlite3_version, sqlite3_sourceid
232232
**
@@ -390,11 +390,11 @@
390390
**
391391
** ^If the database connection is associated with unfinalized prepared
392392
** statements or unfinished sqlite3_backup objects then sqlite3_close()
393393
** will leave the database connection open and return [SQLITE_BUSY].
394394
** ^If sqlite3_close_v2() is called with unfinalized prepared statements
395
-** and unfinished sqlite3_backups, then the database connection becomes
395
+** and/or unfinished sqlite3_backups, then the database connection becomes
396396
** an unusable "zombie" which will automatically be deallocated when the
397397
** last prepared statement is finalized or the last sqlite3_backup is
398398
** finished. The sqlite3_close_v2() interface is intended for use with
399399
** host languages that are garbage collected, and where the order in which
400400
** destructors are called is arbitrary.
@@ -403,11 +403,11 @@
403403
** [sqlite3_blob_close | close] all [BLOB handles], and
404404
** [sqlite3_backup_finish | finish] all [sqlite3_backup] objects associated
405405
** with the [sqlite3] object prior to attempting to close the object. ^If
406406
** sqlite3_close_v2() is called on a [database connection] that still has
407407
** outstanding [prepared statements], [BLOB handles], and/or
408
-** [sqlite3_backup] objects then it returns [SQLITE_OK] but the deallocation
408
+** [sqlite3_backup] objects then it returns [SQLITE_OK] and the deallocation
409409
** of resources is deferred until all [prepared statements], [BLOB handles],
410410
** and [sqlite3_backup] objects are also destroyed.
411411
**
412412
** ^If an [sqlite3] object is destroyed while a transaction is open,
413413
** the transaction is automatically rolled back.
@@ -25565,16 +25565,16 @@
2556525565
2556625566
/*
2556725567
** Return TRUE if pFile has been renamed or unlinked since it was first opened.
2556825568
*/
2556925569
static int fileHasMoved(unixFile *pFile){
25570
+#if OS_VXWORKS
25571
+ return pFile->pInode!=0 && pFile->pId!=pFile->pInode->fileId.pId;
25572
+#else
2557025573
struct stat buf;
2557125574
return pFile->pInode!=0 &&
25572
-#if OS_VXWORKS
25573
- pFile->pId!=pFile->pInode->fileId.Pid;
25574
-#else
25575
- (osStat(pFile->zPath, &buf)!=0 || buf.st_ino!=pFile->pInode->fileId.ino);
25575
+ (osStat(pFile->zPath, &buf)!=0 || buf.st_ino!=pFile->pInode->fileId.ino);
2557625576
#endif
2557725577
}
2557825578
2557925579
2558025580
/*
@@ -32049,22 +32049,18 @@
3204932049
#ifndef NTDDI_WINBLUE
3205032050
# define NTDDI_WINBLUE 0x06030000
3205132051
#endif
3205232052
3205332053
/*
32054
-** Check if the GetVersionEx[AW] functions should be considered deprecated
32055
-** and avoid using them in that case. It should be noted here that if the
32056
-** value of the SQLITE_WIN32_GETVERSIONEX pre-processor macro is zero
32057
-** (whether via this block or via being manually specified), that implies
32058
-** the underlying operating system will always be based on the Windows NT
32059
-** Kernel.
32054
+** Check to see if the GetVersionEx[AW] functions are deprecated on the
32055
+** target system. GetVersionEx was first deprecated in Win8.1.
3206032056
*/
3206132057
#ifndef SQLITE_WIN32_GETVERSIONEX
3206232058
# if defined(NTDDI_VERSION) && NTDDI_VERSION >= NTDDI_WINBLUE
32063
-# define SQLITE_WIN32_GETVERSIONEX 0
32059
+# define SQLITE_WIN32_GETVERSIONEX 0 /* GetVersionEx() is deprecated */
3206432060
# else
32065
-# define SQLITE_WIN32_GETVERSIONEX 1
32061
+# define SQLITE_WIN32_GETVERSIONEX 1 /* GetVersionEx() is current */
3206632062
# endif
3206732063
#endif
3206832064
3206932065
/*
3207032066
** This constant should already be defined (in the "WinDef.h" SDK file).
@@ -32132,11 +32128,11 @@
3213232128
/*
3213332129
** This macro is used when a local variable is set to a value that is
3213432130
** [sometimes] not used by the code (e.g. via conditional compilation).
3213532131
*/
3213632132
#ifndef UNUSED_VARIABLE_VALUE
32137
-# define UNUSED_VARIABLE_VALUE(x) (void)(x)
32133
+# define UNUSED_VARIABLE_VALUE(x) (void)(x)
3213832134
#endif
3213932135
3214032136
/*
3214132137
** Returns the character that should be used as the directory separator.
3214232138
*/
@@ -33029,11 +33025,20 @@
3302933025
/*
3303033026
** NOTE: On some sub-platforms, the InterlockedCompareExchange "function"
3303133027
** is really just a macro that uses a compiler intrinsic (e.g. x64).
3303233028
** So do not try to make this is into a redefinable interface.
3303333029
*/
33030
+#if defined(InterlockedCompareExchange)
33031
+ { "InterlockedCompareExchange", (SYSCALL)0, 0 },
33032
+
3303433033
#define osInterlockedCompareExchange InterlockedCompareExchange
33034
+#else
33035
+ { "InterlockedCompareExchange", (SYSCALL)InterlockedCompareExchange, 0 },
33036
+
33037
+#define osInterlockedCompareExchange ((LONG(WINAPI*)(LONG volatile*, \
33038
+ LONG,LONG))aSyscall[76].pCurrent)
33039
+#endif /* defined(InterlockedCompareExchange) */
3303533040
3303633041
}; /* End of the overrideable system calls */
3303733042
3303833043
/*
3303933044
** This is the xSetSystemCall() method of sqlite3_vfs for all of the
@@ -33289,24 +33294,33 @@
3328933294
/*
3329033295
** This function determines if the machine is running a version of Windows
3329133296
** based on the NT kernel.
3329233297
*/
3329333298
SQLITE_API int sqlite3_win32_is_nt(void){
33299
+#if defined(SQLITE_WIN32_GETVERSIONEX) && SQLITE_WIN32_GETVERSIONEX
3329433300
if( osInterlockedCompareExchange(&sqlite3_os_type, 0, 0)==0 ){
33295
-#if defined(NTDDI_VERSION) && NTDDI_VERSION >= NTDDI_WIN8
33301
+#if !SQLITE_OS_WINRT && defined(SQLITE_WIN32_HAS_WIDE) && \
33302
+ defined(NTDDI_VERSION) && NTDDI_VERSION >= NTDDI_WIN8
3329633303
OSVERSIONINFOW sInfo;
3329733304
sInfo.dwOSVersionInfoSize = sizeof(sInfo);
3329833305
osGetVersionExW(&sInfo);
33299
-#else
33306
+ osInterlockedCompareExchange(&sqlite3_os_type,
33307
+ (sInfo.dwPlatformId == VER_PLATFORM_WIN32_NT) ? 2 : 1, 0);
33308
+#elif defined(SQLITE_WIN32_HAS_ANSI)
3330033309
OSVERSIONINFOA sInfo;
3330133310
sInfo.dwOSVersionInfoSize = sizeof(sInfo);
3330233311
osGetVersionExA(&sInfo);
33303
-#endif
3330433312
osInterlockedCompareExchange(&sqlite3_os_type,
3330533313
(sInfo.dwPlatformId == VER_PLATFORM_WIN32_NT) ? 2 : 1, 0);
33314
+#endif
3330633315
}
33316
+ return osInterlockedCompareExchange(&sqlite3_os_type, 2, 2)==2;
33317
+#elif SQLITE_TEST
3330733318
return osInterlockedCompareExchange(&sqlite3_os_type, 2, 2)==2;
33319
+#else
33320
+ return 1;
33321
+#endif
3330833322
}
3330933323
3331033324
#ifdef SQLITE_WIN32_MALLOC
3331133325
/*
3331233326
** Allocate nBytes of memory.
@@ -37459,11 +37473,11 @@
3745937473
};
3746037474
#endif
3746137475
3746237476
/* Double-check that the aSyscall[] array has been constructed
3746337477
** correctly. See ticket [bb3a86e890c8e96ab] */
37464
- assert( ArraySize(aSyscall)==76 );
37478
+ assert( ArraySize(aSyscall)==77 );
3746537479
3746637480
/* get memory map allocation granularity */
3746737481
memset(&winSysInfo, 0, sizeof(SYSTEM_INFO));
3746837482
#if SQLITE_OS_WINRT
3746937483
osGetNativeSystemInfo(&winSysInfo);
@@ -62277,22 +62291,39 @@
6227762291
pB->zSql = zTmp;
6227862292
pB->isPrepareV2 = pA->isPrepareV2;
6227962293
}
6228062294
6228162295
/*
62282
-** Resize the Vdbe.aOp array so that it is at least one op larger than
62283
-** it was.
62296
+** Resize the Vdbe.aOp array so that it is at least nOp elements larger
62297
+** than its current size. nOp is guaranteed to be less than or equal
62298
+** to 1024/sizeof(Op).
6228462299
**
6228562300
** If an out-of-memory error occurs while resizing the array, return
62286
-** SQLITE_NOMEM. In this case Vdbe.aOp and Vdbe.nOpAlloc remain
62301
+** SQLITE_NOMEM. In this case Vdbe.aOp and Parse.nOpAlloc remain
6228762302
** unchanged (this is so that any opcodes already allocated can be
6228862303
** correctly deallocated along with the rest of the Vdbe).
6228962304
*/
62290
-static int growOpArray(Vdbe *v){
62305
+static int growOpArray(Vdbe *v, int nOp){
6229162306
VdbeOp *pNew;
6229262307
Parse *p = v->pParse;
62308
+
62309
+ /* The SQLITE_TEST_REALLOC_STRESS compile-time option is designed to force
62310
+ ** more frequent reallocs and hence provide more opportunities for
62311
+ ** simulated OOM faults. SQLITE_TEST_REALLOC_STRESS is generally used
62312
+ ** during testing only. With SQLITE_TEST_REALLOC_STRESS grow the op array
62313
+ ** by the minimum* amount required until the size reaches 512. Normal
62314
+ ** operation (without SQLITE_TEST_REALLOC_STRESS) is to double the current
62315
+ ** size of the op array or add 1KB of space, whichever is smaller. */
62316
+#ifdef SQLITE_TEST_REALLOC_STRESS
62317
+ int nNew = (p->nOpAlloc>=512 ? p->nOpAlloc*2 : p->nOpAlloc+nOp);
62318
+#else
6229362319
int nNew = (p->nOpAlloc ? p->nOpAlloc*2 : (int)(1024/sizeof(Op)));
62320
+ UNUSED_PARAMETER(nOp);
62321
+#endif
62322
+
62323
+ assert( nOp<=(1024/sizeof(Op)) );
62324
+ assert( nNew>=(p->nOpAlloc+nOp) );
6229462325
pNew = sqlite3DbRealloc(p->db, v->aOp, nNew*sizeof(Op));
6229562326
if( pNew ){
6229662327
p->nOpAlloc = sqlite3DbMallocSize(p->db, pNew)/sizeof(Op);
6229762328
v->aOp = pNew;
6229862329
}
@@ -62332,11 +62363,11 @@
6233262363
6233362364
i = p->nOp;
6233462365
assert( p->magic==VDBE_MAGIC_INIT );
6233562366
assert( op>0 && op<0xff );
6233662367
if( p->pParse->nOpAlloc<=i ){
62337
- if( growOpArray(p) ){
62368
+ if( growOpArray(p, 1) ){
6233862369
return 1;
6233962370
}
6234062371
}
6234162372
p->nOp++;
6234262373
pOp = &p->aOp[i];
@@ -62734,11 +62765,11 @@
6273462765
** address of the first operation added.
6273562766
*/
6273662767
SQLITE_PRIVATE int sqlite3VdbeAddOpList(Vdbe *p, int nOp, VdbeOpList const *aOp, int iLineno){
6273762768
int addr;
6273862769
assert( p->magic==VDBE_MAGIC_INIT );
62739
- if( p->nOp + nOp > p->pParse->nOpAlloc && growOpArray(p) ){
62770
+ if( p->nOp + nOp > p->pParse->nOpAlloc && growOpArray(p, nOp) ){
6274062771
return 0;
6274162772
}
6274262773
addr = p->nOp;
6274362774
if( ALWAYS(nOp>0) ){
6274462775
int i;
@@ -62919,11 +62950,11 @@
6291962950
6292062951
/*
6292162952
** Change the opcode at addr into OP_Noop
6292262953
*/
6292362954
SQLITE_PRIVATE void sqlite3VdbeChangeToNoop(Vdbe *p, int addr){
62924
- if( p->aOp ){
62955
+ if( addr<p->nOp ){
6292562956
VdbeOp *pOp = &p->aOp[addr];
6292662957
sqlite3 *db = p->db;
6292762958
freeP4(db, pOp->p4type, pOp->p4.p);
6292862959
memset(pOp, 0, sizeof(pOp[0]));
6292962960
pOp->opcode = OP_Noop;
@@ -77439,11 +77470,15 @@
7743977470
}
7744077471
}else{
7744177472
/* EVIDENCE-OF: R-61304-29449 The unlikely(X) function is equivalent to
7744277473
** likelihood(X, 0.0625).
7744377474
** EVIDENCE-OF: R-01283-11636 The unlikely(X) function is short-hand for
77444
- ** likelihood(X,0.0625). */
77475
+ ** likelihood(X,0.0625).
77476
+ ** EVIDENCE-OF: R-36850-34127 The likely(X) function is short-hand for
77477
+ ** likelihood(X,0.9375).
77478
+ ** EVIDENCE-OF: R-53436-40973 The likely(X) function is equivalent to
77479
+ ** likelihood(X,0.9375). */
7744577480
/* TUNING: unlikely() probability is 0.0625. likely() is 0.9375 */
7744677481
pExpr->iTable = pDef->zName[0]=='u' ? 62 : 938;
7744777482
}
7744877483
}
7744977484
}
@@ -96859,10 +96894,13 @@
9685996894
goto exec_out;
9686096895
}
9686196896
}
9686296897
}
9686396898
if( xCallback(pArg, nCol, azVals, azCols) ){
96899
+ /* EVIDENCE-OF: R-38229-40159 If the callback function to
96900
+ ** sqlite3_exec() returns non-zero, then sqlite3_exec() will
96901
+ ** return SQLITE_ABORT. */
9686496902
rc = SQLITE_ABORT;
9686596903
sqlite3VdbeFinalize((Vdbe *)pStmt);
9686696904
pStmt = 0;
9686796905
sqlite3Error(db, SQLITE_ABORT, 0);
9686896906
goto exec_out;
@@ -102110,11 +102148,11 @@
102110102148
VdbeCoverage(v);
102111102149
}
102112102150
sqlite3VdbeChangeP4(v, -1, (const char *)pColl, P4_COLLSEQ);
102113102151
sqlite3VdbeChangeP5(v, SQLITE_NULLEQ);
102114102152
}
102115
- assert( sqlite3VdbeCurrentAddr(v)==iJump );
102153
+ assert( sqlite3VdbeCurrentAddr(v)==iJump || pParse->db->mallocFailed );
102116102154
sqlite3VdbeAddOp3(v, OP_Copy, regResult, regPrev, nResultCol-1);
102117102155
break;
102118102156
}
102119102157
102120102158
case WHERE_DISTINCT_UNIQUE: {
@@ -122944,10 +122982,12 @@
122944122982
/*
122945122983
** Close an existing SQLite database
122946122984
*/
122947122985
static int sqlite3Close(sqlite3 *db, int forceZombie){
122948122986
if( !db ){
122987
+ /* EVIDENCE-OF: R-63257-11740 Calling sqlite3_close() or
122988
+ ** sqlite3_close_v2() with a NULL pointer argument is a harmless no-op. */
122949122989
return SQLITE_OK;
122950122990
}
122951122991
if( !sqlite3SafetyCheckSickOrOk(db) ){
122952122992
return SQLITE_MISUSE_BKPT;
122953122993
}
@@ -124192,11 +124232,11 @@
124192124232
SQLITE_MAX_COMPOUND_SELECT,
124193124233
SQLITE_MAX_VDBE_OP,
124194124234
SQLITE_MAX_FUNCTION_ARG,
124195124235
SQLITE_MAX_ATTACHED,
124196124236
SQLITE_MAX_LIKE_PATTERN_LENGTH,
124197
- SQLITE_MAX_VARIABLE_NUMBER,
124237
+ SQLITE_MAX_VARIABLE_NUMBER, /* IMP: R-38091-32352 */
124198124238
SQLITE_MAX_TRIGGER_DEPTH,
124199124239
};
124200124240
124201124241
/*
124202124242
** Make sure the hard limits are set to reasonable values
@@ -144154,11 +144194,11 @@
144154144194
int *piEnd, /* OUT: Ending offset of token */
144155144195
int *piPos /* OUT: Position integer of token */
144156144196
){
144157144197
unicode_cursor *pCsr = (unicode_cursor *)pC;
144158144198
unicode_tokenizer *p = ((unicode_tokenizer *)pCsr->base.pTokenizer);
144159
- int iCode;
144199
+ int iCode = 0;
144160144200
char *zOut;
144161144201
const unsigned char *z = &pCsr->aInput[pCsr->iOff];
144162144202
const unsigned char *zStart = z;
144163144203
const unsigned char *zEnd;
144164144204
const unsigned char *zTerm = &pCsr->aInput[pCsr->nInput];
144165144205
--- src/sqlite3.c
+++ src/sqlite3.c
@@ -222,11 +222,11 @@
222 ** [sqlite3_libversion_number()], [sqlite3_sourceid()],
223 ** [sqlite_version()] and [sqlite_source_id()].
224 */
225 #define SQLITE_VERSION "3.8.6"
226 #define SQLITE_VERSION_NUMBER 3008006
227 #define SQLITE_SOURCE_ID "2014-08-11 13:53:30 de27c742c0dcda20b51339598bf6094a8dcf5fb9"
228
229 /*
230 ** CAPI3REF: Run-Time Library Version Numbers
231 ** KEYWORDS: sqlite3_version, sqlite3_sourceid
232 **
@@ -390,11 +390,11 @@
390 **
391 ** ^If the database connection is associated with unfinalized prepared
392 ** statements or unfinished sqlite3_backup objects then sqlite3_close()
393 ** will leave the database connection open and return [SQLITE_BUSY].
394 ** ^If sqlite3_close_v2() is called with unfinalized prepared statements
395 ** and unfinished sqlite3_backups, then the database connection becomes
396 ** an unusable "zombie" which will automatically be deallocated when the
397 ** last prepared statement is finalized or the last sqlite3_backup is
398 ** finished. The sqlite3_close_v2() interface is intended for use with
399 ** host languages that are garbage collected, and where the order in which
400 ** destructors are called is arbitrary.
@@ -403,11 +403,11 @@
403 ** [sqlite3_blob_close | close] all [BLOB handles], and
404 ** [sqlite3_backup_finish | finish] all [sqlite3_backup] objects associated
405 ** with the [sqlite3] object prior to attempting to close the object. ^If
406 ** sqlite3_close_v2() is called on a [database connection] that still has
407 ** outstanding [prepared statements], [BLOB handles], and/or
408 ** [sqlite3_backup] objects then it returns [SQLITE_OK] but the deallocation
409 ** of resources is deferred until all [prepared statements], [BLOB handles],
410 ** and [sqlite3_backup] objects are also destroyed.
411 **
412 ** ^If an [sqlite3] object is destroyed while a transaction is open,
413 ** the transaction is automatically rolled back.
@@ -25565,16 +25565,16 @@
25565
25566 /*
25567 ** Return TRUE if pFile has been renamed or unlinked since it was first opened.
25568 */
25569 static int fileHasMoved(unixFile *pFile){
 
 
 
25570 struct stat buf;
25571 return pFile->pInode!=0 &&
25572 #if OS_VXWORKS
25573 pFile->pId!=pFile->pInode->fileId.Pid;
25574 #else
25575 (osStat(pFile->zPath, &buf)!=0 || buf.st_ino!=pFile->pInode->fileId.ino);
25576 #endif
25577 }
25578
25579
25580 /*
@@ -32049,22 +32049,18 @@
32049 #ifndef NTDDI_WINBLUE
32050 # define NTDDI_WINBLUE 0x06030000
32051 #endif
32052
32053 /*
32054 ** Check if the GetVersionEx[AW] functions should be considered deprecated
32055 ** and avoid using them in that case. It should be noted here that if the
32056 ** value of the SQLITE_WIN32_GETVERSIONEX pre-processor macro is zero
32057 ** (whether via this block or via being manually specified), that implies
32058 ** the underlying operating system will always be based on the Windows NT
32059 ** Kernel.
32060 */
32061 #ifndef SQLITE_WIN32_GETVERSIONEX
32062 # if defined(NTDDI_VERSION) && NTDDI_VERSION >= NTDDI_WINBLUE
32063 # define SQLITE_WIN32_GETVERSIONEX 0
32064 # else
32065 # define SQLITE_WIN32_GETVERSIONEX 1
32066 # endif
32067 #endif
32068
32069 /*
32070 ** This constant should already be defined (in the "WinDef.h" SDK file).
@@ -32132,11 +32128,11 @@
32132 /*
32133 ** This macro is used when a local variable is set to a value that is
32134 ** [sometimes] not used by the code (e.g. via conditional compilation).
32135 */
32136 #ifndef UNUSED_VARIABLE_VALUE
32137 # define UNUSED_VARIABLE_VALUE(x) (void)(x)
32138 #endif
32139
32140 /*
32141 ** Returns the character that should be used as the directory separator.
32142 */
@@ -33029,11 +33025,20 @@
33029 /*
33030 ** NOTE: On some sub-platforms, the InterlockedCompareExchange "function"
33031 ** is really just a macro that uses a compiler intrinsic (e.g. x64).
33032 ** So do not try to make this is into a redefinable interface.
33033 */
 
 
 
33034 #define osInterlockedCompareExchange InterlockedCompareExchange
 
 
 
 
 
 
33035
33036 }; /* End of the overrideable system calls */
33037
33038 /*
33039 ** This is the xSetSystemCall() method of sqlite3_vfs for all of the
@@ -33289,24 +33294,33 @@
33289 /*
33290 ** This function determines if the machine is running a version of Windows
33291 ** based on the NT kernel.
33292 */
33293 SQLITE_API int sqlite3_win32_is_nt(void){
 
33294 if( osInterlockedCompareExchange(&sqlite3_os_type, 0, 0)==0 ){
33295 #if defined(NTDDI_VERSION) && NTDDI_VERSION >= NTDDI_WIN8
 
33296 OSVERSIONINFOW sInfo;
33297 sInfo.dwOSVersionInfoSize = sizeof(sInfo);
33298 osGetVersionExW(&sInfo);
33299 #else
 
 
33300 OSVERSIONINFOA sInfo;
33301 sInfo.dwOSVersionInfoSize = sizeof(sInfo);
33302 osGetVersionExA(&sInfo);
33303 #endif
33304 osInterlockedCompareExchange(&sqlite3_os_type,
33305 (sInfo.dwPlatformId == VER_PLATFORM_WIN32_NT) ? 2 : 1, 0);
 
33306 }
 
 
33307 return osInterlockedCompareExchange(&sqlite3_os_type, 2, 2)==2;
 
 
 
33308 }
33309
33310 #ifdef SQLITE_WIN32_MALLOC
33311 /*
33312 ** Allocate nBytes of memory.
@@ -37459,11 +37473,11 @@
37459 };
37460 #endif
37461
37462 /* Double-check that the aSyscall[] array has been constructed
37463 ** correctly. See ticket [bb3a86e890c8e96ab] */
37464 assert( ArraySize(aSyscall)==76 );
37465
37466 /* get memory map allocation granularity */
37467 memset(&winSysInfo, 0, sizeof(SYSTEM_INFO));
37468 #if SQLITE_OS_WINRT
37469 osGetNativeSystemInfo(&winSysInfo);
@@ -62277,22 +62291,39 @@
62277 pB->zSql = zTmp;
62278 pB->isPrepareV2 = pA->isPrepareV2;
62279 }
62280
62281 /*
62282 ** Resize the Vdbe.aOp array so that it is at least one op larger than
62283 ** it was.
 
62284 **
62285 ** If an out-of-memory error occurs while resizing the array, return
62286 ** SQLITE_NOMEM. In this case Vdbe.aOp and Vdbe.nOpAlloc remain
62287 ** unchanged (this is so that any opcodes already allocated can be
62288 ** correctly deallocated along with the rest of the Vdbe).
62289 */
62290 static int growOpArray(Vdbe *v){
62291 VdbeOp *pNew;
62292 Parse *p = v->pParse;
 
 
 
 
 
 
 
 
 
 
 
62293 int nNew = (p->nOpAlloc ? p->nOpAlloc*2 : (int)(1024/sizeof(Op)));
 
 
 
 
 
62294 pNew = sqlite3DbRealloc(p->db, v->aOp, nNew*sizeof(Op));
62295 if( pNew ){
62296 p->nOpAlloc = sqlite3DbMallocSize(p->db, pNew)/sizeof(Op);
62297 v->aOp = pNew;
62298 }
@@ -62332,11 +62363,11 @@
62332
62333 i = p->nOp;
62334 assert( p->magic==VDBE_MAGIC_INIT );
62335 assert( op>0 && op<0xff );
62336 if( p->pParse->nOpAlloc<=i ){
62337 if( growOpArray(p) ){
62338 return 1;
62339 }
62340 }
62341 p->nOp++;
62342 pOp = &p->aOp[i];
@@ -62734,11 +62765,11 @@
62734 ** address of the first operation added.
62735 */
62736 SQLITE_PRIVATE int sqlite3VdbeAddOpList(Vdbe *p, int nOp, VdbeOpList const *aOp, int iLineno){
62737 int addr;
62738 assert( p->magic==VDBE_MAGIC_INIT );
62739 if( p->nOp + nOp > p->pParse->nOpAlloc && growOpArray(p) ){
62740 return 0;
62741 }
62742 addr = p->nOp;
62743 if( ALWAYS(nOp>0) ){
62744 int i;
@@ -62919,11 +62950,11 @@
62919
62920 /*
62921 ** Change the opcode at addr into OP_Noop
62922 */
62923 SQLITE_PRIVATE void sqlite3VdbeChangeToNoop(Vdbe *p, int addr){
62924 if( p->aOp ){
62925 VdbeOp *pOp = &p->aOp[addr];
62926 sqlite3 *db = p->db;
62927 freeP4(db, pOp->p4type, pOp->p4.p);
62928 memset(pOp, 0, sizeof(pOp[0]));
62929 pOp->opcode = OP_Noop;
@@ -77439,11 +77470,15 @@
77439 }
77440 }else{
77441 /* EVIDENCE-OF: R-61304-29449 The unlikely(X) function is equivalent to
77442 ** likelihood(X, 0.0625).
77443 ** EVIDENCE-OF: R-01283-11636 The unlikely(X) function is short-hand for
77444 ** likelihood(X,0.0625). */
 
 
 
 
77445 /* TUNING: unlikely() probability is 0.0625. likely() is 0.9375 */
77446 pExpr->iTable = pDef->zName[0]=='u' ? 62 : 938;
77447 }
77448 }
77449 }
@@ -96859,10 +96894,13 @@
96859 goto exec_out;
96860 }
96861 }
96862 }
96863 if( xCallback(pArg, nCol, azVals, azCols) ){
 
 
 
96864 rc = SQLITE_ABORT;
96865 sqlite3VdbeFinalize((Vdbe *)pStmt);
96866 pStmt = 0;
96867 sqlite3Error(db, SQLITE_ABORT, 0);
96868 goto exec_out;
@@ -102110,11 +102148,11 @@
102110 VdbeCoverage(v);
102111 }
102112 sqlite3VdbeChangeP4(v, -1, (const char *)pColl, P4_COLLSEQ);
102113 sqlite3VdbeChangeP5(v, SQLITE_NULLEQ);
102114 }
102115 assert( sqlite3VdbeCurrentAddr(v)==iJump );
102116 sqlite3VdbeAddOp3(v, OP_Copy, regResult, regPrev, nResultCol-1);
102117 break;
102118 }
102119
102120 case WHERE_DISTINCT_UNIQUE: {
@@ -122944,10 +122982,12 @@
122944 /*
122945 ** Close an existing SQLite database
122946 */
122947 static int sqlite3Close(sqlite3 *db, int forceZombie){
122948 if( !db ){
 
 
122949 return SQLITE_OK;
122950 }
122951 if( !sqlite3SafetyCheckSickOrOk(db) ){
122952 return SQLITE_MISUSE_BKPT;
122953 }
@@ -124192,11 +124232,11 @@
124192 SQLITE_MAX_COMPOUND_SELECT,
124193 SQLITE_MAX_VDBE_OP,
124194 SQLITE_MAX_FUNCTION_ARG,
124195 SQLITE_MAX_ATTACHED,
124196 SQLITE_MAX_LIKE_PATTERN_LENGTH,
124197 SQLITE_MAX_VARIABLE_NUMBER,
124198 SQLITE_MAX_TRIGGER_DEPTH,
124199 };
124200
124201 /*
124202 ** Make sure the hard limits are set to reasonable values
@@ -144154,11 +144194,11 @@
144154 int *piEnd, /* OUT: Ending offset of token */
144155 int *piPos /* OUT: Position integer of token */
144156 ){
144157 unicode_cursor *pCsr = (unicode_cursor *)pC;
144158 unicode_tokenizer *p = ((unicode_tokenizer *)pCsr->base.pTokenizer);
144159 int iCode;
144160 char *zOut;
144161 const unsigned char *z = &pCsr->aInput[pCsr->iOff];
144162 const unsigned char *zStart = z;
144163 const unsigned char *zEnd;
144164 const unsigned char *zTerm = &pCsr->aInput[pCsr->nInput];
144165
--- src/sqlite3.c
+++ src/sqlite3.c
@@ -222,11 +222,11 @@
222 ** [sqlite3_libversion_number()], [sqlite3_sourceid()],
223 ** [sqlite_version()] and [sqlite_source_id()].
224 */
225 #define SQLITE_VERSION "3.8.6"
226 #define SQLITE_VERSION_NUMBER 3008006
227 #define SQLITE_SOURCE_ID "2014-08-12 16:13:37 6715991296886c2a02b9a285a1e61189ad1f79c0"
228
229 /*
230 ** CAPI3REF: Run-Time Library Version Numbers
231 ** KEYWORDS: sqlite3_version, sqlite3_sourceid
232 **
@@ -390,11 +390,11 @@
390 **
391 ** ^If the database connection is associated with unfinalized prepared
392 ** statements or unfinished sqlite3_backup objects then sqlite3_close()
393 ** will leave the database connection open and return [SQLITE_BUSY].
394 ** ^If sqlite3_close_v2() is called with unfinalized prepared statements
395 ** and/or unfinished sqlite3_backups, then the database connection becomes
396 ** an unusable "zombie" which will automatically be deallocated when the
397 ** last prepared statement is finalized or the last sqlite3_backup is
398 ** finished. The sqlite3_close_v2() interface is intended for use with
399 ** host languages that are garbage collected, and where the order in which
400 ** destructors are called is arbitrary.
@@ -403,11 +403,11 @@
403 ** [sqlite3_blob_close | close] all [BLOB handles], and
404 ** [sqlite3_backup_finish | finish] all [sqlite3_backup] objects associated
405 ** with the [sqlite3] object prior to attempting to close the object. ^If
406 ** sqlite3_close_v2() is called on a [database connection] that still has
407 ** outstanding [prepared statements], [BLOB handles], and/or
408 ** [sqlite3_backup] objects then it returns [SQLITE_OK] and the deallocation
409 ** of resources is deferred until all [prepared statements], [BLOB handles],
410 ** and [sqlite3_backup] objects are also destroyed.
411 **
412 ** ^If an [sqlite3] object is destroyed while a transaction is open,
413 ** the transaction is automatically rolled back.
@@ -25565,16 +25565,16 @@
25565
25566 /*
25567 ** Return TRUE if pFile has been renamed or unlinked since it was first opened.
25568 */
25569 static int fileHasMoved(unixFile *pFile){
25570 #if OS_VXWORKS
25571 return pFile->pInode!=0 && pFile->pId!=pFile->pInode->fileId.pId;
25572 #else
25573 struct stat buf;
25574 return pFile->pInode!=0 &&
25575 (osStat(pFile->zPath, &buf)!=0 || buf.st_ino!=pFile->pInode->fileId.ino);
 
 
 
25576 #endif
25577 }
25578
25579
25580 /*
@@ -32049,22 +32049,18 @@
32049 #ifndef NTDDI_WINBLUE
32050 # define NTDDI_WINBLUE 0x06030000
32051 #endif
32052
32053 /*
32054 ** Check to see if the GetVersionEx[AW] functions are deprecated on the
32055 ** target system. GetVersionEx was first deprecated in Win8.1.
 
 
 
 
32056 */
32057 #ifndef SQLITE_WIN32_GETVERSIONEX
32058 # if defined(NTDDI_VERSION) && NTDDI_VERSION >= NTDDI_WINBLUE
32059 # define SQLITE_WIN32_GETVERSIONEX 0 /* GetVersionEx() is deprecated */
32060 # else
32061 # define SQLITE_WIN32_GETVERSIONEX 1 /* GetVersionEx() is current */
32062 # endif
32063 #endif
32064
32065 /*
32066 ** This constant should already be defined (in the "WinDef.h" SDK file).
@@ -32132,11 +32128,11 @@
32128 /*
32129 ** This macro is used when a local variable is set to a value that is
32130 ** [sometimes] not used by the code (e.g. via conditional compilation).
32131 */
32132 #ifndef UNUSED_VARIABLE_VALUE
32133 # define UNUSED_VARIABLE_VALUE(x) (void)(x)
32134 #endif
32135
32136 /*
32137 ** Returns the character that should be used as the directory separator.
32138 */
@@ -33029,11 +33025,20 @@
33025 /*
33026 ** NOTE: On some sub-platforms, the InterlockedCompareExchange "function"
33027 ** is really just a macro that uses a compiler intrinsic (e.g. x64).
33028 ** So do not try to make this is into a redefinable interface.
33029 */
33030 #if defined(InterlockedCompareExchange)
33031 { "InterlockedCompareExchange", (SYSCALL)0, 0 },
33032
33033 #define osInterlockedCompareExchange InterlockedCompareExchange
33034 #else
33035 { "InterlockedCompareExchange", (SYSCALL)InterlockedCompareExchange, 0 },
33036
33037 #define osInterlockedCompareExchange ((LONG(WINAPI*)(LONG volatile*, \
33038 LONG,LONG))aSyscall[76].pCurrent)
33039 #endif /* defined(InterlockedCompareExchange) */
33040
33041 }; /* End of the overrideable system calls */
33042
33043 /*
33044 ** This is the xSetSystemCall() method of sqlite3_vfs for all of the
@@ -33289,24 +33294,33 @@
33294 /*
33295 ** This function determines if the machine is running a version of Windows
33296 ** based on the NT kernel.
33297 */
33298 SQLITE_API int sqlite3_win32_is_nt(void){
33299 #if defined(SQLITE_WIN32_GETVERSIONEX) && SQLITE_WIN32_GETVERSIONEX
33300 if( osInterlockedCompareExchange(&sqlite3_os_type, 0, 0)==0 ){
33301 #if !SQLITE_OS_WINRT && defined(SQLITE_WIN32_HAS_WIDE) && \
33302 defined(NTDDI_VERSION) && NTDDI_VERSION >= NTDDI_WIN8
33303 OSVERSIONINFOW sInfo;
33304 sInfo.dwOSVersionInfoSize = sizeof(sInfo);
33305 osGetVersionExW(&sInfo);
33306 osInterlockedCompareExchange(&sqlite3_os_type,
33307 (sInfo.dwPlatformId == VER_PLATFORM_WIN32_NT) ? 2 : 1, 0);
33308 #elif defined(SQLITE_WIN32_HAS_ANSI)
33309 OSVERSIONINFOA sInfo;
33310 sInfo.dwOSVersionInfoSize = sizeof(sInfo);
33311 osGetVersionExA(&sInfo);
 
33312 osInterlockedCompareExchange(&sqlite3_os_type,
33313 (sInfo.dwPlatformId == VER_PLATFORM_WIN32_NT) ? 2 : 1, 0);
33314 #endif
33315 }
33316 return osInterlockedCompareExchange(&sqlite3_os_type, 2, 2)==2;
33317 #elif SQLITE_TEST
33318 return osInterlockedCompareExchange(&sqlite3_os_type, 2, 2)==2;
33319 #else
33320 return 1;
33321 #endif
33322 }
33323
33324 #ifdef SQLITE_WIN32_MALLOC
33325 /*
33326 ** Allocate nBytes of memory.
@@ -37459,11 +37473,11 @@
37473 };
37474 #endif
37475
37476 /* Double-check that the aSyscall[] array has been constructed
37477 ** correctly. See ticket [bb3a86e890c8e96ab] */
37478 assert( ArraySize(aSyscall)==77 );
37479
37480 /* get memory map allocation granularity */
37481 memset(&winSysInfo, 0, sizeof(SYSTEM_INFO));
37482 #if SQLITE_OS_WINRT
37483 osGetNativeSystemInfo(&winSysInfo);
@@ -62277,22 +62291,39 @@
62291 pB->zSql = zTmp;
62292 pB->isPrepareV2 = pA->isPrepareV2;
62293 }
62294
62295 /*
62296 ** Resize the Vdbe.aOp array so that it is at least nOp elements larger
62297 ** than its current size. nOp is guaranteed to be less than or equal
62298 ** to 1024/sizeof(Op).
62299 **
62300 ** If an out-of-memory error occurs while resizing the array, return
62301 ** SQLITE_NOMEM. In this case Vdbe.aOp and Parse.nOpAlloc remain
62302 ** unchanged (this is so that any opcodes already allocated can be
62303 ** correctly deallocated along with the rest of the Vdbe).
62304 */
62305 static int growOpArray(Vdbe *v, int nOp){
62306 VdbeOp *pNew;
62307 Parse *p = v->pParse;
62308
62309 /* The SQLITE_TEST_REALLOC_STRESS compile-time option is designed to force
62310 ** more frequent reallocs and hence provide more opportunities for
62311 ** simulated OOM faults. SQLITE_TEST_REALLOC_STRESS is generally used
62312 ** during testing only. With SQLITE_TEST_REALLOC_STRESS grow the op array
62313 ** by the minimum* amount required until the size reaches 512. Normal
62314 ** operation (without SQLITE_TEST_REALLOC_STRESS) is to double the current
62315 ** size of the op array or add 1KB of space, whichever is smaller. */
62316 #ifdef SQLITE_TEST_REALLOC_STRESS
62317 int nNew = (p->nOpAlloc>=512 ? p->nOpAlloc*2 : p->nOpAlloc+nOp);
62318 #else
62319 int nNew = (p->nOpAlloc ? p->nOpAlloc*2 : (int)(1024/sizeof(Op)));
62320 UNUSED_PARAMETER(nOp);
62321 #endif
62322
62323 assert( nOp<=(1024/sizeof(Op)) );
62324 assert( nNew>=(p->nOpAlloc+nOp) );
62325 pNew = sqlite3DbRealloc(p->db, v->aOp, nNew*sizeof(Op));
62326 if( pNew ){
62327 p->nOpAlloc = sqlite3DbMallocSize(p->db, pNew)/sizeof(Op);
62328 v->aOp = pNew;
62329 }
@@ -62332,11 +62363,11 @@
62363
62364 i = p->nOp;
62365 assert( p->magic==VDBE_MAGIC_INIT );
62366 assert( op>0 && op<0xff );
62367 if( p->pParse->nOpAlloc<=i ){
62368 if( growOpArray(p, 1) ){
62369 return 1;
62370 }
62371 }
62372 p->nOp++;
62373 pOp = &p->aOp[i];
@@ -62734,11 +62765,11 @@
62765 ** address of the first operation added.
62766 */
62767 SQLITE_PRIVATE int sqlite3VdbeAddOpList(Vdbe *p, int nOp, VdbeOpList const *aOp, int iLineno){
62768 int addr;
62769 assert( p->magic==VDBE_MAGIC_INIT );
62770 if( p->nOp + nOp > p->pParse->nOpAlloc && growOpArray(p, nOp) ){
62771 return 0;
62772 }
62773 addr = p->nOp;
62774 if( ALWAYS(nOp>0) ){
62775 int i;
@@ -62919,11 +62950,11 @@
62950
62951 /*
62952 ** Change the opcode at addr into OP_Noop
62953 */
62954 SQLITE_PRIVATE void sqlite3VdbeChangeToNoop(Vdbe *p, int addr){
62955 if( addr<p->nOp ){
62956 VdbeOp *pOp = &p->aOp[addr];
62957 sqlite3 *db = p->db;
62958 freeP4(db, pOp->p4type, pOp->p4.p);
62959 memset(pOp, 0, sizeof(pOp[0]));
62960 pOp->opcode = OP_Noop;
@@ -77439,11 +77470,15 @@
77470 }
77471 }else{
77472 /* EVIDENCE-OF: R-61304-29449 The unlikely(X) function is equivalent to
77473 ** likelihood(X, 0.0625).
77474 ** EVIDENCE-OF: R-01283-11636 The unlikely(X) function is short-hand for
77475 ** likelihood(X,0.0625).
77476 ** EVIDENCE-OF: R-36850-34127 The likely(X) function is short-hand for
77477 ** likelihood(X,0.9375).
77478 ** EVIDENCE-OF: R-53436-40973 The likely(X) function is equivalent to
77479 ** likelihood(X,0.9375). */
77480 /* TUNING: unlikely() probability is 0.0625. likely() is 0.9375 */
77481 pExpr->iTable = pDef->zName[0]=='u' ? 62 : 938;
77482 }
77483 }
77484 }
@@ -96859,10 +96894,13 @@
96894 goto exec_out;
96895 }
96896 }
96897 }
96898 if( xCallback(pArg, nCol, azVals, azCols) ){
96899 /* EVIDENCE-OF: R-38229-40159 If the callback function to
96900 ** sqlite3_exec() returns non-zero, then sqlite3_exec() will
96901 ** return SQLITE_ABORT. */
96902 rc = SQLITE_ABORT;
96903 sqlite3VdbeFinalize((Vdbe *)pStmt);
96904 pStmt = 0;
96905 sqlite3Error(db, SQLITE_ABORT, 0);
96906 goto exec_out;
@@ -102110,11 +102148,11 @@
102148 VdbeCoverage(v);
102149 }
102150 sqlite3VdbeChangeP4(v, -1, (const char *)pColl, P4_COLLSEQ);
102151 sqlite3VdbeChangeP5(v, SQLITE_NULLEQ);
102152 }
102153 assert( sqlite3VdbeCurrentAddr(v)==iJump || pParse->db->mallocFailed );
102154 sqlite3VdbeAddOp3(v, OP_Copy, regResult, regPrev, nResultCol-1);
102155 break;
102156 }
102157
102158 case WHERE_DISTINCT_UNIQUE: {
@@ -122944,10 +122982,12 @@
122982 /*
122983 ** Close an existing SQLite database
122984 */
122985 static int sqlite3Close(sqlite3 *db, int forceZombie){
122986 if( !db ){
122987 /* EVIDENCE-OF: R-63257-11740 Calling sqlite3_close() or
122988 ** sqlite3_close_v2() with a NULL pointer argument is a harmless no-op. */
122989 return SQLITE_OK;
122990 }
122991 if( !sqlite3SafetyCheckSickOrOk(db) ){
122992 return SQLITE_MISUSE_BKPT;
122993 }
@@ -124192,11 +124232,11 @@
124232 SQLITE_MAX_COMPOUND_SELECT,
124233 SQLITE_MAX_VDBE_OP,
124234 SQLITE_MAX_FUNCTION_ARG,
124235 SQLITE_MAX_ATTACHED,
124236 SQLITE_MAX_LIKE_PATTERN_LENGTH,
124237 SQLITE_MAX_VARIABLE_NUMBER, /* IMP: R-38091-32352 */
124238 SQLITE_MAX_TRIGGER_DEPTH,
124239 };
124240
124241 /*
124242 ** Make sure the hard limits are set to reasonable values
@@ -144154,11 +144194,11 @@
144194 int *piEnd, /* OUT: Ending offset of token */
144195 int *piPos /* OUT: Position integer of token */
144196 ){
144197 unicode_cursor *pCsr = (unicode_cursor *)pC;
144198 unicode_tokenizer *p = ((unicode_tokenizer *)pCsr->base.pTokenizer);
144199 int iCode = 0;
144200 char *zOut;
144201 const unsigned char *z = &pCsr->aInput[pCsr->iOff];
144202 const unsigned char *zStart = z;
144203 const unsigned char *zEnd;
144204 const unsigned char *zTerm = &pCsr->aInput[pCsr->nInput];
144205
+3 -3
--- 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.6"
111111
#define SQLITE_VERSION_NUMBER 3008006
112
-#define SQLITE_SOURCE_ID "2014-08-11 13:53:30 de27c742c0dcda20b51339598bf6094a8dcf5fb9"
112
+#define SQLITE_SOURCE_ID "2014-08-12 16:13:37 6715991296886c2a02b9a285a1e61189ad1f79c0"
113113
114114
/*
115115
** CAPI3REF: Run-Time Library Version Numbers
116116
** KEYWORDS: sqlite3_version, sqlite3_sourceid
117117
**
@@ -275,11 +275,11 @@
275275
**
276276
** ^If the database connection is associated with unfinalized prepared
277277
** statements or unfinished sqlite3_backup objects then sqlite3_close()
278278
** will leave the database connection open and return [SQLITE_BUSY].
279279
** ^If sqlite3_close_v2() is called with unfinalized prepared statements
280
-** and unfinished sqlite3_backups, then the database connection becomes
280
+** and/or unfinished sqlite3_backups, then the database connection becomes
281281
** an unusable "zombie" which will automatically be deallocated when the
282282
** last prepared statement is finalized or the last sqlite3_backup is
283283
** finished. The sqlite3_close_v2() interface is intended for use with
284284
** host languages that are garbage collected, and where the order in which
285285
** destructors are called is arbitrary.
@@ -288,11 +288,11 @@
288288
** [sqlite3_blob_close | close] all [BLOB handles], and
289289
** [sqlite3_backup_finish | finish] all [sqlite3_backup] objects associated
290290
** with the [sqlite3] object prior to attempting to close the object. ^If
291291
** sqlite3_close_v2() is called on a [database connection] that still has
292292
** outstanding [prepared statements], [BLOB handles], and/or
293
-** [sqlite3_backup] objects then it returns [SQLITE_OK] but the deallocation
293
+** [sqlite3_backup] objects then it returns [SQLITE_OK] and the deallocation
294294
** of resources is deferred until all [prepared statements], [BLOB handles],
295295
** and [sqlite3_backup] objects are also destroyed.
296296
**
297297
** ^If an [sqlite3] object is destroyed while a transaction is open,
298298
** the transaction is automatically rolled back.
299299
--- 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.6"
111 #define SQLITE_VERSION_NUMBER 3008006
112 #define SQLITE_SOURCE_ID "2014-08-11 13:53:30 de27c742c0dcda20b51339598bf6094a8dcf5fb9"
113
114 /*
115 ** CAPI3REF: Run-Time Library Version Numbers
116 ** KEYWORDS: sqlite3_version, sqlite3_sourceid
117 **
@@ -275,11 +275,11 @@
275 **
276 ** ^If the database connection is associated with unfinalized prepared
277 ** statements or unfinished sqlite3_backup objects then sqlite3_close()
278 ** will leave the database connection open and return [SQLITE_BUSY].
279 ** ^If sqlite3_close_v2() is called with unfinalized prepared statements
280 ** and unfinished sqlite3_backups, then the database connection becomes
281 ** an unusable "zombie" which will automatically be deallocated when the
282 ** last prepared statement is finalized or the last sqlite3_backup is
283 ** finished. The sqlite3_close_v2() interface is intended for use with
284 ** host languages that are garbage collected, and where the order in which
285 ** destructors are called is arbitrary.
@@ -288,11 +288,11 @@
288 ** [sqlite3_blob_close | close] all [BLOB handles], and
289 ** [sqlite3_backup_finish | finish] all [sqlite3_backup] objects associated
290 ** with the [sqlite3] object prior to attempting to close the object. ^If
291 ** sqlite3_close_v2() is called on a [database connection] that still has
292 ** outstanding [prepared statements], [BLOB handles], and/or
293 ** [sqlite3_backup] objects then it returns [SQLITE_OK] but the deallocation
294 ** of resources is deferred until all [prepared statements], [BLOB handles],
295 ** and [sqlite3_backup] objects are also destroyed.
296 **
297 ** ^If an [sqlite3] object is destroyed while a transaction is open,
298 ** the transaction is automatically rolled back.
299
--- 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.6"
111 #define SQLITE_VERSION_NUMBER 3008006
112 #define SQLITE_SOURCE_ID "2014-08-12 16:13:37 6715991296886c2a02b9a285a1e61189ad1f79c0"
113
114 /*
115 ** CAPI3REF: Run-Time Library Version Numbers
116 ** KEYWORDS: sqlite3_version, sqlite3_sourceid
117 **
@@ -275,11 +275,11 @@
275 **
276 ** ^If the database connection is associated with unfinalized prepared
277 ** statements or unfinished sqlite3_backup objects then sqlite3_close()
278 ** will leave the database connection open and return [SQLITE_BUSY].
279 ** ^If sqlite3_close_v2() is called with unfinalized prepared statements
280 ** and/or unfinished sqlite3_backups, then the database connection becomes
281 ** an unusable "zombie" which will automatically be deallocated when the
282 ** last prepared statement is finalized or the last sqlite3_backup is
283 ** finished. The sqlite3_close_v2() interface is intended for use with
284 ** host languages that are garbage collected, and where the order in which
285 ** destructors are called is arbitrary.
@@ -288,11 +288,11 @@
288 ** [sqlite3_blob_close | close] all [BLOB handles], and
289 ** [sqlite3_backup_finish | finish] all [sqlite3_backup] objects associated
290 ** with the [sqlite3] object prior to attempting to close the object. ^If
291 ** sqlite3_close_v2() is called on a [database connection] that still has
292 ** outstanding [prepared statements], [BLOB handles], and/or
293 ** [sqlite3_backup] objects then it returns [SQLITE_OK] and the deallocation
294 ** of resources is deferred until all [prepared statements], [BLOB handles],
295 ** and [sqlite3_backup] objects are also destroyed.
296 **
297 ** ^If an [sqlite3] object is destroyed while a transaction is open,
298 ** the transaction is automatically rolled back.
299

Keyboard Shortcuts

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