Maximum precision for DECIMAL column in MySQLMatt,

in 4.1 this restriction has been removed:

[EMAIL PROTECTED]:~/mysql-4.1/client> mysql test
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 1 to server version: 4.1.1-alpha-debug-log

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> CREATE TABLE `scale_test6` (`a_dec` decimal(30,23) default NULL)
TYPE=MyI
SAM;
Query OK, 0 rows affected (0.10 sec)

mysql> INSERT INTO scale_test6 (a_dec) VALUES
(12345678.123456789012345678901234
);
Query OK, 1 row affected (0.01 sec)

mysql> SELECT * FROM scale_test6;
+----------------------------------+
| a_dec                            |
+----------------------------------+
| 12345678.12345678918063640594482 |
+----------------------------------+
1 row in set (0.03 sec)

mysql>


Regards,

Heikki


----- Original Message -----
From: Matt Solnit
To: [EMAIL PROTECTED] ; Heikki Tuuri
Sent: Friday, May 30, 2003 8:02 PM
Subject: Maximum precision for DECIMAL column in MySQL


It looks like the maximum precision for a DECIMAL column is 17 in MySQL.  Is
this documented anywhere?  I get the following results:
mysql> CREATE TABLE `scale_test6` (`a_dec` decimal(30,23) default NULL)
TYPE=MyISAM;
mysql> INSERT INTO scale_test6 (a_dec) VALUES
(12345678.123456789012345678901234);
mysql> SELECT * FROM scale_test6;
+----------------------------------+
| a_dec                            |
+----------------------------------+
| 12345678.12345678900000000000000 |
+----------------------------------+
1 row in set (0.00 sec)
Am I doing everything correctly?  I would have expected to see the entire
decimal stored correctly in the table.
-- Matt Solnit <[EMAIL PROTECTED]>


-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to