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

Improvements to the LEFT JOIN strength reduction optimization.

FossilOrigin-Name: 548082dfab5d9484279ccc11cd2833ac131b54b7481372b576d7c28bbb3294ea
This commit is contained in:
drh
2019-10-11 16:01:21 +00:00
parent 8b4d0e2cba
commit 4a254f98e3
3 changed files with 13 additions and 9 deletions

View File

@@ -5231,8 +5231,12 @@ static int impliesNotNullRow(Walker *pWalker, Expr *pExpr){
int sqlite3ExprImpliesNonNullRow(Expr *p, int iTab){
Walker w;
p = sqlite3ExprSkipCollateAndLikely(p);
if( p && p->op==TK_NOTNULL ){
if( p==0 ) return 0;
if( p->op==TK_NOTNULL ){
p = p->pLeft;
}else if( p->op==TK_AND ){
if( sqlite3ExprImpliesNonNullRow(p->pLeft, iTab) ) return 1;
p = p->pRight;
}
w.xExprCallback = impliesNotNullRow;
w.xSelectCallback = 0;