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

Clarify the computation of compatible isOrdered by in the plan solver of

the query planner.

FossilOrigin-Name: b5e8fd575a80334160de0aac8084ed5cd28816a5
This commit is contained in:
drh
2014-08-07 20:37:01 +00:00
parent b28ce65f45
commit f2a90306ca
3 changed files with 12 additions and 8 deletions

View File

@@ -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;