1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-11-19 21:43:15 +03:00

Make sure the omit-noop-left-join optimization is not applied if columns

of the LEFT JOIN are used in the ORDER BY clause.  
Ticket [be84e357c035]

FossilOrigin-Name: 0303d6bc7112e6f810ae1bd75cafc5ffc51f5212
This commit is contained in:
drh
2013-09-03 14:03:47 +00:00
parent 05db3c7743
commit 67a5ec7b54
4 changed files with 38 additions and 9 deletions

View File

@@ -5909,7 +5909,7 @@ WhereInfo *sqlite3WhereBegin(
&& OptimizationEnabled(db, SQLITE_OmitNoopJoin)
){
Bitmask tabUsed = exprListTableUsage(pMaskSet, pResultSet);
if( pOrderBy ) tabUsed |= exprListTableUsage(pMaskSet, pOrderBy);
if( sWLB.pOrderBy ) tabUsed |= exprListTableUsage(pMaskSet, sWLB.pOrderBy);
while( pWInfo->nLevel>=2 ){
WhereTerm *pTerm, *pEnd;
pLoop = pWInfo->a[pWInfo->nLevel-1].pWLoop;