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

Improvements to the sqlite3ExprImpliesNonNullRow() theorem prover.

FossilOrigin-Name: 3fde627616030ca0de87169467e2e453fdc91154942e3a3a92a221df5923b2d2
This commit is contained in:
drh
2019-04-01 19:42:42 +00:00
parent afb3f3c72c
commit d6db6598ca
3 changed files with 19 additions and 8 deletions

View File

@@ -5032,6 +5032,17 @@ static int impliesNotNullRow(Walker *pWalker, Expr *pExpr){
*/
int sqlite3ExprImpliesNonNullRow(Expr *p, int iTab){
Walker w;
p = sqlite3ExprSkipCollate(p);
while( p ){
if( p->op==TK_NOTNULL ){
p = p->pLeft;
}else if( p->op==TK_AND ){
if( sqlite3ExprImpliesNonNullRow(p->pLeft, iTab) ) return 1;
p = p->pRight;
}else{
break;
}
}
w.xExprCallback = impliesNotNullRow;
w.xSelectCallback = 0;
w.xSelectCallback2 = 0;