From 79a13bfd1eb920f187ee1cacad0406cf97d1bae3 Mon Sep 17 00:00:00 2001 From: drh Date: Fri, 31 May 2013 20:28:28 +0000 Subject: [PATCH] Do not search using ON clause constraints of LEFT JOINs to the right of the table. FossilOrigin-Name: 723f901a63313b64a9f10516711fb6136526b79b --- manifest | 12 ++++++------ manifest.uuid | 2 +- src/where.c | 2 ++ 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/manifest b/manifest index b32322793d..5aec48fb0e 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Make\ssure\sa\sunique\scursor\snumber\sis\sallocated\sfor\sautomatic\sindices. -D 2013-05-31T20:00:58.768 +C Do\snot\ssearch\susing\sON\sclause\sconstraints\sof\sLEFT\sJOINs\sto\sthe\sright\sof\nthe\stable. +D 2013-05-31T20:28:28.662 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f F Makefile.in 5e41da95d92656a5004b03d3576e8b226858a28e F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23 @@ -289,7 +289,7 @@ F src/vtab.c b05e5f1f4902461ba9f5fc49bb7eb7c3a0741a83 F src/wal.c 436bfceb141b9423c45119e68e444358ee0ed35d F src/wal.h df01efe09c5cb8c8e391ff1715cca294f89668a4 F src/walker.c 4fa43583d0a84b48f93b1e88f11adf2065be4e73 -F src/where.c 3d93b77c4acc97f0dc018d251f2e2833f8df5663 +F src/where.c 3e4ca21a9b34ab25b2ec13704e8659581d57878d F test/8_3_names.test ebbb5cd36741350040fd28b432ceadf495be25b2 F test/aggerror.test a867e273ef9e3d7919f03ef4f0e8c0d2767944f2 F test/aggnested.test 45c0201e28045ad38a530b5a144b73cd4aa2cfd6 @@ -1093,7 +1093,7 @@ F tool/vdbe-compress.tcl f12c884766bd14277f4fcedcae07078011717381 F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4 F tool/warnings.sh fbc018d67fd7395f440c28f33ef0f94420226381 F tool/win/sqlite.vsix 97894c2790eda7b5bce3cc79cb2a8ec2fde9b3ac -P 665e4291c6e78f11d7181c18c5f2418d1adfcb1c -R 2b43f41e454a1bbd459d18838a33d5bf +P 433d1aecd399590b767ebf07b32023fb718a6574 +R bd0568ec5c6f80c0ba5870a23aeeb2df U drh -Z 9f4cea41d946c49ff071caa4f1da93db +Z 6a19f7c88688bac3b6839a73befa2b33 diff --git a/manifest.uuid b/manifest.uuid index 9e292ef1c6..6cebeafdb2 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -433d1aecd399590b767ebf07b32023fb718a6574 \ No newline at end of file +723f901a63313b64a9f10516711fb6136526b79b \ No newline at end of file diff --git a/src/where.c b/src/where.c index bd0d410cd2..c4a8c22243 100644 --- a/src/where.c +++ b/src/where.c @@ -3996,6 +3996,7 @@ static int whereLoopAddBtreeIndex( rLogSize = estLog(pProbe->aiRowEst[0]); for(; rc==SQLITE_OK && pTerm!=0; pTerm = whereScanNext(&scan)){ int nIn = 1; + if( pTerm->prereqRight & pNew->maskSelf ) continue; pNew->wsFlags = savedLoop.wsFlags; pNew->u.btree.nEq = savedLoop.u.btree.nEq; pNew->nTerm = savedLoop.nTerm; @@ -4146,6 +4147,7 @@ static int whereLoopAddBtree( WhereTerm *pTerm; WhereTerm *pWCEnd = pWC->a + pWC->nTerm; for(pTerm=pWC->a; rc==SQLITE_OK && pTermprereqRight & pNew->maskSelf ) continue; if( termCanDriveIndex(pTerm, pSrc, 0) ){ pNew->u.btree.nEq = 1; pNew->u.btree.pIndex = 0;