Canceling a integrity check in progress (feature request)

View: New views
2 Messages — Rating Filter:   Alert me  

Canceling a integrity check in progress (feature request)

by Dave Wright-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

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@...
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: Canceling a integrity check in progress (feature request)

by Roger Binns :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Dave Wright wrote:
> sqlite3_interrupt does not appear to cancel an integrity check (pragma
> integrity_check or quick_check) in progress.

http://www.sqlite.org/src/info/33fdaab1a0

Roger
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkrzqWgACgkQmOOfHg372QS1jgCg0X406GUZewIz1Krvxz4yIV6n
jVcAn25W6Y5XJUdWfR1jzuBLzZlNrI/S
=PNYJ
-----END PGP SIGNATURE-----
_______________________________________________
sqlite-users mailing list
sqlite-users@...
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users