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

COUNT(NULL) returns incorrect result with sequence storage engine

    XMLWordPrintable

Details

    • 10.1.12

    Description

      "Storage engine handles GROUP BY" optimization in Sequence SE returns incorrect value for COUNT(NULL):

      MariaDB [test]> select * from seq_1_to_3;
      +-----+
      | seq |
      +-----+
      |   1 |
      |   2 |
      |   3 |
      +-----+
       
      MariaDB [test]> select count(NULL) from seq_1_to_3;
      +-------------+
      | count(NULL) |
      +-------------+
      |           3 |
      +-------------+

      This is an incorrect result. For comparison:

      create table t100 (a int);
      insert into t100 values (1),(2),(3);
      select count(NULL) from t100;
      +-------------+
      | count(NULL) |
      +-------------+
      |           0 |
      +-------------+

      Attachments

        Activity

          People

            serg Sergei Golubchik
            psergei Sergei Petrunia
            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.