I have the following prepared statement query:
SELECT id FROM CustomerSettings WHERE id >= ? OR displayNameType = ? AND id < ? LIMIT 5 OFFSET 1
The "id <" part of the query is ignored. Curiously, if I move the statement BEFORE the OR statement then it is correctly evaluated by the MySQL database engine. Is this expected behaviour seems rather odd. I have also tried putting the OR clause in brackets this unfortunately didn't work either; the AND clause immediately following the OR is still ignored.