#4245 (ok 4.1.7) initial Browse query does not match sorting order

4.1.5
fixed
None
1
2014-02-09
2014-01-22
Alexander Schuch
No

phpMyAdmin stores the order of each table per user. So when the user browses a table, the sort order is used from user preferences.

The problem here is that the initial query does not reflect the search order.

  1. Browse a table. The query shown will be "SELECT * FROM table".
  2. Sort by column col. the query shown will be "SELECT * FROM table ORDER BY table.col ASC".
  3. Leave the table and re-enter it or directly hit "Browse" again from top navigation.
  4. The query show is the same as in 1. But the records are sorted according to the stored user preferences as resulting from 2.

I expect the GUI and the result set to be syncronised, regarding shown query and record order, even initially.

Discussion

  • Hi Alexander,
    I was able to reproduce your problem. I will try to fix it

     
  • Marc Delisle
    Marc Delisle
    2014-01-25

    • assigned_to: Marc Delisle
     
  • Marc Delisle
    Marc Delisle
    2014-01-25

    • assigned_to: Marc Delisle --> nobody
     
  • Hi,

    I think there is another bug due to not synchronizing.

    1. Browse a table. The query shown will be "SELECT * FROM table".
    2. Sort by column col. so that sorting is "DESC".
    3. Now go to "SQL" tab and click "go" without changing the query.
    4. Now displayed query is "SELECT * FROM tablename where 1". But still the table
      is sorted in DESC order.
     
  • I made some changes and sent a pull request. With these changes now ordered table and the query are synchronized and displayed only if the user browses tables through navigation tree. Otherwise the order is remembered, but not displayed.

    https://github.com/phpmyadmin/phpmyadmin/pull/872

     
  • Marc Delisle
    Marc Delisle
    2014-01-27

    • assigned_to: Marc Delisle
     
  • Marc Delisle
    Marc Delisle
    2014-01-27

    • summary: initial "Browse" query does not match sorting order --> (ok 4.1.6) initial Browse query does not match sorting order
    • status: open --> resolved
    • Priority: 5 --> 1
     
  • Marc Delisle
    Marc Delisle
    2014-01-29

    • assigned_to: Marc Delisle --> Madhura Jayaratne
     
  • Marc Delisle
    Marc Delisle
    2014-02-01

    • summary: (ok 4.1.6) initial Browse query does not match sorting order --> (ok 4.1.7) initial Browse query does not match sorting order
     
  • I think this bug was not 100% resolved with the new fix.

    1.Browse a table. The query shown will be "SELECT * FROM table".
    2.Sort by a column so that sorting becomes "DESC".
    3.Now go to "SQL" tab, write a query for the table that starts with "SELECT * FROM [tabel name]" without adding any "order by" field, click on "go" button.
    4.Now the table is still sorted in "DESC" order. But it should not be ordered (at least it should be sorted in "ASC" order").

     
  • @Sampath: Thank you for pointing this out. I've written to dev mailing list to get an opinion on the expected behavior of this case. Let's see what others think.

     
  • Marc Delisle
    Marc Delisle
    2014-02-09

    • Status: resolved --> fixed