aboutsummaryrefslogtreecommitdiff
path: root/src/wherecode.c
diff options
context:
space:
mode:
authordrh <drh@noemail.net>2015-11-05 22:30:54 +0000
committerdrh <drh@noemail.net>2015-11-05 22:30:54 +0000
commitb1d607de25eae569ccdf6b56f5b648124bc4def3 (patch)
tree19f0c147aa99219075c4b1b8977b46fba0a7aa98 /src/wherecode.c
parent70528d7868e67752833c6bac7b34f4d5d652d130 (diff)
downloadsqlite-b1d607de25eae569ccdf6b56f5b648124bc4def3.tar.gz
sqlite-b1d607de25eae569ccdf6b56f5b648124bc4def3.zip
Improvements and simplifications to the equality seek logic. Tests are
adjusted so that they all pass now. FossilOrigin-Name: 997ce6c90b454c03cc2ef6934752ee8dd2e520e3
Diffstat (limited to 'src/wherecode.c')
-rw-r--r--src/wherecode.c9
1 files changed, 0 insertions, 9 deletions
diff --git a/src/wherecode.c b/src/wherecode.c
index 644c1aa0a..87db0e0a2 100644
--- a/src/wherecode.c
+++ b/src/wherecode.c
@@ -1026,7 +1026,6 @@ Bitmask sqlite3WhereCodeOneLoopStart(
WhereTerm *pRangeEnd = 0; /* Inequality constraint at range end */
int startEq; /* True if range start uses ==, >= or <= */
int endEq; /* True if range end uses ==, >= or <= */
- int eqOnly; /* True if uses only == */
int start_constraints; /* Start of range is constrained */
int nConstraint; /* Number of constraint terms */
Index *pIdx; /* The index we will be using */
@@ -1096,8 +1095,6 @@ Bitmask sqlite3WhereCodeOneLoopStart(
}
}
assert( pRangeEnd==0 || (pRangeEnd->wtFlags & TERM_VNULL)==0 );
- eqOnly = nEq>0 && (pLoop->wsFlags & WHERE_COLUMN_RANGE)==0
- && (pWInfo->wctrlFlags&WHERE_ORDERBY_MIN)==0;
/* If we are doing a reverse order scan on an ascending index, or
** a forward order scan on a descending index, interchange the
@@ -1170,7 +1167,6 @@ Bitmask sqlite3WhereCodeOneLoopStart(
VdbeCoverageIf(v, op==OP_SeekGE); testcase( op==OP_SeekGE );
VdbeCoverageIf(v, op==OP_SeekLE); testcase( op==OP_SeekLE );
VdbeCoverageIf(v, op==OP_SeekLT); testcase( op==OP_SeekLT );
- if( eqOnly ) sqlite3VdbeChangeP5(v, OPFLAG_SEEKEQ);
/* Load the value for the inequality constraint at the end of the
** range (if any).
@@ -1206,11 +1202,6 @@ Bitmask sqlite3WhereCodeOneLoopStart(
/* Check if the index cursor is past the end of the range. */
if( nConstraint ){
- if( eqOnly ){
- int bx = sqlite3VdbeCurrentAddr(v);
- sqlite3VdbeAddOp2(v, OP_Goto, 0, bx+2);
- pLevel->p2 = bx+1;
- }
op = aEndOp[bRev*2 + endEq];
sqlite3VdbeAddOp4Int(v, op, iIdxCur, addrNxt, regBase, nConstraint);
testcase( op==OP_IdxGT ); VdbeCoverageIf(v, op==OP_IdxGT );