Bug #10781 | Precision value exceeds the maximum range when multiplied. | ||
---|---|---|---|
Submitted: | 20 May 2005 22:20 | Modified: | 21 May 2005 17:14 |
Reporter: | Disha | Email Updates: | |
Status: | Not a Bug | Impact on me: | |
Category: | MySQL Server | Severity: | S2 (Serious) |
Version: | 5.0.5-beta-nt | OS: | Windows (Windows 2003 Standard Edition) |
Assigned to: | CPU Architecture: | Any |
[20 May 2005 22:20]
Disha
[21 May 2005 1:57]
MySQL Verification Team
miguel@hegel:~/dbs/5.0$ bin/mysql -uroot Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 5 to server version: 5.0.6-beta-debug Type 'help;' or '\h' for help. Type '\c' to clear the buffer. mysql> delimiter // mysql> use test1// Database changed mysql> Create table t1 (f1 dec(64,30),f2 dec(64,30))// Query OK, 0 rows affected (0.01 sec) mysql> Insert into t1 values (-2.234,2)// Query OK, 1 row affected (0.00 sec) mysql> Select f1*f2 from t1// +-----------------------------------+ | f1*f2 | +-----------------------------------+ | -4.468000000000000000000000000000 | +-----------------------------------+ 1 row in set (0.00 sec) c:\mysql\bin>mysqladmin -uroot create test1 c:\mysql\bin>mysql -uroot test1 Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 2 to server version: 5.0.6-beta-nt Type 'help;' or '\h' for help. Type '\c' to clear the buffer. mysql> delimiter // mysql> use test1 // Database changed mysql> Create table t1 (f1 dec(64,30),f2 dec(64,30))// Query OK, 0 rows affected (0.09 sec) mysql> Insert into t1 values (-2.234,2)// Query OK, 1 row affected (0.02 sec) mysql> Select f1*f2 from t1// +-----------------------------------+ | f1*f2 | +-----------------------------------+ | -4.468000000000000000000000000000 | +-----------------------------------+ 1 row in set (0.00 sec) mysql>
[21 May 2005 17:14]
Sergei Golubchik
Thank you for taking the time to write to us, but this is not a bug. Please double-check the documentation available at http://www.mysql.com/documentation/ and the instructions on how to report a bug at http://bugs.mysql.com/how-to-report.php Additional info: It should not "display the output in the decimal range (M,D) ie (64,30)" According to the SQL:2003, part 2, Foundation, paragraph 6.26 <numeric value expression>: c) The precision of the result of multiplication is implementation-defined, and the scale is S1 + S2. So the result should be at least (61, 60). But as MySQL 5.0 does not support scale higher than 32, it truncates the number and returns DECIMAL (32,31).