mirror of
https://github.com/sqlite/sqlite.git
synced 2025-11-19 21:43:15 +03:00
Merge latest trunk changes with this branch.
FossilOrigin-Name: 1a4182eedd0143c3f71b3d97f1d1bb25adeba617
This commit is contained in:
@@ -943,7 +943,7 @@ static int vtabBestIndex(Parse *pParse, Table *pTab, sqlite3_index_info *p){
|
||||
|
||||
if( rc!=SQLITE_OK ){
|
||||
if( rc==SQLITE_NOMEM ){
|
||||
pParse->db->mallocFailed = 1;
|
||||
sqlite3OomFault(pParse->db);
|
||||
}else if( !pVtab->zErrMsg ){
|
||||
sqlite3ErrorMsg(pParse, "%s", sqlite3ErrStr(rc));
|
||||
}else{
|
||||
@@ -1735,7 +1735,7 @@ static int whereLoopResize(sqlite3 *db, WhereLoop *p, int n){
|
||||
WhereTerm **paNew;
|
||||
if( p->nLSlot>=n ) return SQLITE_OK;
|
||||
n = (n+7)&~7;
|
||||
paNew = sqlite3DbMallocRaw(db, sizeof(p->aLTerm[0])*n);
|
||||
paNew = sqlite3DbMallocRawNN(db, sizeof(p->aLTerm[0])*n);
|
||||
if( paNew==0 ) return SQLITE_NOMEM;
|
||||
memcpy(paNew, p->aLTerm, sizeof(p->aLTerm[0])*p->nLSlot);
|
||||
if( p->aLTerm!=p->aLTermSpace ) sqlite3DbFree(db, p->aLTerm);
|
||||
@@ -2032,7 +2032,7 @@ static int whereLoopInsert(WhereLoopBuilder *pBuilder, WhereLoop *pTemplate){
|
||||
#endif
|
||||
if( p==0 ){
|
||||
/* Allocate a new WhereLoop to add to the end of the list */
|
||||
*ppPrev = p = sqlite3DbMallocRaw(db, sizeof(WhereLoop));
|
||||
*ppPrev = p = sqlite3DbMallocRawNN(db, sizeof(WhereLoop));
|
||||
if( p==0 ) return SQLITE_NOMEM;
|
||||
whereLoopInit(p);
|
||||
p->pNextLoop = 0;
|
||||
@@ -3529,7 +3529,7 @@ static int wherePathSolver(WhereInfo *pWInfo, LogEst nRowEst){
|
||||
/* Allocate and initialize space for aTo, aFrom and aSortCost[] */
|
||||
nSpace = (sizeof(WherePath)+sizeof(WhereLoop*)*nLoop)*mxChoice*2;
|
||||
nSpace += sizeof(LogEst) * nOrderBy;
|
||||
pSpace = sqlite3DbMallocRaw(db, nSpace);
|
||||
pSpace = sqlite3DbMallocRawNN(db, nSpace);
|
||||
if( pSpace==0 ) return SQLITE_NOMEM;
|
||||
aTo = (WherePath*)pSpace;
|
||||
aFrom = aTo+mxChoice;
|
||||
|
||||
Reference in New Issue
Block a user