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

Invalid use of aggregate function in SP is not detected at CREATE time

    XMLWordPrintable

Details

    • Bug
    • Status: Open (View Workflow)
    • Minor
    • Resolution: Unresolved
    • 10.5, 10.1(EOL), 10.2(EOL), 10.3(EOL), 10.4(EOL)
    • 10.5
    • Stored routines
    • None

    Description

      CREATE OR REPLACE FUNCTION f1() RETURNS INT RETURN SUM(1);
      SELECT f1();
      

      ERROR 1111 (HY000): Invalid use of group function
      

      CREATE OR REPLACE FUNCTION f1() RETURNS INT RETURN ROW_NUMBER() OVER();
      SELECT f1();
      

      ERROR 4015 (HY000): Window function is allowed only in SELECT list and ORDER BY clause
      

      It should report the error at creation rather than execution time.

      Attachments

        Issue Links

          Activity

            People

              bar Alexander Barkov
              bar Alexander Barkov
              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.