1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-01 03:47:19 +03:00

MDEV-5884: EXPLAIN UPDATE ... ORDER BY LIMIT shows wrong #rows

- Make get_index_for_order() return correct #rows. 
  changed EXPLAIN outputs are checked - only #rows is different.
This commit is contained in:
Sergey Petrunya
2014-06-04 00:26:27 +04:00
parent 40da8545a2
commit b6b5b748e7
5 changed files with 36 additions and 12 deletions

View File

@ -24905,7 +24905,8 @@ uint get_index_for_order(ORDER *order, TABLE *table, SQL_SELECT *select,
switch (test_if_order_by_key(order, table, select->quick->index,
&used_key_parts)) {
case 1: // desired order
*need_sort= FALSE;
*need_sort= FALSE;
*scanned_limit= MY_MIN(limit, select->quick->records);
return select->quick->index;
case 0: // unacceptable order
*need_sort= TRUE;
@ -24918,7 +24919,7 @@ uint get_index_for_order(ORDER *order, TABLE *table, SQL_SELECT *select,
{
select->set_quick(reverse_quick);
*need_sort= FALSE;
*scanned_limit= select->quick->records;
*scanned_limit= MY_MIN(limit, select->quick->records);
return select->quick->index;
}
else