concat_ws – deleting spaces after commas – very strange

The SQL directive concat_ws has been behaving very oddly.


In the above case – the space after the comma will be deleted and the concatenated version of the output will be missing a space. However if i changed the comma to a semicolon then the space after it would not disappear.

So if I had

concat_ws(‘; ‘……. );

the space would appear in the output.

If I add 10 spaces after a comma; all of them would be erased.

I’m on MySQL and PHP.

This is the strangest thing I’ve ever encountered. Anyone else experience this?