Commit ee8c7a3e authored by monty@mysql.com's avatar monty@mysql.com

After merge fixes

parent 65b37a04
......@@ -852,8 +852,8 @@ NULL NULL
3.40282e+38 0
DROP TABLE t1;
CREATE TABLE t1 (col1 DOUBLE PRECISION, col2 DOUBLE PRECISION UNSIGNED);
INSERT INTO t1 VALUES (-2.2E-307,0),(+1.7E+308,+1.7E+308);
INSERT INTO t1 VALUES ('-2.2E-307',0),('+1.7E+308','+1.7E+308');
INSERT INTO t1 VALUES (-2.2E-307,0),(2E-307,0),(+1.7E+308,+1.7E+308);
INSERT INTO t1 VALUES ('-2.2E-307',0),('-2E-307',0),('+1.7E+308','+1.7E+308');
INSERT INTO t1 (col1) VALUES (-2.2E-330);
INSERT INTO t1 (col1) VALUES (+1.7E+309);
Got one of the listed errors
......@@ -864,7 +864,7 @@ ERROR 22003: Out of range value adjusted for column 'col1' at row 1
INSERT INTO t1 (col2) VALUES ('-1.2E-3');
ERROR 22003: Out of range value adjusted for column 'col2' at row 1
UPDATE t1 SET col1 =col1 * 5000 WHERE col1 > 0;
ERROR 22003: Out of range value adjusted for column 'col1' at row 2
ERROR 22003: Out of range value adjusted for column 'col1' at row 3
UPDATE t1 SET col2 =col2 / 0 WHERE col2 > 0;
ERROR 22012: Division by 0
UPDATE t1 SET col2= MOD(col2,0) WHERE col2 > 0;
......@@ -890,9 +890,11 @@ Warning 1264 Out of range value adjusted for column 'col2' at row 1
Warning 1264 Out of range value adjusted for column 'col2' at row 1
SELECT * FROM t1;
col1 col2
-2.2e-307 0
0 0
1e-303 0
1.7e+308 1.7e+308
-2.2e-307 0
0 0
-2e-307 0
1.7e+308 1.7e+308
0 NULL
2 NULL
......
......@@ -828,8 +828,8 @@ DROP TABLE t1;
# Test INSERT with DOUBLE
CREATE TABLE t1 (col1 DOUBLE PRECISION, col2 DOUBLE PRECISION UNSIGNED);
INSERT INTO t1 VALUES (-2.2E-307,0),(+1.7E+308,+1.7E+308);
INSERT INTO t1 VALUES ('-2.2E-307',0),('+1.7E+308','+1.7E+308');
INSERT INTO t1 VALUES (-2.2E-307,0),(2E-307,0),(+1.7E+308,+1.7E+308);
INSERT INTO t1 VALUES ('-2.2E-307',0),('-2E-307',0),('+1.7E+308','+1.7E+308');
# We don't give warnings for underflow
INSERT INTO t1 (col1) VALUES (-2.2E-330);
--error 1367,1264
......
......@@ -691,7 +691,6 @@ class Item_sum_udf_str :public Item_udf_sum
{
int err_not_used;
char *end_not_used;
char *end_not_used;
String *res;
res=val_str(&str_value);
return res ? my_strntod(res->charset(),(char*) res->ptr(),res->length(),
......@@ -700,9 +699,16 @@ class Item_sum_udf_str :public Item_udf_sum
longlong val_int()
{
int err_not_used;
String *res; res=val_str(&str_value);
return res ? my_strntoll(res->charset(),res->ptr(),res->length(),10,
(char**) 0, &err_not_used) : (longlong) 0;
char *end;
String *res;
longlong value;
CHARSET_INFO *cs;
if (!(res= val_str(&str_value)))
return 0; /* Null value */
cs= res->charset();
end= (char*) res->ptr()+res->length();
return cs->cset->my_strtoll10(cs, res->ptr(), &end, &err_not_used);
}
my_decimal *val_decimal(my_decimal *dec);
enum Item_result result_type () const { return STRING_RESULT; }
......
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