Bug #16335 Different formatting of "float" values on Windows
Submitted: 10 Jan 2006 12:03
Reporter: Joerg Bruehe Email Updates:
Status: Won't fix Impact on me:
None 
Category:MySQL Server Severity:S3 (Non-critical)
Version:All OS:Windows (Windows)
Assigned to: CPU Architecture:Any

[10 Jan 2006 12:03] Joerg Bruehe
Description:
(This "bug" is just a point of reference for test differences,
so that we can assign a "bug" number in the status pages.)

On Windows, the C runtime sometimes writes one more digit (leading "0") in the exponent part when outputting a floating-point value.

Example (truncated):
-------------------------------------------------------
*** r/type_float.result
--- r/type_float.reject
***************
*** 31,44
  100000        100000
! 1.23457e+9    1234567890
  1e+10 10000000000
  1e+15 1e+15
...
  -10   -10
! 1e-5  1e-5
  1e-10 1e-10
--- 31,44
  100000        100000
! 1.23457e+09   1234567890
  1e+10 10000000000
  1e+15 1e+15
...
  -10   -10
! 1e-05 1e-05
  1e-10 1e-10
***************
*** 87,93
  col1  col2    col3    col4
! 140.36        121.00000       121     3.47850542618522e-07
--- 87,93
  col1  col2    col3    col4
! 140.36        121.00000       121     3.47850542618522e-007
***************
*** 204,219
  insert into t1 values (5e-28);
  select * from t1;
  c
! 5e-28
  drop table t1;
  create table t1 (c char(6));
  insert into t1 values (2e5),(2e6),(2e-4),(2e-5);
  select * from t1;
  c
  200000
! 2e+06
  0.0002
! 2e-05
  drop table t1;
--- 204,219
  insert into t1 values (5e-28);
  select * from t1;
  c
! 5e-028
  drop table t1;
  create table t1 (c char(6));
  insert into t1 values (2e5),(2e6),(2e-4),(2e-5);
  select * from t1;
  c
  200000
! 2e+006
  0.0002
! 2e-005
  drop table t1;
-------------------------------------------------------

How to repeat:
Run the tests on Windows.

Suggested fix:
None, unless we code the equivalent of "printf()".