diff options
author | msvensson@neptunus.(none) <> | 2006-11-28 20:59:57 +0100 |
---|---|---|
committer | msvensson@neptunus.(none) <> | 2006-11-28 20:59:57 +0100 |
commit | 04d5a42bbfb36e614512d692a34130242d345175 (patch) | |
tree | abd103946cab0eae83e36388b799bb0e86227ee3 /sql/item_func.cc | |
parent | cc2821944fcceb54080230acb057c627a5c288ed (diff) | |
parent | 648e86e10849f5d31c9592d6173ac8f1c2b453aa (diff) | |
download | mariadb-git-04d5a42bbfb36e614512d692a34130242d345175.tar.gz |
Merge neptunus.(none):/home/msvensson/mysql/mysql-5.0
into neptunus.(none):/home/msvensson/mysql/mysql-5.0-maint
Diffstat (limited to 'sql/item_func.cc')
-rw-r--r-- | sql/item_func.cc | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/sql/item_func.cc b/sql/item_func.cc index 6e81b03d846..96b3cc3da98 100644 --- a/sql/item_func.cc +++ b/sql/item_func.cc @@ -964,7 +964,14 @@ longlong Item_func_unsigned::val_int() longlong value; int error; - if (args[0]->cast_to_int_type() != STRING_RESULT) + if (args[0]->cast_to_int_type() == DECIMAL_RESULT) + { + my_decimal tmp, *dec= args[0]->val_decimal(&tmp); + if (!(null_value= args[0]->null_value)) + my_decimal2int(E_DEC_FATAL_ERROR, dec, 1, &value); + return value; + } + else if (args[0]->cast_to_int_type() != STRING_RESULT) { value= args[0]->val_int(); null_value= args[0]->null_value; @@ -2894,6 +2901,20 @@ void Item_udf_func::cleanup() } +void Item_udf_func::print(String *str) +{ + str->append(func_name()); + str->append('('); + for (uint i=0 ; i < arg_count ; i++) + { + if (i != 0) + str->append(','); + args[i]->print_item_w_name(str); + } + str->append(')'); +} + + double Item_func_udf_float::val_real() { DBUG_ASSERT(fixed == 1); |