summaryrefslogtreecommitdiff
path: root/sql/item_func.cc
diff options
context:
space:
mode:
authorkostja@bodhi.local <>2006-11-29 02:44:12 +0300
committerkostja@bodhi.local <>2006-11-29 02:44:12 +0300
commit5fea0724bc46684390cfd9311dc8f854ece2bc9b (patch)
treef9f728e4fd94cdcf8bc3f5ea8270ee291aa94890 /sql/item_func.cc
parentea47e05f3cc5929eb1f56cfdc094cedfce318499 (diff)
parent3406fcea39defef5d5cd92f99fa4e60d556f3dae (diff)
downloadmariadb-git-5fea0724bc46684390cfd9311dc8f854ece2bc9b.tar.gz
Merge bk-internal.mysql.com:/home/bk/mysql-5.0
into bodhi.local:/opt/local/work/mysql-5.0-runtime
Diffstat (limited to 'sql/item_func.cc')
-rw-r--r--sql/item_func.cc23
1 files changed, 22 insertions, 1 deletions
diff --git a/sql/item_func.cc b/sql/item_func.cc
index ced472ece40..6bbb199a52b 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;
@@ -2882,6 +2889,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);