summaryrefslogtreecommitdiff
path: root/sql/item_subselect.cc
diff options
context:
space:
mode:
authorOleksandr Byelkin <sanja@mariadb.com>2021-07-23 11:14:13 +0200
committerOleksandr Byelkin <sanja@mariadb.com>2021-09-27 11:00:51 +0200
commit3690c549c6e72646ba74f6b4c83813ee4ac3aea4 (patch)
treee619941de38c42f99b6377e8af00a78700bcfbb1 /sql/item_subselect.cc
parent1a62c878970fea6d2013c432bbd5aae30dbaca89 (diff)
downloadmariadb-git-3690c549c6e72646ba74f6b4c83813ee4ac3aea4.tar.gz
MDEV-24454 Crash at change_item_treebb-10.2-MDEV-24454
Use in_sum_func (and so nest_level) only in LEX to which SELECT lex belong to Reduce usage of current_select (because it does not always point on the correct SELECT_LEX, for example with prepare. Change context for all classes inherited from Item_ident (was only for Item_field) in case of pushing down it to HAVING. Now name resolution context have to have SELECT_LEX reference if the context is present. Fixed feedback plugin stack usage.
Diffstat (limited to 'sql/item_subselect.cc')
-rw-r--r--sql/item_subselect.cc3
1 files changed, 2 insertions, 1 deletions
diff --git a/sql/item_subselect.cc b/sql/item_subselect.cc
index 25621dfe104..3f9a760ce09 100644
--- a/sql/item_subselect.cc
+++ b/sql/item_subselect.cc
@@ -5190,8 +5190,9 @@ bool subselect_hash_sj_engine::make_semi_join_conds()
NULL, TL_READ);
tmp_table_ref->table= tmp_table;
- context= new Name_resolution_context;
+ context= new (thd->mem_root) Name_resolution_context;
context->init();
+ context->select_lex= item_in->unit->first_select();
context->first_name_resolution_table=
context->last_name_resolution_table= tmp_table_ref;
semi_join_conds_context= context;