Fix several edge cases in boolean searches for MySQL. GH issue #1692