diff options
author | drh <drh@noemail.net> | 2018-08-04 16:54:53 +0000 |
---|---|---|
committer | drh <drh@noemail.net> | 2018-08-04 16:54:53 +0000 |
commit | c6ed275fcb7df895811f37f5f25fe4813cb07c89 (patch) | |
tree | e06e6b53c9a1870852ab95bb00de89dd08a687cf /src | |
parent | 8c607191320f828c28418fc42fc64e21f1e3e911 (diff) | |
download | sqlite-c6ed275fcb7df895811f37f5f25fe4813cb07c89.tar.gz sqlite-c6ed275fcb7df895811f37f5f25fe4813cb07c89.zip |
Remove more column-cache residue: The OP_SetColTab and OP_VerifyColTab
opcodes and the associated SQLITE_DEBUG_COLUMNCACHE logic.
FossilOrigin-Name: 80236e81cefdf3d3cda3dbdb6de1575c38e4e248cc4b72ca9ee96d3aa0464bfd
Diffstat (limited to 'src')
-rw-r--r-- | src/sqliteInt.h | 11 | ||||
-rw-r--r-- | src/vdbe.c | 41 | ||||
-rw-r--r-- | src/vdbeInt.h | 4 | ||||
-rw-r--r-- | src/vdbeapi.c | 3 | ||||
-rw-r--r-- | src/vdbeaux.c | 3 | ||||
-rw-r--r-- | src/vdbemem.c | 9 |
6 files changed, 0 insertions, 71 deletions
diff --git a/src/sqliteInt.h b/src/sqliteInt.h index 1cbaf851a..1348d46f6 100644 --- a/src/sqliteInt.h +++ b/src/sqliteInt.h @@ -367,17 +367,6 @@ # 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. */ diff --git a/src/vdbe.c b/src/vdbe.c index 335ba2b8a..3322ea1d0 100644 --- a/src/vdbe.c +++ b/src/vdbe.c @@ -37,18 +37,6 @@ #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 @@ -1308,7 +1296,6 @@ case OP_Copy: { Deephemeralize(pOut); #ifdef SQLITE_DEBUG pOut->pScopyFrom = 0; - pOut->iTabColHash = 0; #endif REGISTER_TRACE(pOp->p2+pOp->p3-n, pOut); if( (n--)==0 ) break; @@ -7446,34 +7433,6 @@ case OP_Abortable: { } #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 diff --git a/src/vdbeInt.h b/src/vdbeInt.h index e291825e3..a15b29a03 100644 --- a/src/vdbeInt.h +++ b/src/vdbeInt.h @@ -211,10 +211,6 @@ struct sqlite3_value { 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 }; /* diff --git a/src/vdbeapi.c b/src/vdbeapi.c index fcc315bc6..b21f70e7e 100644 --- a/src/vdbeapi.c +++ b/src/vdbeapi.c @@ -972,9 +972,6 @@ static const Mem *columnNullValue(void){ /* .pScopyFrom = */ (Mem*)0, /* .mScopyFlags= */ 0, #endif -#ifdef SQLITE_DEBUG_COLUMNCACHE - /* .iTabColHash= */ 0, -#endif }; return &nullMem; } diff --git a/src/vdbeaux.c b/src/vdbeaux.c index f38c141b9..c8b61ba22 100644 --- a/src/vdbeaux.c +++ b/src/vdbeaux.c @@ -1639,9 +1639,6 @@ static void initMemArray(Mem *p, int N, sqlite3 *db, u16 flags){ #ifdef SQLITE_DEBUG p->pScopyFrom = 0; #endif -#ifdef SQLITE_DEBUG_COLUMNCACHE - p->iTabColHash = 0; -#endif p++; } } diff --git a/src/vdbemem.c b/src/vdbemem.c index d0d52ce41..5cdd2bcf6 100644 --- a/src/vdbemem.c +++ b/src/vdbemem.c @@ -934,9 +934,6 @@ void sqlite3VdbeMemAboutToChange(Vdbe *pVdbe, Mem *pMem){ } } pMem->pScopyFrom = 0; -#ifdef SQLITE_DEBUG_COLUMN_CACHE - pMem->iTabColHash = 0; -#endif } #endif /* SQLITE_DEBUG */ @@ -957,9 +954,6 @@ void sqlite3VdbeMemShallowCopy(Mem *pTo, const Mem *pFrom, int srcType){ 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 ); @@ -977,9 +971,6 @@ int sqlite3VdbeMemCopy(Mem *pTo, const Mem *pFrom){ 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) ){ |