summaryrefslogtreecommitdiff
path: root/sql/sql_base.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/sql_base.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/sql_base.cc')
-rw-r--r--sql/sql_base.cc1
1 files changed, 1 insertions, 0 deletions
diff --git a/sql/sql_base.cc b/sql/sql_base.cc
index 9a66b27a454..5173df260d5 100644
--- a/sql/sql_base.cc
+++ b/sql/sql_base.cc
@@ -6440,6 +6440,7 @@ set_new_item_local_context(THD *thd, Item_ident *item, TABLE_LIST *table_ref)
if (!(context= new (thd->mem_root) Name_resolution_context))
return TRUE;
context->init();
+ context->select_lex= table_ref->select_lex;
context->first_name_resolution_table=
context->last_name_resolution_table= table_ref;
item->context= context;