summaryrefslogtreecommitdiff
path: root/sql/item_func.cc
diff options
context:
space:
mode:
authorunknown <holyfoot/hf@mysql.com/deer.(none)>2006-11-06 14:57:47 +0400
committerunknown <holyfoot/hf@mysql.com/deer.(none)>2006-11-06 14:57:47 +0400
commitc0c56d13aa8fafee9ca288d6ca7ef194a96ca24f (patch)
tree2db2c98f009e82fd60577e6f263bdcf5918cea4e /sql/item_func.cc
parent0e69c252a17e6b5753079bc6313f2b7ac6fe1e66 (diff)
parentf00e6bd75d24e311016cd72449ed678c0172f6e6 (diff)
downloadmariadb-git-c0c56d13aa8fafee9ca288d6ca7ef194a96ca24f.tar.gz
Merge bk@192.168.21.1:mysql-5.0-opt
into mysql.com:/home/hf/work/8663/my50-8663 sql/item_func.cc: Auto merged
Diffstat (limited to 'sql/item_func.cc')
-rw-r--r--sql/item_func.cc9
1 files changed, 8 insertions, 1 deletions
diff --git a/sql/item_func.cc b/sql/item_func.cc
index e9f75a507a4..7d68e91dc49 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;