Query:
SELECT id FROM table1
UNION
SELECT id FROM table2
ORDER BY id ASC
LIMIT 55
normally parsed, but when calling toString, order and limit are reversed. ToString result:
SELECT id FROM table1
UNION
SELECT id FROM table2
LIMIT 55
ORDER BY id ASC
Result of toString is failed on database.
If in source query add brackets:
(SELECT id FROM table1
UNION
SELECT id FROM table2)
ORDER BY id ASC
LIMIT 55
Method toString work correct, but it is not always possible to add brackets to the original query.
Query:
normally parsed, but when calling toString, order and limit are reversed. ToString result:
Result of toString is failed on database.
If in source query add brackets:
Method toString work correct, but it is not always possible to add brackets to the original query.