aboutsummaryrefslogtreecommitdiff
path: root/src/expr.c
diff options
context:
space:
mode:
authordrh <drh@noemail.net>2009-12-30 01:13:11 +0000
committerdrh <drh@noemail.net>2009-12-30 01:13:11 +0000
commit27ee406e2ca7ad7059cf58f9d4c20c04f96774ba (patch)
tree20849651a8c100cfe1f3b0a8cc8c82d656dc7af8 /src/expr.c
parentc82b7513bf9cebe6e646f129437fe4b8edce3050 (diff)
downloadsqlite-27ee406e2ca7ad7059cf58f9d4c20c04f96774ba.tar.gz
sqlite-27ee406e2ca7ad7059cf58f9d4c20c04f96774ba.zip
Remove some code in the column cache that is no longer used. Replace it with
an assert(). FossilOrigin-Name: 1f890efb7863bd743b9f6ef841e0c0c4e67d76e1
Diffstat (limited to 'src/expr.c')
-rw-r--r--src/expr.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/expr.c b/src/expr.c
index f7f648f9b..e0d13693c 100644
--- a/src/expr.c
+++ b/src/expr.c
@@ -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++){