mirror of
https://github.com/sqlite/sqlite.git
synced 2025-11-12 13:01:09 +03:00
Rename WhereInfo.pResultSet to pDistinctSet to more accurately reflect what
it represents. FossilOrigin-Name: 5317961411695e107e8cefdeaba62280429979ca
This commit is contained in:
14
manifest
14
manifest
@@ -1,5 +1,5 @@
|
|||||||
C Since\sthe\sreturn\svalue\sof\ssqlite3OsClose()\sis\salways\signored,\swe\smight\sas\nwell\smake\sit\s"void"\sinstead\sof\s"int",\sand\sthereby\ssave\s50\sbytes\sin\sthe\ncompiled\sbinary.
|
C Rename\sWhereInfo.pResultSet\sto\spDistinctSet\sto\smore\saccurately\sreflect\swhat\nit\srepresents.
|
||||||
D 2016-04-14T13:16:58.757
|
D 2016-04-14T13:35:26.807
|
||||||
F Makefile.in eba680121821b8a60940a81454316f47a341487a
|
F Makefile.in eba680121821b8a60940a81454316f47a341487a
|
||||||
F Makefile.linux-gcc 7bc79876b875010e8c8f9502eb935ca92aa3c434
|
F Makefile.linux-gcc 7bc79876b875010e8c8f9502eb935ca92aa3c434
|
||||||
F Makefile.msc 71b8b16cf9393f68e2e2035486ca104872558836
|
F Makefile.msc 71b8b16cf9393f68e2e2035486ca104872558836
|
||||||
@@ -455,8 +455,8 @@ F src/vxworks.h d2988f4e5a61a4dfe82c6524dd3d6e4f2ce3cdb9
|
|||||||
F src/wal.c 4db22ed7e77bcf672b1a685d6ddeffba8d5be302
|
F src/wal.c 4db22ed7e77bcf672b1a685d6ddeffba8d5be302
|
||||||
F src/wal.h 2f7c831cf3b071fa548bf2d5cac640846a7ff19c
|
F src/wal.h 2f7c831cf3b071fa548bf2d5cac640846a7ff19c
|
||||||
F src/walker.c 0f142b5bd3ed2041fc52d773880748b212e63354
|
F src/walker.c 0f142b5bd3ed2041fc52d773880748b212e63354
|
||||||
F src/where.c 24ab561466d92d313747c04edb1a36a7af8663be
|
F src/where.c bae50f2f18f9e8584549a77363858623b07e4915
|
||||||
F src/whereInt.h 93297d56edd137b7ea004490690fb6e2ce028a34
|
F src/whereInt.h 43466b107862e348e5c2a709cc4812a611e27908
|
||||||
F src/wherecode.c 8fdad9fbba723df1c1e8d07e7ea8507572040340
|
F src/wherecode.c 8fdad9fbba723df1c1e8d07e7ea8507572040340
|
||||||
F src/whereexpr.c eacc0e60d029a082b4fc0cc42ea98544add1319e
|
F src/whereexpr.c eacc0e60d029a082b4fc0cc42ea98544add1319e
|
||||||
F test/8_3_names.test ebbb5cd36741350040fd28b432ceadf495be25b2
|
F test/8_3_names.test ebbb5cd36741350040fd28b432ceadf495be25b2
|
||||||
@@ -1482,7 +1482,7 @@ F vsixtest/vsixtest.tcl 6a9a6ab600c25a91a7acc6293828957a386a8a93
|
|||||||
F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc
|
F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc
|
||||||
F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e
|
F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e
|
||||||
F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0
|
F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0
|
||||||
P 5a46914510af4d5557b299db65c68d5df1070766
|
P 7ee570e7a9a2159a8c0d41805c00f91ca0de00e3
|
||||||
R c53fd5d7b34fa75485d686014ecb828c
|
R ba684bc23f92ec8865bd177b82e2674c
|
||||||
U drh
|
U drh
|
||||||
Z 23b6889e197e2a1c3244550aa7848950
|
Z 37e357b73543209990ea5ecc9fc91d8e
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
7ee570e7a9a2159a8c0d41805c00f91ca0de00e3
|
5317961411695e107e8cefdeaba62280429979ca
|
||||||
30
src/where.c
30
src/where.c
@@ -3881,9 +3881,9 @@ static int wherePathSolver(WhereInfo *pWInfo, LogEst nRowEst){
|
|||||||
&& nRowEst
|
&& nRowEst
|
||||||
){
|
){
|
||||||
Bitmask notUsed;
|
Bitmask notUsed;
|
||||||
int rc = wherePathSatisfiesOrderBy(pWInfo, pWInfo->pResultSet, pFrom,
|
int rc = wherePathSatisfiesOrderBy(pWInfo, pWInfo->pDistinctSet, pFrom,
|
||||||
WHERE_DISTINCTBY, nLoop-1, pFrom->aLoop[nLoop-1], ¬Used);
|
WHERE_DISTINCTBY, nLoop-1, pFrom->aLoop[nLoop-1], ¬Used);
|
||||||
if( rc==pWInfo->pResultSet->nExpr ){
|
if( rc==pWInfo->pDistinctSet->nExpr ){
|
||||||
pWInfo->eDistinct = WHERE_DISTINCT_ORDERED;
|
pWInfo->eDistinct = WHERE_DISTINCT_ORDERED;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -4098,14 +4098,14 @@ static int whereShortCut(WhereLoopBuilder *pBuilder){
|
|||||||
** used.
|
** used.
|
||||||
*/
|
*/
|
||||||
WhereInfo *sqlite3WhereBegin(
|
WhereInfo *sqlite3WhereBegin(
|
||||||
Parse *pParse, /* The parser context */
|
Parse *pParse, /* The parser context */
|
||||||
SrcList *pTabList, /* FROM clause: A list of all tables to be scanned */
|
SrcList *pTabList, /* FROM clause: A list of all tables to be scanned */
|
||||||
Expr *pWhere, /* The WHERE clause */
|
Expr *pWhere, /* The WHERE clause */
|
||||||
ExprList *pOrderBy, /* An ORDER BY (or GROUP BY) clause, or NULL */
|
ExprList *pOrderBy, /* An ORDER BY (or GROUP BY) clause, or NULL */
|
||||||
ExprList *pResultSet, /* Result set of the query */
|
ExprList *pDistinctSet, /* Try not to output two rows that duplicate these */
|
||||||
u16 wctrlFlags, /* One of the WHERE_* flags defined in sqliteInt.h */
|
u16 wctrlFlags, /* The WHERE_* flags defined in sqliteInt.h */
|
||||||
int iAuxArg /* If WHERE_ONETABLE_ONLY is set, index cursor number,
|
int iAuxArg /* If WHERE_ONETABLE_ONLY is set, index cursor number
|
||||||
** If WHERE_USE_LIMIT, then the limit amount */
|
** If WHERE_USE_LIMIT, then the limit amount */
|
||||||
){
|
){
|
||||||
int nByteWInfo; /* Num. bytes allocated for WhereInfo struct */
|
int nByteWInfo; /* Num. bytes allocated for WhereInfo struct */
|
||||||
int nTabList; /* Number of elements in pTabList */
|
int nTabList; /* Number of elements in pTabList */
|
||||||
@@ -4180,7 +4180,7 @@ WhereInfo *sqlite3WhereBegin(
|
|||||||
pWInfo->pParse = pParse;
|
pWInfo->pParse = pParse;
|
||||||
pWInfo->pTabList = pTabList;
|
pWInfo->pTabList = pTabList;
|
||||||
pWInfo->pOrderBy = pOrderBy;
|
pWInfo->pOrderBy = pOrderBy;
|
||||||
pWInfo->pResultSet = pResultSet;
|
pWInfo->pDistinctSet = pDistinctSet;
|
||||||
pWInfo->iBreak = pWInfo->iContinue = sqlite3VdbeMakeLabel(v);
|
pWInfo->iBreak = pWInfo->iContinue = sqlite3VdbeMakeLabel(v);
|
||||||
pWInfo->wctrlFlags = wctrlFlags;
|
pWInfo->wctrlFlags = wctrlFlags;
|
||||||
pWInfo->iLimit = iAuxArg;
|
pWInfo->iLimit = iAuxArg;
|
||||||
@@ -4253,13 +4253,13 @@ WhereInfo *sqlite3WhereBegin(
|
|||||||
if( db->mallocFailed ) goto whereBeginError;
|
if( db->mallocFailed ) goto whereBeginError;
|
||||||
|
|
||||||
if( wctrlFlags & WHERE_WANT_DISTINCT ){
|
if( wctrlFlags & WHERE_WANT_DISTINCT ){
|
||||||
if( isDistinctRedundant(pParse, pTabList, &pWInfo->sWC, pResultSet) ){
|
if( isDistinctRedundant(pParse, pTabList, &pWInfo->sWC, pDistinctSet) ){
|
||||||
/* The DISTINCT marking is pointless. Ignore it. */
|
/* The DISTINCT marking is pointless. Ignore it. */
|
||||||
pWInfo->eDistinct = WHERE_DISTINCT_UNIQUE;
|
pWInfo->eDistinct = WHERE_DISTINCT_UNIQUE;
|
||||||
}else if( pOrderBy==0 ){
|
}else if( pOrderBy==0 ){
|
||||||
/* Try to ORDER BY the result set to make distinct processing easier */
|
/* Try to ORDER BY the result set to make distinct processing easier */
|
||||||
pWInfo->wctrlFlags |= WHERE_DISTINCTBY;
|
pWInfo->wctrlFlags |= WHERE_DISTINCTBY;
|
||||||
pWInfo->pOrderBy = pResultSet;
|
pWInfo->pOrderBy = pDistinctSet;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -4338,10 +4338,10 @@ WhereInfo *sqlite3WhereBegin(
|
|||||||
#endif
|
#endif
|
||||||
/* Attempt to omit tables from the join that do not effect the result */
|
/* Attempt to omit tables from the join that do not effect the result */
|
||||||
if( pWInfo->nLevel>=2
|
if( pWInfo->nLevel>=2
|
||||||
&& pResultSet!=0
|
&& pDistinctSet!=0
|
||||||
&& OptimizationEnabled(db, SQLITE_OmitNoopJoin)
|
&& OptimizationEnabled(db, SQLITE_OmitNoopJoin)
|
||||||
){
|
){
|
||||||
Bitmask tabUsed = sqlite3WhereExprListUsage(pMaskSet, pResultSet);
|
Bitmask tabUsed = sqlite3WhereExprListUsage(pMaskSet, pDistinctSet);
|
||||||
if( sWLB.pOrderBy ){
|
if( sWLB.pOrderBy ){
|
||||||
tabUsed |= sqlite3WhereExprListUsage(pMaskSet, sWLB.pOrderBy);
|
tabUsed |= sqlite3WhereExprListUsage(pMaskSet, sWLB.pOrderBy);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -408,7 +408,7 @@ struct WhereInfo {
|
|||||||
Parse *pParse; /* Parsing and code generating context */
|
Parse *pParse; /* Parsing and code generating context */
|
||||||
SrcList *pTabList; /* List of tables in the join */
|
SrcList *pTabList; /* List of tables in the join */
|
||||||
ExprList *pOrderBy; /* The ORDER BY clause or NULL */
|
ExprList *pOrderBy; /* The ORDER BY clause or NULL */
|
||||||
ExprList *pResultSet; /* Result set. DISTINCT operates on these */
|
ExprList *pDistinctSet; /* DISTINCT over all these values */
|
||||||
WhereLoop *pLoops; /* List of all WhereLoop objects */
|
WhereLoop *pLoops; /* List of all WhereLoop objects */
|
||||||
Bitmask revMask; /* Mask of ORDER BY terms that need reversing */
|
Bitmask revMask; /* Mask of ORDER BY terms that need reversing */
|
||||||
LogEst nRowOut; /* Estimated number of output rows */
|
LogEst nRowOut; /* Estimated number of output rows */
|
||||||
|
|||||||
Reference in New Issue
Block a user