diff options
author | Michael Widenius <monty@askmonty.org> | 2011-05-12 14:30:34 +0300 |
---|---|---|
committer | Michael Widenius <monty@askmonty.org> | 2011-05-12 14:30:34 +0300 |
commit | f09f1c7c7da344d0078b2c13edc9249c4c61c6b9 (patch) | |
tree | 1b707c9edf2d159102019147a5dbca390e1aac83 /sql/item_func.h | |
parent | f34be1893892745b5b1a7a099eab4ad8e9ac8641 (diff) | |
parent | 4c81cef75d7871e2c77d6723813ac328c34603b5 (diff) | |
download | mariadb-git-f09f1c7c7da344d0078b2c13edc9249c4c61c6b9.tar.gz |
Merge with dynamic column code
Diffstat (limited to 'sql/item_func.h')
-rw-r--r-- | sql/item_func.h | 24 |
1 files changed, 20 insertions, 4 deletions
diff --git a/sql/item_func.h b/sql/item_func.h index b8f294d9e70..688614c333c 100644 --- a/sql/item_func.h +++ b/sql/item_func.h @@ -461,7 +461,7 @@ class Item_decimal_typecast :public Item_func public: Item_decimal_typecast(Item *a, int len, int dec) :Item_func(a) { - decimals= dec; + decimals= (uint8) dec; max_length= my_decimal_precision_to_length_no_truncation(len, dec, unsigned_flag); } @@ -471,12 +471,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= (uint8) dec; + max_length= (uint32) 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: @@ -1714,7 +1731,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 }; @@ -1878,4 +1895,3 @@ public: return trace_unsupported_by_check_vcol_func_processor(func_name()); } }; - |