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

Wrong result for aggregate function with distinct clause when the value for tmp_table_size is small

    XMLWordPrintable

Details

    Description

      create table t1 (
      a VARCHAR(900),
      b int
      );
      insert into t1 values
      ( 0 , 1 ),
      ( 1 , 2 ),
      ( 2 , 3 ),
      ( 3 , 4 ),
      ( 4 , 5 ),
      ( 5 , 6 ),
      ( 6 , 7 ),
      ( 7 , 8 ),
      ( 8 , 9 ),
      ( 9 , 10 ),
      ( 10 , 11 ),
      ( 11 , 12 ),
      ( 12 , 13 ),
      ( 13 , 14 ),
      ( 14 , 15 ),
      ( 15 , 16 ),
      ( 16 , 17 ),
      ( 17 , 18 ),
      ( 18 , 19 ),
      ( 25 , 26 ),
      ( 26 , 27 ),
      ( 9 , 120 ),
      ( 10 , 121 ),
      ( 11 , 122 ),
      ( 12 , 123 ),
      ( 13 , 124 ),
      ( 14 , 125 ),
      ( 15 , 126 ),
      ( 16 , 127 );
      select count(distinct a) from t1;
      count(distinct a)
      21
      set tmp_table_size=1024;
      select count(distinct a) from t1;
      count(distinct a)
      19
      

      So when we set the value of tmp_table_size=1024, then the result for the select query is incorrect

      Attachments

        Activity

          People

            varun Varun Gupta (Inactive)
            varun Varun Gupta (Inactive)
            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.