summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorunknown <hf@deer.(none)>2005-04-06 15:51:24 +0500
committerunknown <hf@deer.(none)>2005-04-06 15:51:24 +0500
commite3e9ccc5277e92f49180f3bb7e2c349273b15b77 (patch)
tree1bca388b492ee5c3d5e00f555133d6065fa56c21
parent566460ac64e03b2d5f44961e352965ca24bdb911 (diff)
parentacd0dbd2703b6691acce6ff67278384f5ea5700d (diff)
downloadmariadb-git-e3e9ccc5277e92f49180f3bb7e2c349273b15b77.tar.gz
Merge bk@192.168.21.1:/usr/home/bk/mysql-5.0
into deer.(none):/home/hf/work/mysql-5.0.errmsg mysql-test/r/row.result: Auto merged sql/item.cc: Auto merged
-rw-r--r--mysql-test/r/row.result2
-rw-r--r--sql/item.cc16
2 files changed, 11 insertions, 7 deletions
diff --git a/mysql-test/r/row.result b/mysql-test/r/row.result
index 0c75e80cb77..f7f7e3e8429 100644
--- a/mysql-test/r/row.result
+++ b/mysql-test/r/row.result
@@ -15,7 +15,7 @@ select row('a',1.5,3) IN (row(1,2,3), row('a',1.5,3), row('a','a','a'));
row('a',1.5,3) IN (row(1,2,3), row('a',1.5,3), row('a','a','a'))
1
Warnings:
-Error 1366 Incorrect decimal value: '' for column '' at row -1
+Warning 1292 Truncated incorrect DECIMAL value: 'a'
Warning 1292 Truncated incorrect INTEGER value: 'a'
select row('a',0,3) IN (row(3,2,3), row('a','a','3'), row(1,3,3));
row('a',0,3) IN (row(3,2,3), row('a','a','3'), row(1,3,3))
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);
}