Bug #80154 Function ROUND( int value, 10) gets padding 0s
Submitted: 26 Jan 2016 12:33 Modified: 26 Jan 2016 13:40
Reporter: Su Dylan Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: DML Severity:S3 (Non-critical)
Version:5.0/5.1/5.5/5.6/5.7 OS:Any
Assigned to: CPU Architecture:Any

[26 Jan 2016 12:33] Su Dylan
Description:
Output:
=====
mysql> SELECT round( COALESCE( CAST(3 AS unSIGNED), 1 ), 10 );
+-------------------------------------------------+
| round( COALESCE( CAST(3 AS unSIGNED), 1 ), 10 ) |
+-------------------------------------------------+
|                                    3.0000000000 |
+-------------------------------------------------+
1 row in set (0.00 sec)

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

Problem:
=====
3 with no padding 0 is spected.

How to repeat:
SELECT round( COALESCE( CAST(3 AS unSIGNED), 1 ), 10 );

Suggested fix:
3 is returned.
[26 Jan 2016 13:40] MySQL Verification Team
Thank you for the bug report. Same behavior since 5.0.

Your MySQL connection id is 5
Server version: 5.7.12 Source distribution PULL: 2016-JAN-14

Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql 5.7 > SELECT round( COALESCE( CAST(3 AS unSIGNED), 1 ), 10 );
+-------------------------------------------------+
| round( COALESCE( CAST(3 AS unSIGNED), 1 ), 10 ) |
+-------------------------------------------------+
|                                    3.0000000000 |
+-------------------------------------------------+
1 row in set (0.00 sec)

mysql 5.7 > SELECT round( COALESCE( CAST(3 AS SIGNED), 1 ), 10 );
+-----------------------------------------------+
| round( COALESCE( CAST(3 AS SIGNED), 1 ), 10 ) |
+-----------------------------------------------+
|                                             3 |
+-----------------------------------------------+
1 row in set (0.00 sec)

mysql 5.7 >