summaryrefslogtreecommitdiff
path: root/sql/item_sum.h
diff options
context:
space:
mode:
authorOleksandr Byelkin <sanja@mariadb.com>2018-06-19 14:51:50 +0200
committerOleksandr Byelkin <sanja@mariadb.com>2018-06-19 14:51:50 +0200
commit083279f7838d45c475344d20585ead72a147a21d (patch)
treec3ff5b3f6af1c9009b35d9b2560a7073be41ce90 /sql/item_sum.h
parent0121d5a790983c08dabedc66e70f862e47f7c8c7 (diff)
parent6b8802e8dd5467556a024d807a1df23940b00895 (diff)
downloadmariadb-git-083279f7838d45c475344d20585ead72a147a21d.tar.gz
Merge commit '6b8802e8dd5467556a024d807a1df23940b00895' into bb-10.3-fix_len_decbb-10.3-fix_len_dec
Diffstat (limited to 'sql/item_sum.h')
-rw-r--r--sql/item_sum.h34
1 files changed, 19 insertions, 15 deletions
diff --git a/sql/item_sum.h b/sql/item_sum.h
index b66f6ab6143..b400ebd5f80 100644
--- a/sql/item_sum.h
+++ b/sql/item_sum.h
@@ -457,7 +457,8 @@ public:
Updated value is then saved in the field.
*/
virtual void update_field()=0;
- virtual void fix_length_and_dec() { maybe_null=1; null_value=1; }
+ virtual bool fix_length_and_dec()
+ { maybe_null=1; null_value=1; return FALSE; }
virtual Item *result_item(THD *thd, Field *field);
void update_used_tables ();
@@ -753,8 +754,8 @@ public:
String *val_str(String*str);
my_decimal *val_decimal(my_decimal *);
const Type_handler *type_handler() const { return &type_handler_longlong; }
- void fix_length_and_dec()
- { decimals=0; max_length=21; maybe_null=null_value=0; }
+ bool fix_length_and_dec()
+ { decimals=0; max_length=21; maybe_null=null_value=0; return FALSE; }
};
@@ -770,7 +771,7 @@ protected:
my_decimal direct_sum_decimal;
my_decimal dec_buffs[2];
uint curr_dec_buff;
- void fix_length_and_dec();
+ bool fix_length_and_dec();
public:
Item_sum_sum(THD *thd, Item *item_par, bool distinct):
@@ -905,7 +906,7 @@ public:
void fix_length_and_dec_double();
void fix_length_and_dec_decimal();
- void fix_length_and_dec();
+ bool fix_length_and_dec();
enum Sumfunctype sum_func () const
{
return has_with_distinct() ? AVG_DISTINCT_FUNC : AVG_FUNC;
@@ -965,7 +966,7 @@ But, this falls prey to catastrophic cancellation. Instead, use the recurrence
class Item_sum_variance : public Item_sum_num
{
- void fix_length_and_dec();
+ bool fix_length_and_dec();
public:
double recurrence_m, recurrence_s; /* Used in recurrence relation. */
@@ -1052,7 +1053,7 @@ protected:
cmp_sign(item->cmp_sign), was_values(item->was_values)
{ }
bool fix_fields(THD *, Item **);
- void fix_length_and_dec();
+ bool fix_length_and_dec();
void setup_hybrid(THD *thd, Item *item, Item *value_arg);
void clear();
void direct_add(Item *item);
@@ -1132,8 +1133,11 @@ public:
longlong val_int();
void reset_field();
void update_field();
- void fix_length_and_dec()
- { decimals= 0; max_length=21; unsigned_flag= 1; maybe_null= null_value= 0; }
+ bool fix_length_and_dec()
+ {
+ decimals= 0; max_length=21; unsigned_flag= 1; maybe_null= null_value= 0;
+ return FALSE;
+ }
void cleanup()
{
bits= reset_bits;
@@ -1302,7 +1306,7 @@ public:
{
return create_table_field_from_handler(table);
}
- void fix_length_and_dec();
+ bool fix_length_and_dec();
bool fix_fields(THD *thd, Item **ref);
const char *func_name() const;
const Type_handler *type_handler() const;
@@ -1562,7 +1566,7 @@ class Item_sum_udf_float :public Item_udf_sum
String *val_str(String*str);
my_decimal *val_decimal(my_decimal *);
const Type_handler *type_handler() const { return &type_handler_double; }
- void fix_length_and_dec() { fix_num_length_and_dec(); }
+ bool fix_length_and_dec() { fix_num_length_and_dec(); return FALSE; }
Item *copy_or_same(THD* thd);
Item *get_copy(THD *thd)
{ return get_item_copy<Item_sum_udf_float>(thd, this); }
@@ -1584,7 +1588,7 @@ public:
String *val_str(String*str);
my_decimal *val_decimal(my_decimal *);
const Type_handler *type_handler() const { return &type_handler_longlong; }
- void fix_length_and_dec() { decimals=0; max_length=21; }
+ bool fix_length_and_dec() { decimals=0; max_length=21; return FALSE; }
Item *copy_or_same(THD* thd);
Item *get_copy(THD *thd)
{ return get_item_copy<Item_sum_udf_int>(thd, this); }
@@ -1625,7 +1629,7 @@ public:
}
my_decimal *val_decimal(my_decimal *dec);
const Type_handler *type_handler() const { return string_type_handler(); }
- void fix_length_and_dec();
+ bool fix_length_and_dec();
Item *copy_or_same(THD* thd);
Item *get_copy(THD *thd)
{ return get_item_copy<Item_sum_udf_str>(thd, this); }
@@ -1646,7 +1650,7 @@ public:
longlong val_int();
my_decimal *val_decimal(my_decimal *);
const Type_handler *type_handler() const { return &type_handler_newdecimal; }
- void fix_length_and_dec() { fix_num_length_and_dec(); }
+ bool fix_length_and_dec() { fix_num_length_and_dec(); return FALSE; }
Item *copy_or_same(THD* thd);
Item *get_copy(THD *thd)
{ return get_item_copy<Item_sum_udf_decimal>(thd, this); }
@@ -1720,7 +1724,7 @@ public:
{ DBUG_ASSERT(fixed == 1); null_value=1; return 0; }
double val_real() { DBUG_ASSERT(fixed == 1); null_value=1; return 0.0; }
longlong val_int() { DBUG_ASSERT(fixed == 1); null_value=1; return 0; }
- void fix_length_and_dec() { maybe_null=1; max_length=0; }
+ bool fix_length_and_dec() { maybe_null=1; max_length=0; return FALSE; }
enum Sumfunctype sum_func () const { return UDF_SUM_FUNC; }
void clear() {}
bool add() { return 0; }