mirror of
https://github.com/sqlite/sqlite.git
synced 2025-08-08 14:02:16 +03:00
Add the SQLITE_NOMEM_BKPT macro to enhance the ability to debug OOM errors.
Only effective with compiling with SQLITE_DEBUG. FossilOrigin-Name: 9b3454762d142113f5923d754ca6bd2edefbd362
This commit is contained in:
@@ -1670,7 +1670,7 @@ static int loadStatTbl(
|
||||
assert( db->lookaside.bDisable );
|
||||
zSql = sqlite3MPrintf(db, zSql1, zDb);
|
||||
if( !zSql ){
|
||||
return SQLITE_NOMEM;
|
||||
return SQLITE_NOMEM_BKPT;
|
||||
}
|
||||
rc = sqlite3_prepare(db, zSql, -1, &pStmt, 0);
|
||||
sqlite3DbFree(db, zSql);
|
||||
@@ -1710,7 +1710,7 @@ static int loadStatTbl(
|
||||
pIdx->aSample = sqlite3DbMallocZero(db, nByte);
|
||||
if( pIdx->aSample==0 ){
|
||||
sqlite3_finalize(pStmt);
|
||||
return SQLITE_NOMEM;
|
||||
return SQLITE_NOMEM_BKPT;
|
||||
}
|
||||
pSpace = (tRowcnt*)&pIdx->aSample[nSample];
|
||||
pIdx->aAvgEq = pSpace; pSpace += nIdxCol;
|
||||
@@ -1726,7 +1726,7 @@ static int loadStatTbl(
|
||||
|
||||
zSql = sqlite3MPrintf(db, zSql2, zDb);
|
||||
if( !zSql ){
|
||||
return SQLITE_NOMEM;
|
||||
return SQLITE_NOMEM_BKPT;
|
||||
}
|
||||
rc = sqlite3_prepare(db, zSql, -1, &pStmt, 0);
|
||||
sqlite3DbFree(db, zSql);
|
||||
@@ -1764,7 +1764,7 @@ static int loadStatTbl(
|
||||
pSample->p = sqlite3DbMallocZero(db, pSample->n + 2);
|
||||
if( pSample->p==0 ){
|
||||
sqlite3_finalize(pStmt);
|
||||
return SQLITE_NOMEM;
|
||||
return SQLITE_NOMEM_BKPT;
|
||||
}
|
||||
memcpy(pSample->p, sqlite3_column_blob(pStmt, 4), pSample->n);
|
||||
pIdx->nSample++;
|
||||
@@ -1853,7 +1853,7 @@ int sqlite3AnalysisLoad(sqlite3 *db, int iDb){
|
||||
zSql = sqlite3MPrintf(db,
|
||||
"SELECT tbl,idx,stat FROM %Q.sqlite_stat1", sInfo.zDatabase);
|
||||
if( zSql==0 ){
|
||||
rc = SQLITE_NOMEM;
|
||||
rc = SQLITE_NOMEM_BKPT;
|
||||
}else{
|
||||
rc = sqlite3_exec(db, zSql, analysisLoader, &sInfo, 0);
|
||||
sqlite3DbFree(db, zSql);
|
||||
|
Reference in New Issue
Block a user