Bug report #9158
lpad() and rpad() functions do not work in standard way
Status: | Closed | ||
---|---|---|---|
Priority: | Normal | ||
Assignee: | - | ||
Category: | Expressions | ||
Affected QGIS version: | 2.0.1 | Regression?: | No |
Operating System: | Linux | Easy fix?: | No |
Pull Request or Patch supplied: | No | Resolution: | |
Crashes QGIS or corrupts data: | No | Copied to github as #: | 17791 |
Description
In PostGIS and Oracle, lpad('A', 5, 'x') produces 'xxxxA'. In the expression editor in QGIS, it produces 'Axxxx'. Similarly, rpad() adds extra characters to the left, while PostGIS and Oracle add extra characters to the right.
I think the PostGIS way is the commonly understood behavior, since lpad is supposed to mean "left pad" and rpad is supposed to mean "right pad". QGIS should adopt the conventional behavior.
Related issues
Associated revisions
fix lpad/rpad (fixes #9158)
History
#2 Updated by Jürgen Fischer about 11 years ago
- Status changed from Open to Closed
Fixed in changeset bc825b4b46af8d8810abc4b5552921e891bf7bcf.
#3 Updated by Jürgen Fischer about 11 years ago
- Crashes QGIS or corrupts data set to No
- Affected QGIS version set to 2.0.1
- Tracker changed from Feature request to Bug report