diff options
author | unknown <bell@sanja.is.com.ua> | 2003-01-26 21:13:37 +0200 |
---|---|---|
committer | unknown <bell@sanja.is.com.ua> | 2003-01-26 21:13:37 +0200 |
commit | fb2226c37656e8e7fd531e2cc42c0a1a0f75e41a (patch) | |
tree | 14609b76d159c44df4688f35e7c3e6b927d50da7 /sql/sql_select.cc | |
parent | 3fe840ee07992340b5b7977ec66483e6f837ba1b (diff) | |
download | mariadb-git-fb2226c37656e8e7fd531e2cc42c0a1a0f75e41a.tar.gz |
removed switching off static table optimization for subselects (SCRUM , pre-commit to be able merge with temporary table fix)
sql/item.cc:
report other table for outer reference
sql/item.h:
report other table for outer reference
sql/item_cmpfunc.cc:
report other table for outer reference
sql/sql_select.cc:
removed switching off static table optimization for subselects
Diffstat (limited to 'sql/sql_select.cc')
-rw-r--r-- | sql/sql_select.cc | 17 |
1 files changed, 5 insertions, 12 deletions
diff --git a/sql/sql_select.cc b/sql/sql_select.cc index ae45f96fbe8..74d08daf8db 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -442,16 +442,6 @@ JOIN::optimize() thd->fatal_error) DBUG_RETURN(1); - if (select_lex->dependent) - { - /* - Just remove all const-table optimization in case of depended query - TODO: optimize - */ - const_table_map= 0; - const_tables= 0; - found_const_table_map= 0; - } thd->proc_info= "preparing"; if (result->initialize_tables(this)) { @@ -4681,8 +4671,11 @@ do_select(JOIN *join,List<Item> *fields,TABLE *table,Procedure *procedure) join->send_records=0; if (join->tables == join->const_tables) { - if (!(error=(*end_select)(join,join_tab,0)) || error == -3) - error=(*end_select)(join,join_tab,1); + if (!join->select_lex->dependent || + ((!join->conds || join->conds->val_int()) && + (!join->having || join->having->val_int()))) + if (!(error=(*end_select)(join,join_tab,0)) || error == -3) + error=(*end_select)(join,join_tab,1); } else { |