1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-11-18 10:21:03 +03:00

Fix a problem with OOM error handling in the new code on this branch.

FossilOrigin-Name: ea999c9db59e4193b306a2e1b15fc94f8f04cb05e852bb0d068b7d5243a0849b
This commit is contained in:
dan
2021-02-17 20:46:44 +00:00
parent c16592cd1b
commit c2a878ed0a
4 changed files with 50 additions and 9 deletions

View File

@@ -1807,7 +1807,7 @@ static void dropColumnFunc(
while( pCol->t.z[0]!=',' && pCol->t.z[1]!='(' ) pCol->t.z--;
}
zNew = sqlite3_mprintf("%.*s%s", pCol->t.z-zSql, zSql, zEnd);
zNew = sqlite3MPrintf(db, "%.*s%s", pCol->t.z-zSql, zSql, zEnd);
sqlite3_result_text(context, zNew, -1, SQLITE_TRANSIENT);
sqlite3_free(zNew);
@@ -1881,7 +1881,7 @@ void sqlite3AlterDropColumn(Parse *pParse, SrcList *pSrc, Token *pName){
renameTestSchema(pParse, zDb, iDb==1);
/* Edit rows of table on disk */
if( (pTab->aCol[iCol].colFlags & COLFLAG_VIRTUAL)==0 ){
if( pParse->nErr==0 && (pTab->aCol[iCol].colFlags & COLFLAG_VIRTUAL)==0 ){
int i;
int addr;
int reg;