Skip to content

Commit 3d2ed05

Browse files
committed
Bug#34778435: crashing in Item_field::subst_argument_checker.
Problem: When the ORDER BY clause was pushed down into the parenthesised query block, we did not move the window function lists from the outer query block to the inner query block. As a result, the setup of those window functions was missed during Query_block::prepare(), and any query expressions inside those window functions were not prepared. Further optimization of such unprepared expressions would lead to a crash. Solution: Move the window function list from the outer query block to the inner query block. Change-Id: Ided5303d8ce2b99ae42a1be955356400c0a9d565
1 parent c2e746c commit 3d2ed05

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

sql/query_term.cc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,7 @@ Query_term *Query_term::pushdown_limit_order_by(Query_term_set_op *parent) {
112112
child_block->select_limit == nullptr) {
113113
child_block->order_list = this_block->order_list;
114114
child_block->absorb_limit_of(this_block);
115+
child_block->m_windows.prepend(&this_block->m_windows);
115116

116117
if (this_block->first_inner_query_expression() != nullptr) {
117118
// Change context of any items in ORDER BY to child block

0 commit comments

Comments
 (0)