diff options
author | unknown <gkodinov/kgeorge@rakia.(none)> | 2006-07-27 10:11:13 +0300 |
---|---|---|
committer | unknown <gkodinov/kgeorge@rakia.(none)> | 2006-07-27 10:11:13 +0300 |
commit | 667c73be65bc1c1a6f77d6e2bb140cdddae9ec73 (patch) | |
tree | e5e31fb9a25967dbbefa2a267963f47061408f90 /sql | |
parent | 8c92143b4bf715abd307b69a7f3637feec7df2ba (diff) | |
parent | d81d6e7430bfde1d378f45084ceae0ce0694b786 (diff) | |
download | mariadb-git-667c73be65bc1c1a6f77d6e2bb140cdddae9ec73.tar.gz |
Merge gkodinov@bk-internal.mysql.com:/home/bk/mysql-5.0-opt
into rakia.(none):/home/kgeorge/mysql/autopush/B21019-5.0-opt
sql/sql_select.cc:
Auto merged
Diffstat (limited to 'sql')
-rw-r--r-- | sql/item.h | 2 | ||||
-rw-r--r-- | sql/item_func.cc | 4 | ||||
-rw-r--r-- | sql/item_func.h | 5 | ||||
-rw-r--r-- | sql/sql_select.cc | 15 |
4 files changed, 16 insertions, 10 deletions
diff --git a/sql/item.h b/sql/item.h index c59d84aaeaa..514c31c2d74 100644 --- a/sql/item.h +++ b/sql/item.h @@ -752,7 +752,7 @@ public: virtual bool find_item_in_field_list_processor(byte *arg) { return 0; } virtual bool change_context_processor(byte *context) { return 0; } virtual bool reset_query_id_processor(byte *query_id) { return 0; } - virtual bool func_type_checker_processor(byte *arg) { return 0; } + virtual bool is_expensive_processor(byte *arg) { return 0; } virtual Item *equal_fields_propagator(byte * arg) { return this; } virtual Item *set_no_const_sub(byte *arg) { return this; } diff --git a/sql/item_func.cc b/sql/item_func.cc index c31ac2bf047..cbab9a4de1b 100644 --- a/sql/item_func.cc +++ b/sql/item_func.cc @@ -399,9 +399,9 @@ Field *Item_func::tmp_table_field(TABLE *t_arg) } -bool Item_func::func_type_checker_processor(byte *arg) +bool Item_func::is_expensive_processor(byte *arg) { - return *((Functype*)arg) == functype(); + return is_expensive(); } diff --git a/sql/item_func.h b/sql/item_func.h index bac4a186867..b33dae092ac 100644 --- a/sql/item_func.h +++ b/sql/item_func.h @@ -189,7 +189,8 @@ public: Item *transform(Item_transformer transformer, byte *arg); void traverse_cond(Cond_traverser traverser, void * arg, traverse_order order); - bool func_type_checker_processor(byte *arg); + bool is_expensive_processor(byte *arg); + virtual bool is_expensive() { return 0; } }; @@ -947,6 +948,7 @@ public: void cleanup(); Item_result result_type () const { return udf.result_type(); } table_map not_null_tables() const { return 0; } + bool is_expensive() { return 1; } }; @@ -1475,6 +1477,7 @@ public: virtual enum Functype functype() const { return FUNC_SP; } bool fix_fields(THD *thd, Item **ref); + bool is_expensive() { return 1; } }; diff --git a/sql/sql_select.cc b/sql/sql_select.cc index 5c812e759e6..93b0201b8f5 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -1073,10 +1073,7 @@ JOIN::optimize() for (ORDER *tmp_order= order; tmp_order ; tmp_order=tmp_order->next) { Item *item= *tmp_order->item; - Item_func::Functype type=Item_func::FUNC_SP; - Item_func::Functype type1=Item_func::UDF_FUNC; - if (item->walk(&Item::func_type_checker_processor,(byte*)&type) || - item->walk(&Item::func_type_checker_processor,(byte*)&type1)) + if (item->walk(&Item::is_expensive_processor,(byte*)0)) { /* Force tmp table without sort */ need_tmp=1; simple_order=simple_group=0; @@ -6197,10 +6194,16 @@ return_zero_rows(JOIN *join, select_result *result,TABLE_LIST *tables, DBUG_RETURN(0); } - +/* + used only in JOIN::clear +*/ static void clear_tables(JOIN *join) { - for (uint i=0 ; i < join->tables ; i++) + /* + must clear only the non-const tables, as const tables + are not re-calculated. + */ + for (uint i=join->const_tables ; i < join->tables ; i++) mark_as_null_row(join->table[i]); // All fields are NULL } |