Fossil

Check-in [9515143d]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:When forcing a rollback following an error, reset all SQL statement first so that the rollback can be successful.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:9515143de5858081603c04e08526810859bc1edf
User & Date: drh 2011-08-12 11:54:34
Context
2011-08-12
12:13
Fix harmless compiler warnings in tar.c. check-in: 073725ae user: drh tags: trunk
11:54
When forcing a rollback following an error, reset all SQL statement first so that the rollback can be successful. check-in: 9515143d user: drh tags: trunk
2011-08-10
15:54
Change X-Frame-Options to SAMEORIGIN to give reasonable click-jacking protection without blocking some client side scripting currently in use by some fossil users. check-in: b968f023 user: ben tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/db.c.

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