1
0
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:
danielk1977
2006-01-24 16:37:57 +00:00
parent 2b8c13e7a7
commit 8d34dfd656
7 changed files with 111 additions and 37 deletions

View File

@@ -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;
}