Hello
Usual query error, not a bug.
"where a2.a=3" turns left join to inner join because a2.a can not be null here.
This way the conditions contradict each other and it is possible to immediately get an empty set as a result without actually executing the query.
regards, Sergei