summaryrefslogtreecommitdiff
path: root/sql
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2020-05-15 22:37:07 +0300
committerMarko Mäkelä <marko.makela@mariadb.com>2020-05-15 22:43:33 +0300
commitfc0960aa96a00bc5dc7515f651abf3c0e9edbf41 (patch)
tree4879211475d7174f2d6d745f263111efa9901fd8 /sql
parentc8dd41178152c7e82b41c10546d2cffd8a84b441 (diff)
parentefd68f5e3184c54e04045a1350a1ff37dc313348 (diff)
downloadmariadb-git-fc0960aa96a00bc5dc7515f651abf3c0e9edbf41.tar.gz
Merge 10.1 into 10.2
Diffstat (limited to 'sql')
-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 2e023658baf..640ed311602 100644
--- a/sql/item_subselect.cc
+++ b/sql/item_subselect.cc
@@ -2158,10 +2158,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)
{