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

JSON_ARRAYAGG charset issue

    XMLWordPrintable

Details

    Description

      JSON_ARRAYAGG() doesn't evaluate correct charset.

      reproduce:

      MariaDB [test]> CREATE TABLE t1 (a varchar(5));
      Query OK, 0 rows affected (0.035 sec)
       
      MariaDB [test]> INSERT INTO t1 VALUES ('a'),('ä');
      Query OK, 2 rows affected (0.014 sec)
       
      MariaDB [test]> select * from t1;
      +------+
      | a    |
      +------+
      | a    |
      | ä    |
      +------+
      2 rows in set (0.000 sec)
       
      MariaDB [test]> SELECT JSON_ARRAYAGG(a) FROM t1;
      +------------------+
      | JSON_ARRAYAGG(a) |
      +------------------+
      | ["a","▒"]         |
      +------------------+
      1 row in set (0.001 sec)
       
      MariaDB [test]> SELECT JSON_ARRAY(a) FROM t1;
      +---------------+
      | JSON_ARRAY(a) |
      +---------------+
      | ["a"]         |
      | ["ä"]         |
      +---------------+
      2 rows in set (0.000 sec)
       
      MariaDB [test]> select @@version;
      +--------------------------------------+
      | @@version                            |
      +--------------------------------------+
      | 10.5.8-MariaDB-1:10.5.8+maria~bionic |
      +--------------------------------------+
       
      MariaDB [(none)]> select @@character_set_server,@@character_set_client,@@character_set_results,@@collation_connection;
      +------------------------+------------------------+-------------------------+------------------------+
      | @@character_set_server | @@character_set_client | @@character_set_results | @@collation_connection |
      +------------------------+------------------------+-------------------------+------------------------+
      | utf8mb4                | utf8                   | utf8                    | utf8_general_ci        |
      +------------------------+------------------------+-------------------------+------------------------+
      1 row in set (0.000 sec)
      

      Attachments

        Issue Links

          Activity

            People

              serg Sergei Golubchik
              thk Thomas K.
              Votes:
              3 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Git Integration

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