Commit d84ed646 authored by konstantin@mysql.com's avatar konstantin@mysql.com

A test case for Bug#5673 "Rounding problem in 4.0.21 inserting decimal

value into a char field": the patch submitted for the bug a while
ago has never been reviewed or approved to push into 4.0. Decimal
support in 5.0 resolves the issue.
Adding the test case and closing the bug report.
parent 8ca745be
......@@ -764,3 +764,23 @@ non PS, 1.0 in parameter 1.0
PS, 1.0 in parameter 1.0
deallocate prepare stmt;
drop table t1;
create table t1 (
strippedproductid char(15) not null default '',
zlevelprice decimal(10,2) default null,
primary key (strippedproductid)
);
create table t2 (
productid char(15) not null default '',
zlevelprice char(21) default null,
primary key (productid)
);
insert into t1 values ('002trans','49.99');
insert into t1 values ('003trans','39.98');
insert into t1 values ('004trans','31.18');
insert INTO t2 SELECT * FROM t1;
select * from t2;
productid zlevelprice
002trans 49.99
003trans 39.98
004trans 31.18
drop table t1, t2;
......@@ -343,3 +343,31 @@ execute stmt using @a;
select * from t1;
deallocate prepare stmt;
drop table t1;
#
# A test case for Bug#5673 "Rounding problem in 4.0.21 inserting decimal
# value into a char field": this is a regression bug in 4.0 tree caused by
# a fix for some other decimal conversion issue. The patch never was
# approved to get into 4.0 (maybe because it was considered too intrusive)
#
create table t1 (
strippedproductid char(15) not null default '',
zlevelprice decimal(10,2) default null,
primary key (strippedproductid)
);
create table t2 (
productid char(15) not null default '',
zlevelprice char(21) default null,
primary key (productid)
);
insert into t1 values ('002trans','49.99');
insert into t1 values ('003trans','39.98');
insert into t1 values ('004trans','31.18');
insert INTO t2 SELECT * FROM t1;
select * from t2;
drop table t1, t2;
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment