DB2 - Problem description
| Problem IT02275 | Status: Closed |
LPAD() AND RPAD() FUNCTION WITH EMPTY STRING CAUSES THE RESULT STRING TO BE PADDED WITH '00' CHARACTERS | |
| product: | |
DB2 FOR LUW / DB2FORLUW / A50 - DB2 | |
| Problem description: | |
Calling LPAD() and RPAD() function with an empty string '' (pad,
third parameter) results in a output string with right padded
with '00'`s characters up to the length provided. The resulting
varchar string is padded with '00' chars which should not
happen.
Example:
select LPAD('AAAAA', 10, '') AS F1 from sysibm.sysdummy1
F1
----------
AAAAA
1 record(s) selected.
select HEX(LPAD('AAAAA', 10, '')) AS F1 from sysibm.sysdummy1
F1
--------------------
41414141410000000000
1 record(s) selected.
If the pattern (third argument of L/RPAD()) is an empty string
'', then we should return the result without any padding. | |
| Problem Summary: | |
**************************************************************** * USERS AFFECTED: * * ALL * **************************************************************** * PROBLEM DESCRIPTION: * * See Error Description * **************************************************************** * RECOMMENDATION: * * Upgrade to DB2 Version 10.5 Fix Pack 5. * **************************************************************** | |
| Local Fix: | |
| Solution | |
First fixed in DB2 Version 10.5 Fix Pack 5. | |
| Workaround | |
not known / see Local fix | |
| Timestamps | |
Date - problem reported : Date - problem closed : Date - last modified : | 05.06.2014 15.12.2014 15.12.2014 |
| Problem solved at the following versions (IBM BugInfos) | |
| Problem solved according to the fixlist(s) of the following version(s) | |
| 10.5.0.5 |
|