summaryrefslogtreecommitdiff
path: root/sql/filesort.cc
diff options
context:
space:
mode:
authorSergei Petrunia <psergey@askmonty.org>2016-04-06 20:34:23 +0300
committerSergei Petrunia <psergey@askmonty.org>2016-04-06 20:34:23 +0300
commit2efabf81f1faae693ac381de688579283c6fad47 (patch)
treeb5fc37d54498a561b83e469fd6e3c216eb9ba2fd /sql/filesort.cc
parent0a34dc1e976b4901c708f21cb8d636c6f8371beb (diff)
downloadmariadb-git-2efabf81f1faae693ac381de688579283c6fad47.tar.gz
MDEV-9847: Window functions: crash with big_tables=1
- Move filesort's sort_positions argument into class Filesort. - Make window function code construct Filesort with sort_positions=true.
Diffstat (limited to 'sql/filesort.cc')
-rw-r--r--sql/filesort.cc12
1 files changed, 3 insertions, 9 deletions
diff --git a/sql/filesort.cc b/sql/filesort.cc
index 78b74380f7e..82a5c90d0bb 100644
--- a/sql/filesort.cc
+++ b/sql/filesort.cc
@@ -124,17 +124,12 @@ void Sort_param::init_for_filesort(uint sortlen, TABLE *table,
@param thd Current thread
@param table Table to sort
@param filesort How to sort the table
- @param sort_positions Set to TRUE if we want to force sorting by
- position
- (Needed by UPDATE/INSERT or ALTER TABLE or
- when rowids are required by executor)
- applying WHERE condition.
@param[out] found_rows Store the number of found rows here.
This is the number of found rows after
applying WHERE condition.
@note
- If we sort by position (like if sort_positions is 1) filesort() will
- call table->prepare_for_position().
+ If we sort by position (like if filesort->sort_positions==true)
+ filesort() will call table->prepare_for_position().
@retval
0 Error
@@ -142,7 +137,6 @@ void Sort_param::init_for_filesort(uint sortlen, TABLE *table,
*/
SORT_INFO *filesort(THD *thd, TABLE *table, Filesort *filesort,
- bool sort_positions,
Filesort_tracker* tracker)
{
int error;
@@ -203,7 +197,7 @@ SORT_INFO *filesort(THD *thd, TABLE *table, Filesort *filesort,
&multi_byte_charset),
table,
thd->variables.max_length_for_sort_data,
- max_rows, sort_positions);
+ max_rows, filesort->sort_positions);
sort->addon_buf= param.addon_buf;
sort->addon_field= param.addon_field;