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

Clearer presentation of the logic. No functional changes.

FossilOrigin-Name: a3dcf6db76cc09bdfedb1bbeba3b359b77762cbe
This commit is contained in:
drh
2016-02-22 21:19:54 +00:00
parent a6d2f8eb1e
commit 0bf2ad6a18
3 changed files with 13 additions and 12 deletions

View File

@@ -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).
*/