diff options
author | unknown <timour@askmonty.org> | 2010-11-23 00:01:24 +0200 |
---|---|---|
committer | unknown <timour@askmonty.org> | 2010-11-23 00:01:24 +0200 |
commit | 2fa5df5f4eea94bdf8b25406c1e9534535b519c7 (patch) | |
tree | edf85e28ca6e5848470c307cd7c36a9108d9aaeb /sql/item_subselect.h | |
parent | fb215f76bbcbb11177adfb04978b66b3151e7f4d (diff) | |
download | mariadb-git-2fa5df5f4eea94bdf8b25406c1e9534535b519c7.tar.gz |
Fix LP BUG#680038
Analysis:
Single-row subqueries are not considered expensive and are
evaluated both during EXPLAIN in to detect errors like
"Subquery returns more than 1 row", and during optimization to
perform constant optimization.
The cause for the failed ASSERT is in JOIN::join_free, where we set
bool full= (!select_lex->uncacheable && !thd->lex->describe);
Thus for EXPLAIN statements full == FALSE, and as a result the call to
JOIN::cleanup doesn't call JOIN_TAB::cleanup which should have
called table->disable_keyread().
Solution:
Consider all kinds of subquery predicates as expensive.
Diffstat (limited to 'sql/item_subselect.h')
-rw-r--r-- | sql/item_subselect.h | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/sql/item_subselect.h b/sql/item_subselect.h index 85e0191348e..eae9b0e558c 100644 --- a/sql/item_subselect.h +++ b/sql/item_subselect.h @@ -194,6 +194,7 @@ public: */ bool is_evaluated() const; bool is_uncacheable() const; + bool is_expensive() { return TRUE; } /* Used by max/min subquery to initialize value presence registration @@ -210,6 +211,16 @@ public: { return trace_unsupported_by_check_vcol_func_processor("subselect"); } + /** + Callback to test if an IN predicate is expensive. + + @notes + The return value affects the behavior of make_cond_for_table(). + + @retval TRUE if the predicate is expensive + @retval FALSE otherwise + */ + bool is_expensive_processor(uchar *arg) { return TRUE; } Item *safe_charset_converter(CHARSET_INFO *tocs); /** @@ -484,8 +495,6 @@ public: bool init_left_expr_cache(); /* Inform 'this' that it was computed, and contains a valid result. */ void set_first_execution() { if (first_execution) first_execution= FALSE; } - bool is_expensive_processor(uchar *arg); - bool is_expensive() { return TRUE; } bool expr_cache_is_needed(THD *thd); /* |