diff options
author | unknown <holyfoot/hf@hfmain.(none)> | 2007-05-07 15:59:25 +0500 |
---|---|---|
committer | unknown <holyfoot/hf@hfmain.(none)> | 2007-05-07 15:59:25 +0500 |
commit | 42c714fd5f86a1dee317deb91f02994f97dffcef (patch) | |
tree | e059afb3677147e3bb4910d19fa4ded9f438aa17 /sql/item_subselect.cc | |
parent | 2e1ce777814084a896841d789e43ce73bcdff03c (diff) | |
parent | 17da0553bbbe388ae0ffcfcd915a9a1a6d70259f (diff) | |
download | mariadb-git-42c714fd5f86a1dee317deb91f02994f97dffcef.tar.gz |
Merge bk@192.168.21.1:mysql-5.1
into mysql.com:/d2/hf/mrg/mysql-5.1-opt
sql/ha_ndbcluster.cc:
Auto merged
sql/item_func.cc:
Auto merged
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); |