Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Overview
Comment: | Have PRAGMA busy_timeout return 0 if the busy handler has been changed or cancelled. |
---|---|
Downloads: | Tarball | ZIP archive |
Timelines: | family | ancestors | descendants | both | busy-timeout-pragma |
Files: | files | file ages | folders |
SHA1: |
7be5bc36798d30f50658b70fc0bd31af |
User & Date: | drh 2012-09-07 18:49:57.818 |
Context
2012-09-07
| ||
20:10 | Correct two test names to make them unique. (Closed-Leaf check-in: 43e474d3e9 user: mistachkin tags: busy-timeout-pragma) | |
18:49 | Have PRAGMA busy_timeout return 0 if the busy handler has been changed or cancelled. (check-in: 7be5bc3679 user: drh tags: busy-timeout-pragma) | |
16:46 | Add an experimental busy_timeout pragma to facilitate access to the sqlite3_busy_timeout() interfaces for programmers that are working from behind a language wrapper that does not expose that interface. (check-in: 22ebc66851 user: drh tags: busy-timeout-pragma) | |
Changes
Changes to src/main.c.
︙ | ︙ | |||
1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 | int (*xBusy)(void*,int), void *pArg ){ sqlite3_mutex_enter(db->mutex); db->busyHandler.xFunc = xBusy; db->busyHandler.pArg = pArg; db->busyHandler.nBusy = 0; sqlite3_mutex_leave(db->mutex); return SQLITE_OK; } #ifndef SQLITE_OMIT_PROGRESS_CALLBACK /* ** This routine sets the progress callback for an Sqlite database to the | > | 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 | int (*xBusy)(void*,int), void *pArg ){ sqlite3_mutex_enter(db->mutex); db->busyHandler.xFunc = xBusy; db->busyHandler.pArg = pArg; db->busyHandler.nBusy = 0; db->busyTimeout = 0; sqlite3_mutex_leave(db->mutex); return SQLITE_OK; } #ifndef SQLITE_OMIT_PROGRESS_CALLBACK /* ** This routine sets the progress callback for an Sqlite database to the |
︙ | ︙ | |||
1149 1150 1151 1152 1153 1154 1155 | /* ** This routine installs a default busy handler that waits for the ** specified number of milliseconds before returning 0. */ int sqlite3_busy_timeout(sqlite3 *db, int ms){ if( ms>0 ){ | < > < | 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 | /* ** This routine installs a default busy handler that waits for the ** specified number of milliseconds before returning 0. */ int sqlite3_busy_timeout(sqlite3 *db, int ms){ if( ms>0 ){ sqlite3_busy_handler(db, sqliteDefaultBusyCallback, (void*)db); db->busyTimeout = ms; }else{ sqlite3_busy_handler(db, 0, 0); } return SQLITE_OK; } /* ** Cause any pending operation to stop at its earliest opportunity. |
︙ | ︙ |
Changes to src/pragma.c.
︙ | ︙ | |||
1537 1538 1539 1540 1541 1542 1543 | }else /* ** PRAGMA busy_timeout ** PRAGMA busy_timeout = N ** ** Call sqlite3_busy_timeout(db, N). Return the current timeout value | | | | | 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 | }else /* ** PRAGMA busy_timeout ** PRAGMA busy_timeout = N ** ** Call sqlite3_busy_timeout(db, N). Return the current timeout value ** if one is set. If no busy handler or a different busy handler is set ** then 0 is returned. Setting the busy_timeout to 0 or negative ** disables the timeout. */ if( sqlite3StrICmp(zLeft, "busy_timeout")==0 ){ if( zRight ){ sqlite3_busy_timeout(db, sqlite3Atoi(zRight)); } returnSingleInt(pParse, "timeout", db->busyTimeout); }else |
︙ | ︙ |