| Bug #9071 | DECIMAL Value is incorrectly truncated if we enter a out of range value | ||
|---|---|---|---|
| Submitted: | 9 Mar 2005 15:10 | Modified: | 9 Mar 2005 18:49 |
| Reporter: | Disha | Email Updates: | |
| Status: | Duplicate | Impact on me: | |
| Category: | MySQL Server | Severity: | S2 (Serious) |
| Version: | 5.0.3-alpha-nt | OS: | Windows (Windows Server 2003) |
| Assigned to: | CPU Architecture: | Any | |
[9 Mar 2005 18:49]
Trudy Pelzer
This is a duplicate of Bug#8482.

Description: If we set the decimal field as decimal(4,3) i.e. we have 1 digit before the decimal and 3 after it. Then try to enter a value in this field as 9.9999 or greater than that, we are presented with an warning for out range value being adjusted but the truncation is incorrect and the value inserted is 0.000. How to repeat: Repro Steps : 1. Use database 'test' i.e. execute the following SQL statement: use test; 2. Create and Run the follwing query: create table t1 (f1 decimal(4,3)); insert into t1 values(9.9999); select * from t1; 3. Observe that the execution dispalys the result as, +-------+ | f1 | +-------+ | 0.000 | +-------+ Expected Results: It should display the value of "f1" as 9.999 Actual Results : It displays the value of "f1" as 0.000