Sorting erroneous

[expired user #341]'s profile image [expired user #341] posted 17 years ago in General Permalink
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's profile image ansgar posted 17 years ago Permalink
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
[expired user #109]'s profile image [expired user #109] posted 17 years ago Permalink
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's profile image ansgar posted 17 years ago Permalink
Click on the userID column-header until it doesn't show the small arrow indicator.
[expired user #109]'s profile image [expired user #109] posted 17 years ago Permalink
that did it.

Thanks!
[expired user #341]'s profile image [expired user #341] posted 17 years ago Permalink
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's profile image ansgar posted 17 years ago Permalink

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.

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.
[expired user #341]'s profile image [expired user #341] posted 17 years ago Permalink
But the old mySQLfront (I still use it occasionally) doesn't do it. It stays on focus. ???
[expired user #2244]'s profile image [expired user #2244] posted 17 years ago Permalink
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
[expired user #1821]'s profile image [expired user #1821] posted 17 years ago Permalink

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.

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.
[expired user #341]'s profile image [expired user #341] posted 17 years ago Permalink
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 ? ;)
[expired user #1821]'s profile image [expired user #1821] posted 17 years ago Permalink
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
[expired user #5299]'s profile image [expired user #5299] posted 13 years ago Permalink
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's profile image ansgar posted 13 years ago Permalink
Which revision?
In which list/column?
[expired user #5299]'s profile image [expired user #5299] posted 13 years ago Permalink
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's profile image ansgar posted 13 years ago Permalink
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".
[expired user #5299]'s profile image [expired user #5299] posted 13 years ago Permalink
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.