diff options
author | Galina Shalygina <galashalygina@gmail.com> | 2016-05-24 21:29:52 +0300 |
---|---|---|
committer | Galina Shalygina <galashalygina@gmail.com> | 2016-05-24 21:29:52 +0300 |
commit | b4f1f42062d108230b62ad49fedd93ee6e38e168 (patch) | |
tree | a57f64c4f64bed0e7b14fca9ea10ddbaf7f7d702 /sql/item_subselect.cc | |
parent | 0f7fe2a7437e69d1973d4354c2cddd7beeca05b9 (diff) | |
download | mariadb-git-b4f1f42062d108230b62ad49fedd93ee6e38e168.tar.gz |
Fixed the problem of wrong identification of WITH tables defined in WITH clauses without RECURSIVE.
Added test cases to check the fix.
Fixed the problem of wrong types of recursive tables when the type of anchor part does not coincide with the
type of recursive part.
Prevented usage of marerialization and subquery cache for subqueries with recursive references.
Introduced system variables 'max_recursion_level'.
Added a test case to test usage of this variable.
Diffstat (limited to 'sql/item_subselect.cc')
-rw-r--r-- | sql/item_subselect.cc | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/sql/item_subselect.cc b/sql/item_subselect.cc index 94e7bc98618..7d458282825 100644 --- a/sql/item_subselect.cc +++ b/sql/item_subselect.cc @@ -54,7 +54,7 @@ Item_subselect::Item_subselect(THD *thd_arg): have_to_be_excluded(0), inside_first_fix_fields(0), done_first_fix_fields(FALSE), expr_cache(0), forced_const(FALSE), substitution(0), engine(0), eliminated(FALSE), - changed(0), is_correlated(FALSE) + changed(0), is_correlated(FALSE), with_recursive_reference(0) { DBUG_ENTER("Item_subselect::Item_subselect"); DBUG_PRINT("enter", ("this: 0x%lx", (ulong) this)); @@ -771,7 +771,8 @@ bool Item_subselect::expr_cache_is_needed(THD *thd) engine->cols() == 1 && optimizer_flag(thd, OPTIMIZER_SWITCH_SUBQUERY_CACHE) && !(engine->uncacheable() & (UNCACHEABLE_RAND | - UNCACHEABLE_SIDEEFFECT))); + UNCACHEABLE_SIDEEFFECT)) && + !with_recursive_reference); } @@ -810,7 +811,8 @@ bool Item_in_subselect::expr_cache_is_needed(THD *thd) { return (optimizer_flag(thd, OPTIMIZER_SWITCH_SUBQUERY_CACHE) && !(engine->uncacheable() & (UNCACHEABLE_RAND | - UNCACHEABLE_SIDEEFFECT))); + UNCACHEABLE_SIDEEFFECT)) && + !with_recursive_reference); } |