mirror of
https://github.com/sqlite/sqlite.git
synced 2025-11-12 13:01:09 +03:00
Fix issues with ALTER TABLE RENAME COLUMN associated with OOM errors.
FossilOrigin-Name: 0b28dd5c2e4908d5e49eaedd359492e46de8af3bf84120f4683b3ea906882fbf
This commit is contained in:
@@ -970,6 +970,7 @@ static void renameColumnFunc(
|
||||
sParse.nQueryLoop = 1;
|
||||
rc = sqlite3RunParser(&sParse, zSql, &zErr);
|
||||
assert( sParse.pNewTable==0 || sParse.pNewIndex==0 );
|
||||
if( db->mallocFailed ) rc = SQLITE_NOMEM;
|
||||
if( rc==SQLITE_OK && sParse.pNewTable==0 && sParse.pNewIndex==0 ){
|
||||
rc = SQLITE_CORRUPT_BKPT;
|
||||
}
|
||||
@@ -990,8 +991,7 @@ static void renameColumnFunc(
|
||||
sqlite3_result_error_code(context, rc);
|
||||
}
|
||||
sqlite3DbFree(db, zErr);
|
||||
sqlite3_free(zQuot);
|
||||
return;
|
||||
goto renameColumnFunc_done;
|
||||
}
|
||||
|
||||
if( bQuote ){
|
||||
@@ -1094,6 +1094,7 @@ static void renameColumnFunc(
|
||||
sqlite3DbFree(db, zOut);
|
||||
}
|
||||
|
||||
renameColumnFunc_done:
|
||||
if( sParse.pVdbe ){
|
||||
sqlite3VdbeFinalize(sParse.pVdbe);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user