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

function as Window function causes debug assert

    XMLWordPrintable

Details

    Description

      When using AVG as a Window function I get a debug assert at sql_window.cc:3054

      Window_funcs_computation::setup()
       
        if (tab->filesort && tab->filesort->select)
        {
          sel= tab->filesort->select;
          DBUG_ASSERT(!sel->quick);
        }
      

      To reproduce:

      CREATE TABLE s3 (
        k1 bigint NOT NULL,
        c1 int DEFAULT NULL,
        PRIMARY KEY (k1)
      );
       
      SELECT k1, c1, avg(c1) OVER (ORDER BY c1) FROM s3 WHERE k1 < 100 ORDER BY k1;
      

      If you leave off the final ORDER BY k1 or the WHERE clause, no assert. If k1 is not a key, no assert.

      Attachments

        Issue Links

          Activity

            People

              varun Varun Gupta (Inactive)
              David.Hall David Hall (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              4 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.