Fix #2247 Query with operator NOT not working