aboutsummaryrefslogtreecommitdiff
path: root/src/wherecode.c
diff options
context:
space:
mode:
authordrh <drh@noemail.net>2019-12-28 16:20:23 +0000
committerdrh <drh@noemail.net>2019-12-28 16:20:23 +0000
commita4b2df5ce277b5bfb28ceeb1e8d9d052e870b367 (patch)
treea84dbd87be87f53cdd06cb2361fc895b7d7a2b96 /src/wherecode.c
parent51f2b1719ce6cbc5fba38885b3ddf622f8647ce9 (diff)
downloadsqlite-a4b2df5ce277b5bfb28ceeb1e8d9d052e870b367.tar.gz
sqlite-a4b2df5ce277b5bfb28ceeb1e8d9d052e870b367.zip
Disable early coding of transitive constraints at the end of each loop in
the WHERE clause processing if the loop being coded is for a LEFT JOIN, even if the loop is part of an OR-clause optimization for virtual tables. Test cases in TH3. FossilOrigin-Name: 9421b442cad9858ec21050c106aa935a1c0723ab08ef9a867a79638b040b6e68
Diffstat (limited to 'src/wherecode.c')
-rw-r--r--src/wherecode.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/wherecode.c b/src/wherecode.c
index e9cdc1919..289eecb30 100644
--- a/src/wherecode.c
+++ b/src/wherecode.c
@@ -1286,8 +1286,8 @@ Bitmask sqlite3WhereCodeOneLoopStart(
VdbeModuleComment((v, "Begin WHERE-loop%d: %s",iLevel,pTabItem->pTab->zName));
#if WHERETRACE_ENABLED /* 0x20800 */
if( sqlite3WhereTrace & 0x800 ){
- sqlite3DebugPrintf("Coding level %d of %d: notReady=%llx\n",
- iLevel, pWInfo->nLevel, (u64)notReady);
+ sqlite3DebugPrintf("Coding level %d of %d: notReady=%llx iFrom=%d\n",
+ iLevel, pWInfo->nLevel, (u64)notReady, pLevel->iFrom);
sqlite3WhereLoopPrint(pLoop, pWC);
}
if( sqlite3WhereTrace & 0x20000 ){
@@ -2381,7 +2381,7 @@ Bitmask sqlite3WhereCodeOneLoopStart(
if( (pTerm->eOperator & (WO_EQ|WO_IS))==0 ) continue;
if( (pTerm->eOperator & WO_EQUIV)==0 ) continue;
if( pTerm->leftCursor!=iCur ) continue;
- if( pLevel->iLeftJoin ) continue;
+ if( pTabItem->fg.jointype & JT_LEFT ) continue;
pE = pTerm->pExpr;
#ifdef WHERETRACE_ENABLED /* 0x800 */
if( sqlite3WhereTrace & 0x800 ){