Add the ability to disable the push-down optimization using the 0x1000 bit of

SQLITE_TESTCTRL_OPTIMIZATIONS.

FossilOrigin-Name: eddc35f3057e59fdc25a6911abfaa53a10cc43d8030925b65737b2f51f907421
This commit is contained in:
drh
2018-03-20 11:24:30 +00:00
parent cfd74700da
commit 2d277bb5cb
4 changed files with 13 additions and 8 deletions
+4
View File
@@ -3853,6 +3853,7 @@ static int pushDownWhereTerms(
Expr *pNew;
int nChng = 0;
if( pWhere==0 ) return 0;
return 0;
if( pSubq->selFlags & SF_Recursive ) return 0; /* restriction (2) */
#ifdef SQLITE_DEBUG
@@ -5334,6 +5335,7 @@ int sqlite3Select(
** inside the subquery. This can help the subquery to run more efficiently.
*/
if( (pItem->fg.jointype & JT_OUTER)==0
&& OptimizationEnabled(db, SQLITE_PushDown)
&& pushDownWhereTerms(pParse, pSub, p->pWhere, pItem->iCursor)
){
#if SELECTTRACE_ENABLED
@@ -5342,6 +5344,8 @@ int sqlite3Select(
sqlite3TreeViewSelect(0, p, 0);
}
#endif
}else{
SELECTTRACE(0x100,pParse,p,("Push-down not possible\n"));
}
zSavedAuthContext = pParse->zAuthContext;