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

support FOR loop in stored aggregate functions

Details

    • Task
    • Status: Stalled (View Workflow)
    • Major
    • Resolution: Unresolved
    • None
    • Stored routines
    • None

    Description

      Support the syntax (subject to discussion):

      [begin_label:]
      FOR GROUP ROWS DO
        statement_list
      END FOR [ end_label ]
      

      See also MDEV-14415.

      Example:

      CREATE AGGREGATE FUNCTION avg(x DOUBLE) RETURNS DOUBLE
      BEGIN
        DECLARE count INT DEFAULT 0;
        DECLARE sum DOUBLE DEFAULT 0;
        FOR GROUP ROWS DO
          SET count:=count+1;
          SET sum:=sum+x;
        END FOR;
        RETURN sum/count;
      END
      

      Attachments

        Issue Links

          Activity

            Transition Time In Source Status Execution Times
            Varun Gupta (Inactive) made transition -
            Open In Progress
            3d 11h 34m 1
            Varun Gupta (Inactive) made transition -
            In Progress In Review
            21d 46m 1
            Alexander Barkov made transition -
            In Review Stalled
            538d 7h 44m 1

            People

              Unassigned Unassigned
              serg Sergei Golubchik
              Votes:
              0 Vote for this issue
              Watchers:
              6 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.