Commit f9b3cc11 authored by unknown's avatar unknown

MDEV-5819: MySQL Bug #13500371 63704: CONVERSION OF '1.' TO A NUMBER GIVES...

MDEV-5819: MySQL Bug #13500371 63704: CONVERSION OF '1.' TO A NUMBER GIVES ERROR 1265 (WARN_DATA_TRUNCATED)

Fix by MySQL ported
parent e63c03db
...@@ -447,3 +447,21 @@ End of 5.0 tests ...@@ -447,3 +447,21 @@ End of 5.0 tests
select format(truncate('1.7976931348623157E+308',-12),1,'fr_BE') as foo; select format(truncate('1.7976931348623157E+308',-12),1,'fr_BE') as foo;
foo foo
0 0
#
# Bug #13500371 63704: CONVERSION OF '1.' TO A NUMBER GIVES ERROR 1265
# (WARN_DATA_TRUNCATED)
#
CREATE TABLE t1 (f FLOAT);
INSERT INTO t1 VALUES ('1.');
INSERT INTO t1 VALUES ('2.0.');
Warnings:
Warning 1265 Data truncated for column 'f' at row 1
INSERT INTO t1 VALUES ('.');
Warnings:
Warning 1265 Data truncated for column 'f' at row 1
SELECT * FROM t1 ORDER BY f;
f
0
1
2
DROP TABLE t1;
...@@ -331,3 +331,15 @@ eval select concat((truncate((-1.7976931348623157E+307),(0x1e))), ...@@ -331,3 +331,15 @@ eval select concat((truncate((-1.7976931348623157E+307),(0x1e))),
--echo # --echo #
select format(truncate('1.7976931348623157E+308',-12),1,'fr_BE') as foo; select format(truncate('1.7976931348623157E+308',-12),1,'fr_BE') as foo;
--echo #
--echo # Bug #13500371 63704: CONVERSION OF '1.' TO A NUMBER GIVES ERROR 1265
--echo # (WARN_DATA_TRUNCATED)
--echo #
CREATE TABLE t1 (f FLOAT);
INSERT INTO t1 VALUES ('1.');
INSERT INTO t1 VALUES ('2.0.');
INSERT INTO t1 VALUES ('.');
SELECT * FROM t1 ORDER BY f;
DROP TABLE t1;
...@@ -1410,7 +1410,7 @@ static double my_strtod_int(const char *s00, char **se, int *error, char *buf, s ...@@ -1410,7 +1410,7 @@ static double my_strtod_int(const char *s00, char **se, int *error, char *buf, s
else if (nd < 16) else if (nd < 16)
z= 10*z + c - '0'; z= 10*z + c - '0';
nd0= nd; nd0= nd;
if (s < end - 1 && c == '.') if (s < end && c == '.')
{ {
++s; ++s;
if (!nd) if (!nd)
......
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