summaryrefslogtreecommitdiff
path: root/sql/sql_class.h
diff options
context:
space:
mode:
authorSergei Petrunia <sergey@mariadb.com>2023-01-23 13:10:24 +0200
committerSergei Petrunia <sergey@mariadb.com>2023-01-23 18:22:21 +0200
commitf18c2b6c8a92475f685ce60c495faddc5aaab011 (patch)
treeb234fac21e9b055ad27494f28599deeb89dc5456 /sql/sql_class.h
parent00150ff8d40fc046eef4a1a8bd6740024de9e7f4 (diff)
downloadmariadb-git-f18c2b6c8a92475f685ce60c495faddc5aaab011.tar.gz
MDEV-15178: Filesort::make_sortorder: Assertion `pos->field != __null |
(Initial patch by Varun Gupta. Amended and added comments). When the query has both 1. Aggregate functions that require sorting data by group, and 2. Window functions we need to use two temporary tables. The first temp.table will hold the join output. Then it is passed to filesort(). Reading it in sorted order allows to compute the aggregate functions. Then, we need to write their values into the second temp. table. Then, Window Function computation step can pass that to filesort() and read them in the order it needs. Failure to create the second temp. table would cause an assertion failure: window function could would not find where to get the values of the aggregate functions.
Diffstat (limited to 'sql/sql_class.h')
-rw-r--r--sql/sql_class.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/sql/sql_class.h b/sql/sql_class.h
index 49a8509b519..371f17e4faa 100644
--- a/sql/sql_class.h
+++ b/sql/sql_class.h
@@ -5580,6 +5580,12 @@ public:
uint sum_func_count;
uint hidden_field_count;
uint group_parts,group_length,group_null_parts;
+
+ /*
+ If we're doing a GROUP BY operation, shows which one is used:
+ true TemporaryTableWithPartialSums algorithm (see end_update()).
+ false OrderedGroupBy algorithm (see end_write_group()).
+ */
uint quick_group;
/**
Enabled when we have atleast one outer_sum_func. Needed when used