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

Wrong result when query run as a prepared statement

    XMLWordPrintable

Details

    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);
      

      Run normally, this statement

      select * from t2 where t2a in
      (
        select t1a from t1
          group by (select t1a > t2b) order by t1a
      );
      

      produces

      t2a	t2b	t2c
      1	1	1
      2	2	2
      

      but when run as a prepared statement, we get

      t2a	t2b	t2c
      1	1	1
      

      we also get the same wrong result when run as a procedure.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              Johnston Rex Johnston
              Votes:
              0 Vote for this issue
              Watchers:
              1 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.