summaryrefslogtreecommitdiff
path: root/sql
diff options
context:
space:
mode:
authorunknown <hf@deer.(none)>2005-04-08 08:31:53 +0500
committerunknown <hf@deer.(none)>2005-04-08 08:31:53 +0500
commit45b9f0e3a0060e11c5892f34cd77db33bfc20adf (patch)
treecaf47dcbaf745dee7b529dcc2a87880dc0bf1a62 /sql
parent81e8630e2fb55dbd4da7cf4e4c20b44223d80857 (diff)
parent6f0f3b073326d8cd1bed3d6917494196ebacc9c7 (diff)
downloadmariadb-git-45b9f0e3a0060e11c5892f34cd77db33bfc20adf.tar.gz
Merge abotchkov@bk-internal.mysql.com:/home/bk/mysql-5.0
into deer.(none):/home/hf/work/mysql-5.0.errmsg
Diffstat (limited to 'sql')
-rw-r--r--sql/item.cc16
1 files changed, 10 insertions, 6 deletions
diff --git a/sql/item.cc b/sql/item.cc
index 9302a19ccd9..636b6f3cfc8 100644
--- a/sql/item.cc
+++ b/sql/item.cc
@@ -260,8 +260,15 @@ my_decimal *Item::val_decimal_from_string(my_decimal *decimal_value)
return 0; // NULL or EOM
end_ptr= (char*) res->ptr()+ res->length();
- str2my_decimal(E_DEC_FATAL_ERROR, res->ptr(), res->length(), res->charset(),
- decimal_value);
+ if (str2my_decimal(E_DEC_FATAL_ERROR & ~E_DEC_BAD_NUM,
+ res->ptr(), res->length(), res->charset(),
+ decimal_value) & E_DEC_BAD_NUM)
+ {
+ push_warning_printf(current_thd, MYSQL_ERROR::WARN_LEVEL_WARN,
+ ER_TRUNCATED_WRONG_VALUE,
+ ER(ER_TRUNCATED_WRONG_VALUE), "DECIMAL",
+ str_value.c_ptr());
+ }
return decimal_value;
}
@@ -1515,10 +1522,7 @@ longlong Item_string::val_int()
my_decimal *Item_string::val_decimal(my_decimal *decimal_value)
{
- /* following assert is redundant, because fixed=1 assigned in constructor */
- DBUG_ASSERT(fixed == 1);
- string2my_decimal(E_DEC_FATAL_ERROR, &str_value, decimal_value);
- return (decimal_value);
+ return val_decimal_from_string(decimal_value);
}