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

group by removal in Item_singlerow_subselect causing inconsistent results

Details

    • Bug
    • Status: Stalled (View Workflow)
    • Major
    • Resolution: Unresolved
    • 10.5.27
    • 10.5
    • Optimizer
    • None

    Description

      create table t1 (t1a int, t1b int, t1c int) engine=myisam;
      insert into t1 values (1,1,1),(2,2,2);
       
      create table t2 (t2a int, t2b int, t2c int) engine=myisam;
      insert into t2 values (1,1,1),(2,2,2),(3,3,3);
      

      MariaDB [test]> select * from t2 where t2a in ( select t1a from t1 group by (select t1a > t2b) order by t1a );
       
      +------+------+------+
      | t2a  | t2b  | t2c  |
      +------+------+------+
      |    1 |    1 |    1 |
      |    2 |    2 |    2 |
      +------+------+------+
       
      2 rows in set (0.051 sec)
      MariaDB [test]> select * from t2 where t2a in ( select t1a from t1 group by (select t1a > t2b where true) order by t1a );
      +------+------+------+
      | t2a  | t2b  | t2c  |
      +------+------+------+
      |    1 |    1 |    1 |
      +------+------+------+
      1 row in set (0.019 sec)
       
      MariaDB [test]> prepare s from 'select * from t2 where t2a in ( select t1a from t1 group by (select t1a > t2b) order by t1a )';
       
      Query OK, 0 rows affected (0.006 sec)
      Statement prepared
       
      MariaDB [test]> execute s;
      +------+------+------+
      | t2a  | t2b  | t2c  |
      +------+------+------+
      |    1 |    1 |    1 |
      +------+------+------+
      
      

      Attachments

        Issue Links

          Activity

            Transition Time In Source Status Execution Times
            Rex Johnston made transition -
            Open In Progress
            4d 16h 46m 1
            JiraAutomate made transition -
            In Progress Stalled
            47d 23h 7m 1

            People

              Johnston Rex Johnston
              Johnston Rex Johnston
              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.