diff options
author | unknown <gkodinov/kgeorge@magare.gmz> | 2007-05-04 16:37:30 +0300 |
---|---|---|
committer | unknown <gkodinov/kgeorge@magare.gmz> | 2007-05-04 16:37:30 +0300 |
commit | 27f581a0a65a91b089edafa0844acd4af7310146 (patch) | |
tree | 6044b00f62117d52ebae6c52fa1ceae2ae7f2c4e /sql/item_subselect.cc | |
parent | fe4dc96c1973cd7f8a4ae91f41d5162118237ca6 (diff) | |
parent | 1084f2d62bca2ed1347cb3c4cfdb7882967ab6c6 (diff) | |
download | mariadb-git-27f581a0a65a91b089edafa0844acd4af7310146.tar.gz |
Merge magare.gmz:/home/kgeorge/mysql/work/B27531-5.0-opt
into magare.gmz:/home/kgeorge/mysql/work/B27531-5.1-opt
mysql-test/r/cast.result:
Auto merged
mysql-test/r/join_outer.result:
Auto merged
mysql-test/t/cast.test:
Auto merged
mysql-test/t/join_outer.test:
Auto merged
sql/item_func.cc:
Auto merged
sql/item_subselect.cc:
Auto merged
sql/sql_parse.cc:
Auto merged
sql/sql_select.cc:
Auto merged
sql/sql_select.h:
Auto merged
mysql-test/r/subselect.result:
merge of 5.0-opt -> 5.1-opt
mysql-test/t/subselect.test:
merge of 5.0-opt -> 5.1-opt
Diffstat (limited to 'sql/item_subselect.cc')
-rw-r--r-- | sql/item_subselect.cc | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/sql/item_subselect.cc b/sql/item_subselect.cc index 812d3c222c0..7d635ba444e 100644 --- a/sql/item_subselect.cc +++ b/sql/item_subselect.cc @@ -1817,6 +1817,21 @@ int subselect_single_select_engine::exec() thd->lex->current_select= save_select; DBUG_RETURN(join->error ? join->error : 1); } + if (!select_lex->uncacheable && thd->lex->describe && + !(join->select_options & SELECT_DESCRIBE) && + join->need_tmp && item->const_item()) + { + /* + Force join->join_tmp creation, because this subquery will be replaced + by a simple select from the materialization temp table by optimize() + called by EXPLAIN and we need to preserve the initial query structure + so we can display it. + */ + select_lex->uncacheable|= UNCACHEABLE_EXPLAIN; + select_lex->master_unit()->uncacheable|= UNCACHEABLE_EXPLAIN; + if (join->init_save_join_tab()) + DBUG_RETURN(1); + } if (item->engine_changed) { DBUG_RETURN(1); |