diff options
author | dan <dan@noemail.net> | 2020-09-07 11:14:27 +0000 |
---|---|---|
committer | dan <dan@noemail.net> | 2020-09-07 11:14:27 +0000 |
commit | ebd2ecdda7c13e92a01349bf9b58367975b3f264 (patch) | |
tree | a5be390e5478ff5dd64fc8b5391dd1ebc683d446 /src | |
parent | 8ab0809473ea0c4738594fcbb3e0a07244d3bd0b (diff) | |
download | sqlite-ebd2ecdda7c13e92a01349bf9b58367975b3f264.tar.gz sqlite-ebd2ecdda7c13e92a01349bf9b58367975b3f264.zip |
Fix another (harmless in practice) tsan error in shared-cache mode.
FossilOrigin-Name: 5a74fa3f0a64f462c8add9beae231a9bbdd19e54d07b54f08726cb1411fc8d3a
Diffstat (limited to 'src')
-rw-r--r-- | src/vdbesort.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/vdbesort.c b/src/vdbesort.c index 777c2054e..f61b8b732 100644 --- a/src/vdbesort.c +++ b/src/vdbesort.c @@ -970,13 +970,16 @@ int sqlite3VdbeSorterInit( if( pSorter==0 ){ rc = SQLITE_NOMEM_BKPT; }else{ + Btree *pBt = db->aDb[0].pBt; pSorter->pKeyInfo = pKeyInfo = (KeyInfo*)((u8*)pSorter + sz); memcpy(pKeyInfo, pCsr->pKeyInfo, szKeyInfo); pKeyInfo->db = 0; if( nField && nWorker==0 ){ pKeyInfo->nKeyField = nField; } - pSorter->pgsz = pgsz = sqlite3BtreeGetPageSize(db->aDb[0].pBt); + sqlite3BtreeEnter(pBt); + pSorter->pgsz = pgsz = sqlite3BtreeGetPageSize(pBt); + sqlite3BtreeLeave(pBt); pSorter->nTask = nWorker + 1; pSorter->iPrev = (u8)(nWorker - 1); pSorter->bUseThreads = (pSorter->nTask>1); |