mirror of
https://github.com/MariaDB/server.git
synced 2025-01-15 19:42:28 +01:00
MDEV-5819: MySQL Bug #13500371 63704: CONVERSION OF '1.' TO A NUMBER GIVES ERROR 1265 (WARN_DATA_TRUNCATED)
Fix by MySQL ported
This commit is contained in:
parent
e63c03db8d
commit
f9b3cc11bc
3 changed files with 31 additions and 1 deletions
|
@ -447,3 +447,21 @@ End of 5.0 tests
|
|||
select format(truncate('1.7976931348623157E+308',-12),1,'fr_BE') as foo;
|
||||
foo
|
||||
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))),
|
|||
--echo #
|
||||
|
||||
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
|
|||
else if (nd < 16)
|
||||
z= 10*z + c - '0';
|
||||
nd0= nd;
|
||||
if (s < end - 1 && c == '.')
|
||||
if (s < end && c == '.')
|
||||
{
|
||||
++s;
|
||||
if (!nd)
|
||||
|
|
Loading…
Reference in a new issue