Bug #8432 Precision math: DECIMAL(38,38) not accepted

Submitted: 11 Feb 2005 1:50 Modified: 30 Sep 2005 0:39
Reporter: Trudy Pelzer Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server Severity:S3 (Non-critical)
Version:5.0.3-alpha-debug OS:Linux (SuSE 9.1)
Assigned to: MySQL Verification Team CPU Architecture:Any

[11 Feb 2005 1:50] Trudy Pelzer
Description:
MySQL should always return an error, instead of changing
a data type definition, when  the definition is invalid. This
is not always happening: when the size of a column 
definition exceeds 30 post-decimal digits, MySQL changes
the definition to include only 30 post-decimal digits.
But (a) silent column changes should never happen and
(b) a definition of up to DECIMAL(38,38) should be legal
and accepted by the server.

How to repeat:
mysql> create table t1 (col1 decimal(38,38));
Query OK, 0 rows affected (0.01 sec)

mysql> show create table t1;
+-------+-------------------------------------------------------------------------------------------------+
| Table | Create Table                                                                                    |
+-------+-------------------------------------------------------------------------------------------------+
| t1    | CREATE TABLE `t1` (
  `col1` decimal(38,30) default NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 |
+-------+-------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)
-- This is the incorrect response. The CREATE TABLE statement 
asked for the column to be a DECIMAL(38,38) field, not a
DECIMAL(38,30) field as shown here. The requested precision 
of DECIMAL(38,38) should be allowed
[11 Feb 2005 1:58] Jorge del Conde
Verified using 5.0.3 from our bk tree
[2 Apr 2005 11:29] Alexey Botchkov
Unfortunately this only can be fixed in 5.1
Now 30 digits after decimal point is the limit.
[29 Sep 2005 22:28] Brian Aker
Reverify
[30 Sep 2005 0:31] MySQL Verification Team
Below the current behavior:

mysql> select version();
+-----------------+
| version()       |
+-----------------+
| 5.0.14-rc-debug |
+-----------------+
1 row in set (0.00 sec)

mysql> create table t1 (col1 decimal(38,38));
ERROR 1425 (42000): Too big scale 38 specified for column 'col1'. Maximum is 30.
mysql>
[30 Sep 2005 0:39] MySQL Verification Team
Thank you for your bug report. This issue has already been fixed
in the latest released version of that product, which you can download at 
http://www.mysql.com/downloads/

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

Page generated in 0.039 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.