summaryrefslogtreecommitdiff
path: root/sql/item_subselect.cc
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2020-05-16 07:54:09 +0300
committerMarko Mäkelä <marko.makela@mariadb.com>2020-05-16 07:54:09 +0300
commit66f1e288a12c96b1306e204cca37ffee09e97a64 (patch)
tree1e0eddba5c2c821b05317baccd0c05a0fe11b511 /sql/item_subselect.cc
parent9e6e43551fc61bc34152f8d60f5d72f0d3814787 (diff)
parent38d62189a83b0e7293a0ad7fcb79a5fdece3f817 (diff)
downloadmariadb-git-66f1e288a12c96b1306e204cca37ffee09e97a64.tar.gz
Merge 10.3 into 10.4
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 736dfbd33b4..c50f87c8f1c 100644
--- a/sql/item_subselect.cc
+++ b/sql/item_subselect.cc
@@ -2190,10 +2190,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)
{