diff options
author | Sergei Golubchik <sergii@pisem.net> | 2014-03-19 20:33:12 +0100 |
---|---|---|
committer | Sergei Golubchik <sergii@pisem.net> | 2014-03-19 20:33:12 +0100 |
commit | 9418bd9c2167ef6a75d7d1bfaaf5e2cf94d09bae (patch) | |
tree | 7555f2df23c72b1b6eea47aab5542be24742f94c /sql/filesort.cc | |
parent | 1fa1ea0f2df62796a89df8f00f49a4e77d7cf478 (diff) | |
download | mariadb-git-9418bd9c2167ef6a75d7d1bfaaf5e2cf94d09bae.tar.gz |
MDEV-5898 FOUND_ROWS() return incorrect value when using DISTINCT
revert the fix for MDEV-5549, use a different approach.
Diffstat (limited to 'sql/filesort.cc')
-rw-r--r-- | sql/filesort.cc | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/sql/filesort.cc b/sql/filesort.cc index 12b9bb5aadc..776ec064365 100644 --- a/sql/filesort.cc +++ b/sql/filesort.cc @@ -188,7 +188,6 @@ ha_rows filesort(THD *thd, TABLE *table, SORT_FIELD *sortorder, uint s_length, my_b_clear(&buffpek_pointers); buffpek=0; error= 1; - *found_rows= HA_POS_ERROR; param.init_for_filesort(sortlength(thd, sortorder, s_length, &multi_byte_charset), @@ -687,7 +686,7 @@ static ha_rows find_all_keys(Sort_param *param, SQL_SELECT *select, ref_pos= ref_buff; quick_select=select && select->quick; record=0; - *found_rows= pq ? 0 : HA_POS_ERROR; // don't count unless pq is used + *found_rows= 0; flag= ((file->ha_table_flags() & HA_REC_NOT_IN_SEQ) || quick_select); if (flag) ref_pos= &file->ref[0]; @@ -807,14 +806,9 @@ static ha_rows find_all_keys(Sort_param *param, SQL_SELECT *select, if (write_record) { + (*found_rows)++; if (pq) { - /* - only count rows when pq is used - otherwise there might be - other filters *after* the filesort, we don't know the final row - count here - */ - (*found_rows)++; pq->push(ref_pos); idx= pq->num_elements(); } |