Please sign in to comment.
MDEV-19580 Unrelated JOINs corrupt usage of 'WHERE function() IN (sub…
…query)' Handling of top level conjuncts in WHERE whose used_tables() contained RAND_TABLE_BIT in the function make_join_select() was incorrect. As a result if such a conjunct referred to fields non of which belonged to the last joined table it was pushed twice. (This could be seen for a test case from subselect.test whose output was changed after this patch had been applied. In 10.1 when running EXPLAIN FORMAT=JSON for the query from this test case we clearly see that one of the conjuncts is pushed twice.) This fact by itself was not good. Besides, if such a conjunct was pushed to a table that was the result of materialization of a semi-join the query could return a wrong result set. In particular we could watch it for queries with semi-join subqueries whose left parts used stored functions without "deterministic' specifier.
- Loading branch information...
Showing with 331 additions and 19 deletions.
- +1 −1 mysql-test/r/subselect.result
- +89 −0 mysql-test/r/subselect_mat.result
- +1 −1 mysql-test/r/subselect_no_mat.result
- +1 −1 mysql-test/r/subselect_no_opts.result
- +1 −1 mysql-test/r/subselect_no_scache.result
- +1 −1 mysql-test/r/subselect_no_semijoin.result
- +89 −0 mysql-test/r/subselect_sj_mat.result
- +75 −0 mysql-test/t/subselect_sj_mat.test
- +73 −14 sql/sql_select.cc
Oops, something went wrong.