Index: src/sqliteInt.h ================================================================== --- src/sqliteInt.h +++ src/sqliteInt.h @@ -365,21 +365,10 @@ #endif #if defined(NDEBUG) && defined(SQLITE_DEBUG) # undef NDEBUG #endif -/* SQLITE_DEBUG_COLUMNCACHE is synomous with SQLITE_DEBUG. The -** SQLITE_DEBUG_COLUMNCACHE symbol only exists to provide a convenient -** way to search for all code that deals with verifying correct behavior -** of the column cache. -*/ -#ifdef SQLITE_DEBUG -# define SQLITE_DEBUG_COLUMNCACHE 1 -#else -# undef SQLIT_DEBUG_COLUMNCACHE -#endif - /* ** Enable SQLITE_ENABLE_EXPLAIN_COMMENTS if SQLITE_DEBUG is turned on. */ #if !defined(SQLITE_ENABLE_EXPLAIN_COMMENTS) && defined(SQLITE_DEBUG) # define SQLITE_ENABLE_EXPLAIN_COMMENTS 1 Index: src/vdbe.c ================================================================== --- src/vdbe.c +++ src/vdbe.c @@ -34,22 +34,10 @@ # define memAboutToChange(P,M) sqlite3VdbeMemAboutToChange(P,M) #else # define memAboutToChange(P,M) #endif -/* -** Given a cursor number and a column for a table or index, compute a -** hash value for use in the Mem.iTabColHash value. The iTabColHash -** column is only used for verification - it is omitted from production -** builds. Collisions are harmless in the sense that the correct answer -** still results. The only harm of collisions is that they can potential -** reduce column-cache error detection during SQLITE_DEBUG builds. -** -** No valid hash should be 0. -*/ -#define TableColumnHash(T,C) (((u32)(T)<<16)^(u32)(C+2)) - /* ** The following global variable is incremented every time a cursor ** moves, either by the OP_SeekXX, OP_Next, or OP_Prev opcodes. The test ** procedures use this information to make sure that indices are ** working correctly. This variable has no function other than to @@ -1306,11 +1294,10 @@ memAboutToChange(p, pOut); sqlite3VdbeMemShallowCopy(pOut, pIn1, MEM_Ephem); Deephemeralize(pOut); #ifdef SQLITE_DEBUG pOut->pScopyFrom = 0; - pOut->iTabColHash = 0; #endif REGISTER_TRACE(pOp->p2+pOp->p3-n, pOut); if( (n--)==0 ) break; pOut++; pIn1++; @@ -7442,38 +7429,10 @@ */ case OP_Abortable: { sqlite3VdbeAssertAbortable(p); break; } -#endif - -#ifdef SQLITE_DEBUG_COLUMNCACHE -/* Opcode: SetTabCol P1 P2 P3 * * -** -** Set a flag in register REG[P3] indicating that it holds the value -** of column P2 from the table on cursor P1. This flag is checked -** by a subsequent VerifyTabCol opcode. -** -** This opcode only appears SQLITE_DEBUG builds. It is used to verify -** that the expression table column cache is working correctly. -*/ -case OP_SetTabCol: { - aMem[pOp->p3].iTabColHash = TableColumnHash(pOp->p1,pOp->p2); - break; -} -/* Opcode: VerifyTabCol P1 P2 P3 * * -** -** Verify that register REG[P3] contains the value of column P2 from -** cursor P1. Assert() if this is not the case. -** -** This opcode only appears SQLITE_DEBUG builds. It is used to verify -** that the expression table column cache is working correctly. -*/ -case OP_VerifyTabCol: { - assert( aMem[pOp->p3].iTabColHash == TableColumnHash(pOp->p1,pOp->p2) ); - break; -} #endif /* Opcode: Noop * * * * * ** ** Do nothing. This instruction is often useful as a jump Index: src/vdbeInt.h ================================================================== --- src/vdbeInt.h +++ src/vdbeInt.h @@ -209,14 +209,10 @@ void (*xDel)(void*);/* Destructor for Mem.z - only valid if MEM_Dyn */ #ifdef SQLITE_DEBUG Mem *pScopyFrom; /* This Mem is a shallow copy of pScopyFrom */ u16 mScopyFlags; /* flags value immediately after the shallow copy */ #endif -#ifdef SQLITE_DEBUG_COLUMNCACHE - u32 iTabColHash; /* Hash of table.column that is origin of this value */ - u32 iPadding; /* sqlite3_value objects must be 8-byte aligned */ -#endif }; /* ** Size of struct Mem not including the Mem.zMalloc member or anything that ** follows. Index: src/vdbeapi.c ================================================================== --- src/vdbeapi.c +++ src/vdbeapi.c @@ -970,13 +970,10 @@ /* .xDel = */ (void(*)(void*))0, #ifdef SQLITE_DEBUG /* .pScopyFrom = */ (Mem*)0, /* .mScopyFlags= */ 0, #endif -#ifdef SQLITE_DEBUG_COLUMNCACHE - /* .iTabColHash= */ 0, -#endif }; return &nullMem; } /* Index: src/vdbeaux.c ================================================================== --- src/vdbeaux.c +++ src/vdbeaux.c @@ -1637,13 +1637,10 @@ p->flags = flags; p->szMalloc = 0; #ifdef SQLITE_DEBUG p->pScopyFrom = 0; #endif -#ifdef SQLITE_DEBUG_COLUMNCACHE - p->iTabColHash = 0; -#endif p++; } } /* Index: src/vdbemem.c ================================================================== --- src/vdbemem.c +++ src/vdbemem.c @@ -932,13 +932,10 @@ pX->flags = MEM_Undefined; pX->pScopyFrom = 0; } } pMem->pScopyFrom = 0; -#ifdef SQLITE_DEBUG_COLUMN_CACHE - pMem->iTabColHash = 0; -#endif } #endif /* SQLITE_DEBUG */ /* @@ -955,13 +952,10 @@ void sqlite3VdbeMemShallowCopy(Mem *pTo, const Mem *pFrom, int srcType){ assert( (pFrom->flags & MEM_RowSet)==0 ); assert( pTo->db==pFrom->db ); if( VdbeMemDynamic(pTo) ){ vdbeClrCopy(pTo,pFrom,srcType); return; } memcpy(pTo, pFrom, MEMCELLSIZE); -#ifdef SQLITE_DEBUG_COLUMNCACHE - pTo->iTabColHash = pFrom->iTabColHash; -#endif if( (pFrom->flags&MEM_Static)==0 ){ pTo->flags &= ~(MEM_Dyn|MEM_Static|MEM_Ephem); assert( srcType==MEM_Ephem || srcType==MEM_Static ); pTo->flags |= srcType; } @@ -975,13 +969,10 @@ int rc = SQLITE_OK; assert( (pFrom->flags & MEM_RowSet)==0 ); if( VdbeMemDynamic(pTo) ) vdbeMemClearExternAndSetNull(pTo); memcpy(pTo, pFrom, MEMCELLSIZE); -#ifdef SQLITE_DEBUG_COLUMNCACHE - pTo->iTabColHash = pFrom->iTabColHash; -#endif pTo->flags &= ~MEM_Dyn; if( pTo->flags&(MEM_Str|MEM_Blob) ){ if( 0==(pFrom->flags&MEM_Static) ){ pTo->flags |= MEM_Ephem; rc = sqlite3VdbeMemMakeWriteable(pTo);