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

GROUP_CONCAT does cut the string with quotes

    XMLWordPrintable

Details

    • Bug
    • Status: Confirmed (View Workflow)
    • Major
    • Resolution: Unresolved
    • 10.4, 10.11.2, 10.5, 10.6, 10.7, 10.8, 10.9, 10.10, 10.11, 11.0
    • 10.4, 10.5, 10.6, 10.11
    • None
    • macOS Ventura and Ubuntu 22.04

    Description

      We found that with an weird string that our GROUP_CONCAT with JSON_OBJECT fails as it get's cut and the JSON is invalid.

      The reproducer would be:

      CREATE TEMPORARY TABLE t1 SELECT '1"i """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""' as name;
       
      SELECT CONCAT(
                     '[',
                     GROUP_CONCAT(
                             JSON_OBJECT(
                                     'name', t1.name
                                 )
                         ),
                     ']'
                 ) as translations
      FROM t1;
      

      Without a table it works:

      SELECT CONCAT(
                     '[',
                     GROUP_CONCAT(
                             JSON_OBJECT(
                                     'name', '1"i """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""'
                                 )
                         ),
                     ']'
                 ) as translations;
      

      Tested with multiple MariaDB versions. With MySQL it works https://www.db-fiddle.com/f/4fk9vN8rTCpYASuKwyhUz2/0

      Attachments

        Activity

          People

            rucha174 Rucha Deodhar
            shyim Soner Sayakci
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:

              Git Integration

                Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.