Prevent SQLite from assuming that if ((? IS NOT NULL) IS NOT NULL) is true, ? may not be NULL. Fix for [d51a8696].

FossilOrigin-Name: 7833feecfe745e237f239ee4c38a9e4bf7ad66a32919150208da87c00a826473
diff --git a/src/expr.c b/src/expr.c
index ba19a33..b1f405c 100644
--- a/src/expr.c
+++ b/src/expr.c
@@ -5168,10 +5168,11 @@
       return WRC_Prune;
 
     case TK_AND:
-      if( sqlite3ExprImpliesNonNullRow(pExpr->pLeft, pWalker->u.iCur)
-       && sqlite3ExprImpliesNonNullRow(pExpr->pRight, pWalker->u.iCur)
-      ){
-        pWalker->eCode = 1;
+      assert( pWalker->eCode==0 );
+      sqlite3WalkExpr(pWalker, pExpr->pLeft);
+      if( pWalker->eCode ){
+        pWalker->eCode = 0;
+        sqlite3WalkExpr(pWalker, pExpr->pRight);
       }
       return WRC_Prune;
 
@@ -5230,15 +5231,8 @@
 int sqlite3ExprImpliesNonNullRow(Expr *p, int iTab){
   Walker w;
   p = sqlite3ExprSkipCollateAndLikely(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;
-    }
+  if( p && p->op==TK_NOTNULL ){
+    p = p->pLeft;
   }
   w.xExprCallback = impliesNotNullRow;
   w.xSelectCallback = 0;