mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
Fix windows results using "replace_result"
This commit is contained in:
@ -116,10 +116,15 @@ drop table if exists t1;
|
|||||||
# Check conversion of floats to character field (Bug #7774)
|
# Check conversion of floats to character field (Bug #7774)
|
||||||
create table t1 (c char(20));
|
create table t1 (c char(20));
|
||||||
insert into t1 values (5e-28);
|
insert into t1 values (5e-28);
|
||||||
|
# Expected result is "5e-28", but windows returns "5e-028"
|
||||||
|
--replace_result 5e-028 5e-28
|
||||||
select * from t1;
|
select * from t1;
|
||||||
drop table t1;
|
drop table t1;
|
||||||
create table t1 (c char(6));
|
create table t1 (c char(6));
|
||||||
insert into t1 values (2e5),(2e6),(2e-4),(2e-5);
|
insert into t1 values (2e5),(2e6),(2e-4),(2e-5);
|
||||||
|
# Expected result is "2e+06", but windows returns "2e+006"
|
||||||
|
# Expected result is "2e-05", but windows returns "2e-005"
|
||||||
|
--replace_result 2e+006 2e+06 2e-005 2e-05
|
||||||
select * from t1;
|
select * from t1;
|
||||||
drop table t1;
|
drop table t1;
|
||||||
|
|
||||||
|
@ -1050,7 +1050,18 @@ while ($max_power)
|
|||||||
}
|
}
|
||||||
SELECT my_float, my_double, my_varchar FROM t1;
|
SELECT my_float, my_double, my_varchar FROM t1;
|
||||||
|
|
||||||
|
# Expected result 0.000000000011754943372854760000
|
||||||
|
# On windows we get 0.000000000011754943372854770000
|
||||||
|
# use replace_result to correct it
|
||||||
|
--replace_result 0.000000000011754943372854770000 0.000000000011754943372854760000
|
||||||
|
|
||||||
SELECT CAST(my_float AS DECIMAL(65,30)), my_float FROM t1;
|
SELECT CAST(my_float AS DECIMAL(65,30)), my_float FROM t1;
|
||||||
|
|
||||||
|
# Expected result 0.000000000011754943372854760000
|
||||||
|
# On windows we get 0.000000000011754943372854770000
|
||||||
|
# use replace_result to correct it
|
||||||
|
--replace_result 0.000000000011754943372854770000 0.000000000011754943372854760000
|
||||||
|
|
||||||
SELECT CAST(my_double AS DECIMAL(65,30)), my_double FROM t1;
|
SELECT CAST(my_double AS DECIMAL(65,30)), my_double FROM t1;
|
||||||
SELECT CAST(my_varchar AS DECIMAL(65,30)), my_varchar FROM t1;
|
SELECT CAST(my_varchar AS DECIMAL(65,30)), my_varchar FROM t1;
|
||||||
|
|
||||||
|
@ -20,6 +20,8 @@ select @test, @`test`, @TEST, @`TEST`, @"teSt";
|
|||||||
set @select=2,@t5=1.23456;
|
set @select=2,@t5=1.23456;
|
||||||
select @`select`,@not_used;
|
select @`select`,@not_used;
|
||||||
set @test_int=10,@test_double=1e-10,@test_string="abcdeghi",@test_string2="abcdefghij",@select=NULL;
|
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;
|
select @test_int,@test_double,@test_string,@test_string2,@select;
|
||||||
set @test_int="hello",@test_double="hello",@test_string="hello",@test_string2="hello";
|
set @test_int="hello",@test_double="hello",@test_string="hello",@test_string2="hello";
|
||||||
select @test_int,@test_double,@test_string,@test_string2;
|
select @test_int,@test_double,@test_string,@test_string2;
|
||||||
|
Reference in New Issue
Block a user