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

LP:780425 - sql_buffer_result=1 gives wrong result for GROUP BY with a constant expression

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Minor
    • Resolution: Fixed
    • None
    • None
    • None

    Description

      This fails in MySQL 5.1, MariaDB 5.1 and above:

      drop table if exists t1;
      CREATE TABLE t1(f1 DECIMAL(5,1) UNSIGNED);
      INSERT INTO t1 VALUES (0.2),(0.1);
      set sql_buffer_result=0;
      SELECT 1 as 'one' FROM t1 GROUP BY @a:= (SELECT ROUND(f1) FROM t1 WHERE f1 = 0);
      set sql_buffer_result=1;
      SELECT 1 as 'one' FROM t1 GROUP BY @a:= (SELECT ROUND(f1) FROM t1 WHERE f1 = 0);

      The second query return two rows, the first one only one row (which is correct).

      Attachments

        Activity

          People

            monty Michael Widenius
            monty Michael Widenius
            Votes:
            0 Vote for this issue
            Watchers:
            0 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.