Commit d4bedc87 authored by unknown's avatar unknown

Merge dl145s.mysql.com:/data0/bk/team_tree_merge/mysql-5.0-opt

into  dl145s.mysql.com:/data0/bk/team_tree_merge/MERGE2/mysql-5.0


sql/item_func.cc:
  Auto merged
parents ca3e99d8 677a86ca
...@@ -488,3 +488,4 @@ t 0 ...@@ -488,3 +488,4 @@ t 0
Warnings: Warnings:
Warning 1292 Truncated incorrect INTEGER value: '1a' Warning 1292 Truncated incorrect INTEGER value: '1a'
Warning 1292 Truncated incorrect INTEGER value: 't' Warning 1292 Truncated incorrect INTEGER value: 't'
DROP TABLE t1;
...@@ -196,3 +196,4 @@ INSERT INTO t1 VALUES (10), (50), (30), ('1a'), (60), ('t'); ...@@ -196,3 +196,4 @@ INSERT INTO t1 VALUES (10), (50), (30), ('1a'), (60), ('t');
SELECT a,(a + 0) FROM t1 ORDER BY a; SELECT a,(a + 0) FROM t1 ORDER BY a;
SELECT a,(a DIV 2) FROM t1 ORDER BY a; SELECT a,(a DIV 2) FROM t1 ORDER BY a;
SELECT a,CAST(a AS SIGNED) FROM t1 ORDER BY a; SELECT a,CAST(a AS SIGNED) FROM t1 ORDER BY a;
DROP TABLE t1;
...@@ -900,7 +900,8 @@ void Item_func_signed::print(String *str) ...@@ -900,7 +900,8 @@ void Item_func_signed::print(String *str)
longlong Item_func_signed::val_int_from_str(int *error) longlong Item_func_signed::val_int_from_str(int *error)
{ {
char buff[MAX_FIELD_WIDTH], *end; char buff[MAX_FIELD_WIDTH], *end, *start;
uint32 length;
String tmp(buff,sizeof(buff), &my_charset_bin), *res; String tmp(buff,sizeof(buff), &my_charset_bin), *res;
longlong value; longlong value;
...@@ -916,13 +917,21 @@ longlong Item_func_signed::val_int_from_str(int *error) ...@@ -916,13 +917,21 @@ longlong Item_func_signed::val_int_from_str(int *error)
return 0; return 0;
} }
null_value= 0; null_value= 0;
end= (char*) res->ptr()+ res->length(); start= (char *)res->ptr();
value= my_strtoll10(res->ptr(), &end, error); length= res->length();
if (*error > 0 || end != res->ptr()+ res->length())
end= start + length;
value= my_strtoll10(start, &end, error);
if (*error > 0 || end != start+ length)
{
char err_buff[128];
String err_tmp(err_buff,(uint32) sizeof(err_buff), system_charset_info);
err_tmp.copy(start, length, system_charset_info);
push_warning_printf(current_thd, MYSQL_ERROR::WARN_LEVEL_WARN, push_warning_printf(current_thd, MYSQL_ERROR::WARN_LEVEL_WARN,
ER_TRUNCATED_WRONG_VALUE, ER_TRUNCATED_WRONG_VALUE,
ER(ER_TRUNCATED_WRONG_VALUE), "INTEGER", ER(ER_TRUNCATED_WRONG_VALUE), "INTEGER",
res->c_ptr()); err_tmp.c_ptr());
}
return value; return value;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment