• unknown's avatar
    Fix for bug #26788 "mysqld (debug) aborts when inserting specific · 10f11bcd
    unknown authored
    numbers into char fields" and bug #12860 "Difference in zero padding of
    exponent between Unix and Windows"
    
    Rewrote the code that determines what 'precision' argument should be
    passed to sprintf() to fit the string representation of the input number
    into the field.
    We get finer control over conversion by pre-calculating the exponent, so
    we are able to determine which conversion format, 'e' or 'f', will be
    used by sprintf().
    We also remove the leading zero from the exponent on Windows to make it
    compatible with the sprintf() output on other platforms.
    
    
    mysql-test/r/insert.result:
      Added test cases for bug #26788 and bug #31152.
    mysql-test/t/cast.test:
      Removed --replace_result, since the result is now correct on Windows.
    mysql-test/t/insert.test:
      Added test cases for bug #26788 and bug #31152.
    mysql-test/t/type_float.test:
      Removed --replace_result, since the result is now correct on Windows.
    mysql-test/t/variables.test:
      Removed --replace_result, since the result is now correct on Windows.
    sql/field.cc:
      Rewrote the code that determines what 'precision' argument should be
      passed to sprintf() to fit the string representation of the input number
      into the field.
      We get finer control over conversion by pre-calculating the exponent, so
      we are able to determine which conversion format, 'e' or 'f', will be
      used by sprintf().
    10f11bcd
insert.result 19.1 KB