summaryrefslogtreecommitdiff
path: root/sql
diff options
context:
space:
mode:
authorSergei Petrunia <psergey@askmonty.org>2016-02-03 00:15:49 +0300
committerSergei Petrunia <psergey@askmonty.org>2016-02-03 00:17:55 +0300
commit07b8aefe90ca830d2de068f2966cd2288b158a88 (patch)
tree6b5dfb016b69f719b7c4876d91acc5ec8958bbfc /sql
parent55ea26541d4c95e765073c70126d9bb490c572c6 (diff)
downloadmariadb-git-07b8aefe90ca830d2de068f2966cd2288b158a88.tar.gz
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
Diffstat (limited to 'sql')
-rw-r--r--sql/sql_select.cc6
1 files changed, 2 insertions, 4 deletions
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();
}
}