[MDEV-10138] Support for decimals up to 38 digits Created: 2016-05-27  Updated: 2018-08-31  Resolved: 2016-06-24

Status: Closed
Project: MariaDB Server
Component/s: Data Definition - Alter Table
Fix Version/s: 10.2.1

Type: Task Priority: Major
Reporter: Michael Widenius Assignee: Michael Widenius
Resolution: Fixed Votes: 0
Labels: Compatibility

Issue Links:
PartOf
includes MDEV-6304 Controversial comparison behaviour of... Open
Epic Link: Oracle Compatibility
Sprint: Compatibility-1

 Description   

Currently DECIMAL only supports 30 decimals.
We should extend support to at least 38 decimals, to be more compatible with financial applications that depends on this limit

FLOAT and DOUBLE should still have the old limit of 30 decimals.

The change should be done so there is a minimum of notable change for old clients, except if they are using decimal fields with more than 30 decimals.

One change that is unavoidable is that decimal expressions will return results with more than 30 decimal and that if one converts a string to decimal it will have up to 38 decimals.

CREATE ... SELECT with a decimal with > 30 decimals will create a column
with a smaller range than before as we are trying to preserve the number of
decimals.

CREATE TABLE t1 SELECT 123456789012345678901234567890123456789012345.123456789012345678901234567890123456789012345;
Will change the value from:
99999999999999999999999999999999999.999999999999999999999999999999
to
99999999999999999999999999999.999999999999999999999999999999999999



 Comments   
Comment by Elena Stepanova [ 2016-06-20 ]

monty, serg,
What is expected to happen upon migration from a long-decimal version of MariaDB to a non-long-decimal version (be it previous MariaDB or MySQL)?

Comment by Michael Widenius [ 2016-06-21 ]

The migration issue will be fixed as part of the extending default handling task (MDEV-10134).
As part of this, the .frm will be marked as incompatible (version 11) if more than 30 decimals is used and one will get an error in the earlier MariaDB version if one tries to use it.

Comment by Michael Widenius [ 2016-06-24 ]

Pushed into 10.2

Generated at Thu Feb 08 07:39:57 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.