summaryrefslogtreecommitdiff
path: root/sql/filesort.h
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.h
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.h')
-rw-r--r--sql/filesort.h15
1 files changed, 11 insertions, 4 deletions
diff --git a/sql/filesort.h b/sql/filesort.h
index 6d665dbe0aa..18029a10c14 100644
--- a/sql/filesort.h
+++ b/sql/filesort.h
@@ -47,16 +47,25 @@ public:
bool own_select;
/** true means we are using Priority Queue for order by with limit. */
bool using_pq;
+
+ /*
+ TRUE means sort operation must produce table rowids.
+ FALSE means that it halso has an option of producing {sort_key,
+ addon_fields} pairs.
+ */
+ bool sort_positions;
Filesort_tracker *tracker;
- Filesort(ORDER *order_arg, ha_rows limit_arg, SQL_SELECT *select_arg):
+ Filesort(ORDER *order_arg, ha_rows limit_arg, bool sort_positions_arg,
+ SQL_SELECT *select_arg):
order(order_arg),
limit(limit_arg),
sortorder(NULL),
select(select_arg),
own_select(false),
- using_pq(false)
+ using_pq(false),
+ sort_positions(sort_positions_arg)
{
DBUG_ASSERT(order);
};
@@ -143,12 +152,10 @@ public:
{ return filesort_buffer.sort_buffer_size(); }
friend SORT_INFO *filesort(THD *thd, TABLE *table, Filesort *filesort,
- bool sort_positions,
Filesort_tracker* tracker);
};
SORT_INFO *filesort(THD *thd, TABLE *table, Filesort *filesort,
- bool sort_positions,
Filesort_tracker* tracker);
void change_double_for_sort(double nr,uchar *to);