diff options
author | Georgi Kodinov <Georgi.Kodinov@Oracle.com> | 2010-09-29 17:26:32 +0300 |
---|---|---|
committer | Georgi Kodinov <Georgi.Kodinov@Oracle.com> | 2010-09-29 17:26:32 +0300 |
commit | 6a0cfa23bd11e70e398a8803f8204ae6429a9764 (patch) | |
tree | 92b3d8d0f9acdc9f7c1f8e5daef666cd9a58b9af /sql/sql_select.cc | |
parent | 7f552e46089b4e35edc92a70aba291441e33a813 (diff) | |
parent | 292e1af26e0c6921f6b36ca30dbda104e8e7a8d2 (diff) | |
download | mariadb-git-6a0cfa23bd11e70e398a8803f8204ae6429a9764.tar.gz |
merge
Diffstat (limited to 'sql/sql_select.cc')
-rw-r--r-- | sql/sql_select.cc | 24 |
1 files changed, 16 insertions, 8 deletions
diff --git a/sql/sql_select.cc b/sql/sql_select.cc index bded06b2924..2a2fe3eb36f 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -2411,13 +2411,8 @@ JOIN::destroy() cleanup(1); /* Cleanup items referencing temporary table columns */ - if (!tmp_all_fields3.is_empty()) - { - List_iterator_fast<Item> it(tmp_all_fields3); - Item *item; - while ((item= it++)) - item->cleanup(); - } + cleanup_item_list(tmp_all_fields1); + cleanup_item_list(tmp_all_fields3); if (exec_tmp_table1) free_tmp_table(thd, exec_tmp_table1); if (exec_tmp_table2) @@ -2428,6 +2423,19 @@ JOIN::destroy() DBUG_RETURN(error); } + +void JOIN::cleanup_item_list(List<Item> &items) const +{ + if (!items.is_empty()) + { + List_iterator_fast<Item> it(items); + Item *item; + while ((item= it++)) + item->cleanup(); + } +} + + /** An entry point to single-unit select (a select without UNION). @@ -9017,10 +9025,10 @@ simplify_joins(JOIN *join, List<TABLE_LIST> *join_list, COND *conds, bool top) /* Flatten nested joins that can be flattened. */ TABLE_LIST *right_neighbor= NULL; - bool fix_name_res= FALSE; li.rewind(); while ((table= li++)) { + bool fix_name_res= FALSE; nested_join= table->nested_join; if (nested_join && !table->on_expr) { |