summaryrefslogtreecommitdiff
path: root/sql/sql_select.cc
diff options
context:
space:
mode:
authorVarun Gupta <varunraiko1803@gmail.com>2018-07-25 21:17:50 +0530
committerVarun Gupta <varunraiko1803@gmail.com>2018-07-25 21:21:27 +0530
commit37dee22d27c55c14f0be7005c3e5bdbb09e1fc92 (patch)
tree3d2ef2dbc58a57dd129d86e8902b62d49e381ff9 /sql/sql_select.cc
parentf9b43c2565284feefe94e4feaa4c02bf25a6f921 (diff)
downloadmariadb-git-37dee22d27c55c14f0be7005c3e5bdbb09e1fc92.tar.gz
MDEV-15454: Nested SELECT IN returns wrong results
In this case we are setting the field Item_func_eq::in_eqaulity_no for the semi-join equalities. This helps us to remove these equalites as the inner tables are not available during parent select execution while the outer tables are not available during materialization phase. We only have it set for the equalites for the fields involved with the IN subquery and reset it for the equalities which do not belong to the IN subquery. For example in case of nested IN subqueries: SELECT t1.a FROM t1 WHERE t1.a IN (SELECT t2.a FROM t2 where t2.b IN (select t3.b from t3 where t3.c=27 )) there are two equalites involving the fields of the IN subquery 1) t2.b = t3.b : the field Item_func_eq::in_eqaulity_no is set when we merge the grandchild select into the child select 2) t1.a = t2.a : the field Item_func_eq::in_eqaulity_no is set when we merge the child select into the parent select But when we perform case 2) we should ensure that we reset the equalities in the child's WHERE clause.
Diffstat (limited to 'sql/sql_select.cc')
0 files changed, 0 insertions, 0 deletions