Clearer presentation of the logic. No functional changes.
FossilOrigin-Name: a3dcf6db76cc09bdfedb1bbeba3b359b77762cbe
diff --git a/manifest b/manifest
index 14f3934..5cf124d 100644
--- a/manifest
+++ b/manifest
@@ -1,5 +1,5 @@
-C Avoid\san\sunnecessary\sseek\soperation\son\ssome\scorner-case\sskip-scans.
-D 2016-02-22T20:52:26.579
+C Clearer\spresentation\sof\sthe\slogic.\s\sNo\sfunctional\schanges.
+D 2016-02-22T21:19:54.531
F Makefile.in 4e90dc1521879022aa9479268a4cd141d1771142
F Makefile.linux-gcc 7bc79876b875010e8c8f9502eb935ca92aa3c434
F Makefile.msc 28fc4ee02333996d31b3602b39eeb8e609a89ce4
@@ -430,7 +430,7 @@
F src/walker.c 0f142b5bd3ed2041fc52d773880748b212e63354
F src/where.c 5b67fb8035ae4697cf721db095f800ef8dff5f56
F src/whereInt.h 78b6b4de94db84aecbdc07fe3e38f648eb391e9a
-F src/wherecode.c 19aa0189a6088f8fde9105839b00be77f85d4469
+F src/wherecode.c 39c1ef4598bedf1d66249334c74efd23ddd182ac
F src/whereexpr.c fb87944b1254234e5bba671aaf6dee476241506a
F test/8_3_names.test ebbb5cd36741350040fd28b432ceadf495be25b2
F test/affinity2.test a6d901b436328bd67a79b41bb0ac2663918fe3bd
@@ -1429,10 +1429,7 @@
F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4
F tool/warnings.sh a98af506df552f3b3c0d904f94e4cdc4e1a6d598
F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f
-P 64386fa339adb91439da979d74062f67a6ec68fd
-R a08f482677879c74e73ef75af70e8b9f
-T *branch * skip-scan-improvement
-T *sym-skip-scan-improvement *
-T -sym-trunk *
+P 38e837e605076124b73235e1fd832838d9545cb2
+R 56c5c81425d101f0314396c9251634e4
U drh
-Z 08bae61bde61749b6ce2ce908b2beeb6
+Z dfca62313f421fb124d083409ac98469
diff --git a/manifest.uuid b/manifest.uuid
index e2a870a..e56034d 100644
--- a/manifest.uuid
+++ b/manifest.uuid
@@ -1 +1 @@
-38e837e605076124b73235e1fd832838d9545cb2
\ No newline at end of file
+a3dcf6db76cc09bdfedb1bbeba3b359b77762cbe
\ No newline at end of file
diff --git a/src/wherecode.c b/src/wherecode.c
index 34e166b..accc140 100644
--- a/src/wherecode.c
+++ b/src/wherecode.c
@@ -1212,7 +1212,11 @@
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 @@
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).
*/