- attached mysql_limit.patch
Use "LIMIT <offset>, <limit>" syntax on MySQL to support older versions
As discussed on the mailing list:
Old versions of MySQL don't support the LIMIT <limit> OFFSET <offset> syntax that SA currently uses. Instead they use LIMIT <limit>, <offset>. As far as I can tell there is no disadvantage to using the syntax on new versions of MySQL as well.
The attached patch changes MySQLCompiler.limit_clause to use the older syntax. I also added a test to the test suite in dialect/mysql.py, which passes. When I run the whole test suite I do get a number of errors, but I don't think they are related to my change.
The patch is against trunk revision 3515, but I think the same function definition could be used in the 0.3 branch.
Comments (2)
-
Account Deleted -
- changed status to resolved
Commited in 6f3f85e48c7dca360f029c23231711036c66a95f, thanks for the patch!
I tested this up through 6.0 and there's no signs of deprecating the
<offset>, <limit>
syntax. That said, when it's easy to branch a dialog by server revision versions 4.0 and up will probably move back to the PostgresOFFSET
syntax for better readability of the generated SQL. - Log in to comment
Patch against trunk revision 3515