PHP: 5.2.5
MySQL: 5.0.45-community-nt
Apache: 2.2.6 Win32
PMA moves the LIMIT clause before the ORDER BY clause with a query that contains a WHERE clause inside parenthesis ...
To replicate:
Click the SQL tab, and put in a query with a specified LIMIT clause:
SELECT * FROM `tbl` WHERE (`tbl`.`something`=2) ORDER BY `column` ASC LIMIT 0,20
Run this query, then click the column header in the result list to return the result DESC. Click it yet again to sort ASC and PMA will restructure the query like so:
SELECT * FROM `tbl` WHERE (`tbl`.`something`=2) LIMIT 0,20 ORDER BY `column` ASC
It does not do this when PMA puts in it's own LIMIT clause [or, when the user omits the LIMIT clause from their query]
Logged In: YES
user_id=210714
Originator: NO
Fixed in subversion, thanks for reporting.