diff options
author | drh <drh@noemail.net> | 2016-02-22 21:19:54 +0000 |
---|---|---|
committer | drh <drh@noemail.net> | 2016-02-22 21:19:54 +0000 |
commit | 0bf2ad6a18c864efadb0ba79605788d9a29e2cb3 (patch) | |
tree | 41b1fb2c10433dc4d2e0c2b117aa8e65e189a9b4 /src/wherecode.c | |
parent | a6d2f8eb1e2e1be45ac52106fd31eb8c5c81f7f5 (diff) | |
download | sqlite-0bf2ad6a18c864efadb0ba79605788d9a29e2cb3.tar.gz sqlite-0bf2ad6a18c864efadb0ba79605788d9a29e2cb3.zip |
Clearer presentation of the logic. No functional changes.
FossilOrigin-Name: a3dcf6db76cc09bdfedb1bbeba3b359b77762cbe
Diffstat (limited to 'src/wherecode.c')
-rw-r--r-- | src/wherecode.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/wherecode.c b/src/wherecode.c index 34e166bc4..accc14086 100644 --- a/src/wherecode.c +++ b/src/wherecode.c @@ -1212,7 +1212,11 @@ Bitmask sqlite3WhereCodeOneLoopStart( start_constraints = 1; } codeApplyAffinity(pParse, regBase, nConstraint - bSeekPastNull, zStartAff); - if( pLoop->nSkip==0 || nConstraint>pLoop->nSkip ){ + if( pLoop->nSkip>0 && nConstraint==pLoop->nSkip ){ + /* The skip-scan logic inside the call to codeAllEqualityConstraints() + ** above has already left the cursor sitting on the correct row, + ** so no further seeking is needed */ + }else{ op = aStartOp[(start_constraints<<2) + (startEq<<1) + bRev]; assert( op!=0 ); sqlite3VdbeAddOp4Int(v, op, iIdxCur, addrNxt, regBase, nConstraint); @@ -1224,7 +1228,7 @@ Bitmask sqlite3WhereCodeOneLoopStart( VdbeCoverageIf(v, op==OP_SeekLE); testcase( op==OP_SeekLE ); VdbeCoverageIf(v, op==OP_SeekLT); testcase( op==OP_SeekLT ); } - + /* Load the value for the inequality constraint at the end of the ** range (if any). */ |