1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-11-08 03:22:21 +03:00

Remove some code in the column cache that is no longer used. Replace it with

an assert().

FossilOrigin-Name: 1f890efb7863bd743b9f6ef841e0c0c4e67d76e1
This commit is contained in:
drh
2009-12-30 01:13:11 +00:00
parent c82b7513bf
commit 27ee406e2c
3 changed files with 20 additions and 11 deletions

View File

@@ -1964,8 +1964,14 @@ void sqlite3ExprCacheStore(Parse *pParse, int iTab, int iCol, int iReg){
*/
if( pParse->db->flags & SQLITE_ColumnCache ) return;
/* First replace any existing entry */
/* First replace any existing entry.
**
** Actually, the way the column cache is currently used, we are guaranteed
** that the object will never already be in cache. Verify this guarantee.
*/
#ifndef NDEBUG
for(i=0, p=pParse->aColCache; i<SQLITE_N_COLCACHE; i++, p++){
#if 0 /* This code wold remove the entry from the cache if it existed */
if( p->iReg && p->iTable==iTab && p->iColumn==iCol ){
cacheEntryClear(pParse, p);
p->iLevel = pParse->iCacheLevel;
@@ -1973,7 +1979,10 @@ void sqlite3ExprCacheStore(Parse *pParse, int iTab, int iCol, int iReg){
p->lru = pParse->iCacheCnt++;
return;
}
#endif
assert( p->iReg==0 || p->iTable!=iTab || p->iColumn!=iCol );
}
#endif
/* Find an empty slot and replace it */
for(i=0, p=pParse->aColCache; i<SQLITE_N_COLCACHE; i++, p++){