From: drh Date: Fri, 24 Aug 2012 15:29:03 +0000 (+0000) Subject: Additional test cases for OR-optimization with covering indices, including X-Git-Tag: version-3.7.14~17^2~6 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=2797c21639f182c8c52358770bf479ef4e65c1eb;p=thirdparty%2Fsqlite.git Additional test cases for OR-optimization with covering indices, including one test case that currently fails. FossilOrigin-Name: d8b7ab37120ac20e60b6a600cd0e5b34a09cf97a --- diff --git a/manifest b/manifest index cde938ca24..d50c519f35 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Experimental\schange\sto\ssupport\sthe\scovering\sindex\soptimization\sfor\squeries\swith\sOR\sterms\sin\sthe\sWHERE\sclause\sthat\ssearch\sa\ssingle\sindex\smore\sthan\sonce. -D 2012-08-24T10:52:35.794 +C Additional\stest\scases\sfor\sOR-optimization\swith\scovering\sindices,\sincluding\none\stest\scase\sthat\scurrently\sfails. +D 2012-08-24T15:29:03.804 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f F Makefile.in abd5c10d21d1395f140d9e50ea999df8fa4d6376 F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23 @@ -965,7 +965,7 @@ F test/where9.test ae98dc22ef9b6f2bc81e9f164e41b38faa9bda06 F test/whereA.test 24c234263c8fe358f079d5e57d884fb569d2da0a F test/whereB.test 0def95db3bdec220a731c7e4bec5930327c1d8c5 F test/whereC.test 13ff5ec0dba407c0e0c075980c75b3275a6774e5 -F test/whereD.test 54e11307e85c2ae987744f0fefd34214f752ba49 +F test/whereD.test 1aee8a7b3a0674d8d0119d764e069225ce426406 F test/wherelimit.test 5e9fd41e79bb2b2d588ed999d641d9c965619b31 F test/win32lock.test b2a539e85ae6b2d78475e016a9636b4451dc7fb9 F test/zeroblob.test caaecfb4f908f7bc086ed238668049f96774d688 @@ -1013,10 +1013,7 @@ F tool/vdbe-compress.tcl d70ea6d8a19e3571d7ab8c9b75cba86d1173ff0f F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4 F tool/warnings.sh fbc018d67fd7395f440c28f33ef0f94420226381 F tool/win/sqlite.vsix 67d8a99aceb56384a81b3f30d6c71743146d2cc9 -P d4cd6017c9875947a05b1dc36538d4272fb18739 -R 0e14b06eb4293757e84906b2ad3f48bd -T *branch * multi-or-covering-index -T *sym-multi-or-covering-index * -T -sym-trunk * -U dan -Z a3dcd5ab6d90b9bc7bd57494f6da388a +P 1dc8c7c741a82bb98a07f3fdb8142d8bc8d8a98b +R 0de9e52cb560b3160307382415072714 +U drh +Z f74e9ea8f0417bf70ede532a4ecba542 diff --git a/manifest.uuid b/manifest.uuid index af0b97af79..590ba48360 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -1dc8c7c741a82bb98a07f3fdb8142d8bc8d8a98b \ No newline at end of file +d8b7ab37120ac20e60b6a600cd0e5b34a09cf97a \ No newline at end of file diff --git a/test/whereD.test b/test/whereD.test index 10ccbb7d0a..3098b1acfd 100644 --- a/test/whereD.test +++ b/test/whereD.test @@ -19,18 +19,57 @@ source $testdir/tester.tcl set ::testprefix whereD do_execsql_test 1.1 { - CREATE TABLE t(i,j,k); - CREATE INDEX i ON t(i,j,k); + CREATE TABLE t(i,j,k,m,n); + CREATE INDEX ijk ON t(i,j,k); + CREATE INDEX jmn ON t(j,m,n); - INSERT INTO t VALUES(3, 3, 'three'); - INSERT INTO t VALUES(2, 2, 'two'); - INSERT INTO t VALUES(1, 1, 'one'); - INSERT INTO t VALUES(4, 4, 'four'); + INSERT INTO t VALUES(3, 3, 'three', 3, 3); + INSERT INTO t VALUES(2, 2, 'two', 2, 2); + INSERT INTO t VALUES(1, 1, 'one', 1, 1); + INSERT INTO t VALUES(4, 4, 'four', 4, 4); } do_execsql_test 1.2 { SELECT k FROM t WHERE (i=1 AND j=1) OR (i=2 AND j=2); } {one two} +do_execsql_test 1.3 { + SELECT k FROM t WHERE (i=1 AND j=1) OR (i=2 AND j=2) OR (i=3 AND j=3); +} {one two three} +do_execsql_test 1.4 { + SELECT k FROM t WHERE (i=1 AND j=1) OR (j=2 AND m=2); +} {one two} +do_execsql_test 1.5 { + SELECT k FROM t WHERE (i=1 AND j=1) OR (i=2 AND j=2) OR (j=3 AND m=3); +} {one two three} +do_execsql_test 1.6 { + SELECT k FROM t WHERE (i=1 AND j=1) OR (j=2 AND m=2) OR (i=3 AND j=3); +} {one two three} +do_execsql_test 1.7 { + SELECT k FROM t WHERE (j=1 AND m=1) OR (i=2 AND j=2) OR (i=3 AND j=3); +} {one two three} +do_execsql_test 1.8 { + SELECT k FROM t WHERE (i=1 AND j=1) OR (j=2 AND i=2) OR (i=3 AND j=3); +} {one two three} -finish_test +do_execsql_test 2.0 { + CREATE TABLE t1(a,b,c,d); + CREATE INDEX t1b ON t1(b); + CREATE INDEX t1c ON t1(c); + CREATE INDEX t1d ON t1(d); + CREATE TABLE t2(x,y); + CREATE INDEX t2y ON t2(y); + + INSERT INTO t1 VALUES(1,2,3,4); + INSERT INTO t1 VALUES(5,6,7,8); + INSERT INTO t2 VALUES(1,2); + INSERT INTO t2 VALUES(2,7); + INSERT INTO t2 VALUES(3,4); +} {} +do_execsql_test 2.1 { + SELECT a, x FROM t1 JOIN t2 ON +y=d OR x=7 ORDER BY a, x; +} {1 3} +do_execsql_test 2.2 { + SELECT a, x FROM t1 JOIN t2 ON y=d OR x=7 ORDER BY a, x; +} {1 3} +finish_test