[MDEV-8477] Weird inconsistency with CONCAT() syntax Created: 2015-07-17  Updated: 2015-07-17  Resolved: 2015-07-17

Status: Closed
Project: MariaDB Server
Component/s: Parser
Affects Version/s: 5.5.44
Fix Version/s: N/A

Type: Bug Priority: Trivial
Reporter: Federico Razzoli Assignee: Unassigned
Resolution: Not a Bug Votes: 0
Labels: None


 Description   

With, CONCAT(), skipping the commas between parameters is ok:

select concat('a' 'b' 'c');

Interestingly, this only works if all parameters are string literals. Also, this does not work with any other function I tried.

I'm not sure if this "a feature or a bug"... I'm reporting it just in case you are not aware of it.



 Comments   
Comment by Jiri Kavalik [ 2015-07-17 ]

It is not a concat() thing but general string literal behaviour

select 'a' 'b' 'c';

Comment by Elena Stepanova [ 2015-07-17 ]

Right, and it's documented in MySQL manual: http://dev.mysql.com/doc/refman/5.6/en/string-literals.html

Quoted strings placed next to each other are concatenated to a single string. The following lines are equivalent:
 
'a string'
'a' ' ' 'string'

Generated at Thu Feb 08 07:27:26 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.