Bug #10388 wrong result in the union.result
Submitted: 5 May 2005 14:18 Modified: 7 May 2005 9:48
Reporter: Ramil Kalimullin Email Updates:
Status: Won't fix Impact on me:
None 
Category:MySQL Server Severity:S3 (Non-critical)
Version:4.1 OS:
Assigned to: CPU Architecture:Any

[5 May 2005 14:18] Ramil Kalimullin
Description:
When joining decimal(10, 1) and decimal(10,9) fields in a union
we get a decimal(10, 9) field, which is wrong.

How to repeat:
From the union.result:

create table t1 (d decimal(10,1));
create table t2 (d decimal(10,9));
insert into t1 values ("100000000.0");
insert into t2 values ("1.23456780");
create table t3 select * from t2 union select * from t1;
select * from t3;
d
1.234567800
100000000.0

>>>>> note: decimal(10, 9) cannot contain 100000000.0

show create table t3;
Table   Create Table
t3      CREATE TABLE `t3` (
  `d` decimal(10,9) default NULL

>>>>>> why decimal(10,9) here?

) ENGINE=MyISAM DEFAULT CHARSET=latin1
[7 May 2005 9:48] Sergei Golubchik
fixing it would require too big changes in the stable branch - 4.1.
5.0 does not have this bug.