According to the MySQL query reference http://dev.mysql.com/doc/refman/5.1/en/select.html there are other commands which should be placed after the limit as well:
* PROCEDURE (not currently supported by MySQL query)
* [INTO OUTFILE 'file_name'
[CHARACTER SET charset_name] export_options
| INTO DUMPFILE 'file_name'
| INTO var_name [, var_name]]
* [FOR UPDATE | LOCK IN SHARE MODE]
So, please, also make sure that the supported options (except PROCEDURE) are also serialized after the query modifiers.
According to the MySQL query reference http:// dev.mysql. com/doc/ refman/ 5.1/en/ select. html there are other commands which should be placed after the limit as well:
export_ options
* PROCEDURE (not currently supported by MySQL query)
* [INTO OUTFILE 'file_name'
[CHARACTER SET charset_name]
| INTO DUMPFILE 'file_name'
| INTO var_name [, var_name]]
* [FOR UPDATE | LOCK IN SHARE MODE]
So, please, also make sure that the supported options (except PROCEDURE) are also serialized after the query modifiers.