summaryrefslogtreecommitdiff
path: root/sql/sql_select.cc
diff options
context:
space:
mode:
authorIgor Babaev <igor@askmonty.org>2017-04-04 10:04:52 -0700
committerIgor Babaev <igor@askmonty.org>2017-04-04 10:04:52 -0700
commitb0395d8701ec49f49ad23f9917a3b2369bb49e7a (patch)
tree303a33f7c3b47a037960429f9be4b7783feca7f0 /sql/sql_select.cc
parenta821ef76057f17a9532f525d2858bb1d31c0a56d (diff)
downloadmariadb-git-b0395d8701ec49f49ad23f9917a3b2369bb49e7a.tar.gz
Fixed the bug mdev-12429 and its duplicates mdev-12145 and mdev-9886.
Also fixed a wrong result for a test case for mdev-7691 (the alternative one). The test cases for all these bug have materialized semi-joins used inside dependent sub-queries. The patch actually reverts the change inroduced by Monty in 2003. It looks like this change is not valid anymore after the implementation of semi-joins. Adjusted output from EXPLAIN for many other test cases.
Diffstat (limited to 'sql/sql_select.cc')
-rw-r--r--sql/sql_select.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/sql/sql_select.cc b/sql/sql_select.cc
index 43b3b6bf47b..d83e8e2bfce 100644
--- a/sql/sql_select.cc
+++ b/sql/sql_select.cc
@@ -8794,7 +8794,7 @@ make_join_select(JOIN *join,SQL_SELECT *select,COND *cond)
It solve problem with select like SELECT * FROM t1 WHERE rand() > 0.5
*/
if (tab == join->join_tab + join->top_join_tab_count - 1)
- current_map|= OUTER_REF_TABLE_BIT | RAND_TABLE_BIT;
+ current_map|= RAND_TABLE_BIT;
used_tables|=current_map;
if (tab->type == JT_REF && tab->quick &&