BUG FIX (scan optimization): two Scan nodes are not equal if their "as_while"
flags are different.