mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
Fix for bug #10896 (0.00 > -0.00)
mysql-test/r/type_newdecimal.result: test result fixed mysql-test/t/type_newdecimal.test: test case added sql/my_decimal.h: we neede to check for zero here not to get -0.00
This commit is contained in:
@ -896,6 +896,8 @@ create table t1( d1 decimal(18) unsigned, d2 decimal(20) unsigned, d3 decimal (2
|
||||
insert into t1 values(1,-1,-1);
|
||||
ERROR 22003: Out of range value adjusted for column 'd2' at row 1
|
||||
drop table t1;
|
||||
set sql_mode='';
|
||||
set @sav_dpi= @@div_precision_increment;
|
||||
set @@div_precision_increment=15;
|
||||
create table t1 (col1 int, col2 decimal(30,25), col3 numeric(30,25));
|
||||
insert into t1 values (1,0.0123456789012345678912345,0.0123456789012345678912345);
|
||||
@ -909,3 +911,12 @@ select 77777777/7777777;
|
||||
77777777/7777777
|
||||
10.000000900000090
|
||||
drop table t1;
|
||||
set div_precision_increment= @sav_dpi;
|
||||
create table t1 (a decimal(4,2));
|
||||
insert into t1 values (0.00);
|
||||
select * from t1 where a > -0.00;
|
||||
a
|
||||
select * from t1 where a = -0.00;
|
||||
a
|
||||
0.00
|
||||
drop table t1;
|
||||
|
@ -934,10 +934,12 @@ create table t1( d1 decimal(18) unsigned, d2 decimal(20) unsigned, d3 decimal (2
|
||||
--error 1264
|
||||
insert into t1 values(1,-1,-1);
|
||||
drop table t1;
|
||||
set sql_mode='';
|
||||
|
||||
#
|
||||
# Bug #8425 (insufficient precision of the division)
|
||||
#
|
||||
set @sav_dpi= @@div_precision_increment;
|
||||
set @@div_precision_increment=15;
|
||||
create table t1 (col1 int, col2 decimal(30,25), col3 numeric(30,25));
|
||||
insert into t1 values (1,0.0123456789012345678912345,0.0123456789012345678912345);
|
||||
@ -945,4 +947,13 @@ select col2/9999999999 from t1 where col1=1;
|
||||
select 9999999999/col2 from t1 where col1=1;
|
||||
select 77777777/7777777;
|
||||
drop table t1;
|
||||
set div_precision_increment= @sav_dpi;
|
||||
|
||||
#
|
||||
# Bug #10896 (0.00 > -0.00)
|
||||
#
|
||||
create table t1 (a decimal(4,2));
|
||||
insert into t1 values (0.00);
|
||||
select * from t1 where a > -0.00;
|
||||
select * from t1 where a = -0.00;
|
||||
drop table t1;
|
||||
|
Reference in New Issue
Block a user