mirror of
https://github.com/MariaDB/server.git
synced 2026-05-15 03:17:20 +02:00
bug#3612 - Item_func_div set decimals incorrectly
This commit is contained in:
parent
2b4a56b9f3
commit
76bc677117
3 changed files with 24 additions and 0 deletions
|
|
@ -67,6 +67,21 @@ select min(a) from t1;
|
|||
min(a)
|
||||
-0.010
|
||||
drop table t1;
|
||||
create table t1 (c1 double, c2 varchar(20));
|
||||
insert t1 values (121,"16");
|
||||
select c1 + c1 * (c2 / 100) as col from t1;
|
||||
col
|
||||
140.36
|
||||
create table t2 select c1 + c1 * (c2 / 100) as col from t1;
|
||||
select * from t2;
|
||||
col
|
||||
140.36
|
||||
show create table t2;
|
||||
Table Create Table
|
||||
t2 CREATE TABLE `t2` (
|
||||
`col` double default NULL
|
||||
) TYPE=MyISAM
|
||||
drop table t1,t2;
|
||||
create table t1 (f float, f2 float(24), f3 float(6,2), d double, d2 float(53), d3 double(10,3), de decimal, de2 decimal(6), de3 decimal(5,2), n numeric, n2 numeric(8), n3 numeric(5,6));
|
||||
show full columns from t1;
|
||||
Field Type Null Key Default Extra Privileges
|
||||
|
|
|
|||
|
|
@ -28,6 +28,14 @@ select a from t1 order by a;
|
|||
select min(a) from t1;
|
||||
drop table t1;
|
||||
|
||||
create table t1 (c1 double, c2 varchar(20));
|
||||
insert t1 values (121,"16");
|
||||
select c1 + c1 * (c2 / 100) as col from t1;
|
||||
create table t2 select c1 + c1 * (c2 / 100) as col from t1;
|
||||
select * from t2;
|
||||
show create table t2;
|
||||
drop table t1,t2;
|
||||
|
||||
#
|
||||
# FLOAT/DOUBLE/DECIMAL handling
|
||||
#
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue