diff options
author | Alexander Barkov <bar@mariadb.com> | 2019-08-07 14:13:44 +0400 |
---|---|---|
committer | Alexander Barkov <bar@mariadb.com> | 2019-08-07 14:13:44 +0400 |
commit | e978efd96b9a8146ba2c80a1f3aea755568ac73a (patch) | |
tree | acc499d0c89559db0f9fed5b6d184514f216530c /sql/item_sum.cc | |
parent | a8def12e8a65cee915029de46d6e37b338ee9289 (diff) | |
download | mariadb-git-e978efd96b9a8146ba2c80a1f3aea755568ac73a.tar.gz |
MDEV-20273 Add class Item_sum_min_max
Diffstat (limited to 'sql/item_sum.cc')
-rw-r--r-- | sql/item_sum.cc | 76 |
1 files changed, 38 insertions, 38 deletions
diff --git a/sql/item_sum.cc b/sql/item_sum.cc index 111dc88a1e3..081db08e943 100644 --- a/sql/item_sum.cc +++ b/sql/item_sum.cc @@ -1152,9 +1152,9 @@ Item_sum_num::fix_fields(THD *thd, Item **ref) bool -Item_sum_hybrid::fix_fields(THD *thd, Item **ref) +Item_sum_min_max::fix_fields(THD *thd, Item **ref) { - DBUG_ENTER("Item_sum_hybrid::fix_fields"); + DBUG_ENTER("Item_sum_min_max::fix_fields"); DBUG_ASSERT(fixed == 0); if (init_sum_func_check(thd)) @@ -1184,11 +1184,11 @@ Item_sum_hybrid::fix_fields(THD *thd, Item **ref) } -bool Item_sum_hybrid::fix_length_and_dec() +bool Item_sum_min_max::fix_length_and_dec() { DBUG_ASSERT(args[0]->field_type() == args[0]->real_item()->field_type()); DBUG_ASSERT(args[0]->result_type() == args[0]->real_item()->result_type()); - return args[0]->type_handler()->Item_sum_hybrid_fix_length_and_dec(this); + return args[0]->type_handler()->Item_sum_min_max_fix_length_and_dec(this); } @@ -1209,9 +1209,9 @@ bool Item_sum_hybrid::fix_length_and_dec() and Item_sum_min::add() to use different values! */ -void Item_sum_hybrid::setup_hybrid(THD *thd, Item *item, Item *value_arg) +void Item_sum_min_max::setup_hybrid(THD *thd, Item *item, Item *value_arg) { - DBUG_ENTER("Item_sum_hybrid::setup_hybrid"); + DBUG_ENTER("Item_sum_min_max::setup_hybrid"); if (!(value= item->get_cache(thd))) DBUG_VOID_RETURN; value->setup(thd, item); @@ -1232,9 +1232,9 @@ void Item_sum_hybrid::setup_hybrid(THD *thd, Item *item, Item *value_arg) } -Field *Item_sum_hybrid::create_tmp_field(bool group, TABLE *table) +Field *Item_sum_min_max::create_tmp_field(bool group, TABLE *table) { - DBUG_ENTER("Item_sum_hybrid::create_tmp_field"); + DBUG_ENTER("Item_sum_min_max::create_tmp_field"); if (args[0]->type() == Item::FIELD_ITEM) { @@ -2314,9 +2314,9 @@ Item *Item_sum_variance::result_item(THD *thd, Field *field) /* min & max */ -void Item_sum_hybrid::clear() +void Item_sum_min_max::clear() { - DBUG_ENTER("Item_sum_hybrid::clear"); + DBUG_ENTER("Item_sum_min_max::clear"); value->clear(); null_value= 1; DBUG_VOID_RETURN; @@ -2324,7 +2324,7 @@ void Item_sum_hybrid::clear() bool -Item_sum_hybrid::get_date(MYSQL_TIME *ltime, ulonglong fuzzydate) +Item_sum_min_max::get_date(MYSQL_TIME *ltime, ulonglong fuzzydate) { DBUG_ASSERT(fixed == 1); if (null_value) @@ -2336,9 +2336,9 @@ Item_sum_hybrid::get_date(MYSQL_TIME *ltime, ulonglong fuzzydate) } -void Item_sum_hybrid::direct_add(Item *item) +void Item_sum_min_max::direct_add(Item *item) { - DBUG_ENTER("Item_sum_hybrid::direct_add"); + DBUG_ENTER("Item_sum_min_max::direct_add"); DBUG_PRINT("info", ("item: %p", item)); direct_added= TRUE; direct_item= item; @@ -2346,9 +2346,9 @@ void Item_sum_hybrid::direct_add(Item *item) } -double Item_sum_hybrid::val_real() +double Item_sum_min_max::val_real() { - DBUG_ENTER("Item_sum_hybrid::val_real"); + DBUG_ENTER("Item_sum_min_max::val_real"); DBUG_ASSERT(fixed == 1); if (null_value) DBUG_RETURN(0.0); @@ -2358,9 +2358,9 @@ double Item_sum_hybrid::val_real() DBUG_RETURN(retval); } -longlong Item_sum_hybrid::val_int() +longlong Item_sum_min_max::val_int() { - DBUG_ENTER("Item_sum_hybrid::val_int"); + DBUG_ENTER("Item_sum_min_max::val_int"); DBUG_ASSERT(fixed == 1); if (null_value) DBUG_RETURN(0); @@ -2371,9 +2371,9 @@ longlong Item_sum_hybrid::val_int() } -my_decimal *Item_sum_hybrid::val_decimal(my_decimal *val) +my_decimal *Item_sum_min_max::val_decimal(my_decimal *val) { - DBUG_ENTER("Item_sum_hybrid::val_decimal"); + DBUG_ENTER("Item_sum_min_max::val_decimal"); DBUG_ASSERT(fixed == 1); if (null_value) DBUG_RETURN(0); @@ -2385,9 +2385,9 @@ my_decimal *Item_sum_hybrid::val_decimal(my_decimal *val) String * -Item_sum_hybrid::val_str(String *str) +Item_sum_min_max::val_str(String *str) { - DBUG_ENTER("Item_sum_hybrid::val_str"); + DBUG_ENTER("Item_sum_min_max::val_str"); DBUG_ASSERT(fixed == 1); if (null_value) DBUG_RETURN(0); @@ -2398,9 +2398,9 @@ Item_sum_hybrid::val_str(String *str) } -void Item_sum_hybrid::cleanup() +void Item_sum_min_max::cleanup() { - DBUG_ENTER("Item_sum_hybrid::cleanup"); + DBUG_ENTER("Item_sum_min_max::cleanup"); Item_sum::cleanup(); if (cmp) delete cmp; @@ -2416,9 +2416,9 @@ void Item_sum_hybrid::cleanup() DBUG_VOID_RETURN; } -void Item_sum_hybrid::no_rows_in_result() +void Item_sum_min_max::no_rows_in_result() { - DBUG_ENTER("Item_sum_hybrid::no_rows_in_result"); + DBUG_ENTER("Item_sum_min_max::no_rows_in_result"); /* We may be called here twice in case of ref field in function */ if (was_values) { @@ -2429,7 +2429,7 @@ void Item_sum_hybrid::no_rows_in_result() DBUG_VOID_RETURN; } -void Item_sum_hybrid::restore_to_before_no_rows_in_result() +void Item_sum_min_max::restore_to_before_no_rows_in_result() { if (!was_values) { @@ -2693,10 +2693,10 @@ void Item_sum_num::reset_field() } -void Item_sum_hybrid::reset_field() +void Item_sum_min_max::reset_field() { Item *UNINIT_VAR(tmp_item), *arg0; - DBUG_ENTER("Item_sum_hybrid::reset_field"); + DBUG_ENTER("Item_sum_min_max::reset_field"); arg0= args[0]; if (unlikely(direct_added)) @@ -3049,9 +3049,9 @@ Item *Item_sum_avg::result_item(THD *thd, Field *field) } -void Item_sum_hybrid::update_field() +void Item_sum_min_max::update_field() { - DBUG_ENTER("Item_sum_hybrid::update_field"); + DBUG_ENTER("Item_sum_min_max::update_field"); Item *UNINIT_VAR(tmp_item); if (unlikely(direct_added)) { @@ -3081,9 +3081,9 @@ void Item_sum_hybrid::update_field() void -Item_sum_hybrid::min_max_update_str_field() +Item_sum_min_max::min_max_update_str_field() { - DBUG_ENTER("Item_sum_hybrid::min_max_update_str_field"); + DBUG_ENTER("Item_sum_min_max::min_max_update_str_field"); DBUG_ASSERT(cmp); String *res_str=args[0]->val_str(&cmp->value1); @@ -3104,11 +3104,11 @@ Item_sum_hybrid::min_max_update_str_field() void -Item_sum_hybrid::min_max_update_real_field() +Item_sum_min_max::min_max_update_real_field() { double nr,old_nr; - DBUG_ENTER("Item_sum_hybrid::min_max_update_real_field"); + DBUG_ENTER("Item_sum_min_max::min_max_update_real_field"); old_nr=result_field->val_real(); nr= args[0]->val_real(); if (!args[0]->null_value) @@ -3126,11 +3126,11 @@ Item_sum_hybrid::min_max_update_real_field() void -Item_sum_hybrid::min_max_update_int_field() +Item_sum_min_max::min_max_update_int_field() { longlong nr,old_nr; - DBUG_ENTER("Item_sum_hybrid::min_max_update_int_field"); + DBUG_ENTER("Item_sum_min_max::min_max_update_int_field"); old_nr=result_field->val_int(); nr=args[0]->val_int(); if (!args[0]->null_value) @@ -3161,9 +3161,9 @@ Item_sum_hybrid::min_max_update_int_field() optimize: do not get result_field in case of args[0] is NULL */ void -Item_sum_hybrid::min_max_update_decimal_field() +Item_sum_min_max::min_max_update_decimal_field() { - DBUG_ENTER("Item_sum_hybrid::min_max_update_decimal_field"); + DBUG_ENTER("Item_sum_min_max::min_max_update_decimal_field"); my_decimal old_val, nr_val; const my_decimal *old_nr; const my_decimal *nr= args[0]->val_decimal(&nr_val); |