mirror of
https://github.com/sqlite/sqlite.git
synced 2025-08-08 14:02:16 +03:00
The fix at [2bf5413dc2c19d5f] was incomplete in that it failed to clear
the reusable register cache that might contain registers in the STAT4 buffer region. This additional change corrects the problem. [forum:/forumpost/83cb4a95a0|Forum post 83cb4a95a0]. Test case in TH3. FossilOrigin-Name: 5d554e4d0f59a4309fed40e4fb26c7be42f1d4d55ccdcaaf7b4d445aa3122955
This commit is contained in:
@@ -1297,6 +1297,21 @@ static void analyzeOneTable(
|
||||
/* Allocate space to compute results for the largest index */
|
||||
pParse->nMem = MAX(pParse->nMem, regCol+mxCol);
|
||||
doOnce = 0;
|
||||
#ifdef SQLITE_DEBUG
|
||||
/* Verify that setting pParse->nTempReg to zero below really
|
||||
** is needed in some cases, in order to excise all temporary
|
||||
** registers from the middle of the STAT4 buffer.
|
||||
** https://sqlite.org/forum/forumpost/83cb4a95a0 (2023-03-25)
|
||||
*/
|
||||
if( pParse->nTempReg>0 ){
|
||||
int kk;
|
||||
for(kk=0; kk<pParse->nTempReg; kk++){
|
||||
int regT = pParse->aTempReg[kk];
|
||||
testcase( regT>=regCol && regT<regCol+mxCol );
|
||||
}
|
||||
}
|
||||
#endif
|
||||
pParse->nTempReg = 0;
|
||||
}
|
||||
|
||||
addrNext = sqlite3VdbeCurrentAddr(v);
|
||||
|
Reference in New Issue
Block a user