diff options
author | drh <drh@noemail.net> | 2014-08-07 20:37:01 +0000 |
---|---|---|
committer | drh <drh@noemail.net> | 2014-08-07 20:37:01 +0000 |
commit | f2a90306cacfab863d3561024287bcdb88245bcc (patch) | |
tree | 71b01876d5db5772964ec8d3e34445f3094756da /src/where.c | |
parent | b28ce65f45ef4fabef86e0fc1dc55a211ca8d191 (diff) | |
download | sqlite-f2a90306cacfab863d3561024287bcdb88245bcc.tar.gz sqlite-f2a90306cacfab863d3561024287bcdb88245bcc.zip |
Clarify the computation of compatible isOrdered by in the plan solver of
the query planner.
FossilOrigin-Name: b5e8fd575a80334160de0aac8084ed5cd28816a5
Diffstat (limited to 'src/where.c')
-rw-r--r-- | src/where.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/where.c b/src/where.c index ff50f52b4..4dd6579e2 100644 --- a/src/where.c +++ b/src/where.c @@ -5536,10 +5536,14 @@ static int wherePathSolver(WhereInfo *pWInfo, LogEst nRowEst){ ** First look for an existing path among best-so-far paths ** that covers the same set of loops and has the same isOrdered ** setting as the current path candidate. + ** + ** The term "((pTo->isOrdered^isOrdered)&0x80)==0" is equivalent + ** to (pTo->isOrdered==(-1))==(isOrdered==(-1))" for the range + ** of legal values for isOrdered, -1..64. */ for(jj=0, pTo=aTo; jj<nTo; jj++, pTo++){ if( pTo->maskLoop==maskNew - && ((pTo->isOrdered^isOrdered)&80)==0 + && ((pTo->isOrdered^isOrdered)&0x80)==0 ){ testcase( jj==nTo-1 ); break; |