Issues

Select view

Select search mode

 
50 of 69

Sort bug in special case

Won't Do

Description

We found a bug in a usual query, which produces results in a wrong order.

The query is like this:

Where we get different results in different Server Version.

In version 5.7.20-19 we get:

(the correct result)

Beginning from 5.7.21 up to the current latest (5.7.29), we get this result:

Take care of the wrong sort order while using the DESC keyword.

Even more we get the correct order, when leaving out the external_order_id column and confusing results with other select sets:

Please investigate, whats the reason ...

Thanks in advance!

Environment

Docker image and plain package installation on Ubuntu 16.

Attachments

1

Smart Checklist

Details

Assignee

Reporter

Labels

Affects versions

Priority

Smart Checklist

Created April 3, 2020 at 5:03 PM
Updated March 4, 2025 at 9:09 PM
Resolved March 4, 2025 at 9:09 PM

Activity

Show:

Julia Vural March 4, 2025 at 9:09 PM

It appears that this issue is no longer being worked on, so we are closing it for housekeeping purposes. If you believe the issue still exists, please open a new ticket after confirming it's present in the latest release.

Lalit Choudhary April 14, 2020 at 2:28 PM

Lalit Choudhary April 14, 2020 at 1:50 PM
Edited

Testing further I found that issue originally reported for 5.7 old vs New version, Can also visible between 5.7.29  and 8.0.19 version.

 
Percona server:

Upstream MySQL:

So Here we have 2 issues when using order by with limit,
1. Inconsistent output between versions
2. Order By sorting is wrong

 

 

SteffenS April 14, 2020 at 10:49 AM

Thank you!

Lalit Choudhary April 14, 2020 at 10:46 AM

Thank you for your reply.

for consistent output for both 5.7.20 and 5.7.29 was referring to the upstream mysql versions test. 

Regarding "ORDER BY t1.order_id DESC"   yes, results for the  order_id column is  ASC and not DESC.

I will review it again and re-open it.

Loading...