Bug #28684 Compare result set ignores order by in query
Submitted: 25 May 2007 19:03 Modified: 4 Jun 2009 12:58
Reporter: Clifton Kilby III Email Updates:
Status: Won't fix Impact on me:
None 
Category:MySQL Query Browser Severity:S3 (Non-critical)
Version:1.2.10 OS:Windows (XP Pro SP2)
Assigned to: CPU Architecture:Any

[25 May 2007 19:03] Clifton Kilby III
Description:
When using Query brower to compare two result sets, any order by clause is ignored in favor of sorting on the columns in order of appearance.

How to repeat:
I attached the test data that I used for this test. But any multiple column result set should work. Where `ind` is in an order, and `value` is not in order in relation to `ind`
Open a result set in side by side mode as usual.
SELECT ind, `value` FROM testa ORDER by `value` (Result Set 1)
SELECT ind, `value` FROM testb ORDER BY `value` (Result Set 2)
Click the compare resultset button. Order of `value` is interrupted for `ind`
The desired output can be obtained by 
SELECT `value`, ind FROM testa (Result Set 1)
SELECT `value`, ind FROM testb (Result Set 2)
Click the compare resultset button. Order of `value` is forced.
I do not know if this is action as intended, but it is not intuititve, and the specific behavior (or lack thereof) is not clearly documented 

Suggested fix:
If behavior as intended, please clarify documentation.
Otherwise, the perfered action would be leaving the result sets in the state they are defined, and do a line by line compairison as is. It may be easier to "rewrite" the query for the user in such a way that the columns in the ORDER BY clause are promoted to the head of the SELECT statement
[25 May 2007 19:04] Clifton Kilby III
Behavior as is

Attachment: actual result.JPG (image/pjpeg, text), 61.87 KiB.

[25 May 2007 19:04] Clifton Kilby III
Desired behavior

Attachment: intended result.jpg (image/pjpeg, text), 66.62 KiB.

[25 May 2007 19:05] Clifton Kilby III
Test tables, and data.

Attachment: test case.sql (application/octet-stream, text), 1.98 KiB.

[26 May 2007 1:05] MySQL Verification Team
Thank you for the bug report.
[4 Jun 2009 12:58] Axel Schwenke
Many thanks for writing a bug report. We are on the way to implement full functionality of MySQL Query Browser into MySQL Workbench. We won't fix uncritical bugs in Query Browser anymore.

More information on MySQL Workbench:

http://dev.mysql.com/workbench/