Fossil SCM

Update the built-in SQLite to the latest version from the win32-enable-setlk branch.

drh 2025-02-12 17:25 setlk-test
Commit b10995ce96520760d311f26f9ea58ead5de716f70c1991dbea177095492a96cc
2 files changed +29 -17 +1 -1
+29 -17
--- extsrc/sqlite3.c
+++ extsrc/sqlite3.c
@@ -16,11 +16,11 @@
1616
** if you want a wrapper to interface SQLite with your choice of programming
1717
** language. The code for the "sqlite3" command-line shell is also in a
1818
** separate file. This file contains only code for the core SQLite library.
1919
**
2020
** The content in this amalgamation comes from Fossil check-in
21
-** 303e8009ab59aad32030407baf3eff9443f7 with changes in files:
21
+** 5127509abb10cb1da35b9874ea63e0c2f882 with changes in files:
2222
**
2323
**
2424
*/
2525
#ifndef SQLITE_AMALGAMATION
2626
#define SQLITE_CORE 1
@@ -465,11 +465,11 @@
465465
** [sqlite3_libversion_number()], [sqlite3_sourceid()],
466466
** [sqlite_version()] and [sqlite_source_id()].
467467
*/
468468
#define SQLITE_VERSION "3.50.0"
469469
#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"
471471
472472
/*
473473
** CAPI3REF: Run-Time Library Version Numbers
474474
** KEYWORDS: sqlite3_version sqlite3_sourceid
475475
**
@@ -50422,43 +50422,55 @@
5042250422
*/
5042350423
assert( pFile->locktype!=NO_LOCK || locktype==SHARED_LOCK );
5042450424
assert( locktype!=PENDING_LOCK );
5042550425
assert( locktype!=RESERVED_LOCK || pFile->locktype==SHARED_LOCK );
5042650426
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
5042850428
** a SHARED lock. If we are acquiring a SHARED lock, the acquisition of
5042950429
** the PENDING_LOCK byte is temporary.
5043050430
*/
5043150431
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)
5043450434
){
5043550435
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 ){
5043850445
/* Try 3 times to get the pending lock. This is needed to work
5043950446
** around problems caused by indexing and/or anti-virus software on
5044050447
** Windows systems.
50448
+ **
5044150449
** 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
+
5044450454
lastErrno = osGetLastError();
5044550455
OSTRACE(("LOCK-PENDING-FAIL file=%p, count=%d, result=%d\n",
50446
- pFile->h, cnt, res));
50456
+ pFile->h, cnt, res
50457
+ ));
50458
+
5044750459
if( lastErrno==ERROR_INVALID_HANDLE ){
5044850460
pFile->lastErrno = lastErrno;
5044950461
rc = SQLITE_IOERR_LOCK;
5045050462
OSTRACE(("LOCK-FAIL file=%p, count=%d, rc=%s\n",
50451
- pFile->h, cnt, sqlite3ErrName(rc)));
50463
+ pFile->h, cnt, sqlite3ErrName(rc)
50464
+ ));
5045250465
return rc;
5045350466
}
50454
- if( cnt ) sqlite3_win32_sleep(1);
50467
+
50468
+ cnt--;
50469
+ if( cnt>0 ) sqlite3_win32_sleep(1);
5045550470
}
5045650471
gotPendingLock = res;
50457
- if( !res ){
50458
- lastErrno = osGetLastError();
50459
- }
5046050472
}
5046150473
5046250474
/* Acquire a shared lock
5046350475
*/
5046450476
if( locktype==SHARED_LOCK && res ){
@@ -50579,11 +50591,11 @@
5057950591
OSTRACE(("UNLOCK file=%p, oldLock=%d(%d), newLock=%d\n",
5058050592
pFile->h, pFile->locktype, pFile->sharedLockByte, locktype));
5058150593
type = pFile->locktype;
5058250594
if( type>=EXCLUSIVE_LOCK ){
5058350595
winUnlockFile(&pFile->h, SHARED_FIRST, 0, SHARED_SIZE, 0);
50584
- if( locktype==SHARED_LOCK && !winGetReadLock(pFile) ){
50596
+ if( locktype==SHARED_LOCK && !winGetReadLock(pFile, 0) ){
5058550597
/* This should never happen. We should always be able to
5058650598
** reacquire the read lock */
5058750599
rc = winLogError(SQLITE_IOERR_UNLOCK, osGetLastError(),
5058850600
"winUnlock", pFile->zPath);
5058950601
}
@@ -256270,11 +256282,11 @@
256270256282
int nArg, /* Number of args */
256271256283
sqlite3_value **apUnused /* Function arguments */
256272256284
){
256273256285
assert( nArg==0 );
256274256286
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);
256276256288
}
256277256289
256278256290
/*
256279256291
** Implementation of fts5_locale(LOCALE, TEXT) function.
256280256292
**
256281256293
--- 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
--- extsrc/sqlite3.h
+++ extsrc/sqlite3.h
@@ -146,11 +146,11 @@
146146
** [sqlite3_libversion_number()], [sqlite3_sourceid()],
147147
** [sqlite_version()] and [sqlite_source_id()].
148148
*/
149149
#define SQLITE_VERSION "3.50.0"
150150
#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"
152152
153153
/*
154154
** CAPI3REF: Run-Time Library Version Numbers
155155
** KEYWORDS: sqlite3_version sqlite3_sourceid
156156
**
157157
--- 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

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button