mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
Merge polly.(none):/home/kaa/src/maint/bug26788/my51-bug26788
into polly.(none):/home/kaa/src/maint/mysql-5.1-maint
This commit is contained in:
@ -457,6 +457,9 @@ INSERT INTO t1(a,c) VALUES (-1.87e-2, -1.87e-2);
|
||||
INSERT INTO t1(a,c) VALUES (5000e+0, 5000e+0);
|
||||
INSERT INTO t1(a,c) VALUES (-5000e+0, -5000e+0);
|
||||
|
||||
# Expected results are "12.2" and "1.2e+78", but Windows returns "12.3" and
|
||||
# "1.3e+78" due to different rounding rules
|
||||
--replace_result 12.3 12.2 1.3e+78 1.2e+78
|
||||
SELECT * FROM t1;
|
||||
|
||||
DROP TABLE t1;
|
||||
|
@ -50,6 +50,8 @@ select @test, @`test`, @TEST, @`TEST`, @"teSt";
|
||||
set @select=2,@t5=1.23456;
|
||||
select @`select`,@not_used;
|
||||
set @test_int=10,@test_double=1e-10,@test_string="abcdeghi",@test_string2="abcdefghij",@select=NULL;
|
||||
# Expected result "1e-10", windows returns "1e-010"
|
||||
--replace_result 1e-010 1e-10
|
||||
select @test_int,@test_double,@test_string,@test_string2,@select;
|
||||
set @test_int="hello",@test_double="hello",@test_string="hello",@test_string2="hello";
|
||||
select @test_int,@test_double,@test_string,@test_string2;
|
||||
|
@ -6306,7 +6306,10 @@ int Field_str::store(double nr)
|
||||
if (exp >= (int) digits || exp < -4)
|
||||
digits= max(0, (int) (max_length - 5 - (exp >= 100 || exp <= -100)));
|
||||
|
||||
length= (uint) my_sprintf(buff, (buff, "%-.*g", min(digits, DBL_DIG ), nr));
|
||||
/* Limit precision to DBL_DIG to avoid garbage past significant digits */
|
||||
set_if_smaller(digits, DBL_DIG);
|
||||
|
||||
length= (uint) my_sprintf(buff, (buff, "%-.*g", digits, nr));
|
||||
|
||||
#ifdef __WIN__
|
||||
/*
|
||||
|
Reference in New Issue
Block a user