Browse Source
Fixed LP bug #729039.
Fixed LP bug #729039.
If join condition is of the form <t2.key>=<t1.no_key> then the server performs no index look-ups when looking for matching rows of t2 for the rows from t1 with t1.no_key=NULL. It happens because the function add_not_null_conds() injects an additional condition of the form IS NOT NULL(<t1.no_key>) into the WHERE condition. However if the join condition was of the form <t.key>=<outer_ref> no additional null rejecting predicate was generated. This could lead to extra records in the result set if the value of <outer_ref> happened to be NULL. The new code injects null rejecting predicates of the form IS NOT NULL(<outer_ref>) and evaluates them before the first row the subquery is constructed.pull/374/head
7 changed files with 158 additions and 4 deletions
-
28mysql-test/r/subselect.result
-
28mysql-test/r/subselect_no_mat.result
-
28mysql-test/r/subselect_no_opts.result
-
28mysql-test/r/subselect_no_semijoin.result
-
23mysql-test/t/subselect.test
-
25sql/sql_select.cc
-
2sql/sql_select.h
Write
Preview
Loading…
Cancel
Save
Reference in new issue