From 945758f0ec2f91eeb680394296bf1a50f8b82523 Mon Sep 17 00:00:00 2001 From: "bell@sanja.is.com.ua" <> Date: Thu, 2 Jan 2003 12:24:33 +0200 Subject: [PATCH] post-post-review fix (SCRUM) --- sql/item.cc | 5 +++-- sql/item_cmpfunc.h | 2 ++ sql/item_row.cc | 2 ++ sql/item_subselect.cc | 2 +- 4 files changed, 8 insertions(+), 3 deletions(-) diff --git a/sql/item.cc b/sql/item.cc index 8feeabd306e..c6cce9a5b48 100644 --- a/sql/item.cc +++ b/sql/item.cc @@ -1290,9 +1290,10 @@ bool Item_cache_row::setup(Item * item) for (uint i= 0; i < item_count; i++) { Item *el= item->el(i); - if (!(values[i]= Item_cache::get_cache(el->result_type()))) + Item_cache *tmp; + if (!(tmp= values[i]= Item_cache::get_cache(el->result_type()))) return 1; - values[i]->setup(el); + tmp->setup(el); } return 0; } diff --git a/sql/item_cmpfunc.h b/sql/item_cmpfunc.h index 44c788f381c..bd7d1bfaf7a 100644 --- a/sql/item_cmpfunc.h +++ b/sql/item_cmpfunc.h @@ -552,11 +552,13 @@ public: ~cmp_item_row() { if (comparators) + { for (uint i= 0; i < n; i++) { if (comparators[i]) delete comparators[i]; } + } } void store_value(Item *item); int cmp(Item *arg); diff --git a/sql/item_row.cc b/sql/item_row.cc index ba4ac19b880..c62ab60c0cd 100644 --- a/sql/item_row.cc +++ b/sql/item_row.cc @@ -55,6 +55,7 @@ bool Item_row::fix_fields(THD *thd, TABLE_LIST *tabl, Item **ref) return 1; used_tables_cache |= items[i]->used_tables(); if (const_item_cache&= items[i]->const_item() && !with_null) + { if (items[i]->cols() > 1) with_null|= items[i]->null_inside(); else @@ -62,6 +63,7 @@ bool Item_row::fix_fields(THD *thd, TABLE_LIST *tabl, Item **ref) items[i]->val_int(); with_null|= items[i]->null_value; } + } maybe_null|= items[i]->maybe_null; } return 0; diff --git a/sql/item_subselect.cc b/sql/item_subselect.cc index 75aef846b17..c5ecdc87d40 100644 --- a/sql/item_subselect.cc +++ b/sql/item_subselect.cc @@ -604,7 +604,7 @@ void Item_in_subselect::row_value_transformer(THD *thd, } if (sl->having || sl->with_sum_func || sl->group_list.first || - !sl->table_list.elements || !sl->table_list.elements) + !sl->table_list.elements) sl->having= and_items(sl->having, item); else sl->where= and_items(sl->where, item);