Change the name of WhereInfo.pDistinctSet to pResultSet, since it is now

used for more than just DISTINCT processing.

FossilOrigin-Name: 9fc5cd505fe6ab043519d68e999d2285e22452af
This commit is contained in:
drh 2017-02-16 20:52:52 +00:00
parent 5c258dc1cc
commit e9ba910f0d
4 changed files with 17 additions and 17 deletions

View File

@ -1,5 +1,5 @@
C Change\stwo\sMallocZero()\scalls\sinto\sMallocRaw()\sto\savoid\sunnecessary\smemset().
D 2017-02-16T17:18:07.363
C Change\sthe\sname\sof\sWhereInfo.pDistinctSet\sto\spResultSet,\ssince\sit\sis\snow\nused\sfor\smore\sthan\sjust\sDISTINCT\sprocessing.
D 2017-02-16T20:52:52.517
F Makefile.in edb6bcdd37748d2b1c3422ff727c748df7ffe918
F Makefile.linux-gcc 7bc79876b875010e8c8f9502eb935ca92aa3c434
F Makefile.msc 067a6766f800cc8d72845ab61f8de4ffe8f3fc99
@ -475,8 +475,8 @@ F src/vxworks.h d2988f4e5a61a4dfe82c6524dd3d6e4f2ce3cdb9
F src/wal.c 40c543f0a2195d1b0dc88ef12142bea690009344
F src/wal.h 06b2a0b599cc0f53ea97f497cf8c6b758c999f71
F src/walker.c 91a6df7435827e41cff6bb7df50ea00934ee78b0
F src/where.c 6397fab50fdbf9bde76c574ce07b3b776eb28b34
F src/whereInt.h 2bcc3d176e6091cb8f50a30b65c006e88a73614d
F src/where.c 01baf58b72f3ddb7793cdee2871f751e3e09b35e
F src/whereInt.h c0b092180f04608d80c258174b0a14a1f9c8d02f
F src/wherecode.c 677e95413c472c0b413023b6b69a47f40fce1b04
F src/whereexpr.c 130cdd1a43af71b19755270fb1224874cf55158c
F test/8_3_names.test ebbb5cd36741350040fd28b432ceadf495be25b2
@ -1556,7 +1556,7 @@ F vsixtest/vsixtest.tcl 6a9a6ab600c25a91a7acc6293828957a386a8a93
F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc
F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e
F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0
P bb8e264227175fc93f1c86a0083f8ad6c4ce2dc7
R 99427a1cfe699c929367ef60ee07c16f
P ff5e733cbffd73faa4046e0f1c7f24bb6e131738
R 771ea12d7c4097594afa32049854d91e
U drh
Z 3888dc5073b69fac4d8570651367948c
Z f13a633082a8173e1922e71dbb49e7e9

View File

@ -1 +1 @@
ff5e733cbffd73faa4046e0f1c7f24bb6e131738
9fc5cd505fe6ab043519d68e999d2285e22452af

View File

@ -4114,9 +4114,9 @@ static int wherePathSolver(WhereInfo *pWInfo, LogEst nRowEst){
&& nRowEst
){
Bitmask notUsed;
int rc = wherePathSatisfiesOrderBy(pWInfo, pWInfo->pDistinctSet, pFrom,
int rc = wherePathSatisfiesOrderBy(pWInfo, pWInfo->pResultSet, pFrom,
WHERE_DISTINCTBY, nLoop-1, pFrom->aLoop[nLoop-1], &notUsed);
if( rc==pWInfo->pDistinctSet->nExpr ){
if( rc==pWInfo->pResultSet->nExpr ){
pWInfo->eDistinct = WHERE_DISTINCT_ORDERED;
}
}
@ -4353,7 +4353,7 @@ WhereInfo *sqlite3WhereBegin(
SrcList *pTabList, /* FROM clause: A list of all tables to be scanned */
Expr *pWhere, /* The WHERE clause */
ExprList *pOrderBy, /* An ORDER BY (or GROUP BY) clause, or NULL */
ExprList *pDistinctSet, /* Try not to output two rows that duplicate these */
ExprList *pResultSet, /* Query result set. Req'd for DISTINCT */
u16 wctrlFlags, /* The WHERE_* flags defined in sqliteInt.h */
int iAuxArg /* If WHERE_OR_SUBCLAUSE is set, index cursor number
** If WHERE_USE_LIMIT, then the limit amount */
@ -4429,7 +4429,7 @@ WhereInfo *sqlite3WhereBegin(
pWInfo->pParse = pParse;
pWInfo->pTabList = pTabList;
pWInfo->pOrderBy = pOrderBy;
pWInfo->pDistinctSet = pDistinctSet;
pWInfo->pResultSet = pResultSet;
pWInfo->aiCurOnePass[0] = pWInfo->aiCurOnePass[1] = -1;
pWInfo->nLevel = nTabList;
pWInfo->iBreak = pWInfo->iContinue = sqlite3VdbeMakeLabel(v);
@ -4507,13 +4507,13 @@ WhereInfo *sqlite3WhereBegin(
if( db->mallocFailed ) goto whereBeginError;
if( wctrlFlags & WHERE_WANT_DISTINCT ){
if( isDistinctRedundant(pParse, pTabList, &pWInfo->sWC, pDistinctSet) ){
if( isDistinctRedundant(pParse, pTabList, &pWInfo->sWC, pResultSet) ){
/* The DISTINCT marking is pointless. Ignore it. */
pWInfo->eDistinct = WHERE_DISTINCT_UNIQUE;
}else if( pOrderBy==0 ){
/* Try to ORDER BY the result set to make distinct processing easier */
pWInfo->wctrlFlags |= WHERE_DISTINCTBY;
pWInfo->pOrderBy = pDistinctSet;
pWInfo->pOrderBy = pResultSet;
}
}
@ -4589,10 +4589,10 @@ WhereInfo *sqlite3WhereBegin(
#endif
/* Attempt to omit tables from the join that do not effect the result */
if( pWInfo->nLevel>=2
&& pDistinctSet!=0
&& pResultSet!=0
&& OptimizationEnabled(db, SQLITE_OmitNoopJoin)
){
Bitmask tabUsed = sqlite3WhereExprListUsage(pMaskSet, pDistinctSet);
Bitmask tabUsed = sqlite3WhereExprListUsage(pMaskSet, pResultSet);
if( sWLB.pOrderBy ){
tabUsed |= sqlite3WhereExprListUsage(pMaskSet, sWLB.pOrderBy);
}

View File

@ -411,7 +411,7 @@ struct WhereInfo {
Parse *pParse; /* Parsing and code generating context */
SrcList *pTabList; /* List of tables in the join */
ExprList *pOrderBy; /* The ORDER BY clause or NULL */
ExprList *pDistinctSet; /* DISTINCT over all these values */
ExprList *pResultSet; /* Result set of the query */
LogEst iLimit; /* LIMIT if wctrlFlags has WHERE_USE_LIMIT */
int aiCurOnePass[2]; /* OP_OpenWrite cursors for the ONEPASS opt */
int iContinue; /* Jump here to continue with next record */