From 07b8aefe90ca830d2de068f2966cd2288b158a88 Mon Sep 17 00:00:00 2001 From: Sergei Petrunia Date: Wed, 3 Feb 2016 00:15:49 +0300 Subject: MDEV-9504: ANALYZE TABLE shows wrong 'rows' value for ORDER BY query Revert the patch for MDEV-9504. It causes test failures, attempt to fix these causes more failures. The source of all this is that the code in test_if_skip_sort_order() has a peculiar way of treating select_limit parameter: Correct value is computed when the query plan is changed. In other cases, we use an approximation that ignores the presence of GROUP BY clause, or JOINs, or both. A patch that fixes all of the above would be too big to do in 10.1 --- sql/sql_select.cc | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'sql') diff --git a/sql/sql_select.cc b/sql/sql_select.cc index de5f29d9bf4..ea30bf96f06 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -21031,14 +21031,12 @@ check_reverse_order: } table->file->ha_index_or_rnd_end(); - - if (select_limit < table->stat_records()) - tab->limit= select_limit; - if (tab->join->select_options & SELECT_DESCRIBE) { tab->ref.key= -1; tab->ref.key_parts= 0; + if (select_limit < table->stat_records()) + tab->limit= select_limit; table->disable_keyread(); } } -- cgit v1.2.1