summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVicențiu Ciorbaru <vicentiu@mariadb.org>2021-01-13 23:35:08 +0200
committerVicențiu Ciorbaru <vicentiu@mariadb.org>2021-01-13 23:35:08 +0200
commitaa1640355a5ea242378d1cb308c4eff2ab928e5d (patch)
treea1369c74b0bdef9707c5e74c2351d3f5fd5c8b6a
parente971f332697f037f2a37537eac1dfa854e4330a9 (diff)
downloadmariadb-git-aa1640355a5ea242378d1cb308c4eff2ab928e5d.tar.gz
Order fields must be allocated for temporary tables too
-rw-r--r--sql/sql_select.cc4
1 files changed, 4 insertions, 0 deletions
diff --git a/sql/sql_select.cc b/sql/sql_select.cc
index a8d0ece6f6f..4a4633040df 100644
--- a/sql/sql_select.cc
+++ b/sql/sql_select.cc
@@ -3686,7 +3686,11 @@ bool JOIN::make_aggr_tables_info()
(has_group_by || (join_tab + top_join_tab_count > curr_tab + 1)) ?
select_limit : unit->lim.get_select_limit();
if (unit->lim.is_with_ties())
+ {
+ if (alloc_order_fields(this, order))
+ DBUG_RETURN(true);
sort_tab->filesort->limit= HA_POS_ERROR;
+ }
}
if (!only_const_tables() &&
!join_tab[const_tables].filesort &&