distal-attribute
distal-attribute
distal-attribute
distal-attribute

Sorting erroneous

JanSR posted 8 years ago in General
Hi Ansgar,

I have a table with a varchar(20) field, containing values like 'vb_1, vb_23, vb_5' etc.

When I klick on the column header to sort ascending/descending, nothing much happens in heidi. At least the order ist not what it is supposed to be.

Known bug?

Jan
ansgar posted 8 years ago
hmm.. should work. at least I cannot reproduce that error.

- Is the tiny arrow on the column-header visible?
- what does the SQL-log say about the last 2 queries?

Greetings,
Ansgar
sit1way posted 8 years ago
same problem on my end.

Application appears to "remember" original sort request (e.g. click on column userID); thus, further sort requests do not work as original sort request always takes precedence.

Here's a sample from the HeidiSQL log:

SELECT SQL_CALC_FOUND_ROWS * FROM myTable ORDER BY user_id DESC, last_name ASC
SHOW TABLES LIKE 'myTable'
SHOW COLUMNS FROM `user_info` LIKE '%'
SELECT FOUND_ROWS()

I want to sort by last_name, but the application keeps ordering by userID first; then by last_name, which is not the desired ordering scheme...
ansgar posted 8 years ago
Click on the userID column-header until it doesn't show the small arrow indicator.
sit1way posted 8 years ago
that did it.

Thanks!

JanSR posted 8 years ago
Hi Ansgar,

I find it kind of "disturbing" to have the sort arrows be persistent (meaning that I would by default sort in two or more columns if forgot to "unarrow" the previous column(s)).
I would like it better to have a sort by clicking on the column header always to be only the active column and to be able to add a second sort-column mybe by holding the strg-key.

A second thing: Whenever I am in the middle of a wide table (a column where I have to scroll right to see it) and then change the sort option, I always lose focus and get thrown back to the leftmost column. Any Chance to change this?

Jan
ansgar posted 8 years ago

JanSR wrote: I would like it better to have a sort by clicking on the column header always to be only the active column and to be able to add a second sort-column mybe by holding the strg-key.



You're not the first one who had this idea. Doesn't sound bad, so we should implement that.

JanSR wrote: Whenever I am in the middle of a wide table (a column where I have to scroll right to see it) and then change the sort option, I always lose focus and get thrown back to the leftmost column. Any Chance to change this?



Yes, that also annoys me like hell since MySQL-Front 1.0. We only would have to temporarily store the last column-number (and row-number??!) and set the focus on that cell.
JanSR posted 8 years ago
But the old mySQLfront (I still use it occasionally) doesn't do it. It stays on focus. ???
Re Corvo posted 7 years ago
I have me too some sorting problem...

Freshly connected... first sorting on second field OK, second sorting (descending) OK, third sorting BAD. It sorts upon the first field and nothing could change his behaviour...
I also tried to make disappear the tiny arrows (as Ansgar suggested) on the name of fields, but without results...

Merci for any help

Simone
siMKin posted 7 years ago

Re Corvo wrote: I have me too some sorting problem...

Freshly connected... first sorting on second field OK, second sorting (descending) OK, third sorting BAD. It sorts upon the first field and nothing could change his behaviour...



This is how it should be. When you click on the first column it will do something like
ORDER BY col1 ASC
When you click on the the second column it will do:
ORDER BY col1 ASC, col2 ASC
and when you click that one again:
ORDER BY col1 ASC, col2 DESC
But the first one will still have priority. So when you click on the 3rd one, the first column still has preference.

wrote: I also tried to make disappear the tiny arrows (as Ansgar suggested) on the name of fields, but without results...


making the arrow on a column 'disappear' can be achieved by clicking in 3 times in total. So if it's already sorting Ascending, you have to click it another 2 times.
1st: ASC
2nd: DESC
3rd: back to nothing

In the bottom (SQL Log) you can see the queries Heidi performs after every sorting command. You can use it to check wether it actually removed the sorting. When you don't see an arrow anymore, it should appear in the query anymore either.

JanSR posted 7 years ago
I find that the default-multiple-column-sorting annoys the hell out of me ;-)

Since in large tables not all columns are visible at once (and thus not all used sort-options will be visible) I'd recommend at least a button that allows me to "clear all sort commands" in order to get a quick way to sort (certainly) only by one column.

How about it, Ansgar ? ;)
siMKin posted 7 years ago
A workaround to clearing the multiple sorting can be achieved by clicking another table (this will show the data of this table) and then the table again that you were viewing.
Takes only two clicks
thecrumb posted 4 years ago
This is an old thread but I've also noticed when sorting ID columns I get lists like

1
16
17
18

etc.

I can't seem to get back to

1
2
3
4
...

Regardless of what column, or how many times I click it.

Jim
ansgar posted 4 years ago
Which revision?
In which list/column?
thecrumb posted 4 years ago
I have 5.1.0.3598.

If I'm in a data tab for a table and I have a primary ID column (numeric) "userID" and the id's are '1,2,3,4' clicking on the column header results in weird sorting

Arrow down = 1,20,19,18,17...
Arrow up = 1,16,17,18,19...
No arrow (key showing) = 1,16,17,18,19...

Jim

ansgar posted 4 years ago
Well in the data tab it's the server which orders rows in the way they are displayed in the grid.
If you are sure ID is numeric then it could be you have more than one column sorted. Please check that on the top right button "Sorting".
thecrumb posted 4 years ago
Doh! Sure enough - it's a big table and apparently I had clicked one of the other columns which was throwing off the primary.

Thanks!
Jim

Please login to leave a reply, or register at first.