diff options
author | Georgi Kodinov <Georgi.Kodinov@Oracle.com> | 2010-10-05 11:11:56 +0300 |
---|---|---|
committer | Georgi Kodinov <Georgi.Kodinov@Oracle.com> | 2010-10-05 11:11:56 +0300 |
commit | 539291cde946cf350d01ac3f1d78349a73d7b833 (patch) | |
tree | a085e87f237dac5a8cb4aa4f65520c7281c497ba /sql/sql_select.cc | |
parent | babfc48c6e37009b85ebbad106d81ad6d3c4056a (diff) | |
parent | a773c15b4b4e4aab538249bbb7a4934be5f5cc7d (diff) | |
download | mariadb-git-539291cde946cf350d01ac3f1d78349a73d7b833.tar.gz |
merged mysql-5.1 into mysql-5.1-bugteam
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 1a4c12d6940..08bd0c28738 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -2387,13 +2387,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) @@ -2404,6 +2399,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). @@ -8886,10 +8894,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) { |