I have a query that behaves differently in every version of MySQL I’ve tried. Could you do me a favor? Run the following four lines and post a comment with your results. And if you know of a particular bug fix that addresses this issue, let me know about that too.
CREATE TABLE `test` (`id` tinyint); INSERT INTO test VALUES (1), (2), (3), (4), (5); SHOW VARIABLES LIKE 'version%'; (SELECT * from test ORDER BY id DESC LIMIT 3) ORDER BY id ASC;
Here are three results I get on Windows:
4.0.27-nt +----+ | id | +----+ | 5 | | 4 | | 3 | +----+
5.0.15 +----+ | id | +----+ | 5 | | 4 | | 3 | | 2 | | 1 | +----+
5.0.24a-community-nt +------+ | id | +------+ | 3 | | 4 | | 5 | +------+
That last result is the one I expect.

Leave a Reply