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

Merge trunk changes into this branch.

FossilOrigin-Name: d74299f037f3a6a4b3bce8b4d1c76c407c1f3b3e
This commit is contained in:
dan
2014-04-29 16:46:24 +00:00
21 changed files with 1617 additions and 827 deletions

View File

@@ -4904,14 +4904,6 @@ static i8 wherePathSatisfiesOrderBy(
*/
assert( pOrderBy!=0 );
/* Sortability of virtual tables is determined by the xBestIndex method
** of the virtual table itself */
if( pLast->wsFlags & WHERE_VIRTUALTABLE ){
testcase( nLoop>0 ); /* True when outer loops are one-row and match
** no ORDER BY terms */
return pLast->u.vtab.isOrdered;
}
if( nLoop && OptimizationDisabled(db, SQLITE_OrderByIdxJoin) ) return 0;
nOrderBy = pOrderBy->nExpr;
@@ -4924,7 +4916,10 @@ static i8 wherePathSatisfiesOrderBy(
for(iLoop=0; isOrderDistinct && obSat<obDone && iLoop<=nLoop; iLoop++){
if( iLoop>0 ) ready |= pLoop->maskSelf;
pLoop = iLoop<nLoop ? pPath->aLoop[iLoop] : pLast;
assert( (pLoop->wsFlags & WHERE_VIRTUALTABLE)==0 );
if( pLoop->wsFlags & WHERE_VIRTUALTABLE ){
if( pLoop->u.vtab.isOrdered ) obSat = obDone;
break;
}
iCur = pWInfo->pTabList->a[pLoop->iTab].iCursor;
/* Mark off any ORDER BY term X that is a column in the table of