[MDEV-15311] DOUBLE PRECISION(M,D)-SELECT CAST ('value' AS DOUBLE(30)); gives an syntax error Created: 2018-02-14 Updated: 2020-08-25 Resolved: 2018-02-14 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Data types, Documentation |
| Affects Version/s: | 10.2 |
| Fix Version/s: | N/A |
| Type: | Bug | Priority: | Minor |
| Reporter: | Pramod Mahto | Assignee: | Sergei Golubchik |
| Resolution: | Fixed | Votes: | 1 |
| Labels: | datatype | ||
| Description |
|
Hi Team, DOUBLE [(M [, D])] - New in 5.3 D is obviously not an optional requirement but without filling D option it is giving sql syntax error. While looking at MariaDB KB :- "M is the total number of digits and D is the number of digits following the decimal point. If M and D are omitted, values are stored to the limits allowed by the hardware." For Example:-
Another example of create table :-
|
| Comments |
| Comment by Elena Stepanova [ 2018-02-14 ] |
|
As mentioned in comments to MDEV-597 the "D" part in DOUBLE [(M [, D])] for CAST at https://mariadb.com/kb/en/library/convert/ is a documentation issue. DOUBLE(M) makes no sense, it's not even a valid type, as your second example demonstrates, and as documented at https://mariadb.com/kb/en/library/double/. I'll leave it to bar to confirm. |
| Comment by Alexander Barkov [ 2018-02-16 ] |
|
Sergei fixed the manual. Now it says DOUBLE[(M,D)] instead of DOUBLE [(M [, D])]. |