summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sql/sql_select.cc4
1 files changed, 4 insertions, 0 deletions
diff --git a/sql/sql_select.cc b/sql/sql_select.cc
index bae64969fcd..cafafee243e 100644
--- a/sql/sql_select.cc
+++ b/sql/sql_select.cc
@@ -2257,6 +2257,10 @@ make_join_select(JOIN *join,SQL_SELECT *select,COND *cond)
{
JOIN_TAB *tab=join->join_tab+i;
table_map current_map= tab->table->map;
+ /*
+ Following force including random expression in last table condition.
+ It solve problem with select like SELECT * FROM t1 WHERE rand() > 0.5
+ */
if (i == join->tables-1)
current_map|= RAND_TABLE_BIT;
bool use_quick_range=0;