-C An\searly\sattempt\sto\sget\sindexes\sto\swork\swith\sthe\sIS\soperator.\s\sThis\scode\npasses\stests,\sbut\smuch\smore\stesting\sis\sneeded\sto\sverify\sthat\sit\sworks\son\nall\scorner\scases.
-D 2015-05-13T15:24:07.257
+C Add\stestcase()\smacros\sand\scomments\sand\sa\sfew\stest-cases.
+D 2015-05-13T17:54:08.892
F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f
F Makefile.in edfc69769e613a6359c42c06ea1d42c3bece1736
F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23
F src/wal.c ce2cb2d06faab54d1bce3e739bec79e063dd9113
F src/wal.h df01efe09c5cb8c8e391ff1715cca294f89668a4
F src/walker.c c253b95b4ee44b21c406e2a1052636c31ea27804
-F src/where.c 48e3c1f0a8a7ecbaeb5a57c195254243d49430ba
+F src/where.c 98964edb2a27d6f87976b85a8b00862558a277b2
F src/whereInt.h 6b5a8ac7b4adc055176c3330d755735ed674335d
F test/8_3_names.test ebbb5cd36741350040fd28b432ceadf495be25b2
F test/aggerror.test a867e273ef9e3d7919f03ef4f0e8c0d2767944f2
F test/walshared.test 0befc811dcf0b287efae21612304d15576e35417
F test/walslow.test e7be6d9888f83aa5d3d3c7c08aa9b5c28b93609a
F test/walthread.test de8dbaf6d9e41481c460ba31ca61e163d7348f8e
-F test/where.test 28b64e93428961b07b0d486778d63fd672948f6b
+F test/where.test 1ff3d9f8da0a6c0dc5ccfd38d9225b2cdb5b6afb
F test/where2.test 23fdb5d8e756554aad4ca7ae03de9dd8367a2c6e
F test/where3.test 1ad55ba900bd7747f98b6082e65bd3e442c5004e
F test/where4.test d8420ceeb8323a41ceff1f1841fc528e824e1ecf
F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4
F tool/warnings.sh 0abfd78ceb09b7f7c27c688c8e3fe93268a13b32
F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f
-P 59e3e9e764440b7feaafadff74f422535d21bca2
-R 9f6038338a4c8e424f8c4ba92f9afc16
-T *branch * index-is-operator
-T *sym-index-is-operator *
-T -sym-trunk *
+P 6f7f1673d00d216a5aa456acb44793a14f3b3d91
+R 3ff0212a0c4cf6ad597a241e62c5ab7c
U drh
-Z a0eadd388567e992c46f2fabbded464e
+Z fddf4aa627339444877435638e7a9621
-6f7f1673d00d216a5aa456acb44793a14f3b3d91
\ No newline at end of file
+24263d08b11c88416d270013bdaf5ff45125cb4d
\ No newline at end of file
}else if( op==TK_ISNULL ){
c = WO_ISNULL;
}else if( op==TK_IS ){
- c = WO_EQ;
+ c = WO_EQ; /* IS works like ==, just without the IsNull tests */
}else{
assert( (WO_EQ<<(op-TK_EQ)) < 0x7fff );
c = (u16)(WO_EQ<<(op-TK_EQ));
okToChngToIN = 1;
for(; i>=0 && okToChngToIN; i--, pOrTerm++){
assert( pOrTerm->eOperator & WO_EQ );
+ testcase( pOrTerm->pExpr->op==TK_IS );
if( pOrTerm->leftCursor!=iCursor ){
pOrTerm->wtFlags &= ~TERM_OR_OK;
}else if( pOrTerm->u.leftColumn!=iColumn ){
assert( pOrTerm->eOperator & WO_EQ );
assert( pOrTerm->leftCursor==iCursor );
assert( pOrTerm->u.leftColumn==iColumn );
+ testcase( pOrTerm->pExpr->op==TK_IS );
pDup = sqlite3ExprDup(db, pOrTerm->pExpr->pRight, 0);
pList = sqlite3ExprListAppend(pWInfo->pParse, pList, pDup);
pLeft = pOrTerm->pExpr->pLeft;
if( pTerm->u.leftColumn<0 ) return 0;
aff = pSrc->pTab->aCol[pTerm->u.leftColumn].affinity;
if( !sqlite3IndexAffinityOk(pTerm->pExpr, aff) ) return 0;
+ testcase( pTerm->pExpr->op==TK_IS );
return 1;
}
#endif
testcase( pTerm->eOperator & WO_IN );
if( (pTerm->eOperator & (WO_ISNULL|WO_IN))==0 ){
Expr *pRight = pTerm->pExpr->pRight;
+ testcase( pTerm->pExpr->op==TK_IS );
if( (pTerm->wtFlags & TERM_NULLOK)==0
&& sqlite3ExprCanBeNull(pRight)
){
Expr *pRight = pRangeStart->pExpr->pRight;
sqlite3ExprCode(pParse, pRight, regBase+nEq);
whereLikeOptimizationStringFixup(v, pLevel, pRangeStart);
+ testcase( pRangeStart->pExpr->op==TK_IS );
if( (pRangeStart->wtFlags & TERM_NULLOK)==0
&& sqlite3ExprCanBeNull(pRight)
){
sqlite3ExprCacheRemove(pParse, regBase+nEq, 1);
sqlite3ExprCode(pParse, pRight, regBase+nEq);
whereLikeOptimizationStringFixup(v, pLevel, pRangeEnd);
+ testcase( pRangeEnd->pExpr->op==TK_IS );
if( (pRangeEnd->wtFlags & TERM_NULLOK)==0
&& sqlite3ExprCanBeNull(pRight)
){
pAlt = findTerm(pWC, iCur, pTerm->u.leftColumn, notReady, WO_EQ|WO_IN, 0);
if( pAlt==0 ) continue;
if( pAlt->wtFlags & (TERM_CODED) ) continue;
- testcase( pAlt->eOperator & WO_EQ );
+ testcase( (pAlt->eOperator & WO_EQ)!=0 && pAlt->pExpr->op==TK_IS );
testcase( pAlt->eOperator & WO_IN );
VdbeModuleComment((v, "begin transitive constraint"));
pEAlt = sqlite3StackAllocRaw(db, sizeof(*pEAlt));
pLoop->nOut--;
if( pTerm->eOperator&WO_EQ ){
Expr *pRight = pTerm->pExpr->pRight;
+ testcase( pTerm->pExpr->op==TK_IS );
if( sqlite3ExprIsInteger(pRight, &k) && k>=(-1) && k<=1 ){
k = 10;
}else{
){
Expr *pExpr = pTerm->pExpr;
if( (eOp & (WO_EQ|WO_ISNULL))!=0 ){
- testcase( eOp & WO_EQ );
+ testcase( (eOp & WO_EQ)!=0 && pExpr->op==TK_IS );
testcase( eOp & WO_ISNULL );
rc = whereEqualScanEst(pParse, pBuilder, pExpr->pRight, &nOut);
}else{
if( !pColl ) pColl = db->pDfltColl;
z2 = pColl->zName;
if( sqlite3StrICmp(z1, z2)!=0 ) continue;
+ testcase( pTerm->pExpr->op==TK_IS );
}
obSat |= MASKBIT(i);
}
pTerm = findTerm(pWC, iCur, pIdx->aiColumn[j], 0, WO_EQ, pIdx);
if( pTerm==0 ) break;
pLoop->aLTerm[j] = pTerm;
+ testcase( pTerm->pExpr->op==TK_IS );
}
if( j!=pIdx->nKeyCol ) continue;
pLoop->wsFlags = WHERE_COLUMN_EQ|WHERE_ONEROW|WHERE_INDEXED;
do_test where-1.1.1 {
count {SELECT x, y, w FROM t1 WHERE w=10}
} {3 121 10 3}
+do_test where-1.1.1b {
+ count {SELECT x, y, w FROM t1 WHERE w IS 10}
+} {3 121 10 3}
do_eqp_test where-1.1.2 {
SELECT x, y, w FROM t1 WHERE w=10
} {*SEARCH TABLE t1 USING INDEX i1w (w=?)*}
+do_eqp_test where-1.1.2b {
+ SELECT x, y, w FROM t1 WHERE w IS 10
+} {*SEARCH TABLE t1 USING INDEX i1w (w=?)*}
do_test where-1.1.3 {
db status step
} {0}
do_test where-1.3.2 {
count {SELECT x, y, w AS abc FROM t1 WHERE 11=abc}
} {3 144 11 3}
+do_test where-1.3.3 {
+ count {SELECT x, y, w AS abc FROM t1 WHERE 11 IS abc}
+} {3 144 11 3}
do_test where-1.4.1 {
count {SELECT w, x, y FROM t1 WHERE 11=w AND x>2}
} {11 3 144 3}
+do_test where-1.4.1b {
+ count {SELECT w, x, y FROM t1 WHERE 11 IS w AND x>2}
+} {11 3 144 3}
do_eqp_test where-1.4.2 {
SELECT w, x, y FROM t1 WHERE 11=w AND x>2
} {*SEARCH TABLE t1 USING INDEX i1w (w=?)*}
+do_eqp_test where-1.4.2b {
+ SELECT w, x, y FROM t1 WHERE 11 IS w AND x>2
+} {*SEARCH TABLE t1 USING INDEX i1w (w=?)*}
do_test where-1.4.3 {
count {SELECT w AS a, x AS b, y FROM t1 WHERE 11=a AND b>2}
} {11 3 144 3}
do_test where-1.11 {
count {SELECT x, y FROM t1 WHERE x=3 AND y=100 AND w<10}
} {3 100 3}
+do_test where-1.11b {
+ count {SELECT x, y FROM t1 WHERE x IS 3 AND y IS 100 AND w<10}
+} {3 100 3}
# New for SQLite version 2.1: Verify that that inequality constraints
# are used correctly.
do_test where-1.12 {
count {SELECT w FROM t1 WHERE x=3 AND y<100}
} {8 3}
+do_test where-1.12b {
+ count {SELECT w FROM t1 WHERE x IS 3 AND y<100}
+} {8 3}
do_test where-1.13 {
count {SELECT w FROM t1 WHERE x=3 AND 100>y}
} {8 3}
do_test where-1.14 {
count {SELECT w FROM t1 WHERE 3=x AND y<100}
} {8 3}
+do_test where-1.14b {
+ count {SELECT w FROM t1 WHERE 3 IS x AND y<100}
+} {8 3}
do_test where-1.15 {
count {SELECT w FROM t1 WHERE 3=x AND 100>y}
} {8 3}
do_test where-1.18 {
count {SELECT w FROM t1 WHERE x=3 AND y>225}
} {15 3}
+do_test where-1.18b {
+ count {SELECT w FROM t1 WHERE x IS 3 AND y>225}
+} {15 3}
do_test where-1.19 {
count {SELECT w FROM t1 WHERE x=3 AND 225<y}
} {15 3}
do_test where-1.22 {
count {SELECT w FROM t1 WHERE x=3 AND y>121 AND y<196}
} {11 12 5}
+do_test where-1.22b {
+ count {SELECT w FROM t1 WHERE x IS 3 AND y>121 AND y<196}
+} {11 12 5}
do_test where-1.23 {
count {SELECT w FROM t1 WHERE x=3 AND y>=121 AND y<=196}
} {10 11 12 13 9}