-C Further\stests\sfor\sthe\snew\scode\sin\sbtree.c\son\sthis\sbranch.
-D 2026-02-20T16:58:45.446
+C Fix\sOMIT_CONCURRENT\sbuilds\son\sthis\sbranch.
+D 2026-02-20T18:27:02.921
F .fossil-settings/binary-glob 61195414528fb3ea9693577e1980230d78a1f8b0a54c78cf1b9b24d0a409ed6a x
F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1
F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea
F src/bitvec.c 1a048c91b2fbccbbc32dcefa757f93216c0f518ed2bc0b4db39947264479ad06
F src/btmutex.c 30dada73a819a1ef5b7583786370dce1842e12e1ad941e4d05ac29695528daea
F src/btrecord.c 11e78cc540398deeb6f7860ae1732dcf72fa90c0067c931ebe19cb46b2a6ac92
-F src/btree.c 29db13c69d228fc414d776e67d69ce0545df442e7e4dd56864e4565db99bb663
+F src/btree.c ae7eb53c073728fbf65c16bcbe92c0228f8a426f2e9a3f82897dcd0a12cc3467
F src/btree.h c7b48ffbe4f18885bb83eab53c33599d52628b844b3c2d93199484695728c36d
F src/btreeInt.h f896cac9794a34bd1f817b1be291b9d074301158d91e5e39b971f5d2f61aeab6
F src/build.c 899c33f67843888e9f5c996e66c5a4eeca0016eebafcf5e261b32b5df0f1a50c
F src/json.c 8b6341a419150b28530cc21e3951b2238c35cdc312f11b2ca29017fe4b1dedc0
F src/legacy.c d7874bc885906868cd51e6c2156698f2754f02d9eee1bae2d687323c3ca8e5aa
F src/loadext.c 56a542244fbefc739a2ef57fac007c16b2aefdb4377f584e9547db2ce3e071f9
-F src/main.c 966d6f52df89001542b42396785cfe7d62cc66b06dd123c8fb24788bfe6047f1
+F src/main.c 6a81e57f9749b16fe333edf36760afe4dd1e0de75dc147b369660dd10f8547fa
F src/malloc.c 422f7e0498e1c9ef967f06283b6f2c0b16db6b905d8e06f6dbc8baaa3e4e6c5a
F src/mem0.c 6a55ebe57c46ca1a7d98da93aaa07f99f1059645
F src/mem1.c 3bb59158c38e05f6270e761a9f435bf19827a264c13d1631c58b84bdc96d73b2
F test/concurrent9.test 4b59e327c524d09c992f94b5cc7202cfed124ecbb85823c30308b5e1c7e16dca
F test/concurrentA.test 2272fecbf128ac5a8d7b0c9cfe732c4935a5a1b915e237c93ef8dce39f7df670
F test/concurrentB.test b85e8adc4c1acf9b1cc0e8c2012348dc116d4ce032bb699d039f10de9b4cca71
-F test/concurrentC.test d5d4b9ce51a2d1b6fa5f652b24b077dc615085c0cdba302317f727923846ad10
+F test/concurrentC.test fd85071ee3792a1fe9c7faf5cdf70a338cdb1aeaa127ba6d1394db84b8fe0dbe
F test/concurrentD.test ded9c6e975af21652717afb87c8632395610372bc276d1efa701af05233f0c69
F test/conflict.test 3307ffdf988e04b01c4e942d8aa369a977f085bf629f43a627c9a77f39d65926
F test/conflict2.test 5557909ce683b1073982f5d1b61dfb1d41e369533bfdaf003180c5bc87282dd1
F tool/warnings.sh d924598cf2f55a4ecbc2aeb055c10bd5f48114793e7ba25f9585435da29e7e98
F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f
F tool/winmain.c 00c8fb88e365c9017db14c73d3c78af62194d9644feaf60e220ab0f411f3604c
-P 5fe1e2bb8e2049c33e29fa852bebfc151adf2ea4a05971b58ca7f6963c74bcea
-R 9e48e63cc9ae39b6143f273626e4fe0e
+P 9202cd04f74ae69bb82c6574c2259d270ae35c9476cccc2e20f3c1f9c8a6c995
+R 5a7bc9e12a953155b053b6e3af37cb59
U dan
-Z 50ea9f4a1b2820f61ff1e25001651907
+Z 1f713f7a76b880e3040163159533c150
# Remove this line to create a well-formed Fossil manifest.
/* !defined(SQLITE_OMIT_CONCURRENT)
**
-** If this is a BEGIN CONCURRENT transactin, update the BtShared.conc
+** If this is a BEGIN CONCURRENT transaction, update the BtShared.conc
** object to reflect the fact that nSvpt savepoints are now open.
*/
static void btreeBcSavepointBegin(BtShared *pBt, int nSvpt){
- if( nSvpt>=BTCONC_MAX_SAVEPOINT ){
- /* More than 8 nested savepoints. No logical OCC this transaction. */
- pBt->conc.eState = BTCONC_STATE_RETIRED;
- }else if( nSvpt>pBt->conc.nSvpt ){
- int ii;
- for(ii=pBt->conc.nSvpt; ii<nSvpt; ii++){
- pBt->conc.aSvpt[ii] = pBt->conc.nWrite;
+ if( pBt->conc.eState==BTCONC_STATE_INUSE ){
+ if( nSvpt>=BTCONC_MAX_SAVEPOINT ){
+ /* More than 8 nested savepoints. No logical OCC this transaction. */
+ pBt->conc.eState = BTCONC_STATE_RETIRED;
+ }else if( nSvpt>pBt->conc.nSvpt ){
+ int ii;
+ for(ii=pBt->conc.nSvpt; ii<nSvpt; ii++){
+ pBt->conc.aSvpt[ii] = pBt->conc.nWrite;
+ }
+ pBt->conc.nSvpt = nSvpt;
}
- pBt->conc.nSvpt = nSvpt;
}
}
#ifdef SQLITE_DEBUG
{
+ /* Check that BtSharedLog.nByte is the sum of the nByte member of
+ ** all log entries. */
i64 nTotal = 0;
BtSharedLogEntry *pEntry = pBtLog->pFirst;
for( ; pEntry; pEntry=pEntry->pLogNext) nTotal += pEntry->nByte;
);
if( res<=0 ){
- /* This range overlaps with the previous one. This call is to
- ** figure out if it is entirely encapsulated within the previous
- ** range (if res<=0) or if it only partially overlaps and the
- ** max of the previous range needs to be extended (res>0). */
- res = btreeBcRecordCompare(
- pBtConc->pUnpacked, pIn->pKeyInfo,
- pIn->aRecMax, pIn->nRecMax, pIn->drc_max,
- pOut->aRecMax, pOut->nRecMax, pOut->drc_max
- );
+
+ if( pIn->aRecMax!=pIn->aRecMin || pOut->aRecMax!=pOut->aRecMin ){
+ /* This range overlaps with the previous one. This call is to
+ ** figure out if it is entirely encapsulated within the previous
+ ** range (if res<=0) or if it only partially overlaps and the
+ ** max of the previous range needs to be extended (res>0).
+ **
+ ** This test is not required if both pOut and pIn are an exact
+ ** key searchs, not true ranges (if aRecMax==aRecMin). In that
+ ** case, pIn is always wholly encapsulated by pOut. */
+ res = btreeBcRecordCompare(
+ pBtConc->pUnpacked, pIn->pKeyInfo,
+ pIn->aRecMax, pIn->nRecMax, pIn->drc_max,
+ pOut->aRecMax, pOut->nRecMax, pOut->drc_max
+ );
+ }
sqlite3KeyInfoUnref(pIn->pKeyInfo);
if( pIn->aRecMin!=pIn->aRecMax ) sqlite3_free(pIn->aRecMin);
** Figure out which table or index this is using the schema managed by
** pBt. Return the name of the table. If pzIdx is not NULL and the root
** page belongs to an index, set (*pzIdx) to the name of the index.
+**
+** This is used to identify the specific table and index on which a
+** conflict occurred in an sqlite3_log() message.
*/
static const char *btreeBcRootToObject(
- BtShared *pBt,
- Pgno iRoot,
- const char **pzIdx
+ BtShared *pBt, /* Shared b-tree object */
+ Pgno iRoot, /* Root page of table or index */
+ const char **pzIdx /* OUT: Index name (or NULL) */
){
Schema *pSchema = pBt->pSchema;
const char *zRet = 0;
}else{
/* Most index scans are not really scans, but exact lookups. In
** this case pRead->aRecMin==pRead->aRecMax. */
- assert( (pRead->aRecMin!=pRead->aRecMax) || pRead->drc_min>0 );
+ assert( (pRead->aRecMin!=pRead->aRecMax) || pRead->drc_min>=0 );
int cmp = btreeBcRecordCompare(
pBtConc->pUnpacked,
sqlite3_mutex_leave( sqlite3_mutex_alloc(SQLITE_MUTEX_STATIC_MAIN) );
if( pFree ){
- /* TODO: Free existing log entries */
while( pFree->pFirst ){
btreeBcRemoveOldest(pFree);
}
-
sqlite3_mutex_free(pFree->mutex);
sqlite3_free(pFree);
}
# define btreePtrmapCheck(y,z)
# define btreeBcEndTransaction(db, pBt)
+# define btreeBcDisconnect(pBt)
+# define btreeBcScanFinish(pCsr) SQLITE_OK
+# define btreeBcScanStart(pCsr,eRead,pKey,iKey) SQLITE_OK
#endif /* SQLITE_OMIT_CONCURRENT */
static void releasePage(MemPage *pPage); /* Forward reference */
** the record of all pages read within the transaction. */
btreePtrmapDelete(pBt);
btreeBcEndTransaction(db, pBt);
- pBt->conc.eState = BTCONC_STATE_NONE;
sqlite3PagerEndConcurrent(pBt->pPager);
btreeIntegrity(p);
}
sqlite3BtreeEnter(pBtree);
assert( pBt->pCursor!=0 );
+#ifndef SQLITE_OMIT_CONCURRENT
if( SQLITE_OK!=btreeBcScanFinish(pCur) ){
/* Allocation failed in btreeBcScanFinish(), but we have no way
** to return the error to the user. So just disable the BtConcurrent
assert( pBt->conc.eState==BTCONC_STATE_INUSE );
pBt->conc.eState = BTCONC_STATE_RETIRED;
}
+#endif
if( pBt->pCursor==pCur ){
pBt->pCursor = pCur->pNext;
Pgno pgno = 0;
BtShared *pBt = p->pBt;
assert( p->inTrans==TRANS_WRITE && pBt->pPage1 );
- memset(db->aCommit, 0, sizeof(db->aCommit));
sqlite3BtreeEnter(p);
+
+#ifdef SQLITE_OMIT_CONCURRENT
+ rc = sqlite3PagerExclusiveLock(pBt->pPager, 0, 0);
+#else
+ memset(db->aCommit, 0, sizeof(db->aCommit));
rc = sqlite3PagerExclusiveLock(pBt->pPager,
(db->eConcurrent==CONCURRENT_SCHEMA) ? 0 : pBt->pPage1->pDbPage,
db->aCommit
);
-#ifdef SQLITE_OMIT_CONCURRENT
- assert( db->aCommit[SQLITE_COMMIT_CONFLICT_PGNO]==0 );
-#else
if( rc==SQLITE_BUSY_SNAPSHOT
&& db->aCommit[SQLITE_COMMIT_CONFLICT_PGNO]>1