diff options
author | Sergei Golubchik <serg@mariadb.org> | 2015-03-07 13:21:02 +0100 |
---|---|---|
committer | Sergei Golubchik <serg@mariadb.org> | 2015-03-07 13:21:02 +0100 |
commit | 2db62f686e148f09fe5fd0b385fc71f2a3c4a133 (patch) | |
tree | cf1d5d6f0d05f1b50be96d943476173228cbd458 /sql/opt_subselect.cc | |
parent | 143f5d9172647a43cdcf5c27b8a78f32c9f639c0 (diff) | |
parent | d61573d3e5c8f9d85b88f9fa2e79160b159bf67d (diff) | |
download | mariadb-git-2db62f686e148f09fe5fd0b385fc71f2a3c4a133.tar.gz |
Merge branch '10.0' into 10.1
Diffstat (limited to 'sql/opt_subselect.cc')
-rw-r--r-- | sql/opt_subselect.cc | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/sql/opt_subselect.cc b/sql/opt_subselect.cc index 6503d110032..e26937441d1 100644 --- a/sql/opt_subselect.cc +++ b/sql/opt_subselect.cc @@ -513,8 +513,6 @@ bool is_materialization_applicable(THD *thd, Item_in_subselect *in_subs, Subquery !contains {GROUP BY, ORDER BY [LIMIT], aggregate functions}) && subquery predicate is not under "NOT IN")) - (*) The subquery must be part of a SELECT or CREATE TABLE ... SELECT statement. - The current condition also excludes multi-table update statements. A note about prepared statements: we want the if-branch to be taken on PREPARE and each EXECUTE. The rewrites are only done once, but we need select_lex->sj_subselects list to be populated for every EXECUTE. @@ -523,9 +521,7 @@ bool is_materialization_applicable(THD *thd, Item_in_subselect *in_subs, if (optimizer_flag(thd, OPTIMIZER_SWITCH_MATERIALIZATION) && // 0 !child_select->is_part_of_union() && // 1 parent_unit->first_select()->leaf_tables.elements && // 2 - (thd->lex->sql_command == SQLCOM_SELECT || // * - thd->lex->sql_command == SQLCOM_CREATE_TABLE) && // * - child_select->outer_select()->leaf_tables.elements && // 2A + child_select->outer_select()->leaf_tables.elements && // 2A subquery_types_allow_materialization(in_subs) && (in_subs->is_top_level_item() || //3 optimizer_flag(thd, @@ -3894,7 +3890,6 @@ SJ_TMP_TABLE::create_sj_weedout_tmp_table(THD *thd) /* STEP 1: Get temporary table name */ - thd->inc_status_created_tmp_tables(); if (use_temp_pool && !(test_flags & TEST_KEEP_TMP_TABLES)) temp_pool_slot = bitmap_lock_set_next(&temp_pool); |