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

Error is expected after ANY_VALUE(DISTINCT ..)

    XMLWordPrintable

Details

    • Bug
    • Status: Needs Feedback (View Workflow)
    • Major
    • Resolution: Unresolved
    • N/A
    • 13.2
    • None
    • None
    • Q4/2026 Server Maintenance

    Description

      MySQL rejects DISTINCT for ANY_VALUE, while in pr - it is silently accepted, even though DISTINCT there is meaningless

      CREATE TABLE t (g INT, v INT);
      INSERT INTO t VALUES (1,5),(1,5),(1,7),(2,9);
       
      SELECT ANY_VALUE(DISTINCT v) FROM t;
       
      SELECT g, ANY_VALUE(DISTINCT v),
                ANY_VALUE(v),
                COUNT(DISTINCT v) 
      FROM t GROUP BY g ORDER BY g;
      DROP TABLE t;
      

      Attachments

        Issue Links

          Activity

            People

              danblack Daniel Black
              alice Alice Sherepa
              Votes:
              0 Vote for this issue
              Watchers:
              2 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.