-C Increase\sthe\sversion\snumber\sto\s3.8.8.3
-D 2015-02-24T16:22:01.861
+C Make\ssure\spartial\sindexes\sare\snot\squalified\sincorrectly\sby\sa\sconstraint\sthat\nis\sinside\sthe\sON\sclause\sof\sa\sLEFT\sJOIN.\s\sFix\sfor\sticket\s[2326c258d02ead33].\nCherry-pick\sfrom\s[491cfe9b3f87f].
+D 2015-02-24T20:12:57.079
F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f
F Makefile.in 5407a688f4d77a05c18a8142be8ae5a2829dd610
F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23
F src/wal.c 39303f2c9db02a4e422cd8eb2c8760420c6a51fe
F src/wal.h df01efe09c5cb8c8e391ff1715cca294f89668a4
F src/walker.c c253b95b4ee44b21c406e2a1052636c31ea27804
-F src/where.c d46de821bc604a4fd36fa3928c086950e91aafb1
+F src/where.c 88509f19a64a36e1c22a1dbdac74ee1a62d99dc3
F src/whereInt.h d3633e9b592103241b74b0ec76185f3e5b8b62e0
F test/8_3_names.test ebbb5cd36741350040fd28b432ceadf495be25b2
F test/aggerror.test a867e273ef9e3d7919f03ef4f0e8c0d2767944f2
F test/autoindex1.test 6ff78b94f43a59616c06c11c55b12935173506d7
F test/autoindex2.test af7e595c6864cc6ef5fc38d5db579a3e34940cb8
F test/autoindex3.test a3be0d1a53a7d2edff208a5e442312957047e972
-F test/autoindex4.test fc807f9efd158bec60f5dfdf34ebe46fb274612d
+F test/autoindex4.test 49d3cd791a9baa16fb461d7ea3de80d019a819cf
F test/autovacuum.test 941892505d2c0f410a0cb5970dfa1c7c4e5f6e74
F test/autovacuum_ioerr2.test 8a367b224183ad801e0e24dcb7d1501f45f244b4
F test/avtrans.test 0252654f4295ddda3b2cce0e894812259e655a85
F test/index3.test 55a90cff99834305e8141df7afaef39674b57062
F test/index4.test ab92e736d5946840236cd61ac3191f91a7856bf6
F test/index5.test 25b0b451aceed4ac5f7d49f856f6de7257470b3e
-F test/index6.test fb370966ac3cd0989053dd5385757b5c3e24ab6a
+F test/index6.test c56852451b574ad5b2a1789e566e62e6ab244f42
F test/index7.test 917cf1e1c7439bb155abbeabec511b28945e157b
F test/indexedby.test b2f22f3e693a53813aa3f50b812eb609ba6df1ec
F test/indexfault.test 31d4ab9a7d2f6e9616933eb079722362a883eb1d
F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4
F tool/warnings.sh 0abfd78ceb09b7f7c27c688c8e3fe93268a13b32
F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f
-P b20824628f92dfa97533e9f751264b77129cc468
-R 1d12159d5ce064f942cf8d82a191d03d
+P a92afe7d8cc7d0e84d843c8ea7ef714994c3585c
+Q +491cfe9b3f87f5fcc579f953745012cea8d64db7
+R e6b4de7ecd23615c982ef0db9e9401c6
U drh
-Z d2c2bb21cec144f949d676c43bb1b0d3
+Z 41a907f033a9b3020b069f727af1463b
-a92afe7d8cc7d0e84d843c8ea7ef714994c3585c
\ No newline at end of file
+9d94ac6a8b7a2721c15745184b3bb09b15a82503
\ No newline at end of file
for(pTerm=pWC->a; pTerm<pWCEnd; pTerm++){
if( pLoop->prereq==0
&& (pTerm->wtFlags & TERM_VIRTUAL)==0
+ && !ExprHasProperty(pTerm->pExpr, EP_FromJoin)
&& sqlite3ExprIsTableConstant(pTerm->pExpr, pSrc->iCursor) ){
pPartial = sqlite3ExprAnd(pParse->db, pPartial,
sqlite3ExprDup(pParse->db, pTerm->pExpr, 0));
int i;
WhereTerm *pTerm;
for(i=0, pTerm=pWC->a; i<pWC->nTerm; i++, pTerm++){
- if( sqlite3ExprImpliesExpr(pTerm->pExpr, pWhere, iTab) ) return 1;
+ if( sqlite3ExprImpliesExpr(pTerm->pExpr, pWhere, iTab)
+ && !ExprHasProperty(pTerm->pExpr, EP_FromJoin)
+ ){
+ return 1;
+ }
}
return 0;
}
ORDER BY rowid;
} {1 123 654 | 0 555 444 | 4 234 987 |}
+# Ticket [2326c258d02ead33d]
+# Two joins, one with and the other without an ORDER BY clause.
+# The one without ORDER BY correctly returns two rows of result.
+# The one with ORDER BY returns no rows.
+#
+do_execsql_test autoindex4-3.0 {
+ CREATE TABLE A(Name text);
+ CREATE TABLE Items(ItemName text , Name text);
+ INSERT INTO Items VALUES('Item1','Parent');
+ INSERT INTO Items VALUES('Item2','Parent');
+ CREATE TABLE B(Name text);
+
+ SELECT Items.ItemName
+ FROM Items
+ LEFT JOIN A ON (A.Name = Items.ItemName and Items.ItemName = 'dummy')
+ LEFT JOIN B ON (B.Name = Items.ItemName)
+ WHERE Items.Name = 'Parent'
+ ORDER BY Items.ItemName;
+} {Item1 Item2}
+do_execsql_test autoindex4-3.1 {
+ CREATE INDEX Items_x1 ON Items(ItemName,Name) WHERE ItemName = 'dummy';
+
+ SELECT Items.ItemName
+ FROM Items
+ LEFT JOIN A ON (A.Name = Items.ItemName and Items.ItemName = 'dummy')
+ LEFT JOIN B ON (B.Name = Items.ItemName)
+ WHERE Items.Name = 'Parent'
+ ORDER BY Items.ItemName;
+} {Item1 Item2}
+
+
finish_test
PRAGMA integrity_check;
} {ok}
+# Test case for ticket [2326c258d02ead33d69faa63de8f4686b9b1b9d9] on
+# 2015-02-24. Any use of a partial index qualifying constraint inside
+# the ON clause of a LEFT JOIN was causing incorrect results for all
+# versions of SQLite 3.8.0 through 3.8.8.
+#
+do_execsql_test index6-7.0 {
+ CREATE TABLE t7a(x);
+ CREATE TABLE t7b(y);
+ INSERT INTO t7a(x) VALUES(1);
+ CREATE INDEX t7ax ON t7a(x) WHERE x=99;
+ PRAGMA automatic_index=OFF;
+ SELECT * FROM t7a LEFT JOIN t7b ON (x=99) ORDER BY x;
+} {1 {}}
+do_execsql_test index6-7.1 {
+ INSERT INTO t7b(y) VALUES(2);
+ SELECT * FROM t7a JOIN t7b ON (x=99) ORDER BY x;
+} {}
+do_execsql_test index6-7.2 {
+ INSERT INTO t7a(x) VALUES(99);
+ SELECT * FROM t7a LEFT JOIN t7b ON (x=99) ORDER BY x;
+} {1 {} 99 2}
+do_execsql_test index6-7.3 {
+ SELECT * FROM t7a JOIN t7b ON (x=99) ORDER BY x;
+} {99 2}
+do_execsql_test index6-7.4 {
+ EXPLAIN QUERY PLAN
+ SELECT * FROM t7a JOIN t7b ON (x=99) ORDER BY x;
+} {/USING COVERING INDEX t7ax/}
finish_test