Bug #5498 TRIM fails with LEADING or TRAILING if remstr = str
Submitted: 10 Sep 2004 0:18 Modified: 14 Sep 2004 10:23
Reporter: Peter Gulutzan
Status: Closed
Category:Server Severity:S3 (Non-critical)
Version:4.0 OS:Linux (SuSE 8.2)
Assigned to: Ramil Kalimullin Target Version:

[10 Sep 2004 0:18] Peter Gulutzan
Description:
TRIM (LEADING ...) and TRIM (TRAILING ...) don't work if both strings are equal. 
 

How to repeat:
mysql> select trim(both 'foo' from 'foo'); 
+-----------------------------+ 
| trim(both 'foo' from 'foo') | 
+-----------------------------+ 
|                             | 
+-----------------------------+ 
1 row in set (0.00 sec) 
 
mysql> select trim(leading 'foo' from 'foo'); 
+--------------------------------+ 
| trim(leading 'foo' from 'foo') | 
+--------------------------------+ 
| foo                            | 
+--------------------------------+ 
1 row in set (0.00 sec) 
 
mysql> select trim(trailing 'foo' from 'foo'); 
+---------------------------------+ 
| trim(trailing 'foo' from 'foo') | 
+---------------------------------+ 
| foo                             | 
+---------------------------------+ 
1 row in set (0.00 sec)
[14 Sep 2004 10:23] 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