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

Wrong result upon JOIN with constant CSV table

    XMLWordPrintable

Details

    Description

      create table t1 (a int not null) engine=CSV;
      create table t2 (b int) engine=MyISAM;
      insert into t2 values (1);
      select count(*), b from t2 join t1; 
       
      # Cleanup
      drop table t1, t2;
      

      10.5 0ba845a8

      MariaDB [test]> select count(*), b from t2 join t1; 
      +----------+------+
      | count(*) | b    |
      +----------+------+
      |        0 |    1 |
      +----------+------+
      1 row in set (0.002 sec)
      {code:sql}
       
      The expected result is (0,NULL), as without the aggregate function the result set is naturally empty:
      {code:sql}
      MariaDB [test]> select * from t2 join t1; 
      Empty set (0.001 sec)
      

      Reproducible on 10.2-10.6 (possibly earlier versions too), and on MySQL 5.7.
      Not reproducible on MySQL 8.0, even without ONLY_FULL_GROUP_BY which is default there.

      Attachments

        Issue Links

          Activity

            People

              psergei Sergei Petrunia
              elenst Elena Stepanova
              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.