2014-04-29 09:09:31 +00:00
|
|
|
Upstream fix for the issue that caused nautilus to crash.
|
2014-04-25 08:56:58 +00:00
|
|
|
RHBZ: #1075889
|
|
|
|
|
2014-04-29 09:09:31 +00:00
|
|
|
--- src/where.c
|
|
|
|
+++ src/where.c
|
|
|
|
@@ -4855,18 +4855,10 @@
|
|
|
|
** rowid appears in the ORDER BY clause, the corresponding WhereLoop is
|
|
|
|
** automatically order-distinct.
|
|
|
|
*/
|
2014-04-25 08:56:58 +00:00
|
|
|
|
2014-04-29 09:09:31 +00:00
|
|
|
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;
|
|
|
|
testcase( nOrderBy==BMS-1 );
|
|
|
|
if( nOrderBy>BMS-1 ) return 0; /* Cannot optimize overly large ORDER BYs */
|
|
|
|
@@ -4875,11 +4867,14 @@
|
|
|
|
orderDistinctMask = 0;
|
|
|
|
ready = 0;
|
|
|
|
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;
|
2014-04-25 08:56:58 +00:00
|
|
|
+ }
|
2014-04-29 09:09:31 +00:00
|
|
|
iCur = pWInfo->pTabList->a[pLoop->iTab].iCursor;
|
|
|
|
|
|
|
|
/* Mark off any ORDER BY term X that is a column in the table of
|
|
|
|
** the current loop for which there is term in the WHERE
|
|
|
|
** clause of the form X IS NULL or X=? that reference only outer
|
|
|
|
|