mirror of
https://github.com/sqlite/sqlite.git
synced 2025-11-14 00:22:38 +03:00
Handle errors in saving cursor positions during a rollback by aborting all active statements. (CVS 3027)
FossilOrigin-Name: 5df9f022bfb22976f22b996bda169635354b825c
This commit is contained in:
@@ -1101,10 +1101,10 @@ static int vdbeCommit(sqlite3 *db){
|
||||
** aborted so that they do not have data rolled out from underneath
|
||||
** them leading to a segfault.
|
||||
*/
|
||||
static void abortOtherActiveVdbes(Vdbe *pVdbe){
|
||||
void sqlite3AbortOtherActiveVdbes(sqlite3 *db, Vdbe *pExcept){
|
||||
Vdbe *pOther;
|
||||
for(pOther=pVdbe->db->pVdbe; pOther; pOther=pOther->pNext){
|
||||
if( pOther==pVdbe ) continue;
|
||||
for(pOther=db->pVdbe; pOther; pOther=pOther->pNext){
|
||||
if( pOther==pExcept ) continue;
|
||||
if( pOther->magic!=VDBE_MAGIC_RUN || pOther->pc<0 ) continue;
|
||||
closeAllCursors(pOther);
|
||||
pOther->aborted = 1;
|
||||
@@ -1237,7 +1237,7 @@ int sqlite3VdbeHalt(Vdbe *p){
|
||||
/* We are forced to roll back the active transaction. Before doing
|
||||
** so, abort any other statements this handle currently has active.
|
||||
*/
|
||||
abortOtherActiveVdbes(p);
|
||||
sqlite3AbortOtherActiveVdbes(db, p);
|
||||
sqlite3RollbackAll(db);
|
||||
db->autoCommit = 1;
|
||||
}
|
||||
@@ -1274,7 +1274,7 @@ int sqlite3VdbeHalt(Vdbe *p){
|
||||
}else if( p->errorAction==OE_Abort ){
|
||||
xFunc = sqlite3BtreeRollbackStmt;
|
||||
}else{
|
||||
abortOtherActiveVdbes(p);
|
||||
sqlite3AbortOtherActiveVdbes(db, p);
|
||||
sqlite3RollbackAll(db);
|
||||
db->autoCommit = 1;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user