Commit 59a39534 authored by unknown's avatar unknown

After merge fixes


mysql-test/r/strict.result:
  Update tests after merge
mysql-test/t/strict.test:
  Update tests after merge (We can't handle 2.2E-307) anymore as this is out of range with the new method to calculate double
sql/item_sum.h:
  After merge fix
  use my_strtoll10 instead of my_strtonll
parent bc2a2293
...@@ -852,8 +852,8 @@ NULL NULL ...@@ -852,8 +852,8 @@ NULL NULL
3.40282e+38 0 3.40282e+38 0
DROP TABLE t1; DROP TABLE t1;
CREATE TABLE t1 (col1 DOUBLE PRECISION, col2 DOUBLE PRECISION UNSIGNED); 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),(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 (col1) VALUES (-2.2E-330); INSERT INTO t1 (col1) VALUES (-2.2E-330);
INSERT INTO t1 (col1) VALUES (+1.7E+309); INSERT INTO t1 (col1) VALUES (+1.7E+309);
Got one of the listed errors Got one of the listed errors
...@@ -864,7 +864,7 @@ ERROR 22003: Out of range value adjusted for column 'col1' at row 1 ...@@ -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'); INSERT INTO t1 (col2) VALUES ('-1.2E-3');
ERROR 22003: Out of range value adjusted for column 'col2' at row 1 ERROR 22003: Out of range value adjusted for column 'col2' at row 1
UPDATE t1 SET col1 =col1 * 5000 WHERE col1 > 0; 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; UPDATE t1 SET col2 =col2 / 0 WHERE col2 > 0;
ERROR 22012: Division by 0 ERROR 22012: Division by 0
UPDATE t1 SET col2= MOD(col2,0) WHERE col2 > 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 ...@@ -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 Warning 1264 Out of range value adjusted for column 'col2' at row 1
SELECT * FROM t1; SELECT * FROM t1;
col1 col2 col1 col2
-2.2e-307 0 0 0
1e-303 0
1.7e+308 1.7e+308 1.7e+308 1.7e+308
-2.2e-307 0 0 0
-2e-307 0
1.7e+308 1.7e+308 1.7e+308 1.7e+308
0 NULL 0 NULL
2 NULL 2 NULL
......
...@@ -828,8 +828,8 @@ DROP TABLE t1; ...@@ -828,8 +828,8 @@ DROP TABLE t1;
# Test INSERT with DOUBLE # Test INSERT with DOUBLE
CREATE TABLE t1 (col1 DOUBLE PRECISION, col2 DOUBLE PRECISION UNSIGNED); 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),(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');
# We don't give warnings for underflow # We don't give warnings for underflow
INSERT INTO t1 (col1) VALUES (-2.2E-330); INSERT INTO t1 (col1) VALUES (-2.2E-330);
--error 1367,1264 --error 1367,1264
......
...@@ -691,7 +691,6 @@ class Item_sum_udf_str :public Item_udf_sum ...@@ -691,7 +691,6 @@ class Item_sum_udf_str :public Item_udf_sum
{ {
int err_not_used; int err_not_used;
char *end_not_used; char *end_not_used;
char *end_not_used;
String *res; String *res;
res=val_str(&str_value); res=val_str(&str_value);
return res ? my_strntod(res->charset(),(char*) res->ptr(),res->length(), return res ? my_strntod(res->charset(),(char*) res->ptr(),res->length(),
...@@ -700,9 +699,16 @@ class Item_sum_udf_str :public Item_udf_sum ...@@ -700,9 +699,16 @@ class Item_sum_udf_str :public Item_udf_sum
longlong val_int() longlong val_int()
{ {
int err_not_used; int err_not_used;
String *res; res=val_str(&str_value); char *end;
return res ? my_strntoll(res->charset(),res->ptr(),res->length(),10, String *res;
(char**) 0, &err_not_used) : (longlong) 0; 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); my_decimal *val_decimal(my_decimal *dec);
enum Item_result result_type () const { return STRING_RESULT; } 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