Bug #9837 round(1, 6) delivers wrong value in create table context
Submitted: 12 Apr 2005 11:42 Modified: 28 Apr 2005 4:11
Reporter: Matthias Grabert
Status: Closed
Category:Server: MyISAM Severity:S3 (Non-critical)
Version:4.1.10 OS:Sun Solaris 9 AND Windows 32Bit
Assigned to: Ramil Kalimullin Target Version:

[12 Apr 2005 11:42] Matthias Grabert
Description:
A purely executed  select round(1,6)  delivers 1.000000  as result (correct).
But in create table context, the value inserted is incorrect = 0.000009

How to repeat:
drop table if exists Roundtest;
create table Roundtest   select round(1,6);
select * from Roundtest;

result is 0.000009

Suggested fix:
drop table if exists Roundtest;
create table Roundtest   select round(1+0 ,6);
select * from Roundtest;

This works fine. (Why?)
[19 Apr 2005 11:45] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/internals/24135
[27 Apr 2005 15:19] Ramil Kalimullin
Fixed in 4.1.12
[28 Apr 2005 4:11] Paul DuBois
Noted in 4.1.12 changelog.