Fossil SCM
In SQLite, import the fix for the journal_mode=PERSIST delete problem on windows. This has no effect on Fossil since Fossil does not use journal_mode=PERSIST. The update is for completeness only.
Commit
33dc7f31c1423965b448f10f018061feb6f59dd1
Parent
46459fd92244555…
2 files changed
+10
-8
+1
-1
+10
-8
| --- src/sqlite3.c | ||
| +++ src/sqlite3.c | ||
| @@ -222,11 +222,11 @@ | ||
| 222 | 222 | ** [sqlite3_libversion_number()], [sqlite3_sourceid()], |
| 223 | 223 | ** [sqlite_version()] and [sqlite_source_id()]. |
| 224 | 224 | */ |
| 225 | 225 | #define SQLITE_VERSION "3.8.4" |
| 226 | 226 | #define SQLITE_VERSION_NUMBER 3008004 |
| 227 | -#define SQLITE_SOURCE_ID "2014-03-06 13:38:37 0a4200f95cf46ad620b9fd91f4444114a0c74730" | |
| 227 | +#define SQLITE_SOURCE_ID "2014-03-07 14:57:07 e5b17a9d07a35c9b44ff977ba81b93d745d26a11" | |
| 228 | 228 | |
| 229 | 229 | /* |
| 230 | 230 | ** CAPI3REF: Run-Time Library Version Numbers |
| 231 | 231 | ** KEYWORDS: sqlite3_version, sqlite3_sourceid |
| 232 | 232 | ** |
| @@ -44422,19 +44422,21 @@ | ||
| 44422 | 44422 | */ |
| 44423 | 44423 | rc = sqlite3OsCheckReservedLock(pPager->fd, &locked); |
| 44424 | 44424 | if( rc==SQLITE_OK && !locked ){ |
| 44425 | 44425 | Pgno nPage; /* Number of pages in database file */ |
| 44426 | 44426 | |
| 44427 | - /* Check the size of the database file. If it consists of 0 pages, | |
| 44428 | - ** then delete the journal file. See the header comment above for | |
| 44429 | - ** the reasoning here. Delete the obsolete journal file under | |
| 44430 | - ** a RESERVED lock to avoid race conditions and to avoid violating | |
| 44431 | - ** [H33020]. | |
| 44432 | - */ | |
| 44433 | 44427 | rc = pagerPagecount(pPager, &nPage); |
| 44434 | 44428 | if( rc==SQLITE_OK ){ |
| 44435 | - if( nPage==0 ){ | |
| 44429 | + /* If the database is zero pages in size, that means that either (1) the | |
| 44430 | + ** journal is a remnant from a prior database with the same name where | |
| 44431 | + ** the database file but not the journal was deleted, or (2) the initial | |
| 44432 | + ** transaction that populates a new database is being rolled back. | |
| 44433 | + ** In either case, the journal file can be deleted. However, take care | |
| 44434 | + ** not to delete the journal file if it is already open due to | |
| 44435 | + ** journal_mode=PERSIST. | |
| 44436 | + */ | |
| 44437 | + if( nPage==0 && !jrnlOpen ){ | |
| 44436 | 44438 | sqlite3BeginBenignMalloc(); |
| 44437 | 44439 | if( pagerLockDb(pPager, RESERVED_LOCK)==SQLITE_OK ){ |
| 44438 | 44440 | sqlite3OsDelete(pVfs, pPager->zJournal, 0); |
| 44439 | 44441 | if( !pPager->exclusiveMode ) pagerUnlockDb(pPager, SHARED_LOCK); |
| 44440 | 44442 | } |
| 44441 | 44443 |
| --- src/sqlite3.c | |
| +++ src/sqlite3.c | |
| @@ -222,11 +222,11 @@ | |
| 222 | ** [sqlite3_libversion_number()], [sqlite3_sourceid()], |
| 223 | ** [sqlite_version()] and [sqlite_source_id()]. |
| 224 | */ |
| 225 | #define SQLITE_VERSION "3.8.4" |
| 226 | #define SQLITE_VERSION_NUMBER 3008004 |
| 227 | #define SQLITE_SOURCE_ID "2014-03-06 13:38:37 0a4200f95cf46ad620b9fd91f4444114a0c74730" |
| 228 | |
| 229 | /* |
| 230 | ** CAPI3REF: Run-Time Library Version Numbers |
| 231 | ** KEYWORDS: sqlite3_version, sqlite3_sourceid |
| 232 | ** |
| @@ -44422,19 +44422,21 @@ | |
| 44422 | */ |
| 44423 | rc = sqlite3OsCheckReservedLock(pPager->fd, &locked); |
| 44424 | if( rc==SQLITE_OK && !locked ){ |
| 44425 | Pgno nPage; /* Number of pages in database file */ |
| 44426 | |
| 44427 | /* Check the size of the database file. If it consists of 0 pages, |
| 44428 | ** then delete the journal file. See the header comment above for |
| 44429 | ** the reasoning here. Delete the obsolete journal file under |
| 44430 | ** a RESERVED lock to avoid race conditions and to avoid violating |
| 44431 | ** [H33020]. |
| 44432 | */ |
| 44433 | rc = pagerPagecount(pPager, &nPage); |
| 44434 | if( rc==SQLITE_OK ){ |
| 44435 | if( nPage==0 ){ |
| 44436 | sqlite3BeginBenignMalloc(); |
| 44437 | if( pagerLockDb(pPager, RESERVED_LOCK)==SQLITE_OK ){ |
| 44438 | sqlite3OsDelete(pVfs, pPager->zJournal, 0); |
| 44439 | if( !pPager->exclusiveMode ) pagerUnlockDb(pPager, SHARED_LOCK); |
| 44440 | } |
| 44441 |
| --- src/sqlite3.c | |
| +++ src/sqlite3.c | |
| @@ -222,11 +222,11 @@ | |
| 222 | ** [sqlite3_libversion_number()], [sqlite3_sourceid()], |
| 223 | ** [sqlite_version()] and [sqlite_source_id()]. |
| 224 | */ |
| 225 | #define SQLITE_VERSION "3.8.4" |
| 226 | #define SQLITE_VERSION_NUMBER 3008004 |
| 227 | #define SQLITE_SOURCE_ID "2014-03-07 14:57:07 e5b17a9d07a35c9b44ff977ba81b93d745d26a11" |
| 228 | |
| 229 | /* |
| 230 | ** CAPI3REF: Run-Time Library Version Numbers |
| 231 | ** KEYWORDS: sqlite3_version, sqlite3_sourceid |
| 232 | ** |
| @@ -44422,19 +44422,21 @@ | |
| 44422 | */ |
| 44423 | rc = sqlite3OsCheckReservedLock(pPager->fd, &locked); |
| 44424 | if( rc==SQLITE_OK && !locked ){ |
| 44425 | Pgno nPage; /* Number of pages in database file */ |
| 44426 | |
| 44427 | rc = pagerPagecount(pPager, &nPage); |
| 44428 | if( rc==SQLITE_OK ){ |
| 44429 | /* If the database is zero pages in size, that means that either (1) the |
| 44430 | ** journal is a remnant from a prior database with the same name where |
| 44431 | ** the database file but not the journal was deleted, or (2) the initial |
| 44432 | ** transaction that populates a new database is being rolled back. |
| 44433 | ** In either case, the journal file can be deleted. However, take care |
| 44434 | ** not to delete the journal file if it is already open due to |
| 44435 | ** journal_mode=PERSIST. |
| 44436 | */ |
| 44437 | if( nPage==0 && !jrnlOpen ){ |
| 44438 | sqlite3BeginBenignMalloc(); |
| 44439 | if( pagerLockDb(pPager, RESERVED_LOCK)==SQLITE_OK ){ |
| 44440 | sqlite3OsDelete(pVfs, pPager->zJournal, 0); |
| 44441 | if( !pPager->exclusiveMode ) pagerUnlockDb(pPager, SHARED_LOCK); |
| 44442 | } |
| 44443 |
+1
-1
| --- src/sqlite3.h | ||
| +++ src/sqlite3.h | ||
| @@ -107,11 +107,11 @@ | ||
| 107 | 107 | ** [sqlite3_libversion_number()], [sqlite3_sourceid()], |
| 108 | 108 | ** [sqlite_version()] and [sqlite_source_id()]. |
| 109 | 109 | */ |
| 110 | 110 | #define SQLITE_VERSION "3.8.4" |
| 111 | 111 | #define SQLITE_VERSION_NUMBER 3008004 |
| 112 | -#define SQLITE_SOURCE_ID "2014-03-06 13:38:37 0a4200f95cf46ad620b9fd91f4444114a0c74730" | |
| 112 | +#define SQLITE_SOURCE_ID "2014-03-07 14:57:07 e5b17a9d07a35c9b44ff977ba81b93d745d26a11" | |
| 113 | 113 | |
| 114 | 114 | /* |
| 115 | 115 | ** CAPI3REF: Run-Time Library Version Numbers |
| 116 | 116 | ** KEYWORDS: sqlite3_version, sqlite3_sourceid |
| 117 | 117 | ** |
| 118 | 118 |
| --- src/sqlite3.h | |
| +++ src/sqlite3.h | |
| @@ -107,11 +107,11 @@ | |
| 107 | ** [sqlite3_libversion_number()], [sqlite3_sourceid()], |
| 108 | ** [sqlite_version()] and [sqlite_source_id()]. |
| 109 | */ |
| 110 | #define SQLITE_VERSION "3.8.4" |
| 111 | #define SQLITE_VERSION_NUMBER 3008004 |
| 112 | #define SQLITE_SOURCE_ID "2014-03-06 13:38:37 0a4200f95cf46ad620b9fd91f4444114a0c74730" |
| 113 | |
| 114 | /* |
| 115 | ** CAPI3REF: Run-Time Library Version Numbers |
| 116 | ** KEYWORDS: sqlite3_version, sqlite3_sourceid |
| 117 | ** |
| 118 |
| --- src/sqlite3.h | |
| +++ src/sqlite3.h | |
| @@ -107,11 +107,11 @@ | |
| 107 | ** [sqlite3_libversion_number()], [sqlite3_sourceid()], |
| 108 | ** [sqlite_version()] and [sqlite_source_id()]. |
| 109 | */ |
| 110 | #define SQLITE_VERSION "3.8.4" |
| 111 | #define SQLITE_VERSION_NUMBER 3008004 |
| 112 | #define SQLITE_SOURCE_ID "2014-03-07 14:57:07 e5b17a9d07a35c9b44ff977ba81b93d745d26a11" |
| 113 | |
| 114 | /* |
| 115 | ** CAPI3REF: Run-Time Library Version Numbers |
| 116 | ** KEYWORDS: sqlite3_version, sqlite3_sourceid |
| 117 | ** |
| 118 |