Menu

#2638 (ok 2.11.5) Order columns in result list messing up query

2.11.4
fixed
1
2013-06-11
2008-02-05
No

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]

Discussion

  • Marc Delisle

    Marc Delisle - 2008-02-11
    • assigned_to: nobody --> lem9
     
  • Marc Delisle

    Marc Delisle - 2008-02-11
    • priority: 5 --> 1
    • summary: Order columns in result list messing up query --> (ok 2.11.5) Order columns in result list messing up query
    • status: open --> open-fixed
     
  • Marc Delisle

    Marc Delisle - 2008-02-11

    Logged In: YES
    user_id=210714
    Originator: NO

    Fixed in subversion, thanks for reporting.

     
  • Marc Delisle

    Marc Delisle - 2008-03-01
    • status: open-fixed --> closed-fixed
     
  • Michal Čihař

    Michal Čihař - 2013-06-11
    • Status: closed-fixed --> fixed