diff options
author | Sergei Golubchik <sergii@pisem.net> | 2014-03-15 18:24:15 +0100 |
---|---|---|
committer | Sergei Golubchik <sergii@pisem.net> | 2014-03-15 18:24:15 +0100 |
commit | d7304375e5e0ce30979c2b92e70eb0effaa30a25 (patch) | |
tree | bb9d05f40e948d4b027f4da9c007c433a16fa1a6 /sql/item_func.h | |
parent | cd29dc98216d822ad701d604b3eda886e1db2aaa (diff) | |
parent | e0f3a0fae98bea144b962ef8dbbe62e0935aebb1 (diff) | |
download | mariadb-git-d7304375e5e0ce30979c2b92e70eb0effaa30a25.tar.gz |
mysql-5.1.73 merge
Diffstat (limited to 'sql/item_func.h')
-rw-r--r-- | sql/item_func.h | 29 |
1 files changed, 20 insertions, 9 deletions
diff --git a/sql/item_func.h b/sql/item_func.h index 61f7dc2cce3..3d30a472a36 100644 --- a/sql/item_func.h +++ b/sql/item_func.h @@ -1,5 +1,5 @@ -/* Copyright (c) 2000, 2010, Oracle and/or its affiliates. - Copyright (c) 2009, 2013, Monty Program Ab. +/* Copyright (c) 2000, 2013, Oracle and/or its affiliates. + Copyright (c) 2009, 2014, Monty Program Ab. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -420,12 +420,17 @@ 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() - { max_length=args[0]->max_length; unsigned_flag=0; } + { + max_length= min(args[0]->max_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(); } }; @@ -434,13 +439,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) { - max_length= min(args[0]->max_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); }; @@ -1405,6 +1408,14 @@ public: :Item_func(b), cached_result_type(INT_RESULT), entry(NULL), entry_thread_id(0), name(a) {} + Item_func_set_user_var(THD *thd, Item_func_set_user_var *item) + :Item_func(thd, item), cached_result_type(item->cached_result_type), + entry(item->entry), entry_thread_id(item->entry_thread_id), + value(item->value), decimal_buff(item->decimal_buff), + null_item(item->null_item), save_result(item->save_result), + name(item->name) + {} + enum Functype functype() const { return SUSERVAR_FUNC; } double val_real(); longlong val_int(); |