Fossil SCM

Update the built-in SQLite to an 3.8.12 alpha version that fixes the ONEPASS optimization bug.

drh 2015-09-28 14:53 trunk
Commit 292659684c25831b8a088eeb9b9f16d269981a74
3 files changed +1 -1 +45 -13 +2 -2
+1 -1
--- src/shell.c
+++ src/shell.c
@@ -4617,11 +4617,11 @@
46174617
return 1;
46184618
#endif
46194619
}
46204620
data.out = stdout;
46214621
4622
-#ifdef SQLITE_ENABLE_JSON1
4622
+#ifdef SQLITE_SHELL_JSON1
46234623
{
46244624
extern int sqlite3_json_init(sqlite3*);
46254625
sqlite3_auto_extension((void(*)(void))sqlite3_json_init);
46264626
}
46274627
#endif
46284628
--- src/shell.c
+++ src/shell.c
@@ -4617,11 +4617,11 @@
4617 return 1;
4618 #endif
4619 }
4620 data.out = stdout;
4621
4622 #ifdef SQLITE_ENABLE_JSON1
4623 {
4624 extern int sqlite3_json_init(sqlite3*);
4625 sqlite3_auto_extension((void(*)(void))sqlite3_json_init);
4626 }
4627 #endif
4628
--- src/shell.c
+++ src/shell.c
@@ -4617,11 +4617,11 @@
4617 return 1;
4618 #endif
4619 }
4620 data.out = stdout;
4621
4622 #ifdef SQLITE_SHELL_JSON1
4623 {
4624 extern int sqlite3_json_init(sqlite3*);
4625 sqlite3_auto_extension((void(*)(void))sqlite3_json_init);
4626 }
4627 #endif
4628
+45 -13
--- src/sqlite3.c
+++ src/sqlite3.c
@@ -325,11 +325,11 @@
325325
** [sqlite3_libversion_number()], [sqlite3_sourceid()],
326326
** [sqlite_version()] and [sqlite_source_id()].
327327
*/
328328
#define SQLITE_VERSION "3.8.12"
329329
#define SQLITE_VERSION_NUMBER 3008012
330
-#define SQLITE_SOURCE_ID "2015-09-24 18:47:59 668fc1ebaf426f9eed3ed7865e41f1023dafebfb"
330
+#define SQLITE_SOURCE_ID "2015-09-28 14:40:20 9d057f52217e7ef9c3f3eb84117abe3365503f44"
331331
332332
/*
333333
** CAPI3REF: Run-Time Library Version Numbers
334334
** KEYWORDS: sqlite3_version, sqlite3_sourceid
335335
**
@@ -4572,11 +4572,11 @@
45724572
SQLITE_API const void *SQLITE_STDCALL sqlite3_value_text16be(sqlite3_value*);
45734573
SQLITE_API int SQLITE_STDCALL sqlite3_value_type(sqlite3_value*);
45744574
SQLITE_API int SQLITE_STDCALL sqlite3_value_numeric_type(sqlite3_value*);
45754575
45764576
/*
4577
-** CAPI3REF: Obtaining SQL Values
4577
+** CAPI3REF: Finding The Subtype Of SQL Values
45784578
** METHOD: sqlite3_value
45794579
**
45804580
** The sqlite3_value_subtype(V) function returns the subtype for
45814581
** an [application-defined SQL function] argument V. The subtype
45824582
** information can be used to pass a limited amount of context from
@@ -19781,11 +19781,13 @@
1978119781
return p->nRef==0 || pthread_equal(p->owner, pthread_self())==0;
1978219782
}
1978319783
#endif
1978419784
1978519785
/*
19786
-** Try to provide a memory barrier operation, needed for initialization only.
19786
+** Try to provide a memory barrier operation, needed for initialization
19787
+** and also for the implementation of xShmBarrier in the VFS in cases
19788
+** where SQLite is compiled without mutexes.
1978719789
*/
1978819790
SQLITE_PRIVATE void sqlite3MemoryBarrier(void){
1978919791
#if defined(SQLITE_MEMORY_BARRIER)
1979019792
SQLITE_MEMORY_BARRIER;
1979119793
#elif defined(__GNUC__) && GCC_VERSION>=4001000
@@ -20454,11 +20456,13 @@
2045420456
return winMutexNotheld2(p, tid);
2045520457
}
2045620458
#endif
2045720459
2045820460
/*
20459
-** Try to provide a memory barrier operation, needed for initialization only.
20461
+** Try to provide a memory barrier operation, needed for initialization
20462
+** and also for the xShmBarrier method of the VFS in cases when SQLite is
20463
+** compiled without mutexes (SQLITE_THREADSAFE=0).
2046020464
*/
2046120465
SQLITE_PRIVATE void sqlite3MemoryBarrier(void){
2046220466
#if defined(SQLITE_MEMORY_BARRIER)
2046320467
SQLITE_MEMORY_BARRIER;
2046420468
#elif defined(__GNUC__)
@@ -23266,10 +23270,14 @@
2326623270
p = sqlite3Malloc(sizeof(*p));
2326723271
if( p==0 ) return SQLITE_NOMEM;
2326823272
memset(p, 0, sizeof(*p));
2326923273
p->xTask = xTask;
2327023274
p->pIn = pIn;
23275
+ /* If the SQLITE_TESTCTRL_FAULT_INSTALL callback is registered to a
23276
+ ** function that returns SQLITE_ERROR when passed the argument 200, that
23277
+ ** forces worker threads to run sequentially and deterministically
23278
+ ** for testing purposes. */
2327123279
if( sqlite3FaultSim(200) ){
2327223280
rc = 1;
2327323281
}else{
2327423282
rc = pthread_create(&p->tid, 0, xTask, pIn);
2327523283
}
@@ -23350,11 +23358,16 @@
2335023358
assert( ppThread!=0 );
2335123359
assert( xTask!=0 );
2335223360
*ppThread = 0;
2335323361
p = sqlite3Malloc(sizeof(*p));
2335423362
if( p==0 ) return SQLITE_NOMEM;
23355
- if( sqlite3GlobalConfig.bCoreMutex==0 ){
23363
+ /* If the SQLITE_TESTCTRL_FAULT_INSTALL callback is registered to a
23364
+ ** function that returns SQLITE_ERROR when passed the argument 200, that
23365
+ ** forces worker threads to run sequentially and deterministically
23366
+ ** (via the sqlite3FaultSim() term of the conditional) for testing
23367
+ ** purposes. */
23368
+ if( sqlite3GlobalConfig.bCoreMutex==0 || sqlite3FaultSim(200) ){
2335623369
memset(p, 0, sizeof(*p));
2335723370
}else{
2335823371
p->xTask = xTask;
2335923372
p->pIn = pIn;
2336023373
p->tid = (void*)_beginthreadex(0, 0, sqlite3ThreadProc, p, 0, &p->id);
@@ -23378,11 +23391,11 @@
2337823391
BOOL bRc;
2337923392
2338023393
assert( ppOut!=0 );
2338123394
if( NEVER(p==0) ) return SQLITE_NOMEM;
2338223395
if( p->xTask==0 ){
23383
- assert( p->id==GetCurrentThreadId() );
23396
+ /* assert( p->id==GetCurrentThreadId() ); */
2338423397
rc = WAIT_OBJECT_0;
2338523398
assert( p->tid==0 );
2338623399
}else{
2338723400
assert( p->id!=0 && p->id!=GetCurrentThreadId() );
2338823401
rc = sqlite3Win32Wait((HANDLE)p->tid);
@@ -94256,12 +94269,11 @@
9425694269
int iDb;
9425794270
sqlite3 *db = pParse->db;
9425894271
9425994272
if( pParse->nVar>0 ){
9426094273
sqlite3ErrorMsg(pParse, "parameters are not allowed in views");
94261
- sqlite3SelectDelete(db, pSelect);
94262
- return;
94274
+ goto create_view_fail;
9426394275
}
9426494276
sqlite3StartTable(pParse, pName1, pName2, isTemp, 1, 0, noErr);
9426594277
p = pParse->pNewTable;
9426694278
if( p==0 || pParse->nErr ) goto create_view_fail;
9426794279
sqlite3TwoPartName(pParse, pName1, pName2, &pName);
@@ -106729,12 +106741,12 @@
106729106741
int uniqOk = sqlite3VdbeMakeLabel(v);
106730106742
int jmp6;
106731106743
int kk;
106732106744
for(kk=0; kk<pIdx->nKeyCol; kk++){
106733106745
int iCol = pIdx->aiColumn[kk];
106734
- assert( iCol>=0 && iCol<pTab->nCol );
106735
- if( pTab->aCol[iCol].notNull ) continue;
106746
+ assert( iCol!=(-1) && iCol<pTab->nCol );
106747
+ if( iCol>=0 && pTab->aCol[iCol].notNull ) continue;
106736106748
sqlite3VdbeAddOp2(v, OP_IsNull, r1+kk, uniqOk);
106737106749
VdbeCoverage(v);
106738106750
}
106739106751
jmp6 = sqlite3VdbeAddOp1(v, OP_Next, iIdxCur+j); VdbeCoverage(v);
106740106752
sqlite3VdbeGoto(v, uniqOk);
@@ -112889,11 +112901,21 @@
112889112901
#if !defined(SQLITE_OMIT_SUBQUERY) || !defined(SQLITE_OMIT_VIEW)
112890112902
for(i=0; !p->pPrior && i<pTabList->nSrc; i++){
112891112903
struct SrcList_item *pItem = &pTabList->a[i];
112892112904
Select *pSub = pItem->pSelect;
112893112905
int isAggSub;
112906
+ Table *pTab = pItem->pTab;
112894112907
if( pSub==0 ) continue;
112908
+
112909
+ /* Catch mismatch in the declared columns of a view and the number of
112910
+ ** columns in the SELECT on the RHS */
112911
+ if( pTab->nCol!=pSub->pEList->nExpr ){
112912
+ sqlite3ErrorMsg(pParse, "expected %d columns for '%s' but got %d",
112913
+ pTab->nCol, pTab->zName, pSub->pEList->nExpr);
112914
+ goto select_end;
112915
+ }
112916
+
112895112917
isAggSub = (pSub->selFlags & SF_Aggregate)!=0;
112896112918
if( flattenSubquery(pParse, p, i, isAgg, isAggSub) ){
112897112919
/* This subquery can be absorbed into its parent. */
112898112920
if( isAggSub ){
112899112921
isAgg = 1;
@@ -121896,10 +121918,11 @@
121896121918
#ifdef SQLITE_ENABLE_STAT3_OR_STAT4
121897121919
/*
121898121920
** Return the affinity for a single column of an index.
121899121921
*/
121900121922
static char sqlite3IndexColumnAffinity(sqlite3 *db, Index *pIdx, int iCol){
121923
+ assert( iCol>=0 && iCol<pIdx->nColumn );
121901121924
if( !pIdx->zColAff ){
121902121925
if( sqlite3IndexAffinityStr(db, pIdx)==0 ) return SQLITE_AFF_BLOB;
121903121926
}
121904121927
return pIdx->zColAff[iCol];
121905121928
}
@@ -121953,12 +121976,11 @@
121953121976
int nEq = pLoop->u.btree.nEq;
121954121977
sqlite3 *db = pParse->db;
121955121978
int nLower = -1;
121956121979
int nUpper = p->nSample+1;
121957121980
int rc = SQLITE_OK;
121958
- int iCol = p->aiColumn[nEq];
121959
- u8 aff = sqlite3IndexColumnAffinity(db, p, iCol);
121981
+ u8 aff = sqlite3IndexColumnAffinity(db, p, nEq);
121960121982
CollSeq *pColl;
121961121983
121962121984
sqlite3_value *p1 = 0; /* Value extracted from pLower */
121963121985
sqlite3_value *p2 = 0; /* Value extracted from pUpper */
121964121986
sqlite3_value *pVal = 0; /* Value extracted from record */
@@ -125266,11 +125288,14 @@
125266125288
if( pLoop->wsFlags & (WHERE_INDEXED|WHERE_IDX_ONLY) ){
125267125289
pIdx = pLoop->u.btree.pIndex;
125268125290
}else if( pLoop->wsFlags & WHERE_MULTI_OR ){
125269125291
pIdx = pLevel->u.pCovidx;
125270125292
}
125271
- if( pIdx && !db->mallocFailed ){
125293
+ if( pIdx
125294
+ && (pWInfo->eOnePass==ONEPASS_OFF || !HasRowid(pIdx->pTable))
125295
+ && !db->mallocFailed
125296
+ ){
125272125297
last = sqlite3VdbeCurrentAddr(v);
125273125298
k = pLevel->addrBody;
125274125299
pOp = sqlite3VdbeGetOp(v, k);
125275125300
for(; k<last; k++, pOp++){
125276125301
if( pOp->p1!=pLevel->iTabCur ) continue;
@@ -133020,10 +133045,17 @@
133020133045
#ifdef SQLITE_ENABLE_DBSTAT_VTAB
133021133046
if( !db->mallocFailed && rc==SQLITE_OK){
133022133047
rc = sqlite3DbstatRegister(db);
133023133048
}
133024133049
#endif
133050
+
133051
+#ifdef SQLITE_ENABLE_JSON1
133052
+ if( !db->mallocFailed && rc==SQLITE_OK){
133053
+ extern int sqlite3Json1Init(sqlite3*);
133054
+ rc = sqlite3Json1Init(db);
133055
+ }
133056
+#endif
133025133057
133026133058
/* -DSQLITE_DEFAULT_LOCKING_MODE=1 makes EXCLUSIVE the default locking
133027133059
** mode. -DSQLITE_DEFAULT_LOCKING_MODE=0 make NORMAL the default locking
133028133060
** mode. Doing nothing at all also makes NORMAL the default.
133029133061
*/
133030133062
--- src/sqlite3.c
+++ src/sqlite3.c
@@ -325,11 +325,11 @@
325 ** [sqlite3_libversion_number()], [sqlite3_sourceid()],
326 ** [sqlite_version()] and [sqlite_source_id()].
327 */
328 #define SQLITE_VERSION "3.8.12"
329 #define SQLITE_VERSION_NUMBER 3008012
330 #define SQLITE_SOURCE_ID "2015-09-24 18:47:59 668fc1ebaf426f9eed3ed7865e41f1023dafebfb"
331
332 /*
333 ** CAPI3REF: Run-Time Library Version Numbers
334 ** KEYWORDS: sqlite3_version, sqlite3_sourceid
335 **
@@ -4572,11 +4572,11 @@
4572 SQLITE_API const void *SQLITE_STDCALL sqlite3_value_text16be(sqlite3_value*);
4573 SQLITE_API int SQLITE_STDCALL sqlite3_value_type(sqlite3_value*);
4574 SQLITE_API int SQLITE_STDCALL sqlite3_value_numeric_type(sqlite3_value*);
4575
4576 /*
4577 ** CAPI3REF: Obtaining SQL Values
4578 ** METHOD: sqlite3_value
4579 **
4580 ** The sqlite3_value_subtype(V) function returns the subtype for
4581 ** an [application-defined SQL function] argument V. The subtype
4582 ** information can be used to pass a limited amount of context from
@@ -19781,11 +19781,13 @@
19781 return p->nRef==0 || pthread_equal(p->owner, pthread_self())==0;
19782 }
19783 #endif
19784
19785 /*
19786 ** Try to provide a memory barrier operation, needed for initialization only.
 
 
19787 */
19788 SQLITE_PRIVATE void sqlite3MemoryBarrier(void){
19789 #if defined(SQLITE_MEMORY_BARRIER)
19790 SQLITE_MEMORY_BARRIER;
19791 #elif defined(__GNUC__) && GCC_VERSION>=4001000
@@ -20454,11 +20456,13 @@
20454 return winMutexNotheld2(p, tid);
20455 }
20456 #endif
20457
20458 /*
20459 ** Try to provide a memory barrier operation, needed for initialization only.
 
 
20460 */
20461 SQLITE_PRIVATE void sqlite3MemoryBarrier(void){
20462 #if defined(SQLITE_MEMORY_BARRIER)
20463 SQLITE_MEMORY_BARRIER;
20464 #elif defined(__GNUC__)
@@ -23266,10 +23270,14 @@
23266 p = sqlite3Malloc(sizeof(*p));
23267 if( p==0 ) return SQLITE_NOMEM;
23268 memset(p, 0, sizeof(*p));
23269 p->xTask = xTask;
23270 p->pIn = pIn;
 
 
 
 
23271 if( sqlite3FaultSim(200) ){
23272 rc = 1;
23273 }else{
23274 rc = pthread_create(&p->tid, 0, xTask, pIn);
23275 }
@@ -23350,11 +23358,16 @@
23350 assert( ppThread!=0 );
23351 assert( xTask!=0 );
23352 *ppThread = 0;
23353 p = sqlite3Malloc(sizeof(*p));
23354 if( p==0 ) return SQLITE_NOMEM;
23355 if( sqlite3GlobalConfig.bCoreMutex==0 ){
 
 
 
 
 
23356 memset(p, 0, sizeof(*p));
23357 }else{
23358 p->xTask = xTask;
23359 p->pIn = pIn;
23360 p->tid = (void*)_beginthreadex(0, 0, sqlite3ThreadProc, p, 0, &p->id);
@@ -23378,11 +23391,11 @@
23378 BOOL bRc;
23379
23380 assert( ppOut!=0 );
23381 if( NEVER(p==0) ) return SQLITE_NOMEM;
23382 if( p->xTask==0 ){
23383 assert( p->id==GetCurrentThreadId() );
23384 rc = WAIT_OBJECT_0;
23385 assert( p->tid==0 );
23386 }else{
23387 assert( p->id!=0 && p->id!=GetCurrentThreadId() );
23388 rc = sqlite3Win32Wait((HANDLE)p->tid);
@@ -94256,12 +94269,11 @@
94256 int iDb;
94257 sqlite3 *db = pParse->db;
94258
94259 if( pParse->nVar>0 ){
94260 sqlite3ErrorMsg(pParse, "parameters are not allowed in views");
94261 sqlite3SelectDelete(db, pSelect);
94262 return;
94263 }
94264 sqlite3StartTable(pParse, pName1, pName2, isTemp, 1, 0, noErr);
94265 p = pParse->pNewTable;
94266 if( p==0 || pParse->nErr ) goto create_view_fail;
94267 sqlite3TwoPartName(pParse, pName1, pName2, &pName);
@@ -106729,12 +106741,12 @@
106729 int uniqOk = sqlite3VdbeMakeLabel(v);
106730 int jmp6;
106731 int kk;
106732 for(kk=0; kk<pIdx->nKeyCol; kk++){
106733 int iCol = pIdx->aiColumn[kk];
106734 assert( iCol>=0 && iCol<pTab->nCol );
106735 if( pTab->aCol[iCol].notNull ) continue;
106736 sqlite3VdbeAddOp2(v, OP_IsNull, r1+kk, uniqOk);
106737 VdbeCoverage(v);
106738 }
106739 jmp6 = sqlite3VdbeAddOp1(v, OP_Next, iIdxCur+j); VdbeCoverage(v);
106740 sqlite3VdbeGoto(v, uniqOk);
@@ -112889,11 +112901,21 @@
112889 #if !defined(SQLITE_OMIT_SUBQUERY) || !defined(SQLITE_OMIT_VIEW)
112890 for(i=0; !p->pPrior && i<pTabList->nSrc; i++){
112891 struct SrcList_item *pItem = &pTabList->a[i];
112892 Select *pSub = pItem->pSelect;
112893 int isAggSub;
 
112894 if( pSub==0 ) continue;
 
 
 
 
 
 
 
 
 
112895 isAggSub = (pSub->selFlags & SF_Aggregate)!=0;
112896 if( flattenSubquery(pParse, p, i, isAgg, isAggSub) ){
112897 /* This subquery can be absorbed into its parent. */
112898 if( isAggSub ){
112899 isAgg = 1;
@@ -121896,10 +121918,11 @@
121896 #ifdef SQLITE_ENABLE_STAT3_OR_STAT4
121897 /*
121898 ** Return the affinity for a single column of an index.
121899 */
121900 static char sqlite3IndexColumnAffinity(sqlite3 *db, Index *pIdx, int iCol){
 
121901 if( !pIdx->zColAff ){
121902 if( sqlite3IndexAffinityStr(db, pIdx)==0 ) return SQLITE_AFF_BLOB;
121903 }
121904 return pIdx->zColAff[iCol];
121905 }
@@ -121953,12 +121976,11 @@
121953 int nEq = pLoop->u.btree.nEq;
121954 sqlite3 *db = pParse->db;
121955 int nLower = -1;
121956 int nUpper = p->nSample+1;
121957 int rc = SQLITE_OK;
121958 int iCol = p->aiColumn[nEq];
121959 u8 aff = sqlite3IndexColumnAffinity(db, p, iCol);
121960 CollSeq *pColl;
121961
121962 sqlite3_value *p1 = 0; /* Value extracted from pLower */
121963 sqlite3_value *p2 = 0; /* Value extracted from pUpper */
121964 sqlite3_value *pVal = 0; /* Value extracted from record */
@@ -125266,11 +125288,14 @@
125266 if( pLoop->wsFlags & (WHERE_INDEXED|WHERE_IDX_ONLY) ){
125267 pIdx = pLoop->u.btree.pIndex;
125268 }else if( pLoop->wsFlags & WHERE_MULTI_OR ){
125269 pIdx = pLevel->u.pCovidx;
125270 }
125271 if( pIdx && !db->mallocFailed ){
 
 
 
125272 last = sqlite3VdbeCurrentAddr(v);
125273 k = pLevel->addrBody;
125274 pOp = sqlite3VdbeGetOp(v, k);
125275 for(; k<last; k++, pOp++){
125276 if( pOp->p1!=pLevel->iTabCur ) continue;
@@ -133020,10 +133045,17 @@
133020 #ifdef SQLITE_ENABLE_DBSTAT_VTAB
133021 if( !db->mallocFailed && rc==SQLITE_OK){
133022 rc = sqlite3DbstatRegister(db);
133023 }
133024 #endif
 
 
 
 
 
 
 
133025
133026 /* -DSQLITE_DEFAULT_LOCKING_MODE=1 makes EXCLUSIVE the default locking
133027 ** mode. -DSQLITE_DEFAULT_LOCKING_MODE=0 make NORMAL the default locking
133028 ** mode. Doing nothing at all also makes NORMAL the default.
133029 */
133030
--- src/sqlite3.c
+++ src/sqlite3.c
@@ -325,11 +325,11 @@
325 ** [sqlite3_libversion_number()], [sqlite3_sourceid()],
326 ** [sqlite_version()] and [sqlite_source_id()].
327 */
328 #define SQLITE_VERSION "3.8.12"
329 #define SQLITE_VERSION_NUMBER 3008012
330 #define SQLITE_SOURCE_ID "2015-09-28 14:40:20 9d057f52217e7ef9c3f3eb84117abe3365503f44"
331
332 /*
333 ** CAPI3REF: Run-Time Library Version Numbers
334 ** KEYWORDS: sqlite3_version, sqlite3_sourceid
335 **
@@ -4572,11 +4572,11 @@
4572 SQLITE_API const void *SQLITE_STDCALL sqlite3_value_text16be(sqlite3_value*);
4573 SQLITE_API int SQLITE_STDCALL sqlite3_value_type(sqlite3_value*);
4574 SQLITE_API int SQLITE_STDCALL sqlite3_value_numeric_type(sqlite3_value*);
4575
4576 /*
4577 ** CAPI3REF: Finding The Subtype Of SQL Values
4578 ** METHOD: sqlite3_value
4579 **
4580 ** The sqlite3_value_subtype(V) function returns the subtype for
4581 ** an [application-defined SQL function] argument V. The subtype
4582 ** information can be used to pass a limited amount of context from
@@ -19781,11 +19781,13 @@
19781 return p->nRef==0 || pthread_equal(p->owner, pthread_self())==0;
19782 }
19783 #endif
19784
19785 /*
19786 ** Try to provide a memory barrier operation, needed for initialization
19787 ** and also for the implementation of xShmBarrier in the VFS in cases
19788 ** where SQLite is compiled without mutexes.
19789 */
19790 SQLITE_PRIVATE void sqlite3MemoryBarrier(void){
19791 #if defined(SQLITE_MEMORY_BARRIER)
19792 SQLITE_MEMORY_BARRIER;
19793 #elif defined(__GNUC__) && GCC_VERSION>=4001000
@@ -20454,11 +20456,13 @@
20456 return winMutexNotheld2(p, tid);
20457 }
20458 #endif
20459
20460 /*
20461 ** Try to provide a memory barrier operation, needed for initialization
20462 ** and also for the xShmBarrier method of the VFS in cases when SQLite is
20463 ** compiled without mutexes (SQLITE_THREADSAFE=0).
20464 */
20465 SQLITE_PRIVATE void sqlite3MemoryBarrier(void){
20466 #if defined(SQLITE_MEMORY_BARRIER)
20467 SQLITE_MEMORY_BARRIER;
20468 #elif defined(__GNUC__)
@@ -23266,10 +23270,14 @@
23270 p = sqlite3Malloc(sizeof(*p));
23271 if( p==0 ) return SQLITE_NOMEM;
23272 memset(p, 0, sizeof(*p));
23273 p->xTask = xTask;
23274 p->pIn = pIn;
23275 /* If the SQLITE_TESTCTRL_FAULT_INSTALL callback is registered to a
23276 ** function that returns SQLITE_ERROR when passed the argument 200, that
23277 ** forces worker threads to run sequentially and deterministically
23278 ** for testing purposes. */
23279 if( sqlite3FaultSim(200) ){
23280 rc = 1;
23281 }else{
23282 rc = pthread_create(&p->tid, 0, xTask, pIn);
23283 }
@@ -23350,11 +23358,16 @@
23358 assert( ppThread!=0 );
23359 assert( xTask!=0 );
23360 *ppThread = 0;
23361 p = sqlite3Malloc(sizeof(*p));
23362 if( p==0 ) return SQLITE_NOMEM;
23363 /* If the SQLITE_TESTCTRL_FAULT_INSTALL callback is registered to a
23364 ** function that returns SQLITE_ERROR when passed the argument 200, that
23365 ** forces worker threads to run sequentially and deterministically
23366 ** (via the sqlite3FaultSim() term of the conditional) for testing
23367 ** purposes. */
23368 if( sqlite3GlobalConfig.bCoreMutex==0 || sqlite3FaultSim(200) ){
23369 memset(p, 0, sizeof(*p));
23370 }else{
23371 p->xTask = xTask;
23372 p->pIn = pIn;
23373 p->tid = (void*)_beginthreadex(0, 0, sqlite3ThreadProc, p, 0, &p->id);
@@ -23378,11 +23391,11 @@
23391 BOOL bRc;
23392
23393 assert( ppOut!=0 );
23394 if( NEVER(p==0) ) return SQLITE_NOMEM;
23395 if( p->xTask==0 ){
23396 /* assert( p->id==GetCurrentThreadId() ); */
23397 rc = WAIT_OBJECT_0;
23398 assert( p->tid==0 );
23399 }else{
23400 assert( p->id!=0 && p->id!=GetCurrentThreadId() );
23401 rc = sqlite3Win32Wait((HANDLE)p->tid);
@@ -94256,12 +94269,11 @@
94269 int iDb;
94270 sqlite3 *db = pParse->db;
94271
94272 if( pParse->nVar>0 ){
94273 sqlite3ErrorMsg(pParse, "parameters are not allowed in views");
94274 goto create_view_fail;
 
94275 }
94276 sqlite3StartTable(pParse, pName1, pName2, isTemp, 1, 0, noErr);
94277 p = pParse->pNewTable;
94278 if( p==0 || pParse->nErr ) goto create_view_fail;
94279 sqlite3TwoPartName(pParse, pName1, pName2, &pName);
@@ -106729,12 +106741,12 @@
106741 int uniqOk = sqlite3VdbeMakeLabel(v);
106742 int jmp6;
106743 int kk;
106744 for(kk=0; kk<pIdx->nKeyCol; kk++){
106745 int iCol = pIdx->aiColumn[kk];
106746 assert( iCol!=(-1) && iCol<pTab->nCol );
106747 if( iCol>=0 && pTab->aCol[iCol].notNull ) continue;
106748 sqlite3VdbeAddOp2(v, OP_IsNull, r1+kk, uniqOk);
106749 VdbeCoverage(v);
106750 }
106751 jmp6 = sqlite3VdbeAddOp1(v, OP_Next, iIdxCur+j); VdbeCoverage(v);
106752 sqlite3VdbeGoto(v, uniqOk);
@@ -112889,11 +112901,21 @@
112901 #if !defined(SQLITE_OMIT_SUBQUERY) || !defined(SQLITE_OMIT_VIEW)
112902 for(i=0; !p->pPrior && i<pTabList->nSrc; i++){
112903 struct SrcList_item *pItem = &pTabList->a[i];
112904 Select *pSub = pItem->pSelect;
112905 int isAggSub;
112906 Table *pTab = pItem->pTab;
112907 if( pSub==0 ) continue;
112908
112909 /* Catch mismatch in the declared columns of a view and the number of
112910 ** columns in the SELECT on the RHS */
112911 if( pTab->nCol!=pSub->pEList->nExpr ){
112912 sqlite3ErrorMsg(pParse, "expected %d columns for '%s' but got %d",
112913 pTab->nCol, pTab->zName, pSub->pEList->nExpr);
112914 goto select_end;
112915 }
112916
112917 isAggSub = (pSub->selFlags & SF_Aggregate)!=0;
112918 if( flattenSubquery(pParse, p, i, isAgg, isAggSub) ){
112919 /* This subquery can be absorbed into its parent. */
112920 if( isAggSub ){
112921 isAgg = 1;
@@ -121896,10 +121918,11 @@
121918 #ifdef SQLITE_ENABLE_STAT3_OR_STAT4
121919 /*
121920 ** Return the affinity for a single column of an index.
121921 */
121922 static char sqlite3IndexColumnAffinity(sqlite3 *db, Index *pIdx, int iCol){
121923 assert( iCol>=0 && iCol<pIdx->nColumn );
121924 if( !pIdx->zColAff ){
121925 if( sqlite3IndexAffinityStr(db, pIdx)==0 ) return SQLITE_AFF_BLOB;
121926 }
121927 return pIdx->zColAff[iCol];
121928 }
@@ -121953,12 +121976,11 @@
121976 int nEq = pLoop->u.btree.nEq;
121977 sqlite3 *db = pParse->db;
121978 int nLower = -1;
121979 int nUpper = p->nSample+1;
121980 int rc = SQLITE_OK;
121981 u8 aff = sqlite3IndexColumnAffinity(db, p, nEq);
 
121982 CollSeq *pColl;
121983
121984 sqlite3_value *p1 = 0; /* Value extracted from pLower */
121985 sqlite3_value *p2 = 0; /* Value extracted from pUpper */
121986 sqlite3_value *pVal = 0; /* Value extracted from record */
@@ -125266,11 +125288,14 @@
125288 if( pLoop->wsFlags & (WHERE_INDEXED|WHERE_IDX_ONLY) ){
125289 pIdx = pLoop->u.btree.pIndex;
125290 }else if( pLoop->wsFlags & WHERE_MULTI_OR ){
125291 pIdx = pLevel->u.pCovidx;
125292 }
125293 if( pIdx
125294 && (pWInfo->eOnePass==ONEPASS_OFF || !HasRowid(pIdx->pTable))
125295 && !db->mallocFailed
125296 ){
125297 last = sqlite3VdbeCurrentAddr(v);
125298 k = pLevel->addrBody;
125299 pOp = sqlite3VdbeGetOp(v, k);
125300 for(; k<last; k++, pOp++){
125301 if( pOp->p1!=pLevel->iTabCur ) continue;
@@ -133020,10 +133045,17 @@
133045 #ifdef SQLITE_ENABLE_DBSTAT_VTAB
133046 if( !db->mallocFailed && rc==SQLITE_OK){
133047 rc = sqlite3DbstatRegister(db);
133048 }
133049 #endif
133050
133051 #ifdef SQLITE_ENABLE_JSON1
133052 if( !db->mallocFailed && rc==SQLITE_OK){
133053 extern int sqlite3Json1Init(sqlite3*);
133054 rc = sqlite3Json1Init(db);
133055 }
133056 #endif
133057
133058 /* -DSQLITE_DEFAULT_LOCKING_MODE=1 makes EXCLUSIVE the default locking
133059 ** mode. -DSQLITE_DEFAULT_LOCKING_MODE=0 make NORMAL the default locking
133060 ** mode. Doing nothing at all also makes NORMAL the default.
133061 */
133062
+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.8.12"
115115
#define SQLITE_VERSION_NUMBER 3008012
116
-#define SQLITE_SOURCE_ID "2015-09-24 18:47:59 668fc1ebaf426f9eed3ed7865e41f1023dafebfb"
116
+#define SQLITE_SOURCE_ID "2015-09-28 14:40:20 9d057f52217e7ef9c3f3eb84117abe3365503f44"
117117
118118
/*
119119
** CAPI3REF: Run-Time Library Version Numbers
120120
** KEYWORDS: sqlite3_version, sqlite3_sourceid
121121
**
@@ -4358,11 +4358,11 @@
43584358
SQLITE_API const void *SQLITE_STDCALL sqlite3_value_text16be(sqlite3_value*);
43594359
SQLITE_API int SQLITE_STDCALL sqlite3_value_type(sqlite3_value*);
43604360
SQLITE_API int SQLITE_STDCALL sqlite3_value_numeric_type(sqlite3_value*);
43614361
43624362
/*
4363
-** CAPI3REF: Obtaining SQL Values
4363
+** CAPI3REF: Finding The Subtype Of SQL Values
43644364
** METHOD: sqlite3_value
43654365
**
43664366
** The sqlite3_value_subtype(V) function returns the subtype for
43674367
** an [application-defined SQL function] argument V. The subtype
43684368
** information can be used to pass a limited amount of context from
43694369
--- 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.8.12"
115 #define SQLITE_VERSION_NUMBER 3008012
116 #define SQLITE_SOURCE_ID "2015-09-24 18:47:59 668fc1ebaf426f9eed3ed7865e41f1023dafebfb"
117
118 /*
119 ** CAPI3REF: Run-Time Library Version Numbers
120 ** KEYWORDS: sqlite3_version, sqlite3_sourceid
121 **
@@ -4358,11 +4358,11 @@
4358 SQLITE_API const void *SQLITE_STDCALL sqlite3_value_text16be(sqlite3_value*);
4359 SQLITE_API int SQLITE_STDCALL sqlite3_value_type(sqlite3_value*);
4360 SQLITE_API int SQLITE_STDCALL sqlite3_value_numeric_type(sqlite3_value*);
4361
4362 /*
4363 ** CAPI3REF: Obtaining SQL Values
4364 ** METHOD: sqlite3_value
4365 **
4366 ** The sqlite3_value_subtype(V) function returns the subtype for
4367 ** an [application-defined SQL function] argument V. The subtype
4368 ** information can be used to pass a limited amount of context from
4369
--- 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.8.12"
115 #define SQLITE_VERSION_NUMBER 3008012
116 #define SQLITE_SOURCE_ID "2015-09-28 14:40:20 9d057f52217e7ef9c3f3eb84117abe3365503f44"
117
118 /*
119 ** CAPI3REF: Run-Time Library Version Numbers
120 ** KEYWORDS: sqlite3_version, sqlite3_sourceid
121 **
@@ -4358,11 +4358,11 @@
4358 SQLITE_API const void *SQLITE_STDCALL sqlite3_value_text16be(sqlite3_value*);
4359 SQLITE_API int SQLITE_STDCALL sqlite3_value_type(sqlite3_value*);
4360 SQLITE_API int SQLITE_STDCALL sqlite3_value_numeric_type(sqlite3_value*);
4361
4362 /*
4363 ** CAPI3REF: Finding The Subtype Of SQL Values
4364 ** METHOD: sqlite3_value
4365 **
4366 ** The sqlite3_value_subtype(V) function returns the subtype for
4367 ** an [application-defined SQL function] argument V. The subtype
4368 ** information can be used to pass a limited amount of context from
4369

Keyboard Shortcuts

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