[MDEV-6230] Error (too many FOUND_ROWS) for query when using order by Created: 2014-05-12 Updated: 2014-11-27 Resolved: 2014-06-05 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | None |
| Affects Version/s: | 10.0.11 |
| Fix Version/s: | 10.0.12 |
| Type: | Bug | Priority: | Critical |
| Reporter: | David-Julian BUCH (Inactive) | Assignee: | Sergei Golubchik |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Attachments: |
|
||||||||||||||||
| Issue Links: |
|
||||||||||||||||
| Description |
|
If you have a condition on the join and then the where, the priority on the condition of the join is not respected if you have an order by clause. Here is a real query :
This query returns 43316 found rows. If I remove the ORDER BY a.`date_add` DESC statement, I get 356 found rows. If I use the following query, using a temp table it works :
But the ORDER BY `date_add` desc is not applied... the result is not sorted. My structure and data is in the attachement. |
| Comments |
| Comment by Elena Stepanova [ 2014-05-12 ] |
|
Hi, |
| Comment by David-Julian BUCH (Inactive) [ 2014-05-12 ] |
|
If I move the ORDER BY clause outside of the temp table, the query crashes again, this leading me to think that the big point is the problem of the ORDER BY clause... |
| Comment by David-Julian BUCH (Inactive) [ 2014-05-12 ] |
|
Finaly searching a bit, I found out that the correct number of items is returned by the query if I remove the LIMIT clause I have 356 lines returned, it is only the number returned by SQL_CALC_FOUND_ROWS and SELECT FOUND_ROWS() that is incorrect. |
| Comment by Sergei Golubchik [ 2014-05-22 ] |
|
The version is set to 10.0.10-galera — is that right? Doesn't seem to be a galera issue to me. |
| Comment by Elena Stepanova [ 2014-05-24 ] |
|
It does look like the same issue as |
| Comment by Sergei Golubchik [ 2014-06-05 ] |
|
It is a duplicate, yes. The fix for |