summaryrefslogtreecommitdiff
path: root/sql
diff options
context:
space:
mode:
authorunknown <holyfoot/hf@mysql.com/deer.(none)>2006-11-06 15:04:58 +0400
committerunknown <holyfoot/hf@mysql.com/deer.(none)>2006-11-06 15:04:58 +0400
commitf9c6368e485b3d7760e5ba9747f2f767bb96d4ad (patch)
tree29329cee572f5684d5b573e083d1e0188ec087d4 /sql
parent10dd1a371d7c5b99f965ca0bde409baadc772240 (diff)
parentc0c56d13aa8fafee9ca288d6ca7ef194a96ca24f (diff)
downloadmariadb-git-f9c6368e485b3d7760e5ba9747f2f767bb96d4ad.tar.gz
Merge bk@192.168.21.1:mysql-5.0-opt
into mysql.com:/home/hf/work/8663/my50-8663 mysql-test/r/type_newdecimal.result: merging mysql-test/t/type_newdecimal.test: merging
Diffstat (limited to 'sql')
-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;