1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-11-14 00:22:38 +03:00

Have PRAGMA busy_timeout return 0 if the busy handler has been changed

or cancelled.

FossilOrigin-Name: 7be5bc36798d30f50658b70fc0bd31af897f3a87
This commit is contained in:
drh
2012-09-07 18:49:57 +00:00
parent f360396c47
commit c0c7b5ee74
4 changed files with 13 additions and 16 deletions

View File

@@ -1116,6 +1116,7 @@ int sqlite3_busy_handler(
db->busyHandler.xFunc = xBusy;
db->busyHandler.pArg = pArg;
db->busyHandler.nBusy = 0;
db->busyTimeout = 0;
sqlite3_mutex_leave(db->mutex);
return SQLITE_OK;
}
@@ -1153,10 +1154,9 @@ void sqlite3_progress_handler(
*/
int sqlite3_busy_timeout(sqlite3 *db, int ms){
if( ms>0 ){
db->busyTimeout = ms;
sqlite3_busy_handler(db, sqliteDefaultBusyCallback, (void*)db);
db->busyTimeout = ms;
}else{
db->busyTimeout = 0;
sqlite3_busy_handler(db, 0, 0);
}
return SQLITE_OK;