Bug #90161 | decimal(M,D) | ||
---|---|---|---|
Submitted: | 21 Mar 2018 11:43 | Modified: | 8 Apr 2018 19:00 |
Reporter: | Dmitriy Kiselev | Email Updates: | |
Status: | Not a Bug | Impact on me: | |
Category: | MySQL Server: Documentation | Severity: | S3 (Non-critical) |
Version: | 5.7 | OS: | Any |
Assigned to: | CPU Architecture: | Any |
[21 Mar 2018 11:43]
Dmitriy Kiselev
[22 Mar 2018 8:13]
MySQL Verification Team
Hello Dmitriy, Thank you for the report. Thanks, Umesh
[6 Apr 2018 15:35]
Paul DuBois
Posted by developer: "So, can we store -1.0 in DECIMAL(6.3) for example, or not?" No, because DECIMAL(6.3) is not a valid definition. Assuming that you meant DECIMAL(6,3), yes. From the quoted text: "A DECIMAL(M,D) column permits at most M - D digits to the left of the decimal point." For DECIMAL(6,3), at most M-D = 3 digits are permitted to the left of the decimal point. -1.0 has one digit: Permitted. To verify, try this: drop table if exists t; create table t (d decimal(6,3)); insert into t (d) values(-1.0); select * from t;
[8 Apr 2018 19:00]
Dmitriy Kiselev
Thanks for your answer! But what does it mean: "For negative numbers, a literal - character is not stored." I read it in documentation. Is it old information from previous versions?