Uploaded image for project: 'MariaDB ColumnStore'
  1. MariaDB ColumnStore
  2. MCOL-944

coalesce with count(distinct) can lead to incorrect results

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: 1.0.11, 1.1.0
    • Fix Version/s: 1.0.12, 1.1.1
    • Component/s: ExeMgr
    • Labels:
      None
    • Sprint:
      2017-20, 2017-21

      Description

      to reproduce:

      CREATE TABLE test( 
      id BIGINT(20) NULL DEFAULT NULL, 
      integerfield INT(10) UNSIGNED NULL DEFAULT NULL,
       integerfield2 INT(10) UNSIGNED NULL DEFAULT NULL )
      ENGINE=Columnstore;
       
      INSERT INTO test
      VALUES (1, NULL,1), (2, NULL,1), (1,NULL,1);
       
      SELECT COUNT(distinct id),        
      SUM(integerfield),        
      SUM(integerfield2),        
      coalesce(SUM(integerfield),0),        
      coalesce(SUM(integerfield2),0),        
      coalesce(SUM(integerfield),0) + coalesce(SUM(integerfield2),0) 
      FROM   test;
      

      The last column value is -9223372036854775805 instead of 3. Removing the count(distinct) results in the correct result.

        Attachments

          Activity

            People

            Assignee:
            dleeyh Daniel Lee
            Reporter:
            dthompson David Thompson (Inactive)
            Votes:
            1 Vote for this issue
            Watchers:
            4 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.