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

JSON_OBJECTAGG: incorrect error message

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Fixed
    • 10.5
    • 10.5.4
    • JSON
    • None

    Description

      create table t20 (a varchar(10), b int);
      insert into t20 values ('red', 1), ('blue', 2), ('red',1001), ('blue', 1002);
       
      select json_objectagg(a,b) over (order by a ) from t20;
      ERROR 1235 (42000): This version of MariaDB doesn't yet support 'GROUP_CONCAT() aggregate as window function'
      

      Note that error message says GROUP_CONCAT.
      This is because:

      class Item_func_json_objectagg : public Item_sum
      {
      ...
        enum Sumfunctype sum_func () const {return GROUP_CONCAT_FUNC;}
        const char *func_name() const { return "json_objectagg("; }
      

      It is also potentially bad to have sum_func() to return name of another
      function, because somebody somewhere might check its value and typecast
      a pointer to Item_func_group_concat to Item_func_group_concat*.

      Attachments

        Activity

          People

            holyfoot Alexey Botchkov
            psergei Sergei Petrunia
            Votes:
            0 Vote for this issue
            Watchers:
            2 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.