diff options
author | Sergei Golubchik <sergii@pisem.net> | 2013-06-06 17:51:28 +0200 |
---|---|---|
committer | Sergei Golubchik <sergii@pisem.net> | 2013-06-06 17:51:28 +0200 |
commit | 4749d40c635634e25e07d28ce1a04e9263bcc375 (patch) | |
tree | c5bb3287675cd8676d76c8ee42ef2d79cc599e25 /sql/item_func.h | |
parent | 1ff1cb10fc236010b5969058cab934c2b306c931 (diff) | |
parent | 33ef993773449cb3917665b188f6b6575d399bd0 (diff) | |
download | mariadb-git-4749d40c635634e25e07d28ce1a04e9263bcc375.tar.gz |
5.5 merge
Diffstat (limited to 'sql/item_func.h')
-rw-r--r-- | sql/item_func.h | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/sql/item_func.h b/sql/item_func.h index ab6ec706248..bdf91810d81 100644 --- a/sql/item_func.h +++ b/sql/item_func.h @@ -552,12 +552,18 @@ public: class Item_func_signed :public Item_int_func { public: - Item_func_signed(Item *a) :Item_int_func(a) {} + Item_func_signed(Item *a) :Item_int_func(a) + { + unsigned_flag= 0; + } const char *func_name() const { return "cast_as_signed"; } longlong val_int(); longlong val_int_from_str(int *error); void fix_length_and_dec() - { fix_char_length(args[0]->max_char_length()); unsigned_flag=0; } + { + fix_char_length(min(args[0]->max_char_length(), + MY_INT64_NUM_DECIMAL_DIGITS)); + } virtual void print(String *str, enum_query_type query_type); uint decimal_precision() const { return args[0]->decimal_precision(); } }; @@ -566,14 +572,11 @@ public: class Item_func_unsigned :public Item_func_signed { public: - Item_func_unsigned(Item *a) :Item_func_signed(a) {} - const char *func_name() const { return "cast_as_unsigned"; } - void fix_length_and_dec() + Item_func_unsigned(Item *a) :Item_func_signed(a) { - fix_char_length(min(args[0]->max_char_length(), - DECIMAL_MAX_PRECISION + 2)); - unsigned_flag=1; + unsigned_flag= 1; } + const char *func_name() const { return "cast_as_unsigned"; } longlong val_int(); virtual void print(String *str, enum_query_type query_type); }; |