diff options
author | Alexey Kopytov <Alexey.Kopytov@Sun.com> | 2010-04-02 18:22:18 +0400 |
---|---|---|
committer | Alexey Kopytov <Alexey.Kopytov@Sun.com> | 2010-04-02 18:22:18 +0400 |
commit | 3fc2a82ad09542d180502e95c115ea9aa8075089 (patch) | |
tree | 76d303b78b180500645629d87131ff367c134fe4 /sql/sql_select.cc | |
parent | d7dd2fc92f042596c2e72a96934bb207270e7419 (diff) | |
parent | fe25ec8f2425cfd0e59d9a20f0094d6fc6e0cd3a (diff) | |
download | mariadb-git-3fc2a82ad09542d180502e95c115ea9aa8075089.tar.gz |
Automerge.
Diffstat (limited to 'sql/sql_select.cc')
-rw-r--r-- | sql/sql_select.cc | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/sql/sql_select.cc b/sql/sql_select.cc index 3a62396b880..56102779771 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -5145,6 +5145,11 @@ greedy_search(JOIN *join, if (best_extension_by_limited_search(join, remaining_tables, idx, record_count, read_time, search_depth, prune_level)) DBUG_RETURN(TRUE); + /* + 'best_read < DBL_MAX' means that optimizer managed to find + some plan and updated 'best_positions' array accordingly. + */ + DBUG_ASSERT(join->best_read < DBL_MAX); if (size_remain <= search_depth) { @@ -8925,8 +8930,14 @@ simplify_joins(JOIN *join, List<TABLE_LIST> *join_list, COND *conds, bool top) we still make the inner tables dependent on the outer tables. It would be enough to set dependency only on one outer table for them. Yet this is really a rare case. + Note: + RAND_TABLE_BIT mask should not be counted as it + prevents update of inner table dependences. + For example it might happen if RAND() function + is used in JOIN ON clause. */ - if (!(prev_table->on_expr->used_tables() & ~prev_used_tables)) + if (!((prev_table->on_expr->used_tables() & ~RAND_TABLE_BIT) & + ~prev_used_tables)) prev_table->dep_tables|= used_tables; } } |