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

MIN/MAX and "HAVING func(DISTINCT)": wrong results

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Fixed
    • 10.0.13
    • N/A
    • Optimizer
    • None

    Description

      I know that this bug has been fixed by Oracle:
      http://bugs.mysql.com/bug.php?id=69833

      But their solution (as it is documented in the bug page) is funny. I'm opening this to ask you if you could please apply a better fix.

      While the test case looks exotic, I realized that this causes bugs in an application when I use something like this:

      SELECT col1, MIN(col2), MAX(col2)
      FROM table
      GROUP BY col1
      HAVING COUNT(DISTINCT col1) > 1;

      Both MIN and MAX give completely wrong results, which makes the report useless. The only workaround I was able to find is slow.

      Attachments

        Activity

          People

            psergei Sergei Petrunia
            f_razzoli Federico Razzoli
            Votes:
            0 Vote for this issue
            Watchers:
            3 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.