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

Sorting erroneous

User, date Message
Written by JanSR
8 years ago
Category: General
5 posts since Thu, 26 Oct 06
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
Written by ansgar
8 years ago
4940 posts since Fri, 07 Apr 06
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
Written by sit1way
7 years ago
3 posts since Sat, 02 Sep 06
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...
Written by ansgar
7 years ago
4940 posts since Fri, 07 Apr 06
Click on the userID column-header until it doesn't show the small arrow indicator.
Written by sit1way
7 years ago
3 posts since Sat, 02 Sep 06
that did it.

Thanks!
Written by JanSR
7 years ago
5 posts since Thu, 26 Oct 06
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
Written by ansgar
7 years ago
4940 posts since Fri, 07 Apr 06

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.
Written by JanSR
7 years ago
5 posts since Thu, 26 Oct 06
But the old mySQLfront (I still use it occasionally) doesn't do it. It stays on focus. ???
Written by Re Corvo
7 years ago
2 posts since Mon, 07 May 07
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
Written by siMKin
7 years ago
104 posts since Sun, 01 Apr 07

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.
Written by JanSR
7 years ago
5 posts since Thu, 26 Oct 06
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 ? ;)
Written by siMKin
7 years ago
104 posts since Sun, 01 Apr 07
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
Written by thecrumb
4 years ago
3 posts since Wed, 17 Nov 10
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
Written by ansgar
4 years ago
4940 posts since Fri, 07 Apr 06
Which revision?
In which list/column?
Written by thecrumb
4 years ago
3 posts since Wed, 17 Nov 10
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
Written by ansgar
4 years ago
4940 posts since Fri, 07 Apr 06
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".
Written by thecrumb
4 years ago
3 posts since Wed, 17 Nov 10
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.