1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +03:00

Correctly truncate integers inserted into field and double columns

with a number of decimals specified. (Bug #7361)


mysql-test/t/type_float.test:
  Add test for maximum values of float and double columns with number of decimals
mysql-test/r/type_float.result:
  Add results for new test
mysql-test/r/type_float.result.es:
  Add results for new test
sql/field.cc:
  Use ::store(double nr) from ::store(longlong nr) so we get the same range checking
This commit is contained in:
unknown
2005-01-07 17:44:18 +01:00
parent 9ad1b390fc
commit 0c57a67ce0
4 changed files with 84 additions and 34 deletions

View File

@ -93,3 +93,13 @@ create table t1 (f float(54)); # Should give an error
drop table if exists t1;
--enable_warnings
# Ensure that maximum values as the result of number of decimals
# being specified in table schema are enforced (Bug #7361)
create table t1 (f float(4,3));
insert into t1 values (-11.0),(-11),("-11"),(11.0),(11),("11");
select * from t1;
drop table if exists t1;
create table t1 (f double(4,3));
insert into t1 values (-11.0),(-11),("-11"),(11.0),(11),("11");
select * from t1;
drop table if exists t1;