Bug #12956 cast make differ rounding

Submitted: 2 Sep 2005 18:42 Modified: 9 Dec 2005 19:41
Reporter: Oleksandr Byelkin Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server Severity:S3 (Non-critical)
Version:4.0 OS:Any (all)
Assigned to: Ramil Kalimullin CPU Architecture:Any

[2 Sep 2005 18:42] Oleksandr Byelkin
Description:
direct conversion from floating point and convertion via CAST function give different results.
+ create table t1 (a int);
+ insert into t1 values  (55e-1*1e0), (cast(55e-1*1e0 as unsigned integer));
+ select * from t1;
+ a
+ 6
+ 5
+ drop table t1;

bug appeared to be in 4.0, 4.1 and 5,0 versions

How to repeat:
use following mysql-test script:
create table t1 (a int);
insert into t1 values  (55e-1*1e0), (cast(55e-1*1e0 as unsigned integer));
select * from t1;
drop table t1;

Suggested fix:
fix cast function
[28 Nov 2005 10:54] 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/32752
[29 Nov 2005 14:08] 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/32827
[30 Nov 2005 7:18] 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/32848
[2 Dec 2005 11:28] Ramil Kalimullin
fixed in 5.0.17
[9 Dec 2005 19:41] Paul DuBois
Noted in 5.0.17 changelog.

Portions of this website are copyright © 2001, 2002 The PHP Group

Page generated in 0.059 sec. using MySQL 8.4.7-u6-cloud

Timestamp references displayed by the system are UTC.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.