summaryrefslogtreecommitdiff
path: root/sql/item_subselect.cc
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2020-05-16 06:37:24 +0300
committerMarko Mäkelä <marko.makela@mariadb.com>2020-05-16 06:37:24 +0300
commit38d62189a83b0e7293a0ad7fcb79a5fdece3f817 (patch)
treec315b7bfedb5b4cb412b75464e692306c4e51e97 /sql/item_subselect.cc
parent85651269b6186b53bae804413c76f4117fa225d0 (diff)
parent3f12a5968a56cb5030381a78b313fdb36024c7f9 (diff)
downloadmariadb-git-38d62189a83b0e7293a0ad7fcb79a5fdece3f817.tar.gz
Merge 10.2 into 10.3
Diffstat (limited to 'sql/item_subselect.cc')
-rw-r--r--sql/item_subselect.cc9
1 files changed, 6 insertions, 3 deletions
diff --git a/sql/item_subselect.cc b/sql/item_subselect.cc
index 2991709b0a6..715f4e7ca17 100644
--- a/sql/item_subselect.cc
+++ b/sql/item_subselect.cc
@@ -2159,10 +2159,13 @@ Item_in_subselect::create_single_in_to_exists_cond(JOIN *join,
}
else
{
+ /*
+ No need to use real_item for the item, as the ref items that are possible
+ in the subquery either belong to views or to the parent select.
+ For such case we need to refer to the reference and not to the original
+ item.
+ */
Item *item= (Item*) select_lex->item_list.head();
- if (item->type() != REF_ITEM ||
- ((Item_ref*)item)->ref_type() != Item_ref::VIEW_REF)
- item= item->real_item();
if (select_lex->table_list.elements)
{