diff options
author | Dmitry Shulga <dmitry.shulga@mariadb.com> | 2021-05-11 15:16:55 +0700 |
---|---|---|
committer | Sergei Golubchik <serg@mariadb.org> | 2021-06-17 19:30:24 +0200 |
commit | 129098b70ce4a30bad600ea4dc2703e4edadfe88 (patch) | |
tree | d98277853efb3f5092a2663304ad27db1e18e267 | |
parent | 4decc03b285d4a1c42750d6f29c5f0c3a25cd1c4 (diff) | |
download | mariadb-git-129098b70ce4a30bad600ea4dc2703e4edadfe88.tar.gz |
MDEV-16708: Unsupported commands for prepared statements
Fixed the bug in handling queries where select list contains subqueries
with items referencing to items in outer query
-rw-r--r-- | sql/item.cc | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sql/item.cc b/sql/item.cc index 252135f50ad..a016f04953c 100644 --- a/sql/item.cc +++ b/sql/item.cc @@ -5531,7 +5531,7 @@ Item_field::fix_outer_field(THD *thd, Field **from_field, Item **reference) */ Name_resolution_context *last_checked_context= context; Item **ref= (Item **) not_found_item; - SELECT_LEX *current_sel= thd->lex->current_select; + SELECT_LEX *current_sel= context->select_lex; Name_resolution_context *outer_context= 0; SELECT_LEX *select= 0; @@ -5868,7 +5868,7 @@ bool Item_field::fix_fields(THD *thd, Item **reference) DBUG_ASSERT(fixed() == 0); Field *from_field= (Field *)not_found_field; bool outer_fixed= false; - SELECT_LEX *select= thd->lex->current_select; + SELECT_LEX *select= context->select_lex; if (select && select->in_tvc) { |