diff options
author | Sergei Golubchik <serg@mariadb.org> | 2022-04-29 14:50:47 +0200 |
---|---|---|
committer | Sergei Golubchik <serg@mariadb.org> | 2022-04-29 17:05:19 +0200 |
commit | 0beed9b5e933f0ff79b3bb346524f7a451d14e38 (patch) | |
tree | dc3839b657c7f9113ef315a04096480af52a4ae8 /sql/sql_base.cc | |
parent | 8c34eab9688b4face54f15f89f5d62bdfd93b8a7 (diff) | |
download | mariadb-git-0beed9b5e933f0ff79b3bb346524f7a451d14e38.tar.gz |
MDEV-28097 use-after-free when WHERE has subquery with an outer reference in HAVING
when resolving WHERE and ON clauses, do not look in
SELECT list/aliases.
Diffstat (limited to 'sql/sql_base.cc')
-rw-r--r-- | sql/sql_base.cc | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/sql/sql_base.cc b/sql/sql_base.cc index 14b97b43660..ef7a075e304 100644 --- a/sql/sql_base.cc +++ b/sql/sql_base.cc @@ -8398,9 +8398,11 @@ int setup_conds(THD *thd, TABLE_LIST *tables, List<TABLE_LIST> &leaves, thd->lex->which_check_option_applicable(); bool save_is_item_list_lookup= select_lex->is_item_list_lookup; TABLE_LIST *derived= select_lex->master_unit()->derived; + bool save_resolve_in_select_list= select_lex->context.resolve_in_select_list; DBUG_ENTER("setup_conds"); select_lex->is_item_list_lookup= 0; + select_lex->context.resolve_in_select_list= false; thd->column_usage= MARK_COLUMNS_READ; DBUG_PRINT("info", ("thd->column_usage: %d", thd->column_usage)); @@ -8453,6 +8455,7 @@ int setup_conds(THD *thd, TABLE_LIST *tables, List<TABLE_LIST> &leaves, select_lex->where= *conds; } thd->lex->current_select->is_item_list_lookup= save_is_item_list_lookup; + select_lex->context.resolve_in_select_list= save_resolve_in_select_list; DBUG_RETURN(thd->is_error()); err_no_arena: |