diff options
Diffstat (limited to 'sql/item_func.h')
-rw-r--r-- | sql/item_func.h | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/sql/item_func.h b/sql/item_func.h index 5c5ea33f247..0ba73f6e960 100644 --- a/sql/item_func.h +++ b/sql/item_func.h @@ -470,12 +470,29 @@ public: my_decimal *val_decimal(my_decimal*); enum Item_result result_type () const { return DECIMAL_RESULT; } enum_field_types field_type() const { return MYSQL_TYPE_NEWDECIMAL; } - void fix_length_and_dec() {}; + void fix_length_and_dec() {} const char *func_name() const { return "decimal_typecast"; } virtual void print(String *str, enum_query_type query_type); }; +class Item_double_typecast :public Item_real_func +{ +public: + Item_double_typecast(Item *a, int len, int dec) :Item_real_func(a) + { + decimals= dec; + max_length= len; + } + double val_real(); + enum_field_types field_type() const { return MYSQL_TYPE_DOUBLE; } + void fix_length_and_dec() { maybe_null= 1; } + const char *func_name() const { return "double_typecast"; } + virtual void print(String *str, enum_query_type query_type); +}; + + + class Item_func_additive_op :public Item_num_op { public: @@ -1713,7 +1730,7 @@ enum Cast_target { ITEM_CAST_BINARY, ITEM_CAST_SIGNED_INT, ITEM_CAST_UNSIGNED_INT, ITEM_CAST_DATE, ITEM_CAST_TIME, ITEM_CAST_DATETIME, ITEM_CAST_CHAR, - ITEM_CAST_DECIMAL + ITEM_CAST_DECIMAL, ITEM_CAST_DOUBLE }; @@ -1877,4 +1894,3 @@ public: return trace_unsupported_by_check_vcol_func_processor(func_name()); } }; - |