Bug #13569 User friendly

Submitted: 28 Sep 2005 14:09 Modified: 28 Sep 2005 15:00
Reporter: Roberto Spadim (Basic Quality Contributor) Email Updates:
Status: Not a Bug Impact on me:
None 
Category:MySQL Server: Optimizer Severity:S3 (Non-critical)
Version:all OS:Any (all)
Assigned to: CPU Architecture:Any

[28 Sep 2005 14:09] Roberto Spadim
Description:
float(5,5) can cause problems to users like
insert a field with value 1.0000
and then selecting it, we have a return of
0.99999
(aproximate), but changin to float(6,5) this error get out! :P
could we change for example:

alter table blablabla change field field float(m,n) not null default '0';

if (n>0 AND n=m)
   if (m==MAX_m_SIZE) 
       n--; 
   else 
       m++

How to repeat:
create a table with float(5,5), insert 1.0000, and then select it

Suggested fix:
a user friendly alter table change
[28 Sep 2005 14:09] Roberto Spadim
user friendly insue - optimizer change
[28 Sep 2005 15:00] Hartmut Holzgraefe
not a bug, expected behavior:

mysql> insert into f5 values(1);
Query OK, 1 row affected, 1 warning (0.00 sec)

mysql> show warnings;
+---------+------+-----------------------------------------------------+
| Level   | Code | Message                                             |
+---------+------+-----------------------------------------------------+
| Warning | 1264 | Out of range value adjusted for column 'f' at row 1 |
+---------+------+-----------------------------------------------------+
1 row in set (0.00 sec)

use strict sql mode if you want to avoid this kind of auto conversion
[29 Sep 2005 19:04] Roberto Spadim
for a mysql begginer it's not simple like we know, making a friendly change on field type could be more friendly for dummies

Portions of this website are copyright © 2001, 2002 The PHP Group

Page generated in 0.040 sec. using MySQL 8.4.7-u6-cloud

Timestamp references displayed by the system are UTC.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.