Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-8477

Weird inconsistency with CONCAT() syntax

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Trivial
    • Resolution: Not a Bug
    • Affects Version/s: 5.5.44
    • Fix Version/s: N/A
    • Component/s: Parser
    • 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.

        Gliffy Diagrams

          Attachments

            Activity

            Hide
            jkavalik Jiri Kavalik added a comment -

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

            select 'a' 'b' 'c';
            
            Show
            jkavalik Jiri Kavalik added a comment - It is not a concat() thing but general string literal behaviour select 'a' 'b' 'c';
            Hide
            elenst Elena Stepanova added a comment -

            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'
            
            Show
            elenst Elena Stepanova added a comment - 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'

              People

              • Assignee:
                Unassigned
                Reporter:
                f_razzoli Federico Razzoli
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: