151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
|
/*
** Force a rollback and shutdown the database
*/
void db_force_rollback(void){
int i;
static int busy = 0;
if( busy || g.db==0 ) return;
busy = 1;
undo_rollback();
while( pAllStmt ){
db_finalize(pAllStmt);
}
if( nBegin ){
sqlite3_exec(g.db, "ROLLBACK", 0, 0, 0);
nBegin = 0;
}
|
>
>
>
>
|
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
|
/*
** Force a rollback and shutdown the database
*/
void db_force_rollback(void){
int i;
static int busy = 0;
sqlite3_stmt *pStmt = 0;
if( busy || g.db==0 ) return;
busy = 1;
undo_rollback();
while( (pStmt = sqlite3_next_stmt(g.db,pStmt))!=0 ){
sqlite3_reset(pStmt);
}
while( pAllStmt ){
db_finalize(pAllStmt);
}
if( nBegin ){
sqlite3_exec(g.db, "ROLLBACK", 0, 0, 0);
nBegin = 0;
}
|