diff options
author | Igor Babaev <igor@askmonty.org> | 2018-06-03 10:34:41 -0700 |
---|---|---|
committer | Igor Babaev <igor@askmonty.org> | 2018-06-03 10:34:41 -0700 |
commit | cab1d6382623f0611335caf2cd056aa7ee04d7cd (patch) | |
tree | c33b8118a77a78d87d8fb01e908dbfa6a67ca9a2 /sql/item_func.h | |
parent | ffe83e8e7bef32eb2a80aad2d382f0b023dd3a44 (diff) | |
parent | ee5124d714ea01f4e1bd6decf6da38b05c1009ad (diff) | |
download | mariadb-git-cab1d6382623f0611335caf2cd056aa7ee04d7cd.tar.gz |
Merge branch '10.3' into 10.4
Diffstat (limited to 'sql/item_func.h')
-rw-r--r-- | sql/item_func.h | 33 |
1 files changed, 20 insertions, 13 deletions
diff --git a/sql/item_func.h b/sql/item_func.h index 59fc49ead39..a6fcf8f4870 100644 --- a/sql/item_func.h +++ b/sql/item_func.h @@ -32,6 +32,7 @@ extern "C" /* Bug in BSDI include file */ #include "sql_udf.h" // udf_handler #include "my_decimal.h" // string2my_decimal +#include <cmath> class Item_func :public Item_func_or_sum @@ -70,7 +71,7 @@ public: SP_CONTAINS_FUNC,SP_OVERLAPS_FUNC, SP_STARTPOINT,SP_ENDPOINT,SP_EXTERIORRING, SP_POINTN,SP_GEOMETRYN,SP_INTERIORRINGN, SP_RELATE_FUNC, - NOT_FUNC, NOT_ALL_FUNC, + NOT_FUNC, NOT_ALL_FUNC, TEMPTABLE_ROWID, NOW_FUNC, NOW_UTC_FUNC, SYSDATE_FUNC, TRIG_COND_FUNC, SUSERVAR_FUNC, GUSERVAR_FUNC, COLLATE_FUNC, EXTRACT_FUNC, CHAR_TYPECAST_FUNC, FUNC_SP, UDF_FUNC, @@ -82,16 +83,19 @@ public: { with_sum_func= 0; with_field= 0; + with_param= 0; } Item_func(THD *thd, Item *a): Item_func_or_sum(thd, a) { with_sum_func= a->with_sum_func; + with_param= a->with_param; with_field= a->with_field; } Item_func(THD *thd, Item *a, Item *b): Item_func_or_sum(thd, a, b) { with_sum_func= a->with_sum_func || b->with_sum_func; + with_param= a->with_param || b->with_param; with_field= a->with_field || b->with_field; } Item_func(THD *thd, Item *a, Item *b, Item *c): @@ -99,6 +103,7 @@ public: { with_sum_func= a->with_sum_func || b->with_sum_func || c->with_sum_func; with_field= a->with_field || b->with_field || c->with_field; + with_param= a->with_param || b->with_param || c->with_param; } Item_func(THD *thd, Item *a, Item *b, Item *c, Item *d): Item_func_or_sum(thd, a, b, c, d) @@ -107,6 +112,8 @@ public: c->with_sum_func || d->with_sum_func; with_field= a->with_field || b->with_field || c->with_field || d->with_field; + with_param= a->with_param || b->with_param || + c->with_param || d->with_param; } Item_func(THD *thd, Item *a, Item *b, Item *c, Item *d, Item* e): Item_func_or_sum(thd, a, b, c, d, e) @@ -115,6 +122,8 @@ public: c->with_sum_func || d->with_sum_func || e->with_sum_func; with_field= a->with_field || b->with_field || c->with_field || d->with_field || e->with_field; + with_param= a->with_param || b->with_param || + c->with_param || d->with_param || e->with_param; } Item_func(THD *thd, List<Item> &list): Item_func_or_sum(thd, list) @@ -229,7 +238,7 @@ public: */ inline double check_float_overflow(double value) { - return isfinite(value) ? value : raise_float_overflow(); + return std::isfinite(value) ? value : raise_float_overflow(); } /** Throw an error if the input BIGINT value represented by the @@ -1612,14 +1621,13 @@ public: { name= a->name; } - double val_real() { return args[0]->val_real(); } - longlong val_int() { return args[0]->val_int(); } - String *val_str(String *str) { return args[0]->val_str(str); } - my_decimal *val_decimal(my_decimal *dec) { return args[0]->val_decimal(dec); } + double val_real() { return val_real_from_item(args[0]); } + longlong val_int() { return val_int_from_item(args[0]); } + String *val_str(String *str) { return val_str_from_item(args[0], str); } + my_decimal *val_decimal(my_decimal *dec) + { return val_decimal_from_item(args[0], dec); } bool get_date(MYSQL_TIME *ltime, ulonglong fuzzydate) - { - return args[0]->get_date(ltime, fuzzydate); - } + { return get_date_from_item(args[0], ltime, fuzzydate); } const char *func_name() const { return "rollup_const"; } bool const_item() const { return 0; } const Type_handler *type_handler() const { return args[0]->type_handler(); } @@ -1627,9 +1635,7 @@ public: { collation= args[0]->collation; max_length= args[0]->max_length; - decimals=args[0]->decimals; - /* The item could be a NULL constant. */ - null_value= args[0]->is_null(); + decimals=args[0]->decimals; } Item *get_copy(THD *thd) { return get_item_copy<Item_func_rollup_const>(thd, this); } @@ -2851,7 +2857,7 @@ public: { return result_type() != STRING_RESULT ? sp_result_field : - tmp_table_field_from_field_type(table); + create_table_field_from_handler(table); } void make_send_field(THD *thd, Send_field *tmp_field); @@ -3014,6 +3020,7 @@ public: Item_func_uuid_short(THD *thd): Item_longlong_func(thd) {} const char *func_name() const { return "uuid_short"; } longlong val_int(); + bool const_item() const { return false; } void fix_length_and_dec() { max_length= 21; unsigned_flag=1; } table_map used_tables() const { return RAND_TABLE_BIT; } |