diff options
Diffstat (limited to 'sql/item_row.cc')
-rw-r--r-- | sql/item_row.cc | 26 |
1 files changed, 19 insertions, 7 deletions
diff --git a/sql/item_row.cc b/sql/item_row.cc index 12d202a1699..75c3f8a2922 100644 --- a/sql/item_row.cc +++ b/sql/item_row.cc @@ -53,7 +53,7 @@ void Item_row::illegal_method_call(const char *method) DBUG_VOID_RETURN; } -bool Item_row::fix_fields(THD *thd, TABLE_LIST *tabl, Item **ref) +bool Item_row::fix_fields(THD *thd, Item **ref) { DBUG_ASSERT(fixed == 0); null_value= 0; @@ -61,8 +61,8 @@ bool Item_row::fix_fields(THD *thd, TABLE_LIST *tabl, Item **ref) Item **arg, **arg_end; for (arg= items, arg_end= items+arg_count; arg != arg_end ; arg++) { - if ((*arg)->fix_fields(thd, tabl, arg)) - return 1; + if ((*arg)->fix_fields(thd, arg)) + return TRUE; // we can't assign 'item' before, because fix_fields() can change arg Item *item= *arg; used_tables_cache |= item->used_tables(); @@ -73,15 +73,15 @@ bool Item_row::fix_fields(THD *thd, TABLE_LIST *tabl, Item **ref) with_null|= item->null_inside(); else { - item->val_int(); - with_null|= item->null_value; + if (item->is_null()) + with_null|= 1; } } maybe_null|= item->maybe_null; with_sum_func= with_sum_func || item->with_sum_func; } fixed= 1; - return 0; + return FALSE; } @@ -90,7 +90,7 @@ void Item_row::split_sum_func(THD *thd, Item **ref_pointer_array, { Item **arg, **arg_end; for (arg= items, arg_end= items+arg_count; arg != arg_end ; arg++) - (*arg)->split_sum_func2(thd, ref_pointer_array, fields, arg); + (*arg)->split_sum_func2(thd, ref_pointer_array, fields, arg, TRUE); } @@ -138,6 +138,18 @@ bool Item_row::walk(Item_processor processor, byte *arg) return (this->*processor)(arg); } +Item *Item_row::transform(Item_transformer transformer, byte *arg) +{ + for (uint i= 0; i < arg_count; i++) + { + Item *new_item= items[i]->transform(transformer, arg); + if (!new_item) + return 0; + items[i]= new_item; + } + return (this->*transformer)(arg); +} + void Item_row::bring_value() { for (uint i= 0; i < arg_count; i++) |