summaryrefslogtreecommitdiff
path: root/sql/sql_select.cc
diff options
context:
space:
mode:
authorunknown <bell@sanja.is.com.ua>2004-03-16 08:32:21 +0200
committerunknown <bell@sanja.is.com.ua>2004-03-16 08:32:21 +0200
commitcecf1965be55beda77d806cec1eef020ae4b9294 (patch)
treed449ac778a43b170a2c84361ebed5a07bc2e9dda /sql/sql_select.cc
parentc7fd1fa4968b9649567895af2b5ebf11ca2f5e6c (diff)
parent9b641be9933a8dae840c5d8a258256d941981876 (diff)
downloadmariadb-git-cecf1965be55beda77d806cec1eef020ae4b9294.tar.gz
merge
sql/item_func.cc: Auto merged sql/sql_select.cc: Auto merged
Diffstat (limited to 'sql/sql_select.cc')
-rw-r--r--sql/sql_select.cc8
1 files changed, 6 insertions, 2 deletions
diff --git a/sql/sql_select.cc b/sql/sql_select.cc
index 467c1295517..bb9223aef22 100644
--- a/sql/sql_select.cc
+++ b/sql/sql_select.cc
@@ -584,7 +584,9 @@ JOIN::optimize()
DBUG_RETURN(1); // error == -1
}
if (const_table_map != found_const_table_map &&
- !(select_options & SELECT_DESCRIBE))
+ !(select_options & SELECT_DESCRIBE) &&
+ !((conds->used_tables() & RAND_TABLE_BIT) &&
+ select_lex->master_unit() != &thd->lex->unit))// not upper level SELECT
{
zero_result_cause= "no matching row in const table";
DBUG_PRINT("error",("Error: %s", zero_result_cause));
@@ -3407,7 +3409,9 @@ make_join_select(JOIN *join,SQL_SELECT *select,COND *cond)
table_map used_tables;
if (join->tables > 1)
cond->update_used_tables(); // Tablenr may have changed
- if (join->const_tables == join->tables)
+ if (join->const_tables == join->tables &&
+ join->thd->lex->current_select->master_unit() ==
+ &join->thd->lex->unit) // not upper level SELECT
join->const_table_map|=RAND_TABLE_BIT;
{ // Check const tables
COND *const_cond=