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

AVG over a field exported from an inner subquery saturates instead of returning the exact one-row value

    XMLWordPrintable

Details

    • Not for Release Notes

    Description

      the inner derived table contributes exactly one row with constant `663914376`, so `AVG(subq0.c2) OVER ()` must be the exact one-row average `663914376.0000`. MariaDB instead saturates that result to `99999999.9999`.

      CREATE TABLE t3(c0 VARCHAR(100) NOT NULL) ENGINE=MyISAM;

      INSERT INTO t3 VALUES ('802877023');

      SELECT DISTINCTROW AVG(subq0.c2) OVER (), t3.c0
      FROM t3,
      (SELECT 663914376 AS c2 FROM t3) AS subq0; – Expected correct result: 663914376.0000 | 802877023 – actual Wrong result: 99999999.9999 | 802877023

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              yx yx
              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.