1
0
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:
drh
2023-03-25 18:31:24 +00:00
parent e5895333dd
commit 4924e82863
3 changed files with 22 additions and 7 deletions

View File

@@ -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);