From: drh Date: Fri, 31 May 2013 15:50:39 +0000 (+0000) Subject: Remove the definitions of objects that are no longer used: WhereCost, X-Git-Tag: version-3.8.0~130^2~56 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=8030dc7b1f36e2f0f56c0ae6fc71596996a5105d;p=thirdparty%2Fsqlite.git Remove the definitions of objects that are no longer used: WhereCost, WherePlan, and WhereBestIdx. FossilOrigin-Name: 816f8add7e60de2ef8df4fdac090c244f8dbda39 --- diff --git a/manifest b/manifest index 535b2266fe..1dc7a47d76 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Allow\stracing\sof\swhereLoopInsert()\swhen\sthe\s0x8\sbit\sis\sset\son\s".wheretrace".\nRemove\sthe\suse\sof\ssqlite_query_plan\sfrom\swhere2.test.\s\sFix\sa\sbug\sin\sthe\ncode\sgenerator\sfor\sOR\sclause\soptimizations. -D 2013-05-31T15:18:46.709 +C Remove\sthe\sdefinitions\sof\sobjects\sthat\sare\sno\slonger\sused:\s\sWhereCost,\s\nWherePlan,\sand\sWhereBestIdx. +D 2013-05-31T15:50:39.999 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f F Makefile.in 5e41da95d92656a5004b03d3576e8b226858a28e F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23 @@ -220,7 +220,7 @@ F src/shell.c ab6eea968c8745be3aa74e45fedb37d057b4cd0d F src/sqlite.h.in 5b390ca5d94e09e56e7fee6a51ddde4721b89f8e F src/sqlite3.rc fea433eb0a59f4c9393c8e6d76a6e2596b1fe0c0 F src/sqlite3ext.h d936f797812c28b81b26ed18345baf8db28a21a5 -F src/sqliteInt.h c386fb7c61c03a0a65d78e326016449767be5b93 +F src/sqliteInt.h 3ddccdf8ef912119da26945f2d8dff98f59e1d58 F src/sqliteLimit.h 164b0e6749d31e0daa1a4589a169d31c0dec7b3d F src/status.c bedc37ec1a6bb9399944024d63f4c769971955a9 F src/table.c 2cd62736f845d82200acfa1287e33feb3c15d62e @@ -289,7 +289,7 @@ F src/vtab.c b05e5f1f4902461ba9f5fc49bb7eb7c3a0741a83 F src/wal.c 436bfceb141b9423c45119e68e444358ee0ed35d F src/wal.h df01efe09c5cb8c8e391ff1715cca294f89668a4 F src/walker.c 4fa43583d0a84b48f93b1e88f11adf2065be4e73 -F src/where.c e120e28cb55cea658589ec2eca5764dcfa0396c2 +F src/where.c 586b6c3628b75619542468575706ab3192aad236 F test/8_3_names.test ebbb5cd36741350040fd28b432ceadf495be25b2 F test/aggerror.test a867e273ef9e3d7919f03ef4f0e8c0d2767944f2 F test/aggnested.test 45c0201e28045ad38a530b5a144b73cd4aa2cfd6 @@ -1093,7 +1093,7 @@ F tool/vdbe-compress.tcl f12c884766bd14277f4fcedcae07078011717381 F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4 F tool/warnings.sh fbc018d67fd7395f440c28f33ef0f94420226381 F tool/win/sqlite.vsix 97894c2790eda7b5bce3cc79cb2a8ec2fde9b3ac -P b9578c371ee569dca6a0964019959a93407c8ef9 -R 10e84b9c96bf0dc4179bf10aeea4849d +P 707f0323264c35be14847a6adc49a0dc5eaf4ad2 +R 427cbfc4828d3a50415e243b6cfd8031 U drh -Z 1f5041366a1e7c65f32184b30b5b84bc +Z 69d89052012f1e53f4573be3e4c8c80b diff --git a/manifest.uuid b/manifest.uuid index f519953e67..e1da51f18b 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -707f0323264c35be14847a6adc49a0dc5eaf4ad2 \ No newline at end of file +816f8add7e60de2ef8df4fdac090c244f8dbda39 \ No newline at end of file diff --git a/src/sqliteInt.h b/src/sqliteInt.h index a0e7bba7d6..e99098cd0a 100644 --- a/src/sqliteInt.h +++ b/src/sqliteInt.h @@ -720,7 +720,6 @@ typedef struct UnpackedRecord UnpackedRecord; typedef struct VTable VTable; typedef struct VtabCtx VtabCtx; typedef struct Walker Walker; -typedef struct WherePlan WherePlan; typedef struct WhereInfo WhereInfo; typedef struct WhereLevel WhereLevel; @@ -1949,32 +1948,6 @@ struct SrcList { #define JT_ERROR 0x0040 /* unknown or unsupported join type */ -/* -** A WherePlan object holds information that describes a lookup -** strategy. -** -** This object is intended to be opaque outside of the where.c module. -** It is included here only so that that compiler will know how big it -** is. None of the fields in this object should be used outside of -** the where.c module. -** -** Within the union, pIdx is only used when wsFlags&WHERE_INDEXED is true. -** pTerm is only used when wsFlags&WHERE_MULTI_OR is true. And pVtabIdx -** is only used when wsFlags&WHERE_VIRTUALTABLE is true. It is never the -** case that more than one of these conditions is true. -*/ -struct WherePlan { - u32 wsFlags; /* WHERE_* flags that describe the strategy */ - u16 nEq; /* Number of == constraints */ - u16 nOBSat; /* Number of ORDER BY terms satisfied */ - double nRow; /* Estimated number of rows (for EQP) */ - union { - Index *pIdx; /* Index when WHERE_INDEXED is true */ - struct WhereTerm *pTerm; /* WHERE clause term for OR-search */ - sqlite3_index_info *pVtabIdx; /* Virtual table index to use */ - } u; -}; - /* ** For each nested loop in a WHERE clause implementation, the WhereInfo ** structure contains a single instance of this structure. This structure diff --git a/src/where.c b/src/where.c index 6b4521b40a..eaef66cc8e 100644 --- a/src/where.c +++ b/src/where.c @@ -39,7 +39,6 @@ typedef struct WhereClause WhereClause; typedef struct WhereMaskSet WhereMaskSet; typedef struct WhereOrInfo WhereOrInfo; typedef struct WhereAndInfo WhereAndInfo; -typedef struct WhereCost WhereCost; typedef struct WhereLoop WhereLoop; typedef struct WherePath WherePath; typedef struct WhereTerm WhereTerm; @@ -275,16 +274,6 @@ struct WhereMaskSet { int ix[BMS]; /* Cursor assigned to each bit */ }; -/* -** A WhereCost object records a lookup strategy and the estimated -** cost of pursuing that strategy. -*/ -struct WhereCost { - WherePlan plan; /* The lookup strategy */ - double rCost; /* Overall cost of pursuing this search strategy */ - Bitmask used; /* Bitmask of cursors used by this plan */ -}; - /* ** This object is a factory for WhereLoop objects for a particular query. */ @@ -343,28 +332,6 @@ struct WhereLoopBuilder { #define WHERE_TEMP_INDEX 0x00004000 /* Uses an ephemeral index */ #define WHERE_COVER_SCAN 0x00008000 /* Full scan of a covering index */ -/* -** This module contains many separate subroutines that work together to -** find the best indices to use for accessing a particular table in a query. -** An instance of the following structure holds context information about the -** index search so that it can be more easily passed between the various -** routines. -*/ -typedef struct WhereBestIdx WhereBestIdx; -struct WhereBestIdx { - Parse *pParse; /* Parser context */ - WhereClause *pWC; /* The WHERE clause */ - struct SrcList_item *pSrc; /* The FROM clause term to search */ - Bitmask notReady; /* Mask of cursors not available */ - Bitmask notValid; /* Cursors not available for any purpose */ - ExprList *pOrderBy; /* The ORDER BY clause */ - ExprList *pDistinct; /* The select-list if query is DISTINCT */ - sqlite3_index_info **ppIdxInfo; /* Index information passed to xBestIndex */ - int i, n; /* Which loop is being coded; # of loops */ - WhereLevel *aLevel; /* Info about outer loops */ - WhereCost cost; /* Lowest cost query plan */ -}; - /* ** Initialize a preallocated WhereClause structure. */ @@ -5024,7 +4991,6 @@ WhereInfo *sqlite3WhereBegin( WhereInfo *pWInfo; /* Will become the return value of this function */ Vdbe *v = pParse->pVdbe; /* The virtual database engine */ Bitmask notReady; /* Cursors that are not yet positioned */ - WhereBestIdx sWBI; /* Best index search context */ WhereLoopBuilder sWLB; /* The WhereLoop builder */ WhereMaskSet *pMaskSet; /* The expression mask set */ WhereLevel *pLevel; /* A single level in pWInfo->a[] */ @@ -5034,8 +5000,6 @@ WhereInfo *sqlite3WhereBegin( /* Variable initialization */ - memset(&sWBI, 0, sizeof(sWBI)); - sWBI.pParse = pParse; memset(&sWLB, 0, sizeof(sWLB)); sWLB.pParse = pParse; sWLB.db = pParse->db; @@ -5083,11 +5047,10 @@ WhereInfo *sqlite3WhereBegin( pWInfo->pOrderBy = pOrderBy; pWInfo->pDistinct = pDistinct; pWInfo->iBreak = sqlite3VdbeMakeLabel(v); - pWInfo->pWC = sWBI.pWC = (WhereClause *)&((u8 *)pWInfo)[nByteWInfo]; + pWInfo->pWC = (WhereClause *)&((u8 *)pWInfo)[nByteWInfo]; pWInfo->wctrlFlags = wctrlFlags; pWInfo->savedNQueryLoop = pParse->nQueryLoop; - pMaskSet = (WhereMaskSet*)&sWBI.pWC[1]; - sWBI.aLevel = pWInfo->a; + pMaskSet = (WhereMaskSet*)&pWInfo->pWC[1]; sWLB.pWInfo = pWInfo; sWLB.pWC = pWInfo->pWC; @@ -5099,9 +5062,9 @@ WhereInfo *sqlite3WhereBegin( ** subexpression is separated by an AND operator. */ initMaskSet(pMaskSet); - whereClauseInit(sWBI.pWC, pParse, pMaskSet, wctrlFlags); + whereClauseInit(pWInfo->pWC, pParse, pMaskSet, wctrlFlags); sqlite3ExprCodeConstants(pParse, pWhere); - whereSplit(sWBI.pWC, pWhere, TK_AND); /* IMP: R-15842-53296 */ + whereSplit(pWInfo->pWC, pWhere, TK_AND); /* IMP: R-15842-53296 */ /* Special case: a WHERE clause that is constant. Evaluate the ** expression and either jump over all of the code or fall thru. @@ -5146,7 +5109,7 @@ WhereInfo *sqlite3WhereBegin( ** want to analyze these virtual terms, so start analyzing at the end ** and work forward so that the added virtual terms are never processed. */ - exprAnalyzeAll(pTabList, sWBI.pWC); + exprAnalyzeAll(pTabList, pWInfo->pWC); if( db->mallocFailed ){ goto whereBeginError; } @@ -5155,7 +5118,7 @@ WhereInfo *sqlite3WhereBegin( ** If it is, then set pDistinct to NULL and WhereInfo.eDistinct to ** WHERE_DISTINCT_UNIQUE to tell the caller to ignore the DISTINCT. */ - if( pDistinct && isDistinctRedundant(pParse, pTabList, sWBI.pWC, pDistinct) ){ + if( pDistinct && isDistinctRedundant(pParse,pTabList,pWInfo->pWC,pDistinct) ){ pDistinct = 0; pWInfo->eDistinct = WHERE_DISTINCT_UNIQUE; } @@ -5260,7 +5223,7 @@ WhereInfo *sqlite3WhereBegin( } #ifndef SQLITE_OMIT_AUTOMATIC_INDEX if( (pLoop->wsFlags & WHERE_TEMP_INDEX)!=0 ){ - constructAutomaticIndex(pParse, sWBI.pWC, pTabItem, notReady, pLevel); + constructAutomaticIndex(pParse, pWInfo->pWC, pTabItem, notReady, pLevel); }else #endif if( pLoop->u.btree.pIndex!=0 ){ @@ -5275,7 +5238,7 @@ WhereInfo *sqlite3WhereBegin( VdbeComment((v, "%s", pIx->zName)); } sqlite3CodeVerifySchema(pParse, iDb); - notReady &= ~getMask(sWBI.pWC->pMaskSet, pTabItem->iCursor); + notReady &= ~getMask(pWInfo->pWC->pMaskSet, pTabItem->iCursor); } pWInfo->iTop = sqlite3VdbeCurrentAddr(v); if( db->mallocFailed ) goto whereBeginError;