Browse Source
MDEV-16225: wrong resultset from query with semijoin=on
MDEV-16225: wrong resultset from query with semijoin=on
For non-semi-join subquery optimization we do a cost based decision between Materialisation and IN -> EXIST transformation. The issue in this case is that for IN->EXIST transformation we run JOIN::reoptimize with the IN->EXISt conditions and we come up with a new query plan. But when we compare the cost with Materialization, we make the decision to chose Materialization so we need to restore the query plan for Materilization. The saving and restoring for keyuse array and join_tab keyuse is only done when we have atleast one element in the keyuse_array , we are now changing to do it even for 0 elements to main the generality.pull/697/merge
3 changed files with 119 additions and 26 deletions
-
57mysql-test/r/subselect_sj2_mat.result
-
42mysql-test/t/subselect_sj2_mat.test
-
46sql/sql_select.cc
Write
Preview
Loading…
Cancel
Save
Reference in new issue