[Commits] Rev 4052: MDEV-5819: MySQL Bug #13500371 63704: CONVERSION OF '1.' TO A NUMBER GIVES ERROR 1265 (WARN_DATA_TRUNCATED) in file:///home/bell/maria/bzr/work-maria-10.0-MDEV-5819/

sanja at montyprogram.com sanja at montyprogram.com
Fri Mar 14 09:31:19 EET 2014


At file:///home/bell/maria/bzr/work-maria-10.0-MDEV-5819/

------------------------------------------------------------
revno: 4052
revision-id: sanja at montyprogram.com-20140314073116-nklb0jkjd4t1w40n
parent: monty at mariadb.org-20140313144311-hmphz2gup3qdjlp9
committer: sanja at montyprogram.com
branch nick: work-maria-10.0-MDEV-5819
timestamp: Fri 2014-03-14 09:31:16 +0200
message:
  MDEV-5819: MySQL Bug #13500371 63704: CONVERSION OF '1.' TO A NUMBER GIVES ERROR 1265 (WARN_DATA_TRUNCATED)
  
  Fix by MySQL ported
-------------- next part --------------
=== modified file 'mysql-test/r/type_float.result'
--- a/mysql-test/r/type_float.result	2012-01-13 14:50:02 +0000
+++ b/mysql-test/r/type_float.result	2014-03-14 07:31:16 +0000
@@ -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;

=== modified file 'mysql-test/t/type_float.test'
--- a/mysql-test/t/type_float.test	2011-07-18 08:27:05 +0000
+++ b/mysql-test/t/type_float.test	2014-03-14 07:31:16 +0000
@@ -331,3 +331,15 @@ eval select concat((truncate((-1.7976931
 --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;

=== modified file 'strings/dtoa.c'
--- a/strings/dtoa.c	2013-09-14 01:09:36 +0000
+++ b/strings/dtoa.c	2014-03-14 07:31:16 +0000
@@ -1410,7 +1410,7 @@ static double my_strtod_int(const char *
     else if (nd < 16)
       z= 10*z + c - '0';
   nd0= nd;
-  if (s < end - 1 && c == '.')
+  if (s < end && c == '.')
   {
     ++s;
     if (!nd)



More information about the commits mailing list