diff options
author | Alexey Kopytov <Alexey.Kopytov@Sun.com> | 2009-12-22 19:23:13 +0300 |
---|---|---|
committer | Alexey Kopytov <Alexey.Kopytov@Sun.com> | 2009-12-22 19:23:13 +0300 |
commit | 12f364ece7663663cabdc29f106ca69af63fe4e7 (patch) | |
tree | 40437c602d2a9ddaa03a54742cec4884f0974253 /mysql-test/suite | |
parent | d4f23f0cf6db38731a161c5c7b0b056fc67e5c02 (diff) | |
download | mariadb-git-12f364ece7663663cabdc29f106ca69af63fe4e7.tar.gz |
Backport of WL #2934: Make/find library for doing float/double
to string conversions and vice versa"
Initial import of the dtoa.c code and custom wrappers around it
to allow its usage from the server code.
Conversion of FLOAT/DOUBLE values to DECIMAL ones or strings
and vice versa has been significantly reworked. As the new
algoritms are more precise than the older ones, results of such
conversions may not always match those obtained from older
server versions. This in turn may break compatibility for some
applications.
This patch also fixes the following bugs:
- bug #12860 "Difference in zero padding of exponent between
Unix and Windows"
- bug #21497 "DOUBLE truncated to unusable value"
- bug #26788 "mysqld (debug) aborts when inserting specific
numbers into char fields"
- bug #24541 "Data truncated..." on decimal type columns
without any good reason"
Diffstat (limited to 'mysql-test/suite')
-rw-r--r-- | mysql-test/suite/ndb/r/ndb_gis.result | 16 | ||||
-rw-r--r-- | mysql-test/suite/ndb/r/ndb_restore_different_endian_data.result | 4 | ||||
-rw-r--r-- | mysql-test/suite/ndb/r/ps_7ndb.result | 74 |
3 files changed, 47 insertions, 47 deletions
diff --git a/mysql-test/suite/ndb/r/ndb_gis.result b/mysql-test/suite/ndb/r/ndb_gis.result index 61d15b7cb98..54772f596c3 100644 --- a/mysql-test/suite/ndb/r/ndb_gis.result +++ b/mysql-test/suite/ndb/r/ndb_gis.result @@ -266,7 +266,7 @@ fid AsText(EndPoint(g)) 107 POINT(40 10) SELECT fid, GLength(g) FROM gis_line ORDER by fid; fid GLength(g) -105 24.142135623731 +105 24.14213562373095 106 40 107 30 SELECT fid, NumPoints(g) FROM gis_line ORDER by fid; @@ -292,7 +292,7 @@ Note 1003 select astext(startpoint(`test`.`gis_line`.`g`)) AS `AsText(StartPoint SELECT fid, AsText(Centroid(g)) FROM gis_polygon ORDER by fid; fid AsText(Centroid(g)) 108 POINT(15 15) -109 POINT(25.4166666666667 25.4166666666667) +109 POINT(25.416666666666668 25.416666666666668) 110 POINT(20 10) SELECT fid, Area(g) FROM gis_polygon ORDER by fid; fid Area(g) @@ -326,8 +326,8 @@ fid IsClosed(g) 116 0 SELECT fid, AsText(Centroid(g)) FROM gis_multi_polygon ORDER by fid; fid AsText(Centroid(g)) -117 POINT(55.5885277530424 17.426536064114) -118 POINT(55.5885277530424 17.426536064114) +117 POINT(55.58852775304245 17.426536064113982) +118 POINT(55.58852775304245 17.426536064113982) 119 POINT(2 2) SELECT fid, Area(g) FROM gis_multi_polygon ORDER by fid; fid Area(g) @@ -816,7 +816,7 @@ fid AsText(EndPoint(g)) 107 POINT(40 10) SELECT fid, GLength(g) FROM gis_line ORDER by fid; fid GLength(g) -105 24.142135623731 +105 24.14213562373095 106 40 107 30 SELECT fid, NumPoints(g) FROM gis_line ORDER by fid; @@ -842,7 +842,7 @@ Note 1003 select astext(startpoint(`test`.`gis_line`.`g`)) AS `AsText(StartPoint SELECT fid, AsText(Centroid(g)) FROM gis_polygon ORDER by fid; fid AsText(Centroid(g)) 108 POINT(15 15) -109 POINT(25.4166666666667 25.4166666666667) +109 POINT(25.416666666666668 25.416666666666668) 110 POINT(20 10) SELECT fid, Area(g) FROM gis_polygon ORDER by fid; fid Area(g) @@ -876,8 +876,8 @@ fid IsClosed(g) 116 0 SELECT fid, AsText(Centroid(g)) FROM gis_multi_polygon ORDER by fid; fid AsText(Centroid(g)) -117 POINT(55.5885277530424 17.426536064114) -118 POINT(55.5885277530424 17.426536064114) +117 POINT(55.58852775304245 17.426536064113982) +118 POINT(55.58852775304245 17.426536064113982) 119 POINT(2 2) SELECT fid, Area(g) FROM gis_multi_polygon ORDER by fid; fid Area(g) diff --git a/mysql-test/suite/ndb/r/ndb_restore_different_endian_data.result b/mysql-test/suite/ndb/r/ndb_restore_different_endian_data.result index e552de8d854..b101c93d156 100644 --- a/mysql-test/suite/ndb/r/ndb_restore_different_endian_data.result +++ b/mysql-test/suite/ndb/r/ndb_restore_different_endian_data.result @@ -79,7 +79,7 @@ t_pk t_date t_datetime t_timestamp t_time t_year 1 1998-01-01 2006-08-10 10:11:12 2002-10-29 16:51:06 19:38:34 2155 SELECT t_pk,hex(t_bit),t_tinyint,t_bool,t_smallint,t_mediumint,t_int,t_bigint,t_float,t_double,t_decimal FROM t_num; t_pk hex(t_bit) t_tinyint t_bool t_smallint t_mediumint t_int t_bigint t_float t_double t_decimal -1 AAAAAAAAAAAAAAAA 125 1 32765 8388606 2147483647 9223372036854775807 1e+20 1e+150 331.0000000000000000 +1 AAAAAAAAAAAAAAAA 125 1 32765 8388606 2147483647 9223372036854775807 1e20 1e150 331.0000000000000000 SELECT t_pk,t_char,t_varchar,hex(t_binary),hex(t_varbinary) FROM t_string_1; t_pk t_char t_varchar hex(t_binary) hex(t_varbinary) 1 abcdefghijklmn abcdefghijklmnabcdefghijklmnabcdefghijklmnabcdefghijklmn 612020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 4100 @@ -178,7 +178,7 @@ t_pk t_date t_datetime t_timestamp t_time t_year 1 1998-01-01 2006-08-10 10:11:12 2002-10-29 16:51:06 19:38:34 2155 SELECT t_pk,hex(t_bit),t_tinyint,t_bool,t_smallint,t_mediumint,t_int,t_bigint,t_float,t_double,t_decimal FROM t_num; t_pk hex(t_bit) t_tinyint t_bool t_smallint t_mediumint t_int t_bigint t_float t_double t_decimal -1 AAAAAAAAAAAAAAAA 125 1 32765 8388606 2147483647 9223372036854775807 1e+20 1e+150 331.0000000000000000 +1 AAAAAAAAAAAAAAAA 125 1 32765 8388606 2147483647 9223372036854775807 1e20 1e150 331.0000000000000000 SELECT t_pk,t_char,t_varchar,hex(t_binary),hex(t_varbinary) FROM t_string_1; t_pk t_char t_varchar hex(t_binary) hex(t_varbinary) 1 abcdefghijklmn abcdefghijklmnabcdefghijklmnabcdefghijklmnabcdefghijklmn 612020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 4100 diff --git a/mysql-test/suite/ndb/r/ps_7ndb.result b/mysql-test/suite/ndb/r/ps_7ndb.result index e57fdcb6df6..fcb2d641cf0 100644 --- a/mysql-test/suite/ndb/r/ps_7ndb.result +++ b/mysql-test/suite/ndb/r/ps_7ndb.result @@ -2568,10 +2568,10 @@ c3 8388607 c4 2147483647 c5 2147483647 c6 9223372036854775807 -c7 9.22337e+18 -c8 9.22337203685478e+18 -c9 9.22337203685478e+18 -c10 9.22337203685478e+18 +c7 9.22337e18 +c8 9.223372036854776e18 +c9 9.223372036854776e18 +c10 9.223372036854776e18 c12 9999.9999 execute my_delete ; set @arg00= '9223372036854775807' ; @@ -2591,10 +2591,10 @@ c3 8388607 c4 2147483647 c5 2147483647 c6 9223372036854775807 -c7 9.22337e+18 -c8 9.22337203685478e+18 -c9 9.22337203685478e+18 -c10 9.22337203685478e+18 +c7 9.22337e18 +c8 9.223372036854776e18 +c9 9.223372036854776e18 +c10 9.223372036854776e18 c12 9999.9999 execute my_delete ; set @arg00= -9223372036854775808 ; @@ -2614,10 +2614,10 @@ c3 -8388608 c4 -2147483648 c5 -2147483648 c6 -9223372036854775808 -c7 -9.22337e+18 -c8 -9.22337203685478e+18 -c9 -9.22337203685478e+18 -c10 -9.22337203685478e+18 +c7 -9.22337e18 +c8 -9.223372036854776e18 +c9 -9.223372036854776e18 +c10 -9.223372036854776e18 c12 -9999.9999 execute my_delete ; set @arg00= '-9223372036854775808' ; @@ -2637,10 +2637,10 @@ c3 -8388608 c4 -2147483648 c5 -2147483648 c6 -9223372036854775808 -c7 -9.22337e+18 -c8 -9.22337203685478e+18 -c9 -9.22337203685478e+18 -c10 -9.22337203685478e+18 +c7 -9.22337e18 +c8 -9.223372036854776e18 +c9 -9.223372036854776e18 +c10 -9.223372036854776e18 c12 -9999.9999 execute my_delete ; set @arg00= 1.11111111111111111111e+50 ; @@ -2662,10 +2662,10 @@ c3 8388607 c4 2147483647 c5 2147483647 c6 9223372036854775807 -c7 3.40282e+38 -c8 1.11111111111111e+50 -c9 1.11111111111111e+50 -c10 1.11111111111111e+50 +c7 3.40282e38 +c8 1.111111111111111e50 +c9 1.111111111111111e50 +c10 1.111111111111111e50 c12 9999.9999 execute my_delete ; set @arg00= '1.11111111111111111111e+50' ; @@ -2687,10 +2687,10 @@ c3 8388607 c4 2147483647 c5 2147483647 c6 9223372036854775807 -c7 3.40282e+38 -c8 1.11111111111111e+50 -c9 1.11111111111111e+50 -c10 1.11111111111111e+50 +c7 3.40282e38 +c8 1.111111111111111e50 +c9 1.111111111111111e50 +c10 1.111111111111111e50 c12 9999.9999 execute my_delete ; set @arg00= -1.11111111111111111111e+50 ; @@ -2712,10 +2712,10 @@ c3 -8388608 c4 -2147483648 c5 -2147483648 c6 -9223372036854775808 -c7 -3.40282e+38 -c8 -1.11111111111111e+50 -c9 -1.11111111111111e+50 -c10 -1.11111111111111e+50 +c7 -3.40282e38 +c8 -1.111111111111111e50 +c9 -1.111111111111111e50 +c10 -1.111111111111111e50 c12 -9999.9999 execute my_delete ; set @arg00= '-1.11111111111111111111e+50' ; @@ -2737,10 +2737,10 @@ c3 -8388608 c4 -2147483648 c5 -2147483648 c6 -9223372036854775808 -c7 -3.40282e+38 -c8 -1.11111111111111e+50 -c9 -1.11111111111111e+50 -c10 -1.11111111111111e+50 +c7 -3.40282e38 +c8 -1.111111111111111e50 +c9 -1.111111111111111e50 +c10 -1.111111111111111e50 c12 -9999.9999 execute my_delete ; test_sequence @@ -2805,10 +2805,10 @@ c1 c20 c21 c22 c23 c24 c25 c26 c27 c28 c29 c30 51 5 51.0 51.0 51.0 51.0 51.0 51.0 51.0 51.0 51.0 51.0 52 5 52.0 52.0 52.0 52.0 52.0 52.0 52.0 52.0 52.0 52.0 53 5 53.0 53.0 53.0 53.0 53.0 53.0 53.0 53.0 53.0 53.0 -54 5 54 54 54.00 54.00 54.00 54.00 54.00 54.00 54.00 54.00 -55 5 55 55 55 55 55 55 55 55 55 55 -56 6 56 56 56.00 56.00 56.00 56.00 56.00 56.00 56.00 56.00 -57 6 57 57 57.00 57.00 57.00 57.00 57.00 57.00 57.00 57.00 +54 5 54 54 54 54 54 54 54 54 54 54 +55 6 55 55 55 55 55 55 55 55 55 55 +56 6 56 56 56 56 56 56 56 56 56 56 +57 6 57 57 57 57 57 57 57 57 57 57 60 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 61 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 62 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL @@ -3022,7 +3022,7 @@ c1 c13 c14 c15 c16 c17 42 0000-00-00 0000-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 43 0000-00-00 0000-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 50 2001-00-00 2001-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 -51 2010-00-00 2010-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 +51 2001-00-00 2001-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 52 2001-00-00 2001-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 53 2001-00-00 2001-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 60 NULL NULL 1991-01-01 01:01:01 NULL NULL |