Fix the OR-optimization so that it always ignores subplans that do not
use an index. FossilOrigin-Name: 66f92a16866e5825363636b9cc4b8f9b29d9e84d
This commit is contained in:
parent
a3f108e93d
commit
2dc292930d
14
manifest
14
manifest
@ -1,5 +1,5 @@
|
||||
C Reduce\sthe\ssize\sof\sthe\sWhereScan\sobject\sby\s24\sbytes\swhile\salso\sclarifying\sits\noperation.
|
||||
D 2015-08-26T21:08:04.505
|
||||
C Fix\sthe\sOR-optimization\sso\sthat\sit\salways\signores\ssubplans\sthat\sdo\snot\nuse\san\sindex.
|
||||
D 2015-08-27T23:18:55.309
|
||||
F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f
|
||||
F Makefile.in e2218eb228374422969de7b1680eda6864affcef
|
||||
F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23
|
||||
@ -414,7 +414,7 @@ F src/vxworks.h c18586c8edc1bddbc15c004fa16aeb1e1342b4fb
|
||||
F src/wal.c 6fb6b68969e4692593c2552c4e7bff5882de2cb8
|
||||
F src/wal.h df01efe09c5cb8c8e391ff1715cca294f89668a4
|
||||
F src/walker.c 2e14d17f592d176b6dc879c33fbdec4fbccaa2ba
|
||||
F src/where.c caabc9ec1e86168d7717833700cfed01a75f687a
|
||||
F src/where.c 91e73ffc699c140a59baa03a6b7b060db02bed81
|
||||
F src/whereInt.h 901c17c1e3c82745ad9b85b4471543fa59c980e9
|
||||
F src/wherecode.c 3d9113cc307ffeed58db41fe9f2d807c94787ab5
|
||||
F src/whereexpr.c 1a308d1ee5144890d21ea9cf70d49bc96a83432b
|
||||
@ -1287,7 +1287,7 @@ F test/walshared.test 0befc811dcf0b287efae21612304d15576e35417
|
||||
F test/walslow.test e7be6d9888f83aa5d3d3c7c08aa9b5c28b93609a
|
||||
F test/walthread.test de8dbaf6d9e41481c460ba31ca61e163d7348f8e
|
||||
F test/where.test 1ff3d9f8da0a6c0dc5ccfd38d9225b2cdb5b6afb
|
||||
F test/where2.test 23fdb5d8e756554aad4ca7ae03de9dd8367a2c6e
|
||||
F test/where2.test af78c55589cbc82d793449493adba0dc3d659f23
|
||||
F test/where3.test 1ad55ba900bd7747f98b6082e65bd3e442c5004e
|
||||
F test/where4.test 68aa5ad796e33816db2078bc0f6de719c7a0e21f
|
||||
F test/where5.test fdf66f96d29a064b63eb543e28da4dfdccd81ad2
|
||||
@ -1380,7 +1380,7 @@ F tool/vdbe_profile.tcl 67746953071a9f8f2f668b73fe899074e2c6d8c1
|
||||
F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4
|
||||
F tool/warnings.sh 48bd54594752d5be3337f12c72f28d2080cb630b
|
||||
F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f
|
||||
P c2f3bbad778504681b39ab9399a1eb3c1a35ab3f
|
||||
R f5f6b9b31662d17ccccce315f9a81df1
|
||||
P cbc3c9a8bf169ae0b21f26855038502c6cc25cfe
|
||||
R 3aef897e420a61a50263b8e461848e83
|
||||
U drh
|
||||
Z be2744e78cce20e5ac9fa855b3738fc2
|
||||
Z b614bfef572643d9445d8b8a4d103409
|
||||
|
@ -1 +1 @@
|
||||
cbc3c9a8bf169ae0b21f26855038502c6cc25cfe
|
||||
66f92a16866e5825363636b9cc4b8f9b29d9e84d
|
16
src/where.c
16
src/where.c
@ -1923,18 +1923,20 @@ static int whereLoopInsert(WhereLoopBuilder *pBuilder, WhereLoop *pTemplate){
|
||||
** and prereqs.
|
||||
*/
|
||||
if( pBuilder->pOrSet!=0 ){
|
||||
if( pTemplate->nLTerm ){
|
||||
#if WHERETRACE_ENABLED
|
||||
u16 n = pBuilder->pOrSet->n;
|
||||
int x =
|
||||
u16 n = pBuilder->pOrSet->n;
|
||||
int x =
|
||||
#endif
|
||||
whereOrInsert(pBuilder->pOrSet, pTemplate->prereq, pTemplate->rRun,
|
||||
whereOrInsert(pBuilder->pOrSet, pTemplate->prereq, pTemplate->rRun,
|
||||
pTemplate->nOut);
|
||||
#if WHERETRACE_ENABLED /* 0x8 */
|
||||
if( sqlite3WhereTrace & 0x8 ){
|
||||
sqlite3DebugPrintf(x?" or-%d: ":" or-X: ", n);
|
||||
whereLoopPrint(pTemplate, pBuilder->pWC);
|
||||
}
|
||||
if( sqlite3WhereTrace & 0x8 ){
|
||||
sqlite3DebugPrintf(x?" or-%d: ":" or-X: ", n);
|
||||
whereLoopPrint(pTemplate, pBuilder->pWC);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
return SQLITE_OK;
|
||||
}
|
||||
|
||||
|
@ -322,9 +322,14 @@ do_test where2-6.3 {
|
||||
} {6 2 49 51 99 6 10000 10006 100 6 10201 10207 sort t1 *}
|
||||
do_test where2-6.4 {
|
||||
queryplan {
|
||||
SELECT * FROM t1 WHERE w=99 OR +w=100 OR 6=w ORDER BY +w
|
||||
SELECT *, '|' FROM t1 WHERE w=99 OR +w=100 OR 6=w ORDER BY +w
|
||||
}
|
||||
} {6 2 49 51 99 6 10000 10006 100 6 10201 10207 sort t1 *}
|
||||
} {6 2 49 51 | 99 6 10000 10006 | 100 6 10201 10207 | sort t1 *}
|
||||
do_test where2-6.5 {
|
||||
queryplan {
|
||||
SELECT *, '|' FROM t1 WHERE w=99 OR y=10201 OR 6=w ORDER BY +w
|
||||
}
|
||||
} {6 2 49 51 | 99 6 10000 10006 | 100 6 10201 10207 | sort t1 *}
|
||||
|
||||
set ::idx {}
|
||||
ifcapable subquery {set ::idx i1zyx}
|
||||
|
Loading…
x
Reference in New Issue
Block a user