Bug #11594 | CONCAT_WS Behavior | ||
---|---|---|---|
Submitted: | 27 Jun 2005 20:47 | Modified: | 28 Jun 2005 17:30 |
Reporter: | Sergio Salvatore | Email Updates: | |
Status: | Duplicate | Impact on me: | |
Category: | MySQL Server: Optimizer | Severity: | S3 (Non-critical) |
Version: | 4.1.11 | OS: | Linux (RedHat Linux ES3) |
Assigned to: | Assigned Account | CPU Architecture: | Any |
[27 Jun 2005 20:47]
Sergio Salvatore
[28 Jun 2005 2:44]
Peter Laursen
reproduced on MySQL 5.0.7 (on winXP SP2) mysql> select concat_ws(' ', trackname, artistname), trackname, artistname from -> tracks left join trackstoartists on (tracks.trackid = trackstoartists.trackid) -> left join artists on (trackstoartists.artistid = artists.artistid) WHERE trackname LIKE '%in%'; +---------------------------------------+---------------------+-------------+ | concat_ws(' ', trackname, artistname) | trackname | artistname | +---------------------------------------+---------------------+-------------+ | April In Paris Vernon Duke | April In Paris | Vernon Duke | | Autumn In New York | Autumn In New York | NULL | +---------------------------------------+---------------------+-------------+ 2 rows in set (0.01 sec) mysql> select concat_ws(' ', trackname, artistname), trackname, artistname from -> tracks left join trackstoartists on (tracks.trackid = trackstoartists.trackid) -> left join artists on (trackstoartists.artistid = artists.artistid) WHERE concat_ws(' ', trackname, artistname ) LIKE '%in%'; +---------------------------------------+----------------+-------------+ | concat_ws(' ', trackname, artistname) | trackname | artistname | +---------------------------------------+----------------+-------------+ | April In Paris Vernon Duke | April In Paris | Vernon Duke | +---------------------------------------+----------------+-------------+ 1 row in set (0.00 sec) My comment to that: It might not be an issue with the concat_ws() function but with the parser that parses WHERE...LIKE's @Sergio: 1) do you seriously mean that the first column in result is completely skipped with your MySQL-version ? 2) I believe that " LIKE '%in%in' " is a TYPO and should be " LIKE '%in%' " only ?!
[28 Jun 2005 3:23]
Peter Laursen
I see now that the reason for the missing column in result is a missing "," SELECT concat_ws(' ', trackname, artistname ) trackname, ...... >>> SELECT concat_ws(' ', trackname, artistname ), trackname, ....
[28 Jun 2005 12:03]
Aleksey Kishkin
Hmm. I would say that changing "concat_ws() like .." to "trackname like .. or artistname like .. " gives proper result. changing "like '%In%'" to "locate ('In',concat_ws()) > 0" gives wrong result. looks like bug
[28 Jun 2005 17:30]
Igor Babaev
This bug is a duplicate of bug #11469.