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

Duplicate square brackets in JSON_ARRAYAGG upon query with HAVING

    XMLWordPrintable

Details

    • Bug
    • Status: Open (View Workflow)
    • Major
    • Resolution: Unresolved
    • 10.5
    • 10.5
    • JSON
    • None

    Description

      CREATE TABLE t1 (a INT, b VARCHAR(10));
      INSERT INTO t1 VALUES (1,"foo"), (2,"bar");
       
      SELECT a, JSON_ARRAYAGG(b) as j FROM t1 GROUP BY a HAVING j = '["foo"]';
      

      Actual result, 10.5 baca526555

      MariaDB [test]> SELECT a, JSON_ARRAYAGG(b) as j FROM t1 GROUP BY a HAVING j = '["foo"]';
      +------+-----------+
      | a    | j         |
      +------+-----------+
      |    1 | [["foo"]] |
      +------+-----------+
      1 row in set (0.002 sec)
      

      Attachments

        Issue Links

          Activity

            People

              rucha174 Rucha Deodhar
              elenst Elena Stepanova
              Votes:
              0 Vote for this issue
              Watchers:
              1 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.