1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-11-12 13:01:09 +03:00

Remove an unnecessary parameter from selectInnerLoop().

FossilOrigin-Name: dd95887f82739d05585edfb70913fdaaab154de46c4d3113dd32d283767fb6fc
This commit is contained in:
drh
2017-09-15 17:40:34 +00:00
parent 3df6c3b1c5
commit 2def2f7e0a
3 changed files with 25 additions and 25 deletions

View File

@@ -1,5 +1,5 @@
C Improved\sthe\sheader-comment\sdocumentation\son\ssqlite3ExprCodeExprList().\nNo\schanges\sto\scode. C Remove\san\sunnecessary\sparameter\sfrom\sselectInnerLoop().
D 2017-09-15T15:38:01.722 D 2017-09-15T17:40:34.507
F Makefile.in c644bbe8ebe4aae82ad6783eae6b6beea4c727b99ff97568b847ced5e2ac7afb F Makefile.in c644bbe8ebe4aae82ad6783eae6b6beea4c727b99ff97568b847ced5e2ac7afb
F Makefile.linux-gcc 7bc79876b875010e8c8f9502eb935ca92aa3c434 F Makefile.linux-gcc 7bc79876b875010e8c8f9502eb935ca92aa3c434
F Makefile.msc 6a7a74bf60ad395098c0bd175ab054cd65ef85d7f034198d52bcc4d9e5fb4c6b F Makefile.msc 6a7a74bf60ad395098c0bd175ab054cd65ef85d7f034198d52bcc4d9e5fb4c6b
@@ -457,7 +457,7 @@ F src/printf.c 40aee47ae9be4bd3dbdc8968bd07fddc027be8edec8daddf24d3391d36698a1c
F src/random.c 80f5d666f23feb3e6665a6ce04c7197212a88384 F src/random.c 80f5d666f23feb3e6665a6ce04c7197212a88384
F src/resolve.c 4324a94573b1e29286f8121e4881db59eaedc014afeb274c8d3e07ed282e0e20 F src/resolve.c 4324a94573b1e29286f8121e4881db59eaedc014afeb274c8d3e07ed282e0e20
F src/rowset.c 7b7e7e479212e65b723bf40128c7b36dc5afdfac F src/rowset.c 7b7e7e479212e65b723bf40128c7b36dc5afdfac
F src/select.c c9b3d8444bbf6f167d84f41ca6f3672e2521cb163a8c706b19058dc82fffe9b8 F src/select.c 5945cf1a5426c279c9f3c6ad16d24c3dc55349b69afba4f35cf3fe115418b122
F src/shell.c c1206a23d9239f8f51751d3be9b8c3b02fa4103546bea1add7f864d84a8276ab F src/shell.c c1206a23d9239f8f51751d3be9b8c3b02fa4103546bea1add7f864d84a8276ab
F src/shell.c.in bb9720a8c5c98d3984b16ab7540e7142bcae959666ecf248bfc523a1d44220ee F src/shell.c.in bb9720a8c5c98d3984b16ab7540e7142bcae959666ecf248bfc523a1d44220ee
F src/sqlite.h.in ab4f8a29d1580dfaeb6891fa1b83cff8229ba0daa56994707ceaca71495d9ab7 F src/sqlite.h.in ab4f8a29d1580dfaeb6891fa1b83cff8229ba0daa56994707ceaca71495d9ab7
@@ -1654,7 +1654,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 4da49a95c0f07ed7790169e8833c3e2dacda504a3d997f567572020148abe30b P 5dc3ecb5f67968545fb35ceed61ad625e069c4e744c5c3ebaea65e2fee347a5f
R bec2d8e8b1fdf47c35ba1679c00b4d84 R bedf4233ae6bc36b349315bc4854b90d
U drh U drh
Z 9190f931e57ef2b5b105e255f9cf8a27 Z 884e6c4ed9b99d145e55ac32471e70b4

View File

@@ -1 +1 @@
5dc3ecb5f67968545fb35ceed61ad625e069c4e744c5c3ebaea65e2fee347a5f dd95887f82739d05585edfb70913fdaaab154de46c4d3113dd32d283767fb6fc

View File

@@ -664,16 +664,15 @@ static void codeDistinct(
** This routine generates the code for the inside of the inner loop ** This routine generates the code for the inside of the inner loop
** of a SELECT. ** of a SELECT.
** **
** If srcTab is negative, then the pEList expressions ** If srcTab is negative, then the p->pEList expressions
** are evaluated in order to get the data for this row. If srcTab is ** are evaluated in order to get the data for this row. If srcTab is
** zero or more, then data is pulled from srcTab and pEList is used only ** zero or more, then data is pulled from srcTab and p->pEList is used only
** to get the number of columns and the collation sequence for each column. ** to get the number of columns and the collation sequence for each column.
*/ */
static void selectInnerLoop( static void selectInnerLoop(
Parse *pParse, /* The parser context */ Parse *pParse, /* The parser context */
Select *p, /* The complete select statement being coded */ Select *p, /* The complete select statement being coded */
ExprList *pEList, /* List of values being extracted */ int srcTab, /* Pull data from this table if non-negative */
int srcTab, /* Pull data from this table */
SortCtx *pSort, /* If not NULL, info on how to process ORDER BY */ SortCtx *pSort, /* If not NULL, info on how to process ORDER BY */
DistinctCtx *pDistinct, /* If not NULL, info on how to process DISTINCT */ DistinctCtx *pDistinct, /* If not NULL, info on how to process DISTINCT */
SelectDest *pDest, /* How to dispose of the results */ SelectDest *pDest, /* How to dispose of the results */
@@ -697,7 +696,7 @@ static void selectInnerLoop(
int regOrig; /* Start of memory holding full result (or 0) */ int regOrig; /* Start of memory holding full result (or 0) */
assert( v ); assert( v );
assert( pEList!=0 ); assert( p->pEList!=0 );
hasDistinct = pDistinct ? pDistinct->eTnctType : WHERE_DISTINCT_NOOP; hasDistinct = pDistinct ? pDistinct->eTnctType : WHERE_DISTINCT_NOOP;
if( pSort && pSort->pOrderBy==0 ) pSort = 0; if( pSort && pSort->pOrderBy==0 ) pSort = 0;
if( pSort==0 && !hasDistinct ){ if( pSort==0 && !hasDistinct ){
@@ -707,7 +706,7 @@ static void selectInnerLoop(
/* Pull the requested columns. /* Pull the requested columns.
*/ */
nResultCol = pEList->nExpr; nResultCol = p->pEList->nExpr;
if( pDest->iSdst==0 ){ if( pDest->iSdst==0 ){
if( pSort ){ if( pSort ){
@@ -730,7 +729,7 @@ static void selectInnerLoop(
if( srcTab>=0 ){ if( srcTab>=0 ){
for(i=0; i<nResultCol; i++){ for(i=0; i<nResultCol; i++){
sqlite3VdbeAddOp3(v, OP_Column, srcTab, i, regResult+i); sqlite3VdbeAddOp3(v, OP_Column, srcTab, i, regResult+i);
VdbeComment((v, "%s", pEList->a[i].zName)); VdbeComment((v, "%s", p->pEList->a[i].zName));
} }
}else if( eDest!=SRT_Exists ){ }else if( eDest!=SRT_Exists ){
/* If the destination is an EXISTS(...) expression, the actual /* If the destination is an EXISTS(...) expression, the actual
@@ -743,24 +742,24 @@ static void selectInnerLoop(
ecelFlags = 0; ecelFlags = 0;
} }
if( pSort && hasDistinct==0 && eDest!=SRT_EphemTab && eDest!=SRT_Table ){ if( pSort && hasDistinct==0 && eDest!=SRT_EphemTab && eDest!=SRT_Table ){
/* For each expression in pEList that is a copy of an expression in /* For each expression in p->pEList that is a copy of an expression in
** the ORDER BY clause (pSort->pOrderBy), set the associated ** the ORDER BY clause (pSort->pOrderBy), set the associated
** iOrderByCol value to one more than the index of the ORDER BY ** iOrderByCol value to one more than the index of the ORDER BY
** expression within the sort-key that pushOntoSorter() will generate. ** expression within the sort-key that pushOntoSorter() will generate.
** This allows the pEList field to be omitted from the sorted record, ** This allows the p->pEList field to be omitted from the sorted record,
** saving space and CPU cycles. */ ** saving space and CPU cycles. */
ecelFlags |= (SQLITE_ECEL_OMITREF|SQLITE_ECEL_REF); ecelFlags |= (SQLITE_ECEL_OMITREF|SQLITE_ECEL_REF);
for(i=pSort->nOBSat; i<pSort->pOrderBy->nExpr; i++){ for(i=pSort->nOBSat; i<pSort->pOrderBy->nExpr; i++){
int j; int j;
if( (j = pSort->pOrderBy->a[i].u.x.iOrderByCol)>0 ){ if( (j = pSort->pOrderBy->a[i].u.x.iOrderByCol)>0 ){
pEList->a[j-1].u.x.iOrderByCol = i+1-pSort->nOBSat; p->pEList->a[j-1].u.x.iOrderByCol = i+1-pSort->nOBSat;
} }
} }
regOrig = 0; regOrig = 0;
assert( eDest==SRT_Set || eDest==SRT_Mem assert( eDest==SRT_Set || eDest==SRT_Mem
|| eDest==SRT_Coroutine || eDest==SRT_Output ); || eDest==SRT_Coroutine || eDest==SRT_Output );
} }
nResultCol = sqlite3ExprCodeExprList(pParse,pEList,regResult,0,ecelFlags); nResultCol = sqlite3ExprCodeExprList(pParse,p->pEList,regResult,0,ecelFlags);
} }
/* If the DISTINCT keyword was present on the SELECT statement /* If the DISTINCT keyword was present on the SELECT statement
@@ -792,7 +791,7 @@ static void selectInnerLoop(
iJump = sqlite3VdbeCurrentAddr(v) + nResultCol; iJump = sqlite3VdbeCurrentAddr(v) + nResultCol;
for(i=0; i<nResultCol; i++){ for(i=0; i<nResultCol; i++){
CollSeq *pColl = sqlite3ExprCollSeq(pParse, pEList->a[i].pExpr); CollSeq *pColl = sqlite3ExprCollSeq(pParse, p->pEList->a[i].pExpr);
if( i<nResultCol-1 ){ if( i<nResultCol-1 ){
sqlite3VdbeAddOp3(v, OP_Ne, regResult+i, iJump, regPrev+i); sqlite3VdbeAddOp3(v, OP_Ne, regResult+i, iJump, regPrev+i);
VdbeCoverage(v); VdbeCoverage(v);
@@ -2147,7 +2146,7 @@ static void generateWithRecursiveQuery(
/* Output the single row in Current */ /* Output the single row in Current */
addrCont = sqlite3VdbeMakeLabel(v); addrCont = sqlite3VdbeMakeLabel(v);
codeOffset(v, regOffset, addrCont); codeOffset(v, regOffset, addrCont);
selectInnerLoop(pParse, p, p->pEList, iCurrent, selectInnerLoop(pParse, p, iCurrent,
0, 0, pDest, addrCont, addrBreak); 0, 0, pDest, addrCont, addrBreak);
if( regLimit ){ if( regLimit ){
sqlite3VdbeAddOp2(v, OP_DecrJumpZero, regLimit, addrBreak); sqlite3VdbeAddOp2(v, OP_DecrJumpZero, regLimit, addrBreak);
@@ -2466,7 +2465,7 @@ static int multiSelect(
computeLimitRegisters(pParse, p, iBreak); computeLimitRegisters(pParse, p, iBreak);
sqlite3VdbeAddOp2(v, OP_Rewind, unionTab, iBreak); VdbeCoverage(v); sqlite3VdbeAddOp2(v, OP_Rewind, unionTab, iBreak); VdbeCoverage(v);
iStart = sqlite3VdbeCurrentAddr(v); iStart = sqlite3VdbeCurrentAddr(v);
selectInnerLoop(pParse, p, p->pEList, unionTab, selectInnerLoop(pParse, p, unionTab,
0, 0, &dest, iCont, iBreak); 0, 0, &dest, iCont, iBreak);
sqlite3VdbeResolveLabel(v, iCont); sqlite3VdbeResolveLabel(v, iCont);
sqlite3VdbeAddOp2(v, OP_Next, unionTab, iStart); VdbeCoverage(v); sqlite3VdbeAddOp2(v, OP_Next, unionTab, iStart); VdbeCoverage(v);
@@ -2539,7 +2538,7 @@ static int multiSelect(
iStart = sqlite3VdbeAddOp2(v, OP_RowData, tab1, r1); iStart = sqlite3VdbeAddOp2(v, OP_RowData, tab1, r1);
sqlite3VdbeAddOp4Int(v, OP_NotFound, tab2, iCont, r1, 0); VdbeCoverage(v); sqlite3VdbeAddOp4Int(v, OP_NotFound, tab2, iCont, r1, 0); VdbeCoverage(v);
sqlite3ReleaseTempReg(pParse, r1); sqlite3ReleaseTempReg(pParse, r1);
selectInnerLoop(pParse, p, p->pEList, tab1, selectInnerLoop(pParse, p, tab1,
0, 0, &dest, iCont, iBreak); 0, 0, &dest, iCont, iBreak);
sqlite3VdbeResolveLabel(v, iCont); sqlite3VdbeResolveLabel(v, iCont);
sqlite3VdbeAddOp2(v, OP_Next, tab1, iStart); VdbeCoverage(v); sqlite3VdbeAddOp2(v, OP_Next, tab1, iStart); VdbeCoverage(v);
@@ -5545,7 +5544,8 @@ int sqlite3Select(
} }
/* Use the standard inner loop. */ /* Use the standard inner loop. */
selectInnerLoop(pParse, p, pEList, -1, &sSort, &sDistinct, pDest, assert( p->pEList==pEList );
selectInnerLoop(pParse, p, -1, &sSort, &sDistinct, pDest,
sqlite3WhereContinueLabel(pWInfo), sqlite3WhereContinueLabel(pWInfo),
sqlite3WhereBreakLabel(pWInfo)); sqlite3WhereBreakLabel(pWInfo));
@@ -5848,7 +5848,7 @@ int sqlite3Select(
sqlite3VdbeAddOp1(v, OP_Return, regOutputRow); sqlite3VdbeAddOp1(v, OP_Return, regOutputRow);
finalizeAggFunctions(pParse, &sAggInfo); finalizeAggFunctions(pParse, &sAggInfo);
sqlite3ExprIfFalse(pParse, pHaving, addrOutputRow+1, SQLITE_JUMPIFNULL); sqlite3ExprIfFalse(pParse, pHaving, addrOutputRow+1, SQLITE_JUMPIFNULL);
selectInnerLoop(pParse, p, p->pEList, -1, &sSort, selectInnerLoop(pParse, p, -1, &sSort,
&sDistinct, pDest, &sDistinct, pDest,
addrOutputRow+1, addrSetAbort); addrOutputRow+1, addrSetAbort);
sqlite3VdbeAddOp1(v, OP_Return, regOutputRow); sqlite3VdbeAddOp1(v, OP_Return, regOutputRow);
@@ -5992,7 +5992,7 @@ int sqlite3Select(
sSort.pOrderBy = 0; sSort.pOrderBy = 0;
sqlite3ExprIfFalse(pParse, pHaving, addrEnd, SQLITE_JUMPIFNULL); sqlite3ExprIfFalse(pParse, pHaving, addrEnd, SQLITE_JUMPIFNULL);
selectInnerLoop(pParse, p, p->pEList, -1, 0, 0, selectInnerLoop(pParse, p, -1, 0, 0,
pDest, addrEnd, addrEnd); pDest, addrEnd, addrEnd);
sqlite3ExprListDelete(db, pDel); sqlite3ExprListDelete(db, pDel);
} }