sqlite3_interrupt does not appear to cancel an integrity check (pragma
integrity_check or quick_check) in progress. Given how long these
checks can take on big DBs, it's nice to be able to abort them (if
your app is asked to exit for example).

I've hacked in my own support for doing this, but would love to see an
official version committed for a future release.

The simple fix I put in place was to add:

  sqlite3_snprintf(sizeof(zContext), zContext, "Page %d: ", iPage);
/* allow checking to be aborted */
  if (pCheck->pBt->db->u1.isInterrupted)
  {
          checkAppendMsg(pCheck, zContext, "Check interrupted");
          return -1;
  }

...near the top of: checkTreePage(...)
In practice this causes several other error messages to get appended
to the check results as well, and the actual statement returns
SQLITE_ROW. A better solution would be one that causes the execution
to return  SQLITE_INTERRUPT, but this is good enough for my case.

Thanks,
Dave Wright
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to