1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-11-11 01:42:22 +03:00

Restore the LEFT JOIN strength reduction that was partially lost in

[d747afda5683ca5f] when strength reduction was generalized to all OUTER JOINs.

FossilOrigin-Name: 2d962b84dd8ac2d0968f0283f8f082c1c2a7a1f99b59053b2ad8f58745396447
This commit is contained in:
drh
2023-06-02 18:05:54 +00:00
parent a3f943942c
commit 038158e94a
5 changed files with 31 additions and 16 deletions

View File

@@ -7234,7 +7234,8 @@ int sqlite3Select(
** "OUTER JOIN strength reduction" in the SQLite documentation.
*/
if( (pItem->fg.jointype & (JT_LEFT|JT_LTORJ))!=0
&& sqlite3ExprImpliesNonNullRow(p->pWhere, pItem->iCursor)
&& sqlite3ExprImpliesNonNullRow(p->pWhere, pItem->iCursor,
pItem->fg.jointype & JT_LTORJ)
&& OptimizationEnabled(db, SQLITE_SimplifyJoin)
){
if( pItem->fg.jointype & JT_LEFT ){