Fossil SCM
Update the built-in SQLite to the latest version from the win32-enable-setlk branch.
Commit
b10995ce96520760d311f26f9ea58ead5de716f70c1991dbea177095492a96cc
Parent
5045fc26b3f771f…
2 files changed
+29
-17
+1
-1
+29
-17
| --- extsrc/sqlite3.c | ||
| +++ extsrc/sqlite3.c | ||
| @@ -16,11 +16,11 @@ | ||
| 16 | 16 | ** if you want a wrapper to interface SQLite with your choice of programming |
| 17 | 17 | ** language. The code for the "sqlite3" command-line shell is also in a |
| 18 | 18 | ** separate file. This file contains only code for the core SQLite library. |
| 19 | 19 | ** |
| 20 | 20 | ** The content in this amalgamation comes from Fossil check-in |
| 21 | -** 303e8009ab59aad32030407baf3eff9443f7 with changes in files: | |
| 21 | +** 5127509abb10cb1da35b9874ea63e0c2f882 with changes in files: | |
| 22 | 22 | ** |
| 23 | 23 | ** |
| 24 | 24 | */ |
| 25 | 25 | #ifndef SQLITE_AMALGAMATION |
| 26 | 26 | #define SQLITE_CORE 1 |
| @@ -465,11 +465,11 @@ | ||
| 465 | 465 | ** [sqlite3_libversion_number()], [sqlite3_sourceid()], |
| 466 | 466 | ** [sqlite_version()] and [sqlite_source_id()]. |
| 467 | 467 | */ |
| 468 | 468 | #define SQLITE_VERSION "3.50.0" |
| 469 | 469 | #define SQLITE_VERSION_NUMBER 3050000 |
| 470 | -#define SQLITE_SOURCE_ID "2025-02-11 18:32:22 303e8009ab59aad32030407baf3eff9443f7f9bed7947218b78293b06bba1737" | |
| 470 | +#define SQLITE_SOURCE_ID "2025-02-12 17:21:24 5127509abb10cb1da35b9874ea63e0c2f882b10567606e2bdd636a50811a693c" | |
| 471 | 471 | |
| 472 | 472 | /* |
| 473 | 473 | ** CAPI3REF: Run-Time Library Version Numbers |
| 474 | 474 | ** KEYWORDS: sqlite3_version sqlite3_sourceid |
| 475 | 475 | ** |
| @@ -50422,43 +50422,55 @@ | ||
| 50422 | 50422 | */ |
| 50423 | 50423 | assert( pFile->locktype!=NO_LOCK || locktype==SHARED_LOCK ); |
| 50424 | 50424 | assert( locktype!=PENDING_LOCK ); |
| 50425 | 50425 | assert( locktype!=RESERVED_LOCK || pFile->locktype==SHARED_LOCK ); |
| 50426 | 50426 | |
| 50427 | - /* Lock the PENDING_LOCK byte if we need to acquire a PENDING lock or | |
| 50427 | + /* Lock the PENDING_LOCK byte if we need to acquire an EXCLUSIVE lock or | |
| 50428 | 50428 | ** a SHARED lock. If we are acquiring a SHARED lock, the acquisition of |
| 50429 | 50429 | ** the PENDING_LOCK byte is temporary. |
| 50430 | 50430 | */ |
| 50431 | 50431 | newLocktype = pFile->locktype; |
| 50432 | - if( pFile->locktype==NO_LOCK | |
| 50433 | - || (locktype==EXCLUSIVE_LOCK && pFile->locktype<=RESERVED_LOCK) | |
| 50432 | + if( locktype==SHARED_LOCK | |
| 50433 | + || (locktype==EXCLUSIVE_LOCK && pFile->locktype==RESERVED_LOCK) | |
| 50434 | 50434 | ){ |
| 50435 | 50435 | int cnt = 3; |
| 50436 | - while( cnt-->0 && (res = winLockFile(&pFile->h, SQLITE_LOCKFILE_FLAGS, | |
| 50437 | - PENDING_BYTE, 0, 1, 0))==0 ){ | |
| 50436 | + | |
| 50437 | + /* Flags for the LockFileEx() call. This should be an exclusive lock if | |
| 50438 | + ** this call is to obtain EXCLUSIVE, or a shared lock if this call is to | |
| 50439 | + ** obtain SHARED. */ | |
| 50440 | + int flags = LOCKFILE_FAIL_IMMEDIATELY; | |
| 50441 | + if( locktype==EXCLUSIVE_LOCK ){ | |
| 50442 | + flags |= LOCKFILE_EXCLUSIVE_LOCK; | |
| 50443 | + } | |
| 50444 | + while( cnt>0 ){ | |
| 50438 | 50445 | /* Try 3 times to get the pending lock. This is needed to work |
| 50439 | 50446 | ** around problems caused by indexing and/or anti-virus software on |
| 50440 | 50447 | ** Windows systems. |
| 50448 | + ** | |
| 50441 | 50449 | ** If you are using this code as a model for alternative VFSes, do not |
| 50442 | - ** copy this retry logic. It is a hack intended for Windows only. | |
| 50443 | - */ | |
| 50450 | + ** copy this retry logic. It is a hack intended for Windows only. */ | |
| 50451 | + res = winLockFile(&pFile->h, flags, PENDING_BYTE, 0, 1, 0); | |
| 50452 | + if( res ) break; | |
| 50453 | + | |
| 50444 | 50454 | lastErrno = osGetLastError(); |
| 50445 | 50455 | OSTRACE(("LOCK-PENDING-FAIL file=%p, count=%d, result=%d\n", |
| 50446 | - pFile->h, cnt, res)); | |
| 50456 | + pFile->h, cnt, res | |
| 50457 | + )); | |
| 50458 | + | |
| 50447 | 50459 | if( lastErrno==ERROR_INVALID_HANDLE ){ |
| 50448 | 50460 | pFile->lastErrno = lastErrno; |
| 50449 | 50461 | rc = SQLITE_IOERR_LOCK; |
| 50450 | 50462 | OSTRACE(("LOCK-FAIL file=%p, count=%d, rc=%s\n", |
| 50451 | - pFile->h, cnt, sqlite3ErrName(rc))); | |
| 50463 | + pFile->h, cnt, sqlite3ErrName(rc) | |
| 50464 | + )); | |
| 50452 | 50465 | return rc; |
| 50453 | 50466 | } |
| 50454 | - if( cnt ) sqlite3_win32_sleep(1); | |
| 50467 | + | |
| 50468 | + cnt--; | |
| 50469 | + if( cnt>0 ) sqlite3_win32_sleep(1); | |
| 50455 | 50470 | } |
| 50456 | 50471 | gotPendingLock = res; |
| 50457 | - if( !res ){ | |
| 50458 | - lastErrno = osGetLastError(); | |
| 50459 | - } | |
| 50460 | 50472 | } |
| 50461 | 50473 | |
| 50462 | 50474 | /* Acquire a shared lock |
| 50463 | 50475 | */ |
| 50464 | 50476 | if( locktype==SHARED_LOCK && res ){ |
| @@ -50579,11 +50591,11 @@ | ||
| 50579 | 50591 | OSTRACE(("UNLOCK file=%p, oldLock=%d(%d), newLock=%d\n", |
| 50580 | 50592 | pFile->h, pFile->locktype, pFile->sharedLockByte, locktype)); |
| 50581 | 50593 | type = pFile->locktype; |
| 50582 | 50594 | if( type>=EXCLUSIVE_LOCK ){ |
| 50583 | 50595 | winUnlockFile(&pFile->h, SHARED_FIRST, 0, SHARED_SIZE, 0); |
| 50584 | - if( locktype==SHARED_LOCK && !winGetReadLock(pFile) ){ | |
| 50596 | + if( locktype==SHARED_LOCK && !winGetReadLock(pFile, 0) ){ | |
| 50585 | 50597 | /* This should never happen. We should always be able to |
| 50586 | 50598 | ** reacquire the read lock */ |
| 50587 | 50599 | rc = winLogError(SQLITE_IOERR_UNLOCK, osGetLastError(), |
| 50588 | 50600 | "winUnlock", pFile->zPath); |
| 50589 | 50601 | } |
| @@ -256270,11 +256282,11 @@ | ||
| 256270 | 256282 | int nArg, /* Number of args */ |
| 256271 | 256283 | sqlite3_value **apUnused /* Function arguments */ |
| 256272 | 256284 | ){ |
| 256273 | 256285 | assert( nArg==0 ); |
| 256274 | 256286 | UNUSED_PARAM2(nArg, apUnused); |
| 256275 | - sqlite3_result_text(pCtx, "fts5: 2025-02-11 17:10:46 e5ec5bb9f4dc3e02db7ab0e49686f47617af75d3f7d4ab23288a1aea4a693e59", -1, SQLITE_TRANSIENT); | |
| 256287 | + sqlite3_result_text(pCtx, "fts5: 2025-02-12 17:21:24 5127509abb10cb1da35b9874ea63e0c2f882b10567606e2bdd636a50811a693c", -1, SQLITE_TRANSIENT); | |
| 256276 | 256288 | } |
| 256277 | 256289 | |
| 256278 | 256290 | /* |
| 256279 | 256291 | ** Implementation of fts5_locale(LOCALE, TEXT) function. |
| 256280 | 256292 | ** |
| 256281 | 256293 |
| --- extsrc/sqlite3.c | |
| +++ extsrc/sqlite3.c | |
| @@ -16,11 +16,11 @@ | |
| 16 | ** if you want a wrapper to interface SQLite with your choice of programming |
| 17 | ** language. The code for the "sqlite3" command-line shell is also in a |
| 18 | ** separate file. This file contains only code for the core SQLite library. |
| 19 | ** |
| 20 | ** The content in this amalgamation comes from Fossil check-in |
| 21 | ** 303e8009ab59aad32030407baf3eff9443f7 with changes in files: |
| 22 | ** |
| 23 | ** |
| 24 | */ |
| 25 | #ifndef SQLITE_AMALGAMATION |
| 26 | #define SQLITE_CORE 1 |
| @@ -465,11 +465,11 @@ | |
| 465 | ** [sqlite3_libversion_number()], [sqlite3_sourceid()], |
| 466 | ** [sqlite_version()] and [sqlite_source_id()]. |
| 467 | */ |
| 468 | #define SQLITE_VERSION "3.50.0" |
| 469 | #define SQLITE_VERSION_NUMBER 3050000 |
| 470 | #define SQLITE_SOURCE_ID "2025-02-11 18:32:22 303e8009ab59aad32030407baf3eff9443f7f9bed7947218b78293b06bba1737" |
| 471 | |
| 472 | /* |
| 473 | ** CAPI3REF: Run-Time Library Version Numbers |
| 474 | ** KEYWORDS: sqlite3_version sqlite3_sourceid |
| 475 | ** |
| @@ -50422,43 +50422,55 @@ | |
| 50422 | */ |
| 50423 | assert( pFile->locktype!=NO_LOCK || locktype==SHARED_LOCK ); |
| 50424 | assert( locktype!=PENDING_LOCK ); |
| 50425 | assert( locktype!=RESERVED_LOCK || pFile->locktype==SHARED_LOCK ); |
| 50426 | |
| 50427 | /* Lock the PENDING_LOCK byte if we need to acquire a PENDING lock or |
| 50428 | ** a SHARED lock. If we are acquiring a SHARED lock, the acquisition of |
| 50429 | ** the PENDING_LOCK byte is temporary. |
| 50430 | */ |
| 50431 | newLocktype = pFile->locktype; |
| 50432 | if( pFile->locktype==NO_LOCK |
| 50433 | || (locktype==EXCLUSIVE_LOCK && pFile->locktype<=RESERVED_LOCK) |
| 50434 | ){ |
| 50435 | int cnt = 3; |
| 50436 | while( cnt-->0 && (res = winLockFile(&pFile->h, SQLITE_LOCKFILE_FLAGS, |
| 50437 | PENDING_BYTE, 0, 1, 0))==0 ){ |
| 50438 | /* Try 3 times to get the pending lock. This is needed to work |
| 50439 | ** around problems caused by indexing and/or anti-virus software on |
| 50440 | ** Windows systems. |
| 50441 | ** If you are using this code as a model for alternative VFSes, do not |
| 50442 | ** copy this retry logic. It is a hack intended for Windows only. |
| 50443 | */ |
| 50444 | lastErrno = osGetLastError(); |
| 50445 | OSTRACE(("LOCK-PENDING-FAIL file=%p, count=%d, result=%d\n", |
| 50446 | pFile->h, cnt, res)); |
| 50447 | if( lastErrno==ERROR_INVALID_HANDLE ){ |
| 50448 | pFile->lastErrno = lastErrno; |
| 50449 | rc = SQLITE_IOERR_LOCK; |
| 50450 | OSTRACE(("LOCK-FAIL file=%p, count=%d, rc=%s\n", |
| 50451 | pFile->h, cnt, sqlite3ErrName(rc))); |
| 50452 | return rc; |
| 50453 | } |
| 50454 | if( cnt ) sqlite3_win32_sleep(1); |
| 50455 | } |
| 50456 | gotPendingLock = res; |
| 50457 | if( !res ){ |
| 50458 | lastErrno = osGetLastError(); |
| 50459 | } |
| 50460 | } |
| 50461 | |
| 50462 | /* Acquire a shared lock |
| 50463 | */ |
| 50464 | if( locktype==SHARED_LOCK && res ){ |
| @@ -50579,11 +50591,11 @@ | |
| 50579 | OSTRACE(("UNLOCK file=%p, oldLock=%d(%d), newLock=%d\n", |
| 50580 | pFile->h, pFile->locktype, pFile->sharedLockByte, locktype)); |
| 50581 | type = pFile->locktype; |
| 50582 | if( type>=EXCLUSIVE_LOCK ){ |
| 50583 | winUnlockFile(&pFile->h, SHARED_FIRST, 0, SHARED_SIZE, 0); |
| 50584 | if( locktype==SHARED_LOCK && !winGetReadLock(pFile) ){ |
| 50585 | /* This should never happen. We should always be able to |
| 50586 | ** reacquire the read lock */ |
| 50587 | rc = winLogError(SQLITE_IOERR_UNLOCK, osGetLastError(), |
| 50588 | "winUnlock", pFile->zPath); |
| 50589 | } |
| @@ -256270,11 +256282,11 @@ | |
| 256270 | int nArg, /* Number of args */ |
| 256271 | sqlite3_value **apUnused /* Function arguments */ |
| 256272 | ){ |
| 256273 | assert( nArg==0 ); |
| 256274 | UNUSED_PARAM2(nArg, apUnused); |
| 256275 | sqlite3_result_text(pCtx, "fts5: 2025-02-11 17:10:46 e5ec5bb9f4dc3e02db7ab0e49686f47617af75d3f7d4ab23288a1aea4a693e59", -1, SQLITE_TRANSIENT); |
| 256276 | } |
| 256277 | |
| 256278 | /* |
| 256279 | ** Implementation of fts5_locale(LOCALE, TEXT) function. |
| 256280 | ** |
| 256281 |
| --- extsrc/sqlite3.c | |
| +++ extsrc/sqlite3.c | |
| @@ -16,11 +16,11 @@ | |
| 16 | ** if you want a wrapper to interface SQLite with your choice of programming |
| 17 | ** language. The code for the "sqlite3" command-line shell is also in a |
| 18 | ** separate file. This file contains only code for the core SQLite library. |
| 19 | ** |
| 20 | ** The content in this amalgamation comes from Fossil check-in |
| 21 | ** 5127509abb10cb1da35b9874ea63e0c2f882 with changes in files: |
| 22 | ** |
| 23 | ** |
| 24 | */ |
| 25 | #ifndef SQLITE_AMALGAMATION |
| 26 | #define SQLITE_CORE 1 |
| @@ -465,11 +465,11 @@ | |
| 465 | ** [sqlite3_libversion_number()], [sqlite3_sourceid()], |
| 466 | ** [sqlite_version()] and [sqlite_source_id()]. |
| 467 | */ |
| 468 | #define SQLITE_VERSION "3.50.0" |
| 469 | #define SQLITE_VERSION_NUMBER 3050000 |
| 470 | #define SQLITE_SOURCE_ID "2025-02-12 17:21:24 5127509abb10cb1da35b9874ea63e0c2f882b10567606e2bdd636a50811a693c" |
| 471 | |
| 472 | /* |
| 473 | ** CAPI3REF: Run-Time Library Version Numbers |
| 474 | ** KEYWORDS: sqlite3_version sqlite3_sourceid |
| 475 | ** |
| @@ -50422,43 +50422,55 @@ | |
| 50422 | */ |
| 50423 | assert( pFile->locktype!=NO_LOCK || locktype==SHARED_LOCK ); |
| 50424 | assert( locktype!=PENDING_LOCK ); |
| 50425 | assert( locktype!=RESERVED_LOCK || pFile->locktype==SHARED_LOCK ); |
| 50426 | |
| 50427 | /* Lock the PENDING_LOCK byte if we need to acquire an EXCLUSIVE lock or |
| 50428 | ** a SHARED lock. If we are acquiring a SHARED lock, the acquisition of |
| 50429 | ** the PENDING_LOCK byte is temporary. |
| 50430 | */ |
| 50431 | newLocktype = pFile->locktype; |
| 50432 | if( locktype==SHARED_LOCK |
| 50433 | || (locktype==EXCLUSIVE_LOCK && pFile->locktype==RESERVED_LOCK) |
| 50434 | ){ |
| 50435 | int cnt = 3; |
| 50436 | |
| 50437 | /* Flags for the LockFileEx() call. This should be an exclusive lock if |
| 50438 | ** this call is to obtain EXCLUSIVE, or a shared lock if this call is to |
| 50439 | ** obtain SHARED. */ |
| 50440 | int flags = LOCKFILE_FAIL_IMMEDIATELY; |
| 50441 | if( locktype==EXCLUSIVE_LOCK ){ |
| 50442 | flags |= LOCKFILE_EXCLUSIVE_LOCK; |
| 50443 | } |
| 50444 | while( cnt>0 ){ |
| 50445 | /* Try 3 times to get the pending lock. This is needed to work |
| 50446 | ** around problems caused by indexing and/or anti-virus software on |
| 50447 | ** Windows systems. |
| 50448 | ** |
| 50449 | ** If you are using this code as a model for alternative VFSes, do not |
| 50450 | ** copy this retry logic. It is a hack intended for Windows only. */ |
| 50451 | res = winLockFile(&pFile->h, flags, PENDING_BYTE, 0, 1, 0); |
| 50452 | if( res ) break; |
| 50453 | |
| 50454 | lastErrno = osGetLastError(); |
| 50455 | OSTRACE(("LOCK-PENDING-FAIL file=%p, count=%d, result=%d\n", |
| 50456 | pFile->h, cnt, res |
| 50457 | )); |
| 50458 | |
| 50459 | if( lastErrno==ERROR_INVALID_HANDLE ){ |
| 50460 | pFile->lastErrno = lastErrno; |
| 50461 | rc = SQLITE_IOERR_LOCK; |
| 50462 | OSTRACE(("LOCK-FAIL file=%p, count=%d, rc=%s\n", |
| 50463 | pFile->h, cnt, sqlite3ErrName(rc) |
| 50464 | )); |
| 50465 | return rc; |
| 50466 | } |
| 50467 | |
| 50468 | cnt--; |
| 50469 | if( cnt>0 ) sqlite3_win32_sleep(1); |
| 50470 | } |
| 50471 | gotPendingLock = res; |
| 50472 | } |
| 50473 | |
| 50474 | /* Acquire a shared lock |
| 50475 | */ |
| 50476 | if( locktype==SHARED_LOCK && res ){ |
| @@ -50579,11 +50591,11 @@ | |
| 50591 | OSTRACE(("UNLOCK file=%p, oldLock=%d(%d), newLock=%d\n", |
| 50592 | pFile->h, pFile->locktype, pFile->sharedLockByte, locktype)); |
| 50593 | type = pFile->locktype; |
| 50594 | if( type>=EXCLUSIVE_LOCK ){ |
| 50595 | winUnlockFile(&pFile->h, SHARED_FIRST, 0, SHARED_SIZE, 0); |
| 50596 | if( locktype==SHARED_LOCK && !winGetReadLock(pFile, 0) ){ |
| 50597 | /* This should never happen. We should always be able to |
| 50598 | ** reacquire the read lock */ |
| 50599 | rc = winLogError(SQLITE_IOERR_UNLOCK, osGetLastError(), |
| 50600 | "winUnlock", pFile->zPath); |
| 50601 | } |
| @@ -256270,11 +256282,11 @@ | |
| 256282 | int nArg, /* Number of args */ |
| 256283 | sqlite3_value **apUnused /* Function arguments */ |
| 256284 | ){ |
| 256285 | assert( nArg==0 ); |
| 256286 | UNUSED_PARAM2(nArg, apUnused); |
| 256287 | sqlite3_result_text(pCtx, "fts5: 2025-02-12 17:21:24 5127509abb10cb1da35b9874ea63e0c2f882b10567606e2bdd636a50811a693c", -1, SQLITE_TRANSIENT); |
| 256288 | } |
| 256289 | |
| 256290 | /* |
| 256291 | ** Implementation of fts5_locale(LOCALE, TEXT) function. |
| 256292 | ** |
| 256293 |
+1
-1
| --- extsrc/sqlite3.h | ||
| +++ extsrc/sqlite3.h | ||
| @@ -146,11 +146,11 @@ | ||
| 146 | 146 | ** [sqlite3_libversion_number()], [sqlite3_sourceid()], |
| 147 | 147 | ** [sqlite_version()] and [sqlite_source_id()]. |
| 148 | 148 | */ |
| 149 | 149 | #define SQLITE_VERSION "3.50.0" |
| 150 | 150 | #define SQLITE_VERSION_NUMBER 3050000 |
| 151 | -#define SQLITE_SOURCE_ID "2025-02-11 18:32:22 303e8009ab59aad32030407baf3eff9443f7f9bed7947218b78293b06bba1737" | |
| 151 | +#define SQLITE_SOURCE_ID "2025-02-12 17:21:24 5127509abb10cb1da35b9874ea63e0c2f882b10567606e2bdd636a50811a693c" | |
| 152 | 152 | |
| 153 | 153 | /* |
| 154 | 154 | ** CAPI3REF: Run-Time Library Version Numbers |
| 155 | 155 | ** KEYWORDS: sqlite3_version sqlite3_sourceid |
| 156 | 156 | ** |
| 157 | 157 |
| --- extsrc/sqlite3.h | |
| +++ extsrc/sqlite3.h | |
| @@ -146,11 +146,11 @@ | |
| 146 | ** [sqlite3_libversion_number()], [sqlite3_sourceid()], |
| 147 | ** [sqlite_version()] and [sqlite_source_id()]. |
| 148 | */ |
| 149 | #define SQLITE_VERSION "3.50.0" |
| 150 | #define SQLITE_VERSION_NUMBER 3050000 |
| 151 | #define SQLITE_SOURCE_ID "2025-02-11 18:32:22 303e8009ab59aad32030407baf3eff9443f7f9bed7947218b78293b06bba1737" |
| 152 | |
| 153 | /* |
| 154 | ** CAPI3REF: Run-Time Library Version Numbers |
| 155 | ** KEYWORDS: sqlite3_version sqlite3_sourceid |
| 156 | ** |
| 157 |
| --- extsrc/sqlite3.h | |
| +++ extsrc/sqlite3.h | |
| @@ -146,11 +146,11 @@ | |
| 146 | ** [sqlite3_libversion_number()], [sqlite3_sourceid()], |
| 147 | ** [sqlite_version()] and [sqlite_source_id()]. |
| 148 | */ |
| 149 | #define SQLITE_VERSION "3.50.0" |
| 150 | #define SQLITE_VERSION_NUMBER 3050000 |
| 151 | #define SQLITE_SOURCE_ID "2025-02-12 17:21:24 5127509abb10cb1da35b9874ea63e0c2f882b10567606e2bdd636a50811a693c" |
| 152 | |
| 153 | /* |
| 154 | ** CAPI3REF: Run-Time Library Version Numbers |
| 155 | ** KEYWORDS: sqlite3_version sqlite3_sourceid |
| 156 | ** |
| 157 |