diff options
author | bell@sanja.is.com.ua <> | 2003-01-26 21:34:14 +0200 |
---|---|---|
committer | bell@sanja.is.com.ua <> | 2003-01-26 21:34:14 +0200 |
commit | 5469c014e3c6f4d0b79abfc00b2b222b430e0900 (patch) | |
tree | 31c2abc31e9acb20388a8652e15dfb623da9d680 /sql/sql_select.cc | |
parent | 760e22f0bb9e288e1730958adf0f47343d89474a (diff) | |
parent | c80f766ea21578b7399bda9a7d7843f737408019 (diff) | |
download | mariadb-git-5469c014e3c6f4d0b79abfc00b2b222b430e0900.tar.gz |
Merge sanja.is.com.ua:/home/bell/mysql/work-leak-4.1
into sanja.is.com.ua:/home/bell/mysql/work-select-4.1
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 c9872813412..c39b958edfb 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -484,16 +484,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)) { @@ -4895,8 +4885,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 { |