Fossil SCM

Upgrade the build-in SQLite to a new 3.11.0 alpha that fixes the LIKE operator bug found in 3.10.0.

drh 2016-01-20 14:42 trunk
Commit 0d757274d30b31865e20e87905d0355fd5043ddb
2 files changed +36 -27 +1 -1
+36 -27
--- src/sqlite3.c
+++ src/sqlite3.c
@@ -327,11 +327,11 @@
327327
** [sqlite3_libversion_number()], [sqlite3_sourceid()],
328328
** [sqlite_version()] and [sqlite_source_id()].
329329
*/
330330
#define SQLITE_VERSION "3.11.0"
331331
#define SQLITE_VERSION_NUMBER 3011000
332
-#define SQLITE_SOURCE_ID "2016-01-18 17:48:28 acaf426449bf6fd3140fd63141750ff69d1119a5"
332
+#define SQLITE_SOURCE_ID "2016-01-20 14:22:41 204432ee72fda8e82d244c4aa18de7ec4811b8e1"
333333
334334
/*
335335
** CAPI3REF: Run-Time Library Version Numbers
336336
** KEYWORDS: sqlite3_version, sqlite3_sourceid
337337
**
@@ -13663,11 +13663,11 @@
1366313663
** each recursion. The boundary between these two regions is determined
1366413664
** using offsetof(Parse,nVar) so the nVar field must be the first field
1366513665
** in the recursive region.
1366613666
************************************************************************/
1366713667
13668
- int nVar; /* Number of '?' variables seen in the SQL so far */
13668
+ ynVar nVar; /* Number of '?' variables seen in the SQL so far */
1366913669
int nzVar; /* Number of available slots in azVar[] */
1367013670
u8 iPkSortOrder; /* ASC or DESC for INTEGER PRIMARY KEY */
1367113671
u8 explain; /* True if the EXPLAIN flag is found on the query */
1367213672
#ifndef SQLITE_OMIT_VIRTUALTABLE
1367313673
u8 declareVtab; /* True if inside sqlite3_declare_vtab() */
@@ -13945,14 +13945,14 @@
1394513945
1394613946
/*
1394713947
** Context pointer passed down through the tree-walk.
1394813948
*/
1394913949
struct Walker {
13950
+ Parse *pParse; /* Parser context. */
1395013951
int (*xExprCallback)(Walker*, Expr*); /* Callback for expressions */
1395113952
int (*xSelectCallback)(Walker*,Select*); /* Callback for SELECTs */
1395213953
void (*xSelectCallback2)(Walker*,Select*);/* Second callback for SELECTs */
13953
- Parse *pParse; /* Parser context. */
1395413954
int walkerDepth; /* Number of subqueries */
1395513955
u8 eCode; /* A small processing code */
1395613956
union { /* Extra data for callback */
1395713957
NameContext *pNC; /* Naming context */
1395813958
int n; /* A counter */
@@ -22394,12 +22394,13 @@
2239422394
}
2239522395
return p;
2239622396
}
2239722397
2239822398
/*
22399
-** Allocate and zero memory. If the allocation fails, make
22400
-** the mallocFailed flag in the connection pointer.
22399
+** Allocate memory, either lookaside (if possible) or heap.
22400
+** If the allocation fails, set the mallocFailed flag in
22401
+** the connection pointer.
2240122402
**
2240222403
** If db!=0 and db->mallocFailed is true (indicating a prior malloc
2240322404
** failure on the same database connection) then always return 0.
2240422405
** Hence for a particular database connection, once malloc starts
2240522406
** failing, it fails consistently until mallocFailed is reset.
@@ -22411,12 +22412,12 @@
2241122412
** if( b ) a[10] = 9;
2241222413
**
2241322414
** In other words, if a subsequent malloc (ex: "b") worked, it is assumed
2241422415
** that all prior mallocs (ex: "a") worked too.
2241522416
*/
22417
+static SQLITE_NOINLINE void *dbMallocRawFinish(sqlite3 *db, u64 n);
2241622418
SQLITE_PRIVATE void *sqlite3DbMallocRaw(sqlite3 *db, u64 n){
22417
- void *p;
2241822419
assert( db==0 || sqlite3_mutex_held(db->mutex) );
2241922420
assert( db==0 || db->pnBytesFreed==0 );
2242022421
#ifndef SQLITE_OMIT_LOOKASIDE
2242122422
if( db ){
2242222423
LookasideSlot *pBuf;
@@ -22442,11 +22443,14 @@
2244222443
#else
2244322444
if( db && db->mallocFailed ){
2244422445
return 0;
2244522446
}
2244622447
#endif
22447
- p = sqlite3Malloc(n);
22448
+ return dbMallocRawFinish(db, n);
22449
+}
22450
+static SQLITE_NOINLINE void *dbMallocRawFinish(sqlite3 *db, u64 n){
22451
+ void *p = sqlite3Malloc(n);
2244822452
if( !p && db ){
2244922453
db->mallocFailed = 1;
2245022454
}
2245122455
sqlite3MemdebugSetType(p,
2245222456
(db && db->lookaside.bEnabled) ? MEMTYPE_LOOKASIDE : MEMTYPE_HEAP);
@@ -62524,13 +62528,12 @@
6252462528
** This must be done in advance. Once the balance starts, the cell
6252562529
** offset section of the btree page will be overwritten and we will no
6252662530
** long be able to find the cells if a pointer to each cell is not saved
6252762531
** first.
6252862532
*/
62529
- memset(&b.szCell[b.nCell], 0, sizeof(b.szCell[0])*limit);
62533
+ memset(&b.szCell[b.nCell], 0, sizeof(b.szCell[0])*(limit+pOld->nOverflow));
6253062534
if( pOld->nOverflow>0 ){
62531
- memset(&b.szCell[b.nCell+limit], 0, sizeof(b.szCell[0])*pOld->nOverflow);
6253262535
limit = pOld->aiOvfl[0];
6253362536
for(j=0; j<limit; j++){
6253462537
b.apCell[b.nCell] = aData + (maskPage & get2byteAligned(piCell));
6253562538
piCell += 2;
6253662539
b.nCell++;
@@ -68390,11 +68393,12 @@
6839068393
VdbeOp *pOp;
6839168394
if( p->db->mallocFailed ) return 0;
6839268395
assert( addr>=0 && addr<p->nOp );
6839368396
pOp = &p->aOp[addr];
6839468397
freeP4(p->db, pOp->p4type, pOp->p4.p);
68395
- memset(pOp, 0, sizeof(pOp[0]));
68398
+ pOp->p4type = P4_NOTUSED;
68399
+ pOp->p4.z = 0;
6839668400
pOp->opcode = OP_Noop;
6839768401
return 1;
6839868402
}
6839968403
6840068404
/*
@@ -69438,11 +69442,10 @@
6943869442
do {
6943969443
nByte = 0;
6944069444
p->aMem = allocSpace(p->aMem, nMem*sizeof(Mem), zCsr, &nFree, &nByte);
6944169445
p->aVar = allocSpace(p->aVar, nVar*sizeof(Mem), zCsr, &nFree, &nByte);
6944269446
p->apArg = allocSpace(p->apArg, nArg*sizeof(Mem*), zCsr, &nFree, &nByte);
69443
- p->azVar = allocSpace(p->azVar, nVar*sizeof(char*), zCsr, &nFree, &nByte);
6944469447
p->apCsr = allocSpace(p->apCsr, nCursor*sizeof(VdbeCursor*),
6944569448
zCsr, &nFree, &nByte);
6944669449
p->aOnceFlag = allocSpace(p->aOnceFlag, nOnce, zCsr, &nFree, &nByte);
6944769450
#ifdef SQLITE_ENABLE_STMT_SCANSTATUS
6944869451
p->anExec = allocSpace(p->anExec, p->nOp*sizeof(i64), zCsr, &nFree, &nByte);
@@ -69461,15 +69464,14 @@
6946169464
for(n=0; n<nVar; n++){
6946269465
p->aVar[n].flags = MEM_Null;
6946369466
p->aVar[n].db = db;
6946469467
}
6946569468
}
69466
- if( p->azVar && pParse->nzVar>0 ){
69467
- p->nzVar = pParse->nzVar;
69468
- memcpy(p->azVar, pParse->azVar, p->nzVar*sizeof(p->azVar[0]));
69469
- memset(pParse->azVar, 0, pParse->nzVar*sizeof(pParse->azVar[0]));
69470
- }
69469
+ p->nzVar = pParse->nzVar;
69470
+ p->azVar = pParse->azVar;
69471
+ pParse->nzVar = 0;
69472
+ pParse->azVar = 0;
6947169473
if( p->aMem ){
6947269474
p->aMem--; /* aMem[] goes from 1..nMem */
6947369475
p->nMem = nMem; /* not from 0..nMem-1 */
6947469476
for(n=1; n<=nMem; n++){
6947569477
p->aMem[n].flags = MEM_Undefined;
@@ -70452,10 +70454,11 @@
7045270454
pNext = pSub->pNext;
7045370455
vdbeFreeOpArray(db, pSub->aOp, pSub->nOp);
7045470456
sqlite3DbFree(db, pSub);
7045570457
}
7045670458
for(i=p->nzVar-1; i>=0; i--) sqlite3DbFree(db, p->azVar[i]);
70459
+ sqlite3DbFree(db, p->azVar);
7045770460
vdbeFreeOpArray(db, p->aOp, p->nOp);
7045870461
sqlite3DbFree(db, p->aColName);
7045970462
sqlite3DbFree(db, p->zSql);
7046070463
sqlite3DbFree(db, p->pFree);
7046170464
#ifdef SQLITE_ENABLE_STMT_SCANSTATUS
@@ -71196,13 +71199,13 @@
7119671199
v1 = sqlite3ValueText((sqlite3_value*)&c1, pColl->enc);
7119771200
n1 = v1==0 ? 0 : c1.n;
7119871201
v2 = sqlite3ValueText((sqlite3_value*)&c2, pColl->enc);
7119971202
n2 = v2==0 ? 0 : c2.n;
7120071203
rc = pColl->xCmp(pColl->pUser, n1, v1, n2, v2);
71204
+ if( (v1==0 || v2==0) && prcErr ) *prcErr = SQLITE_NOMEM;
7120171205
sqlite3VdbeMemRelease(&c1);
7120271206
sqlite3VdbeMemRelease(&c2);
71203
- if( (v1==0 || v2==0) && prcErr ) *prcErr = SQLITE_NOMEM;
7120471207
return rc;
7120571208
}
7120671209
}
7120771210
7120871211
/*
@@ -71986,15 +71989,17 @@
7198671989
** Transfer error message text from an sqlite3_vtab.zErrMsg (text stored
7198771990
** in memory obtained from sqlite3_malloc) into a Vdbe.zErrMsg (text stored
7198871991
** in memory obtained from sqlite3DbMalloc).
7198971992
*/
7199071993
SQLITE_PRIVATE void sqlite3VtabImportErrmsg(Vdbe *p, sqlite3_vtab *pVtab){
71991
- sqlite3 *db = p->db;
71992
- sqlite3DbFree(db, p->zErrMsg);
71993
- p->zErrMsg = sqlite3DbStrDup(db, pVtab->zErrMsg);
71994
- sqlite3_free(pVtab->zErrMsg);
71995
- pVtab->zErrMsg = 0;
71994
+ if( pVtab->zErrMsg ){
71995
+ sqlite3 *db = p->db;
71996
+ sqlite3DbFree(db, p->zErrMsg);
71997
+ p->zErrMsg = sqlite3DbStrDup(db, pVtab->zErrMsg);
71998
+ sqlite3_free(pVtab->zErrMsg);
71999
+ pVtab->zErrMsg = 0;
72000
+ }
7199672001
}
7199772002
#endif /* SQLITE_OMIT_VIRTUALTABLE */
7199872003
7199972004
/************** End of vdbeaux.c *********************************************/
7200072005
/************** Begin file vdbeapi.c *****************************************/
@@ -86034,14 +86039,16 @@
8603486039
pParse->nHeight += pExpr->nHeight;
8603586040
}
8603686041
#endif
8603786042
savedHasAgg = pNC->ncFlags & (NC_HasAgg|NC_MinMaxAgg);
8603886043
pNC->ncFlags &= ~(NC_HasAgg|NC_MinMaxAgg);
86039
- memset(&w, 0, sizeof(w));
86044
+ w.pParse = pNC->pParse;
8604086045
w.xExprCallback = resolveExprStep;
8604186046
w.xSelectCallback = resolveSelectStep;
86042
- w.pParse = pNC->pParse;
86047
+ w.xSelectCallback2 = 0;
86048
+ w.walkerDepth = 0;
86049
+ w.eCode = 0;
8604386050
w.u.pNC = pNC;
8604486051
sqlite3WalkExpr(&w, pExpr);
8604586052
#if SQLITE_MAX_EXPR_DEPTH>0
8604686053
pNC->pParse->nHeight -= pExpr->nHeight;
8604786054
#endif
@@ -100498,11 +100505,11 @@
100498100505
continue;
100499100506
}
100500100507
}
100501100508
c2 = Utf8Read(zString);
100502100509
if( c==c2 ) continue;
100503
- if( noCase && sqlite3Tolower(c)==sqlite3Tolower(c2) ){
100510
+ if( noCase && c<0x80 && c2<0x80 && sqlite3Tolower(c)==sqlite3Tolower(c2) ){
100504100511
continue;
100505100512
}
100506100513
if( c==matchOne && zPattern!=zEscaped && c2!=0 ) continue;
100507100514
return 0;
100508100515
}
@@ -121631,10 +121638,11 @@
121631121638
int cnt; /* Number of non-wildcard prefix characters */
121632121639
char wc[3]; /* Wildcard characters */
121633121640
sqlite3 *db = pParse->db; /* Database connection */
121634121641
sqlite3_value *pVal = 0;
121635121642
int op; /* Opcode of pRight */
121643
+ int rc; /* Result code to return */
121636121644
121637121645
if( !sqlite3IsLikeFunction(db, pExpr, pnoCase, wc) ){
121638121646
return 0;
121639121647
}
121640121648
#ifdef SQLITE_EBCDIC
@@ -121696,12 +121704,13 @@
121696121704
}else{
121697121705
z = 0;
121698121706
}
121699121707
}
121700121708
121709
+ rc = (z!=0);
121701121710
sqlite3ValueFree(pVal);
121702
- return (z!=0);
121711
+ return rc;
121703121712
}
121704121713
#endif /* SQLITE_OMIT_LIKE_OPTIMIZATION */
121705121714
121706121715
121707121716
#ifndef SQLITE_OMIT_VIRTUALTABLE
@@ -183596,11 +183605,11 @@
183596183605
sqlite3_context *pCtx, /* Function call context */
183597183606
int nArg, /* Number of args */
183598183607
sqlite3_value **apVal /* Function arguments */
183599183608
){
183600183609
assert( nArg==0 );
183601
- sqlite3_result_text(pCtx, "fts5: 2016-01-18 17:48:28 acaf426449bf6fd3140fd63141750ff69d1119a5", -1, SQLITE_TRANSIENT);
183610
+ sqlite3_result_text(pCtx, "fts5: 2016-01-20 14:22:41 204432ee72fda8e82d244c4aa18de7ec4811b8e1", -1, SQLITE_TRANSIENT);
183602183611
}
183603183612
183604183613
static int fts5Init(sqlite3 *db){
183605183614
static const sqlite3_module fts5Mod = {
183606183615
/* iVersion */ 2,
183607183616
--- src/sqlite3.c
+++ src/sqlite3.c
@@ -327,11 +327,11 @@
327 ** [sqlite3_libversion_number()], [sqlite3_sourceid()],
328 ** [sqlite_version()] and [sqlite_source_id()].
329 */
330 #define SQLITE_VERSION "3.11.0"
331 #define SQLITE_VERSION_NUMBER 3011000
332 #define SQLITE_SOURCE_ID "2016-01-18 17:48:28 acaf426449bf6fd3140fd63141750ff69d1119a5"
333
334 /*
335 ** CAPI3REF: Run-Time Library Version Numbers
336 ** KEYWORDS: sqlite3_version, sqlite3_sourceid
337 **
@@ -13663,11 +13663,11 @@
13663 ** each recursion. The boundary between these two regions is determined
13664 ** using offsetof(Parse,nVar) so the nVar field must be the first field
13665 ** in the recursive region.
13666 ************************************************************************/
13667
13668 int nVar; /* Number of '?' variables seen in the SQL so far */
13669 int nzVar; /* Number of available slots in azVar[] */
13670 u8 iPkSortOrder; /* ASC or DESC for INTEGER PRIMARY KEY */
13671 u8 explain; /* True if the EXPLAIN flag is found on the query */
13672 #ifndef SQLITE_OMIT_VIRTUALTABLE
13673 u8 declareVtab; /* True if inside sqlite3_declare_vtab() */
@@ -13945,14 +13945,14 @@
13945
13946 /*
13947 ** Context pointer passed down through the tree-walk.
13948 */
13949 struct Walker {
 
13950 int (*xExprCallback)(Walker*, Expr*); /* Callback for expressions */
13951 int (*xSelectCallback)(Walker*,Select*); /* Callback for SELECTs */
13952 void (*xSelectCallback2)(Walker*,Select*);/* Second callback for SELECTs */
13953 Parse *pParse; /* Parser context. */
13954 int walkerDepth; /* Number of subqueries */
13955 u8 eCode; /* A small processing code */
13956 union { /* Extra data for callback */
13957 NameContext *pNC; /* Naming context */
13958 int n; /* A counter */
@@ -22394,12 +22394,13 @@
22394 }
22395 return p;
22396 }
22397
22398 /*
22399 ** Allocate and zero memory. If the allocation fails, make
22400 ** the mallocFailed flag in the connection pointer.
 
22401 **
22402 ** If db!=0 and db->mallocFailed is true (indicating a prior malloc
22403 ** failure on the same database connection) then always return 0.
22404 ** Hence for a particular database connection, once malloc starts
22405 ** failing, it fails consistently until mallocFailed is reset.
@@ -22411,12 +22412,12 @@
22411 ** if( b ) a[10] = 9;
22412 **
22413 ** In other words, if a subsequent malloc (ex: "b") worked, it is assumed
22414 ** that all prior mallocs (ex: "a") worked too.
22415 */
 
22416 SQLITE_PRIVATE void *sqlite3DbMallocRaw(sqlite3 *db, u64 n){
22417 void *p;
22418 assert( db==0 || sqlite3_mutex_held(db->mutex) );
22419 assert( db==0 || db->pnBytesFreed==0 );
22420 #ifndef SQLITE_OMIT_LOOKASIDE
22421 if( db ){
22422 LookasideSlot *pBuf;
@@ -22442,11 +22443,14 @@
22442 #else
22443 if( db && db->mallocFailed ){
22444 return 0;
22445 }
22446 #endif
22447 p = sqlite3Malloc(n);
 
 
 
22448 if( !p && db ){
22449 db->mallocFailed = 1;
22450 }
22451 sqlite3MemdebugSetType(p,
22452 (db && db->lookaside.bEnabled) ? MEMTYPE_LOOKASIDE : MEMTYPE_HEAP);
@@ -62524,13 +62528,12 @@
62524 ** This must be done in advance. Once the balance starts, the cell
62525 ** offset section of the btree page will be overwritten and we will no
62526 ** long be able to find the cells if a pointer to each cell is not saved
62527 ** first.
62528 */
62529 memset(&b.szCell[b.nCell], 0, sizeof(b.szCell[0])*limit);
62530 if( pOld->nOverflow>0 ){
62531 memset(&b.szCell[b.nCell+limit], 0, sizeof(b.szCell[0])*pOld->nOverflow);
62532 limit = pOld->aiOvfl[0];
62533 for(j=0; j<limit; j++){
62534 b.apCell[b.nCell] = aData + (maskPage & get2byteAligned(piCell));
62535 piCell += 2;
62536 b.nCell++;
@@ -68390,11 +68393,12 @@
68390 VdbeOp *pOp;
68391 if( p->db->mallocFailed ) return 0;
68392 assert( addr>=0 && addr<p->nOp );
68393 pOp = &p->aOp[addr];
68394 freeP4(p->db, pOp->p4type, pOp->p4.p);
68395 memset(pOp, 0, sizeof(pOp[0]));
 
68396 pOp->opcode = OP_Noop;
68397 return 1;
68398 }
68399
68400 /*
@@ -69438,11 +69442,10 @@
69438 do {
69439 nByte = 0;
69440 p->aMem = allocSpace(p->aMem, nMem*sizeof(Mem), zCsr, &nFree, &nByte);
69441 p->aVar = allocSpace(p->aVar, nVar*sizeof(Mem), zCsr, &nFree, &nByte);
69442 p->apArg = allocSpace(p->apArg, nArg*sizeof(Mem*), zCsr, &nFree, &nByte);
69443 p->azVar = allocSpace(p->azVar, nVar*sizeof(char*), zCsr, &nFree, &nByte);
69444 p->apCsr = allocSpace(p->apCsr, nCursor*sizeof(VdbeCursor*),
69445 zCsr, &nFree, &nByte);
69446 p->aOnceFlag = allocSpace(p->aOnceFlag, nOnce, zCsr, &nFree, &nByte);
69447 #ifdef SQLITE_ENABLE_STMT_SCANSTATUS
69448 p->anExec = allocSpace(p->anExec, p->nOp*sizeof(i64), zCsr, &nFree, &nByte);
@@ -69461,15 +69464,14 @@
69461 for(n=0; n<nVar; n++){
69462 p->aVar[n].flags = MEM_Null;
69463 p->aVar[n].db = db;
69464 }
69465 }
69466 if( p->azVar && pParse->nzVar>0 ){
69467 p->nzVar = pParse->nzVar;
69468 memcpy(p->azVar, pParse->azVar, p->nzVar*sizeof(p->azVar[0]));
69469 memset(pParse->azVar, 0, pParse->nzVar*sizeof(pParse->azVar[0]));
69470 }
69471 if( p->aMem ){
69472 p->aMem--; /* aMem[] goes from 1..nMem */
69473 p->nMem = nMem; /* not from 0..nMem-1 */
69474 for(n=1; n<=nMem; n++){
69475 p->aMem[n].flags = MEM_Undefined;
@@ -70452,10 +70454,11 @@
70452 pNext = pSub->pNext;
70453 vdbeFreeOpArray(db, pSub->aOp, pSub->nOp);
70454 sqlite3DbFree(db, pSub);
70455 }
70456 for(i=p->nzVar-1; i>=0; i--) sqlite3DbFree(db, p->azVar[i]);
 
70457 vdbeFreeOpArray(db, p->aOp, p->nOp);
70458 sqlite3DbFree(db, p->aColName);
70459 sqlite3DbFree(db, p->zSql);
70460 sqlite3DbFree(db, p->pFree);
70461 #ifdef SQLITE_ENABLE_STMT_SCANSTATUS
@@ -71196,13 +71199,13 @@
71196 v1 = sqlite3ValueText((sqlite3_value*)&c1, pColl->enc);
71197 n1 = v1==0 ? 0 : c1.n;
71198 v2 = sqlite3ValueText((sqlite3_value*)&c2, pColl->enc);
71199 n2 = v2==0 ? 0 : c2.n;
71200 rc = pColl->xCmp(pColl->pUser, n1, v1, n2, v2);
 
71201 sqlite3VdbeMemRelease(&c1);
71202 sqlite3VdbeMemRelease(&c2);
71203 if( (v1==0 || v2==0) && prcErr ) *prcErr = SQLITE_NOMEM;
71204 return rc;
71205 }
71206 }
71207
71208 /*
@@ -71986,15 +71989,17 @@
71986 ** Transfer error message text from an sqlite3_vtab.zErrMsg (text stored
71987 ** in memory obtained from sqlite3_malloc) into a Vdbe.zErrMsg (text stored
71988 ** in memory obtained from sqlite3DbMalloc).
71989 */
71990 SQLITE_PRIVATE void sqlite3VtabImportErrmsg(Vdbe *p, sqlite3_vtab *pVtab){
71991 sqlite3 *db = p->db;
71992 sqlite3DbFree(db, p->zErrMsg);
71993 p->zErrMsg = sqlite3DbStrDup(db, pVtab->zErrMsg);
71994 sqlite3_free(pVtab->zErrMsg);
71995 pVtab->zErrMsg = 0;
 
 
71996 }
71997 #endif /* SQLITE_OMIT_VIRTUALTABLE */
71998
71999 /************** End of vdbeaux.c *********************************************/
72000 /************** Begin file vdbeapi.c *****************************************/
@@ -86034,14 +86039,16 @@
86034 pParse->nHeight += pExpr->nHeight;
86035 }
86036 #endif
86037 savedHasAgg = pNC->ncFlags & (NC_HasAgg|NC_MinMaxAgg);
86038 pNC->ncFlags &= ~(NC_HasAgg|NC_MinMaxAgg);
86039 memset(&w, 0, sizeof(w));
86040 w.xExprCallback = resolveExprStep;
86041 w.xSelectCallback = resolveSelectStep;
86042 w.pParse = pNC->pParse;
 
 
86043 w.u.pNC = pNC;
86044 sqlite3WalkExpr(&w, pExpr);
86045 #if SQLITE_MAX_EXPR_DEPTH>0
86046 pNC->pParse->nHeight -= pExpr->nHeight;
86047 #endif
@@ -100498,11 +100505,11 @@
100498 continue;
100499 }
100500 }
100501 c2 = Utf8Read(zString);
100502 if( c==c2 ) continue;
100503 if( noCase && sqlite3Tolower(c)==sqlite3Tolower(c2) ){
100504 continue;
100505 }
100506 if( c==matchOne && zPattern!=zEscaped && c2!=0 ) continue;
100507 return 0;
100508 }
@@ -121631,10 +121638,11 @@
121631 int cnt; /* Number of non-wildcard prefix characters */
121632 char wc[3]; /* Wildcard characters */
121633 sqlite3 *db = pParse->db; /* Database connection */
121634 sqlite3_value *pVal = 0;
121635 int op; /* Opcode of pRight */
 
121636
121637 if( !sqlite3IsLikeFunction(db, pExpr, pnoCase, wc) ){
121638 return 0;
121639 }
121640 #ifdef SQLITE_EBCDIC
@@ -121696,12 +121704,13 @@
121696 }else{
121697 z = 0;
121698 }
121699 }
121700
 
121701 sqlite3ValueFree(pVal);
121702 return (z!=0);
121703 }
121704 #endif /* SQLITE_OMIT_LIKE_OPTIMIZATION */
121705
121706
121707 #ifndef SQLITE_OMIT_VIRTUALTABLE
@@ -183596,11 +183605,11 @@
183596 sqlite3_context *pCtx, /* Function call context */
183597 int nArg, /* Number of args */
183598 sqlite3_value **apVal /* Function arguments */
183599 ){
183600 assert( nArg==0 );
183601 sqlite3_result_text(pCtx, "fts5: 2016-01-18 17:48:28 acaf426449bf6fd3140fd63141750ff69d1119a5", -1, SQLITE_TRANSIENT);
183602 }
183603
183604 static int fts5Init(sqlite3 *db){
183605 static const sqlite3_module fts5Mod = {
183606 /* iVersion */ 2,
183607
--- src/sqlite3.c
+++ src/sqlite3.c
@@ -327,11 +327,11 @@
327 ** [sqlite3_libversion_number()], [sqlite3_sourceid()],
328 ** [sqlite_version()] and [sqlite_source_id()].
329 */
330 #define SQLITE_VERSION "3.11.0"
331 #define SQLITE_VERSION_NUMBER 3011000
332 #define SQLITE_SOURCE_ID "2016-01-20 14:22:41 204432ee72fda8e82d244c4aa18de7ec4811b8e1"
333
334 /*
335 ** CAPI3REF: Run-Time Library Version Numbers
336 ** KEYWORDS: sqlite3_version, sqlite3_sourceid
337 **
@@ -13663,11 +13663,11 @@
13663 ** each recursion. The boundary between these two regions is determined
13664 ** using offsetof(Parse,nVar) so the nVar field must be the first field
13665 ** in the recursive region.
13666 ************************************************************************/
13667
13668 ynVar nVar; /* Number of '?' variables seen in the SQL so far */
13669 int nzVar; /* Number of available slots in azVar[] */
13670 u8 iPkSortOrder; /* ASC or DESC for INTEGER PRIMARY KEY */
13671 u8 explain; /* True if the EXPLAIN flag is found on the query */
13672 #ifndef SQLITE_OMIT_VIRTUALTABLE
13673 u8 declareVtab; /* True if inside sqlite3_declare_vtab() */
@@ -13945,14 +13945,14 @@
13945
13946 /*
13947 ** Context pointer passed down through the tree-walk.
13948 */
13949 struct Walker {
13950 Parse *pParse; /* Parser context. */
13951 int (*xExprCallback)(Walker*, Expr*); /* Callback for expressions */
13952 int (*xSelectCallback)(Walker*,Select*); /* Callback for SELECTs */
13953 void (*xSelectCallback2)(Walker*,Select*);/* Second callback for SELECTs */
 
13954 int walkerDepth; /* Number of subqueries */
13955 u8 eCode; /* A small processing code */
13956 union { /* Extra data for callback */
13957 NameContext *pNC; /* Naming context */
13958 int n; /* A counter */
@@ -22394,12 +22394,13 @@
22394 }
22395 return p;
22396 }
22397
22398 /*
22399 ** Allocate memory, either lookaside (if possible) or heap.
22400 ** If the allocation fails, set the mallocFailed flag in
22401 ** the connection pointer.
22402 **
22403 ** If db!=0 and db->mallocFailed is true (indicating a prior malloc
22404 ** failure on the same database connection) then always return 0.
22405 ** Hence for a particular database connection, once malloc starts
22406 ** failing, it fails consistently until mallocFailed is reset.
@@ -22411,12 +22412,12 @@
22412 ** if( b ) a[10] = 9;
22413 **
22414 ** In other words, if a subsequent malloc (ex: "b") worked, it is assumed
22415 ** that all prior mallocs (ex: "a") worked too.
22416 */
22417 static SQLITE_NOINLINE void *dbMallocRawFinish(sqlite3 *db, u64 n);
22418 SQLITE_PRIVATE void *sqlite3DbMallocRaw(sqlite3 *db, u64 n){
 
22419 assert( db==0 || sqlite3_mutex_held(db->mutex) );
22420 assert( db==0 || db->pnBytesFreed==0 );
22421 #ifndef SQLITE_OMIT_LOOKASIDE
22422 if( db ){
22423 LookasideSlot *pBuf;
@@ -22442,11 +22443,14 @@
22443 #else
22444 if( db && db->mallocFailed ){
22445 return 0;
22446 }
22447 #endif
22448 return dbMallocRawFinish(db, n);
22449 }
22450 static SQLITE_NOINLINE void *dbMallocRawFinish(sqlite3 *db, u64 n){
22451 void *p = sqlite3Malloc(n);
22452 if( !p && db ){
22453 db->mallocFailed = 1;
22454 }
22455 sqlite3MemdebugSetType(p,
22456 (db && db->lookaside.bEnabled) ? MEMTYPE_LOOKASIDE : MEMTYPE_HEAP);
@@ -62524,13 +62528,12 @@
62528 ** This must be done in advance. Once the balance starts, the cell
62529 ** offset section of the btree page will be overwritten and we will no
62530 ** long be able to find the cells if a pointer to each cell is not saved
62531 ** first.
62532 */
62533 memset(&b.szCell[b.nCell], 0, sizeof(b.szCell[0])*(limit+pOld->nOverflow));
62534 if( pOld->nOverflow>0 ){
 
62535 limit = pOld->aiOvfl[0];
62536 for(j=0; j<limit; j++){
62537 b.apCell[b.nCell] = aData + (maskPage & get2byteAligned(piCell));
62538 piCell += 2;
62539 b.nCell++;
@@ -68390,11 +68393,12 @@
68393 VdbeOp *pOp;
68394 if( p->db->mallocFailed ) return 0;
68395 assert( addr>=0 && addr<p->nOp );
68396 pOp = &p->aOp[addr];
68397 freeP4(p->db, pOp->p4type, pOp->p4.p);
68398 pOp->p4type = P4_NOTUSED;
68399 pOp->p4.z = 0;
68400 pOp->opcode = OP_Noop;
68401 return 1;
68402 }
68403
68404 /*
@@ -69438,11 +69442,10 @@
69442 do {
69443 nByte = 0;
69444 p->aMem = allocSpace(p->aMem, nMem*sizeof(Mem), zCsr, &nFree, &nByte);
69445 p->aVar = allocSpace(p->aVar, nVar*sizeof(Mem), zCsr, &nFree, &nByte);
69446 p->apArg = allocSpace(p->apArg, nArg*sizeof(Mem*), zCsr, &nFree, &nByte);
 
69447 p->apCsr = allocSpace(p->apCsr, nCursor*sizeof(VdbeCursor*),
69448 zCsr, &nFree, &nByte);
69449 p->aOnceFlag = allocSpace(p->aOnceFlag, nOnce, zCsr, &nFree, &nByte);
69450 #ifdef SQLITE_ENABLE_STMT_SCANSTATUS
69451 p->anExec = allocSpace(p->anExec, p->nOp*sizeof(i64), zCsr, &nFree, &nByte);
@@ -69461,15 +69464,14 @@
69464 for(n=0; n<nVar; n++){
69465 p->aVar[n].flags = MEM_Null;
69466 p->aVar[n].db = db;
69467 }
69468 }
69469 p->nzVar = pParse->nzVar;
69470 p->azVar = pParse->azVar;
69471 pParse->nzVar = 0;
69472 pParse->azVar = 0;
 
69473 if( p->aMem ){
69474 p->aMem--; /* aMem[] goes from 1..nMem */
69475 p->nMem = nMem; /* not from 0..nMem-1 */
69476 for(n=1; n<=nMem; n++){
69477 p->aMem[n].flags = MEM_Undefined;
@@ -70452,10 +70454,11 @@
70454 pNext = pSub->pNext;
70455 vdbeFreeOpArray(db, pSub->aOp, pSub->nOp);
70456 sqlite3DbFree(db, pSub);
70457 }
70458 for(i=p->nzVar-1; i>=0; i--) sqlite3DbFree(db, p->azVar[i]);
70459 sqlite3DbFree(db, p->azVar);
70460 vdbeFreeOpArray(db, p->aOp, p->nOp);
70461 sqlite3DbFree(db, p->aColName);
70462 sqlite3DbFree(db, p->zSql);
70463 sqlite3DbFree(db, p->pFree);
70464 #ifdef SQLITE_ENABLE_STMT_SCANSTATUS
@@ -71196,13 +71199,13 @@
71199 v1 = sqlite3ValueText((sqlite3_value*)&c1, pColl->enc);
71200 n1 = v1==0 ? 0 : c1.n;
71201 v2 = sqlite3ValueText((sqlite3_value*)&c2, pColl->enc);
71202 n2 = v2==0 ? 0 : c2.n;
71203 rc = pColl->xCmp(pColl->pUser, n1, v1, n2, v2);
71204 if( (v1==0 || v2==0) && prcErr ) *prcErr = SQLITE_NOMEM;
71205 sqlite3VdbeMemRelease(&c1);
71206 sqlite3VdbeMemRelease(&c2);
 
71207 return rc;
71208 }
71209 }
71210
71211 /*
@@ -71986,15 +71989,17 @@
71989 ** Transfer error message text from an sqlite3_vtab.zErrMsg (text stored
71990 ** in memory obtained from sqlite3_malloc) into a Vdbe.zErrMsg (text stored
71991 ** in memory obtained from sqlite3DbMalloc).
71992 */
71993 SQLITE_PRIVATE void sqlite3VtabImportErrmsg(Vdbe *p, sqlite3_vtab *pVtab){
71994 if( pVtab->zErrMsg ){
71995 sqlite3 *db = p->db;
71996 sqlite3DbFree(db, p->zErrMsg);
71997 p->zErrMsg = sqlite3DbStrDup(db, pVtab->zErrMsg);
71998 sqlite3_free(pVtab->zErrMsg);
71999 pVtab->zErrMsg = 0;
72000 }
72001 }
72002 #endif /* SQLITE_OMIT_VIRTUALTABLE */
72003
72004 /************** End of vdbeaux.c *********************************************/
72005 /************** Begin file vdbeapi.c *****************************************/
@@ -86034,14 +86039,16 @@
86039 pParse->nHeight += pExpr->nHeight;
86040 }
86041 #endif
86042 savedHasAgg = pNC->ncFlags & (NC_HasAgg|NC_MinMaxAgg);
86043 pNC->ncFlags &= ~(NC_HasAgg|NC_MinMaxAgg);
86044 w.pParse = pNC->pParse;
86045 w.xExprCallback = resolveExprStep;
86046 w.xSelectCallback = resolveSelectStep;
86047 w.xSelectCallback2 = 0;
86048 w.walkerDepth = 0;
86049 w.eCode = 0;
86050 w.u.pNC = pNC;
86051 sqlite3WalkExpr(&w, pExpr);
86052 #if SQLITE_MAX_EXPR_DEPTH>0
86053 pNC->pParse->nHeight -= pExpr->nHeight;
86054 #endif
@@ -100498,11 +100505,11 @@
100505 continue;
100506 }
100507 }
100508 c2 = Utf8Read(zString);
100509 if( c==c2 ) continue;
100510 if( noCase && c<0x80 && c2<0x80 && sqlite3Tolower(c)==sqlite3Tolower(c2) ){
100511 continue;
100512 }
100513 if( c==matchOne && zPattern!=zEscaped && c2!=0 ) continue;
100514 return 0;
100515 }
@@ -121631,10 +121638,11 @@
121638 int cnt; /* Number of non-wildcard prefix characters */
121639 char wc[3]; /* Wildcard characters */
121640 sqlite3 *db = pParse->db; /* Database connection */
121641 sqlite3_value *pVal = 0;
121642 int op; /* Opcode of pRight */
121643 int rc; /* Result code to return */
121644
121645 if( !sqlite3IsLikeFunction(db, pExpr, pnoCase, wc) ){
121646 return 0;
121647 }
121648 #ifdef SQLITE_EBCDIC
@@ -121696,12 +121704,13 @@
121704 }else{
121705 z = 0;
121706 }
121707 }
121708
121709 rc = (z!=0);
121710 sqlite3ValueFree(pVal);
121711 return rc;
121712 }
121713 #endif /* SQLITE_OMIT_LIKE_OPTIMIZATION */
121714
121715
121716 #ifndef SQLITE_OMIT_VIRTUALTABLE
@@ -183596,11 +183605,11 @@
183605 sqlite3_context *pCtx, /* Function call context */
183606 int nArg, /* Number of args */
183607 sqlite3_value **apVal /* Function arguments */
183608 ){
183609 assert( nArg==0 );
183610 sqlite3_result_text(pCtx, "fts5: 2016-01-20 14:22:41 204432ee72fda8e82d244c4aa18de7ec4811b8e1", -1, SQLITE_TRANSIENT);
183611 }
183612
183613 static int fts5Init(sqlite3 *db){
183614 static const sqlite3_module fts5Mod = {
183615 /* iVersion */ 2,
183616
+1 -1
--- 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-01-18 17:48:28 acaf426449bf6fd3140fd63141750ff69d1119a5"
116
+#define SQLITE_SOURCE_ID "2016-01-20 14:22:41 204432ee72fda8e82d244c4aa18de7ec4811b8e1"
117117
118118
/*
119119
** CAPI3REF: Run-Time Library Version Numbers
120120
** KEYWORDS: sqlite3_version, sqlite3_sourceid
121121
**
122122
--- 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-01-18 17:48:28 acaf426449bf6fd3140fd63141750ff69d1119a5"
117
118 /*
119 ** CAPI3REF: Run-Time Library Version Numbers
120 ** KEYWORDS: sqlite3_version, sqlite3_sourceid
121 **
122
--- 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-01-20 14:22:41 204432ee72fda8e82d244c4aa18de7ec4811b8e1"
117
118 /*
119 ** CAPI3REF: Run-Time Library Version Numbers
120 ** KEYWORDS: sqlite3_version, sqlite3_sourceid
121 **
122

Keyboard Shortcuts

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