Bug #2182 lpad returns incorrect result
Submitted: 21 Dec 2003 14:03 Modified: 19 Jan 2004 5:26
Reporter: Georg Richter Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server Severity:S3 (Non-critical)
Version:4.1 OS:
Assigned to: Ramil Kalimullin CPU Architecture:Any

[21 Dec 2003 14:03] Georg Richter
Description:
lpad returns empty string when passing first argument as integer and number of 
digits is equal to len. 

How to repeat:
mysql> select lpad(12345,5,"#"); 
+-------------------+ 
| lpad(12345,5,"#") | 
+-------------------+ 
|                   | 
+-------------------+ 
1 row in set (0.00 sec) 
 
mysql> select rpad(12345,5,"#"); 
+-------------------+ 
| rpad(12345,5,"#") | 
+-------------------+ 
| 12345             | 
+-------------------+ 
1 row in set (0.00 sec) 
 
mysql> select lpad("12345",5,"#"); 
+---------------------+ 
| lpad("12345",5,"#") | 
+---------------------+ 
| 12345               | 
+---------------------+ 
1 row in set (0.01 sec)
[22 Dec 2003 5:54] MySQL Verification Team
Thank you for your bug report. This issue has been committed to our
source repository of that product and will be incorporated into the
next release.

If necessary, you can access the source repository and build the latest
available version, including the bugfix, yourself. More information 
about accessing the source trees is available at
    http://www.mysql.com/doc/en/Installing_source_tree.html

Additional info:

Fix will come in 4.1.2
[19 Jan 2004 5:26] Ramil Kalimullin
Thank you for your bug report. This issue has been committed to our
source repository of that product and will be incorporated into the
next release.

If necessary, you can access the source repository and build the latest
available version, including the bugfix, yourself. More information 
about accessing the source trees is available at
    http://www.mysql.com/doc/en/Installing_source_tree.html